From 9b49ba602535dfa136af088dbcc66b2acf8e51f6 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Tue, 17 Oct 2023 22:53:05 +0200 Subject: [PATCH] fixup! evp/signature.c: add NID output to EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE --- crypto/evp/signature.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crypto/evp/signature.c b/crypto/evp/signature.c index 30a5c9a0d8d0e..fc023362f355e 100644 --- a/crypto/evp/signature.c +++ b/crypto/evp/signature.c @@ -407,18 +407,17 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation, evp_pkey_ctx_free_old_ops(ctx); ctx->operation = operation; - ERR_set_mark(); - - if (evp_pkey_ctx_is_legacy(ctx)) - goto legacy; if (ctx->pkey == NULL) { - ERR_clear_last_mark(); ERR_raise(ERR_LIB_EVP, EVP_R_NO_KEY_SET); goto err; } keynid = ctx->pkey->type; + ERR_set_mark(); + if (evp_pkey_ctx_is_legacy(ctx)) + goto legacy; + /* * Try to derive the supported signature from |ctx->keymgmt|. */