diff options
author | Eric Biggers <ebiggers@google.com> | 2022-01-18 16:13:04 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-15 14:18:03 +0200 |
commit | 44fe7e8c24680cb632f9e97f8d800538932ec9a0 (patch) | |
tree | 0896880c88f8c69031baafd6482485381138d79a /crypto/api.c | |
parent | 1d01831be939b87e43e79b43a8e4e5a3b442fd74 (diff) | |
download | linux-crypto-44fe7e8c24680cb632f9e97f8d800538932ec9a0.tar.gz linux-crypto-44fe7e8c24680cb632f9e97f8d800538932ec9a0.zip |
crypto: rsa-pkcs1pad - restore signature length check
commit d3481accd974541e6a5d6a1fb588924a3519c36e upstream.
RSA PKCS#1 v1.5 signatures are required to be the same length as the RSA
key size. RFC8017 specifically requires the verifier to check this
(https://datatracker.ietf.org/doc/html/rfc8017#section-8.2.2).
Commit 39669c60ba49 ("crypto: Add hash param to pkcs1pad") changed the
kernel to allow longer signatures, but didn't explain this part of the
change; it seems to be unrelated to the rest of the commit.
Revert this change, since it doesn't appear to be correct.
We can be pretty sure that no one is relying on overly-long signatures
(which would have to be front-padded with zeroes) being supported, given
that they would have been broken since commit 5bb3d56f3518
("crypto: akcipher - new verify API for public key algorithms").
Fixes: 39669c60ba49 ("crypto: Add hash param to pkcs1pad")
Cc: <stable@vger.kernel.org> # v4.6+
Cc: Tadeusz Struk <tadeusz.struk@linaro.org>
Suggested-by: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'crypto/api.c')
0 files changed, 0 insertions, 0 deletions