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 adde3e13aba583bf4a65393fa2e77986645b4d2e..9808b66bbd53a6520cb8d510d8646d8d316e9989 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;