[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221229203708.13628-4-vdronov@redhat.com>
Date: Thu, 29 Dec 2022 21:37:05 +0100
From: Vladis Dronov <vdronov@...hat.com>
To: Herbert Xu <herbert@...dor.apana.org.au>,
"David S . Miller" <davem@...emloft.net>
Cc: Nicolai Stange <nstange@...e.de>, Elliott Robert <elliott@....com>,
Stephan Mueller <smueller@...onox.de>,
Eric Biggers <ebiggers@...gle.com>,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
Vladis Dronov <vdronov@...hat.com>
Subject: [PATCH v2 3/6] crypto: xts - drop redundant xts key check
xts_fallback_setkey() in xts_aes_set_key() will now enforce key size
rule in FIPS mode when setting up the fallback algorithm keys, which
makes the check in xts_aes_set_key() redundant or unreachable. So just
drop this check.
xts_fallback_setkey() now makes a key size check in xts_verify_key():
xts_fallback_setkey()
crypto_skcipher_setkey() [ skcipher_setkey_unaligned() ]
cipher->setkey() { .setkey = xts_setkey }
xts_setkey()
xts_verify_key()
Signed-off-by: Vladis Dronov <vdronov@...hat.com>
Reviewed-by: Eric Biggers <ebiggers@...gle.com>
---
arch/s390/crypto/aes_s390.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c
index 526c3f40f6a2..c773820e4af9 100644
--- a/arch/s390/crypto/aes_s390.c
+++ b/arch/s390/crypto/aes_s390.c
@@ -398,10 +398,6 @@ static int xts_aes_set_key(struct crypto_skcipher *tfm, const u8 *in_key,
if (err)
return err;
- /* In fips mode only 128 bit or 256 bit keys are valid */
- if (fips_enabled && key_len != 32 && key_len != 64)
- return -EINVAL;
-
/* Pick the correct function code based on the key length */
fc = (key_len == 32) ? CPACF_KM_XTS_128 :
(key_len == 64) ? CPACF_KM_XTS_256 : 0;
--
2.38.1
Powered by blists - more mailing lists