Commit 01027c984d for openssl.org

commit 01027c984d4caa83f9a54cf3712fe4e53021c7b4
Author: Dr. David von Oheimb <dev@ddvo.net>
Date:   Thu Feb 6 17:15:28 2025 +0100

    CMP get_genm_itav(): suppress misleading error message on GENP with rejection

    Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
    Reviewed-by: Paul Dale <paul.dale@oracle.com>
    MergeDate: Tue Mar 24 17:06:55 2026
    (Merged from https://github.com/openssl/openssl/pull/29074)

diff --git a/crypto/cmp/cmp_genm.c b/crypto/cmp/cmp_genm.c
index 67b0531675..1c7ed9757d 100644
--- a/crypto/cmp/cmp_genm.c
+++ b/crypto/cmp/cmp_genm.c
@@ -112,7 +112,8 @@ static OSSL_CMP_ITAV *get_genm_itav(OSSL_CMP_CTX *ctx,
     req = NULL;
     itavs = OSSL_CMP_exec_GENM_ses(ctx);
     if (itavs == NULL) {
-        if (OSSL_CMP_CTX_get_status(ctx) != OSSL_CMP_PKISTATUS_request)
+        if (OSSL_CMP_CTX_get_status(ctx) != OSSL_CMP_PKISTATUS_request
+            && OSSL_CMP_CTX_get_status(ctx) != OSSL_CMP_PKISTATUS_rejection)
             ERR_raise_data(ERR_LIB_CMP, CMP_R_GETTING_GENP,
                 "with infoType %s", desc);
         return NULL;
@@ -148,7 +149,7 @@ static OSSL_CMP_ITAV *get_genm_itav(OSSL_CMP_CTX *ctx,
         OSSL_CMP_ITAV_free(itav);
     }
     ERR_raise_data(ERR_LIB_CMP, CMP_R_INVALID_GENP,
-        "could not find any ITAV for %s", desc);
+        "could not find any suitable ITAV for %s", desc);

 err:
     sk_OSSL_CMP_ITAV_free(itavs);