kernel-fxtec-pro1x/crypto/asymmetric_keys
David Howells 6c2dc5ae4a X.509: Extract signature digest and make self-signed cert checks earlier
Extract the signature digest for an X.509 certificate earlier, at the end
of x509_cert_parse() rather than leaving it to the callers thereof since it
has to be called anyway.

Further, immediately after that, check the signature on self-signed
certificates, also rather in the callers of x509_cert_parse().

We note in the x509_certificate struct the following bits of information:

 (1) Whether the signature is self-signed (even if we can't check the
     signature due to missing crypto).

 (2) Whether the key held in the certificate needs unsupported crypto to be
     used.  We may get a PKCS#7 message with X.509 certs that we can't make
     use of - we just ignore them and give ENOPKG at the end it we couldn't
     verify anything if at least one of these unusable certs are in the
     chain of trust.

 (3) Whether the signature held in the certificate needs unsupported crypto
     to be checked.  We can still use the key held in this certificate,
     even if we can't check the signature on it - if it is held in the
     system trusted keyring, for instance.  We just can't add it to a ring
     of trusted keys or follow it further up the chain of trust.

Making these checks earlier allows x509_check_signature() to be removed and
replaced with direct calls to public_key_verify_signature().

Signed-off-by: David Howells <dhowells@redhat.com>
2016-04-06 16:13:34 +01:00
..
.gitignore X.509: Add a crypto key parser for binary (DER) X.509 certificates 2012-10-08 13:50:22 +10:30
asymmetric_keys.h KEYS: Merge the type-specific data with the payload data 2015-10-21 15:18:36 +01:00
asymmetric_type.c KEYS: Allow authentication data to be stored in an asymmetric key 2016-04-06 16:13:33 +01:00
Kconfig akcipher: Move the RSA DER encoding check to the crypto layer 2016-03-03 21:49:27 +00:00
Makefile akcipher: Move the RSA DER encoding check to the crypto layer 2016-03-03 21:49:27 +00:00
mscode.asn1 pefile: Parse the "Microsoft individual code signing" data blob 2014-07-09 14:58:37 +01:00
mscode_parser.c X.509: Make algo identifiers text instead of enum 2016-03-03 21:49:27 +00:00
pkcs7.asn1 PKCS#7: Appropriately restrict authenticated attributes and content type 2015-08-12 17:01:01 +01:00
pkcs7_key_type.c PKCS#7: Add MODULE_LICENSE() to test module 2015-08-13 02:51:33 +01:00
pkcs7_parser.c PKCS#7: Make the signature a pointer rather than embedding it 2016-04-06 16:13:33 +01:00
pkcs7_parser.h PKCS#7: Make the signature a pointer rather than embedding it 2016-04-06 16:13:33 +01:00
pkcs7_trust.c PKCS#7: Make the signature a pointer rather than embedding it 2016-04-06 16:13:33 +01:00
pkcs7_verify.c X.509: Extract signature digest and make self-signed cert checks earlier 2016-04-06 16:13:34 +01:00
public_key.c KEYS: Allow authentication data to be stored in an asymmetric key 2016-04-06 16:13:33 +01:00
signature.c KEYS: Add identifier pointers to public_key_signature struct 2016-04-06 16:13:33 +01:00
verify_pefile.c X.509: Make algo identifiers text instead of enum 2016-03-03 21:49:27 +00:00
verify_pefile.h X.509: Make algo identifiers text instead of enum 2016-03-03 21:49:27 +00:00
x509.asn1 X.509: Add bits needed for PKCS#7 2014-07-01 16:40:19 +01:00
x509_akid.asn1 X.509: Extract both parts of the AuthorityKeyIdentifier 2015-08-07 16:26:13 +01:00
x509_cert_parser.c X.509: Extract signature digest and make self-signed cert checks earlier 2016-04-06 16:13:34 +01:00
x509_parser.h X.509: Extract signature digest and make self-signed cert checks earlier 2016-04-06 16:13:34 +01:00
x509_public_key.c X.509: Extract signature digest and make self-signed cert checks earlier 2016-04-06 16:13:34 +01:00