speed: Correct handling of async_jobs for KEM and signature algos

Setup the loopargs array for all jobs, not only for the very first one.

It may fail with "Could not allocate 0 bytes for sig sign loop" and/or will
cause the loop functions to fail silently, because they operate on a NULL
PKEY context when "-async_jobs <n>" is specified.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/22399)
This commit is contained in:
Ingo Franzki 2023-10-16 14:07:05 +02:00 committed by Matt Caswell
parent 4e09305ee0
commit df5f419b14

View File

@ -3830,7 +3830,7 @@ skip_hmac:
loopargs[i].kem_rcv_secret[testnum] = rcv_secret;
EVP_PKEY_free(pkey);
pkey = NULL;
break;
continue;
kem_err_break:
ERR_print_errors(bio_err);
@ -4010,7 +4010,7 @@ skip_hmac:
loopargs[i].sig_sig[testnum] = sig;
EVP_PKEY_free(pkey);
pkey = NULL;
break;
continue;
sig_err_break:
ERR_print_errors(bio_err);