mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-03-24 06:51:37 +01:00
47 lines
1.7 KiB
Diff
47 lines
1.7 KiB
Diff
From 0472b6a95fa36257d0bf4ad99a14d437eedaa9ee Mon Sep 17 00:00:00 2001
|
|
From: Jack Lloyd <jack@randombit.net>
|
|
Date: Tue, 17 Jul 2018 12:59:05 -0400
|
|
Subject: [PATCH] Handle another possible OpenSSL error only seen on non-x86_64
|
|
|
|
GH #1627
|
|
---
|
|
src/lib/prov/openssl/openssl_ec.cpp | 23 ++++++++++++++++-------
|
|
1 file changed, 16 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/src/lib/prov/openssl/openssl_ec.cpp b/src/lib/prov/openssl/openssl_ec.cpp
|
|
index ca5be857a5..b9e53b6fdc 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);
|
|
}
|