提交 a9c57a9c 编写于 作者: J Jamie Iles 提交者: Herbert Xu

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: NJoe Perches <joe@perches.com>
Signed-off-by: NJamie Iles <jamie@jamieiles.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 a1a38c4c
...@@ -873,7 +873,7 @@ static int spacc_aes_setkey(struct crypto_ablkcipher *cipher, const u8 *key, ...@@ -873,7 +873,7 @@ static int spacc_aes_setkey(struct crypto_ablkcipher *cipher, const u8 *key,
* request for any other size (192 bits) then we need to do a software * request for any other size (192 bits) then we need to do a software
* fallback. * fallback.
*/ */
if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) && if (len != AES_KEYSIZE_128 && len != AES_KEYSIZE_256 &&
ctx->sw_cipher) { ctx->sw_cipher) {
/* /*
* Set the fallback transform to use the same request flags as * 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,7 +886,7 @@ static int spacc_aes_setkey(struct crypto_ablkcipher *cipher, const u8 *key,
err = crypto_ablkcipher_setkey(ctx->sw_cipher, key, len); err = crypto_ablkcipher_setkey(ctx->sw_cipher, key, len);
if (err) if (err)
goto sw_setkey_failed; goto sw_setkey_failed;
} else if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) && } else if (len != AES_KEYSIZE_128 && len != AES_KEYSIZE_256 &&
!ctx->sw_cipher) !ctx->sw_cipher)
err = -EINVAL; err = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册