android_kernel_motorola_sm6225/crypto/asymmetric_keys
Thore Sommer fbb3ad9fb4 X.509: if signature is unsupported skip validation
commit ef5b52a631f8c18353e80ccab8408b963305510c upstream.

When the hash algorithm for the signature is not available the digest size
is 0 and the signature in the certificate is marked as unsupported.

When validating a self-signed certificate, this needs to be checked,
because otherwise trying to validate the signature will fail with an
warning:

Loading compiled-in X.509 certificates
WARNING: CPU: 0 PID: 1 at crypto/rsa-pkcs1pad.c:537 \
pkcs1pad_verify+0x46/0x12c
...
Problem loading in-kernel X.509 certificate (-22)

Signed-off-by: Thore Sommer <public@thson.de>
Cc: stable@vger.kernel.org # v4.7+
Fixes: 6c2dc5ae4a ("X.509: Extract signature digest and make self-signed cert checks earlier")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-23 10:48:11 +02:00
..
asymmetric_keys.h
asymmetric_type.c docs: Fix some broken references 2018-06-15 18:10:01 -03:00
Kconfig crypto: asymmetric_keys - select CRYPTO_HASH where needed 2019-07-26 09:14:13 +02:00
Makefile kbuild: rename *-asn1.[ch] to *.asn1.[ch] 2018-04-07 19:04:02 +09:00
mscode.asn1
mscode_parser.c kbuild: rename *-asn1.[ch] to *.asn1.[ch] 2018-04-07 19:04:02 +09:00
pkcs7.asn1
pkcs7_key_type.c Replace magic for trusting the secondary keyring with #define 2018-08-16 09:57:20 -07:00
pkcs7_parser.c kbuild: rename *-asn1.[ch] to *.asn1.[ch] 2018-04-07 19:04:02 +09:00
pkcs7_parser.h
pkcs7_trust.c
pkcs7_verify.c
public_key.c
restrict.c
signature.c docs: Fix some broken references 2018-06-15 18:10:01 -03:00
verify_pefile.c verify_pefile: relax wrapper length check 2023-04-20 12:04:40 +02:00
verify_pefile.h
x509.asn1
x509_akid.asn1
x509_cert_parser.c X.509: unpack RSA signatureValue field from BIT STRING 2018-06-25 12:17:08 -07:00
x509_parser.h
x509_public_key.c X.509: if signature is unsupported skip validation 2023-09-23 10:48:11 +02:00