From fd251c9eea2a054ec9968e7097c3e752287af26c Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 24 Jul 2026 17:41:21 -0400 Subject: [PATCH] delete ECDSA private key BIGNUM if non-openssl or older openssl crypto library --- libi2pd/Signature.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libi2pd/Signature.h b/libi2pd/Signature.h index fe609fb8..7e85bf42 100644 --- a/libi2pd/Signature.h +++ b/libi2pd/Signature.h @@ -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 ()