NativeCrypto: throw BadPaddingException if EVP_CipherFinal_ex fails

Since nothing was being pushed onto the stack, no exception was thrown
in throwExceptionIfNecessary with the constant time fix present in
1.0.1j. The fix is to throw our own error if nothing was thrown.

(cherry picked from commit e74933ecfb7dc7d91ebe6620a91d86fdc735ed58)

Bug: 18621207
Change-Id: I25e653c493e162c5fda46f320117c013a2661aa4
diff --git a/src/main/native/org_conscrypt_NativeCrypto.cpp b/src/main/native/org_conscrypt_NativeCrypto.cpp
index af85611..0392dac 100644
--- a/src/main/native/org_conscrypt_NativeCrypto.cpp
+++ b/src/main/native/org_conscrypt_NativeCrypto.cpp
@@ -4476,8 +4476,12 @@
 
     int outl;
     if (!EVP_CipherFinal_ex(ctx, out + outOffset, &outl)) {
-        throwExceptionIfNecessary(env, "EVP_CipherFinal_ex");
-        JNI_TRACE("ctx=%p EVP_CipherFinal_ex => threw error", ctx);
+        if (throwExceptionIfNecessary(env, "EVP_CipherFinal_ex")) {
+            JNI_TRACE("ctx=%p EVP_CipherFinal_ex => threw error", ctx);
+        } else {
+            throwBadPaddingException(env, "EVP_CipherFinal_ex");
+            JNI_TRACE("ctx=%p EVP_CipherFinal_ex => threw padding exception", ctx);
+        }
         return 0;
     }