Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9c57a9c authored by Jamie Iles's avatar Jamie Iles Committed by Herbert Xu
Browse files

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJamie Iles <jamie@jamieiles.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent a1a38c4c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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
	 * fallback.
	 */
	if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) &&
	if (len != AES_KEYSIZE_128 && len != AES_KEYSIZE_256 &&
	    ctx->sw_cipher) {
		/*
		 * 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,
		err = crypto_ablkcipher_setkey(ctx->sw_cipher, key, len);
		if (err)
			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)
		err = -EINVAL;