From b8028d489037033a6eaa02b11755e5be0e688523 Mon Sep 17 00:00:00 2001 From: Ingo Franzki Date: Wed, 8 Jan 2025 16:00:33 +0100 Subject: speed: Pass IV to EVP_CipherInit_ex for -evp runs with non-AEAD ciphers Some (non-AEAD) ciphers require an IV to be used. Always pass a (dummy) IV when setting the key. It is ignored by ciphers that do not use an IV. Commit 607a46d003f472d4bce646f3df6e85725094d68a corrected the use of AEAD ciphers, but removed the IV from being passed to EVP_CipherInit_ex() for non-AEAD ciphers. Fixes: https://github.com/openssl/openssl/commit/607a46d003f472d4bce646f3df6e85725094d68a Signed-off-by: Ingo Franzki Reviewed-by: Dmitry Belyavskiy Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26346) --- apps/speed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/speed.c') diff --git a/apps/speed.c b/apps/speed.c index 561e641158..972e576760 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -2999,7 +2999,7 @@ int speed_main(int argc, char **argv) if (!ae_mode) { if (!EVP_CipherInit_ex(loopargs[k].ctx, NULL, NULL, - loopargs[k].key, NULL, -1)) { + loopargs[k].key, iv, -1)) { BIO_printf(bio_err, "\nFailed to set the key\n"); dofail(); exit(1); -- cgit v1.2.3