[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210210071853.GA30831@gondor.apana.org.au>
Date: Wed, 10 Feb 2021 18:18:53 +1100
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Thara Gopinath <thara.gopinath@...aro.org>
Cc: davem@...emloft.net, bjorn.andersson@...aro.org,
ebiggers@...gle.com, ardb@...nel.org, sivaprak@...eaurora.org,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 04/11] crypto: qce: skcipher: Return unsupported if
any three keys are same for DES3 algorithms
On Sun, Feb 07, 2021 at 09:39:39AM -0500, Thara Gopinath wrote:
>
> + /*
> + * The crypto engine does not support any two keys
> + * being the same for triple des algorithms. The
> + * verify_skcipher_des3_key does not check for all the
> + * below conditions. Return -ENOKEY in case any two keys
> + * are the same. Revisit to see if a fallback cipher
> + * is needed to handle this condition.
> + */
> + memcpy(_key, key, DES3_EDE_KEY_SIZE);
> + if (!((_key[0] ^ _key[2]) | (_key[1] ^ _key[3])) |
> + !((_key[2] ^ _key[4]) | (_key[3] ^ _key[5])) |
> + !((_key[0] ^ _key[4]) | (_key[1] ^ _key[5])))
> + return -ENOKEY;
This introduces a sparse warning:
CHECK ../drivers/crypto/qce/skcipher.c
../drivers/crypto/qce/skcipher.c:241:58: warning: dubious: !x | !y
../drivers/crypto/qce/skcipher.c:242:58: warning: dubious: x | !y
Please make sure that you test your patches with C=1 so that
you don't introduce new sparse warnings.
Thanks,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists