Fix pkeyutl -verifyrecover
authorMatt Caswell <matt@openssl.org>
Thu, 29 Aug 2019 16:15:16 +0000 (17:15 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 8 Jan 2020 10:02:20 +0000 (10:02 +0000)
When performing a pkeyutl -verifyrecover operation the input file is not
a hash - it is the signature itself. Therefore don't do the check to make
sure it looks like a hash.

Fixes #9658

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9731)

(cherry picked from commit 5ffc33244cd4d66e47dfa66ce89cb38d0f3074cc)

apps/pkeyutl.c

index 2c4e524b693e4794b0e4d31bef8d371a490b2967..ea779b674893d2e929162fbb3e99ef3f2fe6ccf3 100644 (file)
@@ -299,8 +299,7 @@ int pkeyutl_main(int argc, char **argv)
     /* Sanity check the input */
     if (buf_inlen > EVP_MAX_MD_SIZE
             && (pkey_op == EVP_PKEY_OP_SIGN
-                || pkey_op == EVP_PKEY_OP_VERIFY
-                || pkey_op == EVP_PKEY_OP_VERIFYRECOVER)) {
+                || pkey_op == EVP_PKEY_OP_VERIFY)) {
         BIO_printf(bio_err,
                    "Error: The input data looks too long to be a hash\n");
         goto end;