From: Dr. David von Oheimb Date: Wed, 26 Feb 2025 17:49:58 +0000 (+0100) Subject: OSSL_CMP_CTX_{set,get}_option(): improve error diagnostics X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcd0c3ffabe17cdee50a8aa89705bd355b46b304;p=thirdparty%2Fopenssl.git OSSL_CMP_CTX_{set,get}_option(): improve error diagnostics Reviewed-by: Eugene Syromiatnikov Reviewed-by: Paul Dale MergeDate: Tue Mar 24 17:06:57 2026 (Merged from https://github.com/openssl/openssl/pull/29074) --- diff --git a/crypto/cmp/cmp_ctx.c b/crypto/cmp/cmp_ctx.c index e1dc88989f5..28f9a77e8f6 100644 --- a/crypto/cmp/cmp_ctx.c +++ b/crypto/cmp/cmp_ctx.c @@ -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; } }