From af0857f0e7ae46b7c3df2eca496cfcb71f1ff904 Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Sat, 19 Oct 2019 16:38:21 +0200 Subject: [PATCH] apps/speed: allow to continue tests after any init failure handling. previouly the exit(1) call was aborting the whole execution. Improve error message. Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/10078) --- apps/speed.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/speed.c b/apps/speed.c index e4b104e9c3..ae6546bf00 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -2396,6 +2396,8 @@ int speed_main(int argc, char **argv) count = run_benchmark(async_jobs, EVP_Digest_MDC2_loop, loopargs); d = Time_F(STOP); print_result(D_MDC2, testnum, count, d); + if (count < 0) + break; } } #endif @@ -2409,6 +2411,8 @@ int speed_main(int argc, char **argv) count = run_benchmark(async_jobs, EVP_Digest_MD4_loop, loopargs); d = Time_F(STOP); print_result(D_MD4, testnum, count, d); + if (count < 0) + break; } } #endif @@ -2503,6 +2507,8 @@ int speed_main(int argc, char **argv) count = run_benchmark(async_jobs, EVP_Digest_RMD160_loop, loopargs); d = Time_F(STOP); print_result(D_RMD160, testnum, count, d); + if (count < 0) + break; } } #endif @@ -3920,8 +3926,10 @@ static void pkey_print_message(const char *str, const char *str2, long num, static void print_result(int alg, int run_no, int count, double time_used) { if (count == -1) { - BIO_puts(bio_err, "EVP error!\n"); - exit(1); + BIO_printf(bio_err, "%s error!\n", names[alg]); + ERR_print_errors(bio_err); + /* exit(1); disable exit until default provider enabled */ + return; } BIO_printf(bio_err, mr ? "+R:%d:%s:%f\n" -- 2.39.2