diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/des_generic.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/des_generic.c b/crypto/des_generic.c index 5d0e4580f998..5bd3ee345a64 100644 --- a/crypto/des_generic.c +++ b/crypto/des_generic.c | |||
@@ -868,9 +868,10 @@ static int des3_ede_setkey(struct crypto_tfm *tfm, const u8 *key, | |||
868 | u32 *flags = &tfm->crt_flags; | 868 | u32 *flags = &tfm->crt_flags; |
869 | 869 | ||
870 | if (unlikely(!((K[0] ^ K[2]) | (K[1] ^ K[3])) || | 870 | if (unlikely(!((K[0] ^ K[2]) | (K[1] ^ K[3])) || |
871 | !((K[2] ^ K[4]) | (K[3] ^ K[5])))) | 871 | !((K[2] ^ K[4]) | (K[3] ^ K[5]))) && |
872 | (*flags & CRYPTO_TFM_REQ_WEAK_KEY)) | ||
872 | { | 873 | { |
873 | *flags |= CRYPTO_TFM_RES_BAD_KEY_SCHED; | 874 | *flags |= CRYPTO_TFM_RES_WEAK_KEY; |
874 | return -EINVAL; | 875 | return -EINVAL; |
875 | } | 876 | } |
876 | 877 | ||