Skip to content

Commit

Permalink
evp_pkey_ctx_setget_params_to_ctrl(): Always properly set ctx.action_…
Browse files Browse the repository at this point in the history
…type

Fixes openssl#24698

Some applicable translations are bidirectional so they have
NONE action_type. However we need to set the real action_type
in the ctx.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
(Merged from openssl#24709)

(cherry picked from commit 55c1458)
  • Loading branch information
t8m committed Jun 26, 2024
1 parent c94b641 commit 93991bf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/evp/ctrl_params_translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2777,7 +2777,7 @@ static int evp_pkey_ctx_setget_params_to_ctrl(EVP_PKEY_CTX *pctx,
fixup_args_fn *fixup = default_fixup_args;
int ret;

tmpl.action_type = action_type;
ctx.action_type = tmpl.action_type = action_type;
tmpl.keytype1 = tmpl.keytype2 = keytype;
tmpl.optype = optype;
tmpl.param_key = params->key;
Expand All @@ -2786,7 +2786,6 @@ static int evp_pkey_ctx_setget_params_to_ctrl(EVP_PKEY_CTX *pctx,
if (translation != NULL) {
if (translation->fixup_args != NULL)
fixup = translation->fixup_args;
ctx.action_type = translation->action_type;
ctx.ctrl_cmd = translation->ctrl_num;
}
ctx.pctx = pctx;
Expand Down

0 comments on commit 93991bf

Please sign in to comment.