crypto: nx - Fix timing leak in GCM and CCM decryption
authorDavid Gstir <david@sigma-star.at>
Sun, 15 Nov 2015 16:14:41 +0000 (17:14 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 16 Nov 2015 13:39:23 +0000 (21:39 +0800)
commitcb8affb55c7e64816f3effcd9b2fc3268c016fac
treea4db924f12ad7421f71ca0ca10a374b4eb814267
parent8005c49d9aea74d382f474ce11afbbc7d7130bec
crypto: nx - Fix timing leak in GCM and CCM decryption

Using non-constant time memcmp() makes the verification of the authentication
tag in the decrypt path vulnerable to timing attacks. Fix this by using
crypto_memneq() instead.

Cc: stable@vger.kernel.org
Signed-off-by: David Gstir <david@sigma-star.at>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/nx/nx-aes-ccm.c
drivers/crypto/nx/nx-aes-gcm.c