diff --git a/apps/lib/cmp_mock_srv.c b/apps/lib/cmp_mock_srv.c index ce62af2b007aa4..516b1870b0ebb2 100644 --- a/apps/lib/cmp_mock_srv.c +++ b/apps/lib/cmp_mock_srv.c @@ -464,7 +464,7 @@ static OSSL_CMP_ITAV *process_genm_itav(mock_srv_ctx *ctx, int req_nid, if (!OSSL_CMP_ITAV_get0_rootCaCert(req, &rootcacert)) return NULL; - if (rootcacert != NULL + if (rootcacert != NULL && ctx->newWithNew != NULL && X509_NAME_cmp(X509_get_subject_name(rootcacert), X509_get_subject_name(ctx->newWithNew)) != 0) /* The subjects do not match */