summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2016-09-02 17:34:31 -0400
committerRich Salz <rsalz@openssl.org>2016-09-20 15:48:23 -0400
commitd6637ce17ec5b811ea06543f3b584d25bfdeaaa3 (patch)
treef7c43c44aacc26b48864d702e1a61d8c89c3f431
parente5cb5dbd3cc55514bb1e59a63dc8cb49221ec506 (diff)
RT3669: dgst can only sign/verify one file.
Check arg count and print an error message. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 13a461831ab85ec9f55806ebf2df5ffb7f3f357a)
-rw-r--r--apps/dgst.c4
1 files changed, 4 insertions, 0 deletions
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,