des: prevent error when using two key triple DES with a random key
authorPauli <pauli@openssl.org>
Mon, 6 Feb 2023 22:29:57 +0000 (09:29 +1100)
committerPauli <pauli@openssl.org>
Wed, 8 Feb 2023 10:54:24 +0000 (21:54 +1100)
commit587e0407803af330c0b04238fcbce78521ce35d7
treebeb4a8ffb8f31e880c09bf6b149f29ef9ec6bdde
parentae08ed08e49b945d516294106fa185bb136669b2
des: prevent error when using two key triple DES with a random key

Two key 3DES only sets two keys and the random generation errors out if fewer
than three keys are required.  It shouldn't.

Fixes #20212

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20224)
providers/implementations/ciphers/cipher_tdes_common.c
test/destest.c