diff options
author | Jamie Iles <jamie@jamieiles.com> | 2011-12-13 04:54:06 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2011-12-20 02:20:05 -0500 |
commit | a9c57a9c6afb41951aa08317d0cd65a66aed38df (patch) | |
tree | 2dcb1dfedfd642ff03da7e1f1afc43baaebc80e1 /drivers | |
parent | a1a38c4c6a0f73e8a9dc217c0e4e0ac483a89f25 (diff) |
crypto: picoxcell - fix boolean and / or confusion
The AES engine only supports 128 and 256 bit keys so we should correctly
test for that.
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/picoxcell_crypto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c index 9b1571c2a5a4..58480d009324 100644 --- a/drivers/crypto/picoxcell_crypto.c +++ b/drivers/crypto/picoxcell_crypto.c | |||
@@ -873,7 +873,7 @@ static int spacc_aes_setkey(struct crypto_ablkcipher *cipher, const u8 *key, | |||
873 | * request for any other size (192 bits) then we need to do a software | 873 | * request for any other size (192 bits) then we need to do a software |
874 | * fallback. | 874 | * fallback. |
875 | */ | 875 | */ |
876 | if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) && | 876 | if (len != AES_KEYSIZE_128 && len != AES_KEYSIZE_256 && |
877 | ctx->sw_cipher) { | 877 | ctx->sw_cipher) { |
878 | /* | 878 | /* |
879 | * Set the fallback transform to use the same request flags as | 879 | * Set the fallback transform to use the same request flags as |
@@ -886,7 +886,7 @@ static int spacc_aes_setkey(struct crypto_ablkcipher *cipher, const u8 *key, | |||
886 | err = crypto_ablkcipher_setkey(ctx->sw_cipher, key, len); | 886 | err = crypto_ablkcipher_setkey(ctx->sw_cipher, key, len); |
887 | if (err) | 887 | if (err) |
888 | goto sw_setkey_failed; | 888 | goto sw_setkey_failed; |
889 | } else if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) && | 889 | } else if (len != AES_KEYSIZE_128 && len != AES_KEYSIZE_256 && |
890 | !ctx->sw_cipher) | 890 | !ctx->sw_cipher) |
891 | err = -EINVAL; | 891 | err = -EINVAL; |
892 | 892 | ||