delete ECDSA private key BIGNUM if non-openssl or older openssl crypto library

This commit is contained in:
orignal
2026-07-24 17:41:21 -04:00
parent d52d406a90
commit fd251c9eea
+6 -1
View File
@@ -285,7 +285,12 @@ namespace crypto
ECDSASigner (const uint8_t * signingPrivateKey)
{
m_PrivateKey = EC_KEY_new_by_curve_name (curve);
EC_KEY_set_private_key (m_PrivateKey, BN_bin2bn (signingPrivateKey, keyLen/2, NULL));
BIGNUM * privKey = BN_bin2bn (signingPrivateKey, keyLen/2, nullptr);
if (priKey)
{
EC_KEY_set_private_key (m_PrivateKey, privKey);
BN_free (privKey);
}
}
~ECDSASigner ()