mirror of https://github.com/openssl/openssl.git
Fix memleak in rsa_cms_decrypt
If a call to EVP_PKEY_CTX_set_rsa_mgf1_md() fails then the caller
needs to free the label.
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20319)
(cherry picked from commit d32dd65053)
This commit is contained in:
parent
a9bc7b9287
commit
90e3a8cadc
|
|
@ -99,8 +99,10 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri)
|
|||
if (EVP_PKEY_CTX_set_rsa_mgf1_md(pkctx, mgf1md) <= 0)
|
||||
goto err;
|
||||
if (label != NULL
|
||||
&& EVP_PKEY_CTX_set0_rsa_oaep_label(pkctx, label, labellen) <= 0)
|
||||
&& EVP_PKEY_CTX_set0_rsa_oaep_label(pkctx, label, labellen) <= 0) {
|
||||
OPENSSL_free(label);
|
||||
goto err;
|
||||
}
|
||||
/* Carry on */
|
||||
rv = 1;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue