From 50a8f559e8f4e4becdee5502aa9fa2f35885869c Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sat, 11 Oct 2025 07:40:54 +0800 Subject: [PATCH] cmp: guard NULL header sender when expected_sender is set MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Joshua Rogers Reviewed-by: Saša Nedvědický Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/28847) --- crypto/cmp/cmp_vfy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crypto/cmp/cmp_vfy.c b/crypto/cmp/cmp_vfy.c index e2432febb2f..0fb73b5e84d 100644 --- a/crypto/cmp/cmp_vfy.c +++ b/crypto/cmp/cmp_vfy.c @@ -725,6 +725,11 @@ int ossl_cmp_msg_check_update(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg, const X509_NAME *actual_sender; char *str; + if (hdr->sender == NULL) { + ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_SENDER_IDENTIFICATION); + return 0; + } + if (hdr->sender->type != GEN_DIRNAME) { ERR_raise(ERR_LIB_CMP, CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED); return 0; -- 2.47.3