]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
speed: Pass IV to EVP_CipherInit_ex for -evp runs with non-AEAD ciphers
authorIngo Franzki <ifranzki@linux.ibm.com>
Wed, 8 Jan 2025 15:00:33 +0000 (16:00 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 13 Jan 2025 10:48:03 +0000 (11:48 +0100)
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 <ifranzki@linux.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26346)

(cherry picked from commit b8028d489037033a6eaa02b11755e5be0e688523)

apps/speed.c

index 337bb2190ec818fcd5302e3c440e975fb7f54bbd..6846ae91aca45869d3f03aea53451a406d5dc9ea 100644 (file)
@@ -2424,7 +2424,7 @@ skip_hmac:
 
                     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");
                             ERR_print_errors(bio_err);
                             exit(1);