From 5ac85984ecfc5e2c693750186534648af4711ef3 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 30 Jun 2000 15:58:37 +0000 Subject: [PATCH] Check for missing engine name, and also, do not count up the number of given algorithms when an engine is given --- apps/speed.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/speed.c b/apps/speed.c index 27f89b577f..31a2c18a4e 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -397,6 +397,11 @@ int MAIN(int argc, char **argv) { argc--; argv++; + if(argc == 0) + { + BIO_printf(bio_err,"no engine given\n"); + goto end; + } if((e = ENGINE_by_id(*argv)) == NULL) { BIO_printf(bio_err,"invalid engine \"%s\"\n", @@ -411,6 +416,11 @@ int MAIN(int argc, char **argv) BIO_printf(bio_err,"engine \"%s\" set.\n", *argv); /* Free our "structural" reference. */ ENGINE_free(e); + /* It will be increased again further down. We just + don't want speed to confuse an engine with an + algorithm, especially when none is given (which + means all of them should be run) */ + j--; } else #ifndef NO_MD2 -- 2.25.1