aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov/openssl/openssl_ec.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-05-31 17:34:47 -0400
committerJack Lloyd <[email protected]>2018-05-31 19:14:50 -0400
commit26f31c652fc1c25f3349530c7bf8ee0eb999e469 (patch)
tree8ea72f31b1638aba22733961671cca4ad194d47d /src/lib/prov/openssl/openssl_ec.cpp
parentc82667e15d2ac1be856bbdfd74002f2f52e5c277 (diff)
Handle EC_R_BAD_SIGNATURE from OpenSSL
Diffstat (limited to 'src/lib/prov/openssl/openssl_ec.cpp')
-rw-r--r--src/lib/prov/openssl/openssl_ec.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/prov/openssl/openssl_ec.cpp b/src/lib/prov/openssl/openssl_ec.cpp
index c61f83d02..ca5be857a 100644
--- a/src/lib/prov/openssl/openssl_ec.cpp
+++ b/src/lib/prov/openssl/openssl_ec.cpp
@@ -185,7 +185,18 @@ class OpenSSL_ECDSA_Verification_Operation final : public PK_Ops::Verification_w
const int res = ECDSA_do_verify(msg, msg_len, sig.get(), m_ossl_ec.get());
if(res < 0)
+ {
+ int err = ERR_get_error();
+#if defined(EC_R_BAD_SIGNATURE)
+ if(ERR_GET_REASON(err) != EC_R_BAD_SIGNATURE)
+ throw OpenSSL_Error("ECDSA_do_verify", err);
+#elif defined(ECDSA_R_BAD_SIGNATURE)
+ if(ERR_GET_REASON(err) != ECDSA_R_BAD_SIGNATURE)
+ throw OpenSSL_Error("ECDSA_do_verify", err);
+#else
throw OpenSSL_Error("ECDSA_do_verify");
+#endif
+ }
return (res == 1);
}