diff options
author | Jack Lloyd <[email protected]> | 2018-07-17 12:59:05 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-07-17 12:59:05 -0400 |
commit | 0472b6a95fa36257d0bf4ad99a14d437eedaa9ee (patch) | |
tree | ef4b43345e88f181ba7030d8c6d9df6604946627 /src | |
parent | 4a49689de0f98ab29f09842cb8f6f79a03aafe7b (diff) |
Handle another possible OpenSSL error only seen on non-x86_64
GH #1627
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/prov/openssl/openssl_ec.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/lib/prov/openssl/openssl_ec.cpp b/src/lib/prov/openssl/openssl_ec.cpp index ca5be857a..b9e53b6fd 100644 --- a/src/lib/prov/openssl/openssl_ec.cpp +++ b/src/lib/prov/openssl/openssl_ec.cpp @@ -187,15 +187,24 @@ class OpenSSL_ECDSA_Verification_Operation final : public PK_Ops::Verification_w if(res < 0) { int err = ERR_get_error(); + + bool hard_error = true; + #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"); + if(ERR_GET_REASON(err) == EC_R_BAD_SIGNATURE) + hard_error = false; #endif +#if defined(EC_R_POINT_AT_INFINITY) + if(ERR_GET_REASON(err) == EC_R_POINT_AT_INFINITY) + hard_error = false; +#endif +#if defined(ECDSA_R_BAD_SIGNATURE) + if(ERR_GET_REASON(err) == ECDSA_R_BAD_SIGNATURE) + hard_error = false; +#endif + + if(hard_error) + throw OpenSSL_Error("ECDSA_do_verify", err); } return (res == 1); } |