Commit fcd0c3ffab for openssl.org
commit fcd0c3ffabe17cdee50a8aa89705bd355b46b304
Author: Dr. David von Oheimb <dev@ddvo.net>
Date: Wed Feb 26 18:49:58 2025 +0100
OSSL_CMP_CTX_{set,get}_option(): improve error diagnostics
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)
diff --git a/crypto/cmp/cmp_ctx.c b/crypto/cmp/cmp_ctx.c
index e1dc88989f..28f9a77e8f 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;
}
}