RT3669: dgst can only sign/verify one file.
authorRich Salz <rsalz@openssl.org>
Fri, 2 Sep 2016 21:34:31 +0000 (17:34 -0400)
committerRich Salz <rsalz@openssl.org>
Tue, 20 Sep 2016 19:47:55 +0000 (15:47 -0400)
Check arg count and print an error message.

Reviewed-by: Richard Levitte <levitte@openssl.org>
apps/dgst.c

index e438b7c8cc35675e101daa75c95e26ddbc98da72..b10b93e5880671aa9a90370101470c7fc8b39802 100644 (file)
@@ -185,6 +185,10 @@ int dgst_main(int argc, char **argv)
     }
     argc = opt_num_rest();
     argv = opt_rest();
+    if (keyfile != NULL && argc > 1) {
+        BIO_printf(bio_err, "%s: Can only sign or verify one file.\n", prog);
+        goto end;
+    }
 
     if (do_verify && !sigfile) {
         BIO_printf(bio_err,