summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2012-10-08 11:26:48 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-08 11:26:48 -0700
commit83400bd3bef87f79c384912ebf892bee489d0f03 (patch)
treee0ea753c6ff26f13004668aff1e5ed895458f65f
parent29e51335337132ebe338b61c7ff16ec4005285c9 (diff)
parentf3862a786823c304a0f36f11266c66a55a68a5cf (diff)
downloadlibcore-83400bd3bef87f79c384912ebf892bee489d0f03.zip
libcore-83400bd3bef87f79c384912ebf892bee489d0f03.tar.gz
libcore-83400bd3bef87f79c384912ebf892bee489d0f03.tar.bz2
Merge "NativeCrypto: clear errors for key verification" into jb-mr1-dev
-rw-r--r--luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp b/luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
index cb82226..1cecffc 100644
--- a/luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
+++ b/luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
@@ -1810,6 +1810,13 @@ static jint NativeCrypto_EVP_VerifyFinal(JNIEnv* env, jclass, jint ctxRef, jbyte
if (ok < 0) {
throwExceptionIfNecessary(env, "NativeCrypto_EVP_VerifyFinal");
}
+
+ /*
+ * For DSA keys, OpenSSL appears to have a bug where it returns
+ * errors for any result != 1. See dsa_ossl.c in dsa_do_verify
+ */
+ freeOpenSslErrorState();
+
JNI_TRACE("NativeCrypto_EVP_VerifyFinal(%p, %p, %d, %d, %p) => %d",
ctx, buffer, offset, length, pkey, ok);