Legacy digests can have custom control values
authorDmitry Belyavskiy <beldmit@gmail.com>
Tue, 21 Jan 2020 17:08:38 +0000 (20:08 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Wed, 22 Jan 2020 17:13:03 +0000 (20:13 +0300)
Fixes #10915.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10916)

crypto/evp/digest.c

index adde3e1..9808b66 100644 (file)
@@ -663,7 +663,7 @@ int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)
     }
 
     if (ctx->digest->prov == NULL
-        && (ctx->pctx == NULL
+        || (ctx->pctx == NULL
             || (ctx->pctx->operation != EVP_PKEY_OP_VERIFYCTX
                 && ctx->pctx->operation != EVP_PKEY_OP_SIGNCTX)))
         goto legacy;