]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix potential memory leak on failure of dsa_gen_init()
authorNiels Dossche <niels.dossche@ugent.be>
Wed, 20 Nov 2024 19:22:43 +0000 (20:22 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 25 Nov 2024 14:14:34 +0000 (15:14 +0100)
commit0f73f3d9366325a09baeaecfdc22814695905962
tree40148026df31fb3c7439b51fa8a23b400132fb33
parentae1130502661e7cf235de7ea44252a753337440a
Fix potential memory leak on failure of dsa_gen_init()

When dsa_gen_set_params()  returns 0, it could have duplicated the memory for the parameter
OSSL_PKEY_PARAM_FFC_DIGEST already in gctx->mdname, leading to a memory leak.

Allocated here: https://github.com/openssl/openssl/blob/47a80fd2034cd4314d3b4958539dcd3106087109/providers/implementations/keymgmt/dsa_kmgmt.c#L524
Can return 0 here: https://github.com/openssl/openssl/blob/47a80fd2034cd4314d3b4958539dcd3106087109/providers/implementations/keymgmt/dsa_kmgmt.c#L529-L536

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26016)

(cherry picked from commit d7e8f6f7816f2be3ab5e498d180424940fd58695)
providers/implementations/keymgmt/dsa_kmgmt.c