From: Rich Salz Date: Fri, 2 Sep 2016 21:34:31 +0000 (-0400) Subject: RT3669: dgst can only sign/verify one file. X-Git-Tag: OpenSSL_1_1_0a~27 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d6637ce17ec5b811ea06543f3b584d25bfdeaaa3;p=oweals%2Fopenssl.git RT3669: dgst can only sign/verify one file. Check arg count and print an error message. Reviewed-by: Richard Levitte (cherry picked from commit 13a461831ab85ec9f55806ebf2df5ffb7f3f357a) --- diff --git a/apps/dgst.c b/apps/dgst.c index e438b7c8cc..b10b93e588 100644 --- a/apps/dgst.c +++ b/apps/dgst.c @@ -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,