[PATCH] dnssec-keygen: double free after keygen error
Hello,
while I was playing with FIPS mode support, I found dnssec-keygen is crashing reliably in that mode. If RSA_generate_key_ex fails for any reason and OpenSSL 1.1+ is used, freed pointer is not reset to null. In err label it is then freed again. I doubt it is possible to trigger this error remotely, but it might be security related. I will leave that to you for consideration. I think always assigning explicit NULL outside BN_GENCB_free would not hurt. Changed by the second patch.
Is there reason why EVP_PKEY_CTX is not used for key generation instead? Is patch with more recent generic API welcome?
0001-Fix-double-free-on-RSA_generate_key_ex-failure.patch0002-Do-not-assign-NULL-conditionally-in-OpenSSL-1.1-make.patch