mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
fix(Crypto::EVPPKey): leak
This commit is contained in:
parent
92b3bb5455
commit
83a928967d
@ -73,14 +73,15 @@ EVPPKey::EVPPKey(const PKCS12Container& cont): EVPPKey(cont.getKey())
|
||||
|
||||
void pushBuildParamBignum(OSSL_PARAM_BLD* paramBld, const char* key, const std::vector<unsigned char>& bytes)
|
||||
{
|
||||
BIGNUM* bignum = nullptr;
|
||||
if (!(bignum = BN_bin2bn(bytes.data(), (int)bytes.size(), nullptr)))
|
||||
BIGNUM* pBigNum = nullptr;
|
||||
if (!(pBigNum = BN_bin2bn(bytes.data(), (int)bytes.size(), nullptr)))
|
||||
{
|
||||
std::string msg = "pushBuildParamBignum(): BN_bin2bn()\n";
|
||||
throw OpenSSLException(getError(msg));
|
||||
}
|
||||
|
||||
OSSL_PARAM_BLD_push_BN(paramBld, key, bignum);
|
||||
OSSL_PARAM_BLD_push_BN(paramBld, key, pBigNum);
|
||||
BN_clear_free(pBigNum);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user