Browse Source

Merge pull request #868 from sipa/fix_650

Fix #650: CKey::SetSecret BIGNUM leak
0.8
Pieter Wuille 13 years ago
parent
commit
49355d9993
  1. 3
      src/key.h

3
src/key.h

@ -144,7 +144,10 @@ public:
if (bn == NULL) if (bn == NULL)
throw key_error("CKey::SetSecret() : BN_bin2bn failed"); throw key_error("CKey::SetSecret() : BN_bin2bn failed");
if (!EC_KEY_regenerate_key(pkey,bn)) if (!EC_KEY_regenerate_key(pkey,bn))
{
BN_clear_free(bn);
throw key_error("CKey::SetSecret() : EC_KEY_regenerate_key failed"); throw key_error("CKey::SetSecret() : EC_KEY_regenerate_key failed");
}
BN_clear_free(bn); BN_clear_free(bn);
fSet = true; fSet = true;
if (fCompressed || fCompressedPubKey) if (fCompressed || fCompressedPubKey)

Loading…
Cancel
Save