From a5e55f62975c0f978eb348763a1de0cd923f0d77 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 20 Sep 2016 21:41:58 +0200 Subject: [PATCH] RT4669: dgst can only sign/verify one file Check arg count and print an error message. Reviewed-by: Rich Salz --- apps/dgst.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/dgst.c b/apps/dgst.c index 95e5fa3fc7..26afcd7b30 100644 --- a/apps/dgst.c +++ b/apps/dgst.c @@ -243,6 +243,11 @@ int MAIN(int argc, char **argv) argv++; } + if (keyfile != NULL && argc > 1) { + BIO_printf(bio_err, "Can only sign or verify one file\n"); + goto end; + } + if (do_verify && !sigfile) { BIO_printf(bio_err, "No signature to verify: use the -signature option\n"); -- 2.25.1