Clear OpenSSL errors on EC_KEY_get0_private_key failures

(cherry picked from commit 86b04368b0)
This commit is contained in:
Mark Andrews
2023-08-31 10:57:43 +10:00
parent 386e88d0e4
commit 4d37996b1a

View File

@@ -455,8 +455,11 @@ opensslecdsa_compare(const dst_key_t *key1, const dst_key_t *key2) {
if (priv1 != NULL || priv2 != NULL) {
if (priv1 == NULL || priv2 == NULL || BN_cmp(priv1, priv2) != 0)
{
ERR_clear_error();
DST_RET(false);
}
} else {
ERR_clear_error();
}
ret = true;