From: Eugene Syromiatnikov Date: Mon, 15 Sep 2025 03:05:01 +0000 (+0200) Subject: crypto/evp/ctrl_params_translate.c: fix a typo in the error message X-Git-Tag: 4.0-PRE-CLANG-FORMAT-WEBKIT~501 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce7fae1bc31c35abfa6b0c2daa9f889f6b370a0d;p=thirdparty%2Fopenssl.git crypto/evp/ctrl_params_translate.c: fix a typo in the error message The ERR_raise_data() call on failure to find ctx->p2 in str_value_map erroneously refers to ctx->p1 instead; fix that but supplying the correct field and casting it to the supposed const char * type. Fixes: 9a1c4e41e8d3 "EVP: Implement data-driven translation between known ctrl and OSSL_PARAMs" Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665427 References: https://github.com/openssl/project/issues/1432 Signed-off-by: Eugene Syromiatnikov Reviewed-by: Paul Dale Reviewed-by: Matt Caswell Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/28546) --- diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c index 87887d6ebb2..76dd8e0d364 100644 --- a/crypto/evp/ctrl_params_translate.c +++ b/crypto/evp/ctrl_params_translate.c @@ -1357,7 +1357,7 @@ static int fix_rsa_padding_mode(enum state state, if (i == OSSL_NELEM(str_value_map)) { ERR_raise_data(ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE, "[action:%d, state:%d] padding name %s", - ctx->action_type, state, ctx->p1); + ctx->action_type, state, (const char *)ctx->p2); ctx->p1 = ret = -2; } else if (state == POST_CTRL_TO_PARAMS) { /* EVP_PKEY_CTRL_GET_RSA_PADDING weirdness explained further up */