]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
OSSL_CMP_CTX_{set,get}_option(): improve error diagnostics
authorDr. David von Oheimb <dev@ddvo.net>
Wed, 26 Feb 2025 17:49:58 +0000 (18:49 +0100)
committerTomas Mraz <tomas@openssl.foundation>
Tue, 24 Mar 2026 17:06:45 +0000 (18:06 +0100)
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Tue Mar 24 17:06:57 2026
(Merged from https://github.com/openssl/openssl/pull/29074)

crypto/cmp/cmp_ctx.c

index e1dc88989f53c91b820c8903f50fbe74233b2ab9..28f9a77e8f69046f3dc75382d01f24c6c54eea4e 100644 (file)
@@ -977,7 +977,7 @@ DEFINE_set1_ASN1_OCTET_STRING(OSSL_CMP_CTX, transactionID)
         ctx->revocationReason = val;
         break;
     default:
-        ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_OPTION);
+        ERR_raise_data(ERR_LIB_CMP, CMP_R_INVALID_OPTION, "%d", opt);
         return 0;
     }
 
@@ -1039,7 +1039,7 @@ int OSSL_CMP_CTX_get_option(const OSSL_CMP_CTX *ctx, int opt)
     case OSSL_CMP_OPT_REVOCATION_REASON:
         return ctx->revocationReason;
     default:
-        ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_OPTION);
+        ERR_raise_data(ERR_LIB_CMP, CMP_R_INVALID_OPTION, "%d", opt);
         return -1;
     }
 }