summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-06-12 00:20:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-15 13:16:16 +0300
commit716986547f1f052a7f49b5e5502e76db3a32d3e7 (patch)
treeebb1761cfabb4100d70d88c1a77440459750ef0a /crypto
parent0d6758f74a469ff34e353ddd9bf3229afff7915b (diff)
downloadlinux-716986547f1f052a7f49b5e5502e76db3a32d3e7.tar.xz
crypto: rsa-pkcs1pad - use constant time memory comparison for MACs
commit fec17cb2231733174e039ad9054fa16bb358e2ec upstream. Otherwise, we enable all sorts of forgeries via timing attack. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Suggested-by: Stephan Müller <smueller@chronox.de> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: linux-crypto@vger.kernel.org Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/rsa-pkcs1pad.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c
index 8baab4307f7b..7830d304dff6 100644
--- a/crypto/rsa-pkcs1pad.c
+++ b/crypto/rsa-pkcs1pad.c
@@ -496,7 +496,7 @@ static int pkcs1pad_verify_complete(struct akcipher_request *req, int err)
goto done;
pos++;
- if (memcmp(out_buf + pos, digest_info->data, digest_info->size))
+ if (crypto_memneq(out_buf + pos, digest_info->data, digest_info->size))
goto done;
pos += digest_info->size;