From: Dr. David von Oheimb Date: Mon, 11 Mar 2024 11:48:26 +0000 (+0100) Subject: OSSL_CMP_validate_msg(): fix check such that OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR... X-Git-Tag: openssl-3.4.0-alpha1~485 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b893ceef2feb6b64504446f984ee5a57d2b69d1f;p=thirdparty%2Fopenssl.git OSSL_CMP_validate_msg(): fix check such that OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR becomes usable again Fixes #23706 Reviewed-by: Tomas Mraz Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/23814) --- diff --git a/crypto/cmp/cmp_vfy.c b/crypto/cmp/cmp_vfy.c index ec99ab7fe58..47bf38b2af5 100644 --- a/crypto/cmp/cmp_vfy.c +++ b/crypto/cmp/cmp_vfy.c @@ -632,7 +632,7 @@ int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg) default: scrt = ctx->srvCert; if (scrt == NULL) { - if (ctx->trusted == NULL) { + if (ctx->trusted == NULL && ctx->secretValue != NULL) { ossl_cmp_info(ctx, "no trust store nor pinned server cert available for verifying signature-based CMP message protection"); ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_TRUST_ANCHOR); return 0;