merge in lmp-mr1-release history after reset to lmp-mr1-dev
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;
     }