openssl/crypto/cms
Ryan Hooper b5ab449e26 Fix Memory leak in CMS_EncryptedData_set1_key
When CMS_EncryptedData_set1_key is called repeatedly it will
leak data on the second call. This was because
cms->d.encryptedData was already set and needed to be cleared
before the call to M_ASN1_new_of.

Fixes: #28606

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28668)

(cherry picked from commit 7de825efa2)
2025-10-01 17:49:39 +02:00
..
build.info Drop unnecessary checks of OPENSSL_NO_DH, OPENSSL_NO_DSA and OPENSSL_NO_EC 2020-12-16 11:56:38 +01:00
cms_asn1.c Copyright year updates 2024-06-04 14:58:30 +02:00
cms_att.c Copyright year updates 2024-01-30 13:13:27 +00:00
cms_cd.c Convert ZLIB defines to OPENSSL_NO_ZLIB 2022-10-18 09:30:21 -04:00
cms_dd.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
cms_dh.c dh_cms_set_peerkey(): Fix the incorrect condition 2024-12-11 18:13:45 +01:00
cms_ec.c Copyright year updates 2023-09-07 09:59:15 +01:00
cms_enc.c Fix Memory leak in CMS_EncryptedData_set1_key 2025-10-01 17:49:39 +02:00
cms_env.c Copyright year updates 2024-06-04 14:58:30 +02:00
cms_err.c Copyright year updates 2025-02-11 14:36:52 +00:00
cms_ess.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
cms_io.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
cms_kari.c Copyright year updates 2025-02-11 14:36:52 +00:00
cms_lib.c Copyright year updates 2024-06-04 14:58:30 +02:00
cms_local.h Copyright year updates 2024-06-04 14:58:30 +02:00
cms_pwri.c kek_unwrap_key(): Fix incorrect check of unwrapped key size 2025-09-29 11:59:42 +02:00
cms_rsa.c Fix memleak in rsa_cms_sign error path 2024-09-05 17:05:24 +02:00
cms_sd.c Copyright year updates 2024-06-04 14:58:30 +02:00
cms_smime.c Copyright year updates 2024-06-04 14:58:30 +02:00