From: Andrew Dinh Date: Wed, 7 Jan 2026 16:24:30 +0000 (+0900) Subject: PKCS12_item_decrypt_d2i_ex(): Check oct argument for NULL X-Git-Tag: openssl-3.0.19~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36ecb4960872a4ce04bf6f1e1f4e78d75ec0c0c7;p=thirdparty%2Fopenssl.git PKCS12_item_decrypt_d2i_ex(): Check oct argument for NULL Fixes CVE-2025-69421 Reviewed-by: Nikola Pajkovsky Reviewed-by: Saša Nedvědický Reviewed-by: Eugene Syromiatnikov Reviewed-by: Tomas Mraz MergeDate: Mon Jan 26 19:56:08 2026 (cherry picked from commit 2c13bf15286328641a805eb3b7c97e27d42881fb) --- diff --git a/crypto/pkcs12/p12_decr.c b/crypto/pkcs12/p12_decr.c index 9db66ccb8d4..827815ee8f9 100644 --- a/crypto/pkcs12/p12_decr.c +++ b/crypto/pkcs12/p12_decr.c @@ -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;