]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Correct handling of AEAD-encrypted CMS with inadmissibly long IV
authorIgor Ustinov <igus68@gmail.com>
Mon, 12 Jan 2026 11:19:59 +0000 (12:19 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 26 Jan 2026 19:34:22 +0000 (20:34 +0100)
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

crypto/evp/evp_lib.c

index bee4e62dea245faef97a0d9c3959739ab6847016..72f374c81a6f7b1db21fe1be45510daae710a4d8 100644 (file)
@@ -249,10 +249,9 @@ int evp_cipher_get_asn1_aead_params(EVP_CIPHER_CTX *c, ASN1_TYPE *type,
     if (type == NULL || asn1_params == NULL)
         return 0;
 
-    i = ossl_asn1_type_get_octetstring_int(type, &tl, NULL, EVP_MAX_IV_LENGTH);
-    if (i <= 0)
+    i = ossl_asn1_type_get_octetstring_int(type, &tl, iv, EVP_MAX_IV_LENGTH);
+    if (i <= 0 || i > EVP_MAX_IV_LENGTH)
         return -1;
-    ossl_asn1_type_get_octetstring_int(type, &tl, iv, i);
 
     memcpy(asn1_params->iv, iv, i);
     asn1_params->iv_len = i;