Fix propquery handling in EVP_DigestSignInit_ex
authorPetr Gotthard <petr.gotthard@centrum.cz>
Mon, 15 Feb 2021 10:53:45 +0000 (11:53 +0100)
committerShane Lontis <shane.lontis@oracle.com>
Wed, 17 Feb 2021 01:09:46 +0000 (11:09 +1000)
Fixes #14183. Fix the condition to detect legacy engines, so the
`props` are considered even when libctx == NULL.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14188)

crypto/evp/m_sigver.c

index bdcac90078eb359966d8f7408272872621fa87d8..57c8ce78a48ee446d1a007f043ac21df456e6f95 100644 (file)
@@ -60,7 +60,7 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
     }
 
     if (ctx->pctx == NULL) {
-        if (libctx != NULL)
+        if (e == NULL)
             ctx->pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, props);
         else
             ctx->pctx = EVP_PKEY_CTX_new(pkey, e);