From 5111eacd50cf9a415b5891567fc6a930e7beeeff Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Fri, 16 Aug 2024 11:54:00 +0200 Subject: [PATCH] speed.c: Return success with -testmode -async_jobs if not ASYNC_is_capable() Fixes #25203 Reviewed-by: Matt Caswell Reviewed-by: Tom Cosgrove Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/25204) --- apps/speed.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/speed.c b/apps/speed.c index 81befba9d45..48f91b2213f 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -2011,14 +2011,17 @@ int speed_main(int argc, char **argv) case OPT_ASYNCJOBS: #ifndef OPENSSL_NO_ASYNC async_jobs = opt_int_arg(); + if (async_jobs > 99999) { + BIO_printf(bio_err, "%s: too many async_jobs\n", prog); + goto opterr; + } if (!ASYNC_is_capable()) { BIO_printf(bio_err, "%s: async_jobs specified but async not supported\n", prog); - goto opterr; - } - if (async_jobs > 99999) { - BIO_printf(bio_err, "%s: too many async_jobs\n", prog); + if (testmode) + /* Return success in the testmode. */ + return 0; goto opterr; } #endif -- 2.47.3