X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=crypto%2Ftwofish.c;h=5d6d02c1a95dd505dcad12bd29005bac7b874c62;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=9feced721b768279d14fa11cc634936f40d59f5d;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/crypto/twofish.c b/crypto/twofish.c index 9feced721..5d6d02c1a 100644 --- a/crypto/twofish.c +++ b/crypto/twofish.c @@ -663,7 +663,10 @@ static int twofish_setkey(void *cx, const u8 *key, /* Check key length. */ if (key_len != 16 && key_len != 24 && key_len != 32) + { + *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; return -EINVAL; /* unsupported key length */ + } /* Compute the first two words of the S vector. The magic numbers are * the entries of the RS matrix, preprocessed through poly_to_exp. The