]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
PKCS12_item_decrypt_d2i_ex(): Check oct argument for NULL
authorAndrew Dinh <andrewd@openssl.org>
Wed, 7 Jan 2026 16:24:30 +0000 (01:24 +0900)
committerTomas Mraz <tomas@openssl.org>
Mon, 26 Jan 2026 19:56:53 +0000 (20:56 +0100)
Fixes CVE-2025-69421

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Mon Jan 26 19:56:08 2026
(cherry picked from commit 2c13bf15286328641a805eb3b7c97e27d42881fb)

crypto/pkcs12/p12_decr.c

index 9db66ccb8d4c6ff23b16f45aa0f199636a5f7607..827815ee8f971fee871a983f03bbc9108286e2a2 100644 (file)
@@ -140,6 +140,11 @@ void *PKCS12_item_decrypt_d2i_ex(const X509_ALGOR *algor, const ASN1_ITEM *it,
     void *ret;
     int outlen = 0;
 
+    if (oct == NULL) {
+        ERR_raise(ERR_LIB_PKCS12, ERR_R_PASSED_NULL_PARAMETER);
+        return NULL;
+    }
+
     if (!PKCS12_pbe_crypt_ex(algor, pass, passlen, oct->data, oct->length,
             &out, &outlen, 0, libctx, propq))
         return NULL;