EVP_MD_CTX_ctrl(): Remove unnecessary control
authorRichard Levitte <levitte@openssl.org>
Sun, 2 Feb 2020 12:09:29 +0000 (13:09 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 4 Feb 2020 18:32:37 +0000 (19:32 +0100)
A check was present as to what operation is performed with this
context.  It may have been useful at some point, but isn't any more.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10947)

crypto/evp/digest.c

index adde3e13aba583bf4a65393fa2e77986645b4d2e..be6fcb58f175644703734e1039a5e64004598083 100644 (file)
@@ -662,10 +662,7 @@ int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)
         return 0;
     }
 
-    if (ctx->digest->prov == NULL
-        && (ctx->pctx == NULL
-            || (ctx->pctx->operation != EVP_PKEY_OP_VERIFYCTX
-                && ctx->pctx->operation != EVP_PKEY_OP_SIGNCTX)))
+    if (ctx->digest->prov == NULL)
         goto legacy;
 
     switch (cmd) {