crypto: inside-secure - Remove redundant DES ECB & CBC keysize check
authorPascal van Leeuwen <pascalvanl@gmail.com>
Wed, 31 Jul 2019 06:10:54 +0000 (08:10 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Aug 2019 05:11:39 +0000 (15:11 +1000)
This patch removes a DES key size check that is redundant as it is already
performed by the crypto API itself due to min_keysize = max_keysize.

Signed-off-by: Pascal van Leeuwen <pvanleeuwen@verimatrix.com>
Acked-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel_cipher.c

index 718d64f6e3ee496d12ff3f476ac7c2514c993888..5682fe8b606e4b4002cccd95ee43bed5ec24fd50 100644 (file)
@@ -1197,11 +1197,6 @@ static int safexcel_des_setkey(struct crypto_skcipher *ctfm, const u8 *key,
        u32 tmp[DES_EXPKEY_WORDS];
        int ret;
 
-       if (len != DES_KEY_SIZE) {
-               crypto_skcipher_set_flags(ctfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
-               return -EINVAL;
-       }
-
        ret = des_ekey(tmp, key);
        if (!ret && (tfm->crt_flags & CRYPTO_TFM_REQ_FORBID_WEAK_KEYS)) {
                tfm->crt_flags |= CRYPTO_TFM_RES_WEAK_KEY;