Commit f85a3c8f authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by Greg Kroah-Hartman

crypto: rsa-pkcs1pad - use constant time memory comparison for MACs

commit fec17cb2 upstream.

Otherwise, we enable all sorts of forgeries via timing attack.
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Suggested-by: default avatarStephan Müller <smueller@chronox.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d56e029f
...@@ -496,7 +496,7 @@ static int pkcs1pad_verify_complete(struct akcipher_request *req, int err) ...@@ -496,7 +496,7 @@ static int pkcs1pad_verify_complete(struct akcipher_request *req, int err)
goto done; goto done;
pos++; 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; goto done;
pos += digest_info->size; pos += digest_info->size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment