Skip to content

Commit b6f5278

Browse files
nefigtutherbertx
authored andcommitted
crypto: s390/aes - 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 <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 0ee4336 commit b6f5278

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

arch/s390/crypto/aes_s390.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,6 @@ static int xts_aes_set_key(struct crypto_skcipher *tfm, const u8 *in_key,
398398
if (err)
399399
return err;
400400

401-
/* In fips mode only 128 bit or 256 bit keys are valid */
402-
if (fips_enabled && key_len != 32 && key_len != 64)
403-
return -EINVAL;
404-
405401
/* Pick the correct function code based on the key length */
406402
fc = (key_len == 32) ? CPACF_KM_XTS_128 :
407403
(key_len == 64) ? CPACF_KM_XTS_256 : 0;

0 commit comments

Comments
 (0)