Skip to content

Commit ce39170

Browse files
igus68t8m
authored andcommitted
Correct handling of AEAD-encrypted CMS with inadmissibly long IV
Fixes CVE-2025-15467 Reviewed-by: Norbert Pocs <norbertp@openssl.org> Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> MergeDate: Mon Jan 26 19:34:29 2026
1 parent 3250efd commit ce39170

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crypto/evp/evp_lib.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,9 @@ int evp_cipher_get_asn1_aead_params(EVP_CIPHER_CTX *c, ASN1_TYPE *type,
249249
if (type == NULL || asn1_params == NULL)
250250
return 0;
251251

252-
i = ossl_asn1_type_get_octetstring_int(type, &tl, NULL, EVP_MAX_IV_LENGTH);
253-
if (i <= 0)
252+
i = ossl_asn1_type_get_octetstring_int(type, &tl, iv, EVP_MAX_IV_LENGTH);
253+
if (i <= 0 || i > EVP_MAX_IV_LENGTH)
254254
return -1;
255-
ossl_asn1_type_get_octetstring_int(type, &tl, iv, i);
256255

257256
memcpy(asn1_params->iv, iv, i);
258257
asn1_params->iv_len = i;

0 commit comments

Comments
 (0)