linux/crypto/asymmetric_keys
David Howells a511e1af8b KEYS: Move the point of trust determination to __key_link()
Move the point at which a key is determined to be trustworthy to
__key_link() so that we use the contents of the keyring being linked in to
to determine whether the key being linked in is trusted or not.

What is 'trusted' then becomes a matter of what's in the keyring.

Currently, the test is done when the key is parsed, but given that at that
point we can only sensibly refer to the contents of the system trusted
keyring, we can only use that as the basis for working out the
trustworthiness of a new key.

With this change, a trusted keyring is a set of keys that once the
trusted-only flag is set cannot be added to except by verification through
one of the contained keys.

Further, adding a key into a trusted keyring, whilst it might grant
trustworthiness in the context of that keyring, does not automatically
grant trustworthiness in the context of a second keyring to which it could
be secondarily linked.

To accomplish this, the authentication data associated with the key source
must now be retained.  For an X.509 cert, this means the contents of the
AuthorityKeyIdentifier and the signature data.


If system keyrings are disabled then restrict_link_by_builtin_trusted()
resolves to restrict_link_reject().  The integrity digital signature code
still works correctly with this as it was previously using
KEY_FLAG_TRUSTED_ONLY, which doesn't permit anything to be added if there
is no system keyring against which trust can be determined.

Signed-off-by: David Howells <dhowells@redhat.com>
2016-04-11 22:43:43 +01:00
..
.gitignore X.509: Add a crypto key parser for binary (DER) X.509 certificates 2012-10-08 13:50:22 +10:30
Kconfig KEYS: Make the system trusted keyring depend on the asymmetric key type 2016-04-11 22:43:24 +01:00
Makefile X.509: Move the trust validation code out to its own file 2016-04-11 22:42:55 +01:00
asymmetric_keys.h KEYS: Generalise x509_request_asymmetric_key() 2016-04-11 22:41:56 +01:00
asymmetric_type.c KEYS: Generalise x509_request_asymmetric_key() 2016-04-11 22:41:56 +01:00
mscode.asn1 pefile: Parse the "Microsoft individual code signing" data blob 2014-07-09 14:58:37 +01:00
mscode_parser.c KEYS: Generalise system_verify_data() to provide access to internal content 2016-04-06 16:14:24 +01: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: Make trust determination dependent on contents of trust keyring 2016-04-06 16:14:24 +01:00
pkcs7_parser.c KEYS: Generalise system_verify_data() to provide access to internal content 2016-04-06 16:14:24 +01:00
pkcs7_parser.h PKCS#7: Make trust determination dependent on contents of trust keyring 2016-04-06 16:14:24 +01:00
pkcs7_trust.c KEYS: Generalise x509_request_asymmetric_key() 2016-04-11 22:41:56 +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
restrict.c KEYS: Move the point of trust determination to __key_link() 2016-04-11 22:43:43 +01:00
signature.c KEYS: Add identifier pointers to public_key_signature struct 2016-04-06 16:13:33 +01:00
verify_pefile.c PKCS#7: Make trust determination dependent on contents of trust keyring 2016-04-06 16:14:24 +01:00
verify_pefile.h KEYS: Generalise system_verify_data() to provide access to internal content 2016-04-06 16:14:24 +01: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 KEYS: Move the point of trust determination to __key_link() 2016-04-11 22:43:43 +01:00
x509_public_key.c KEYS: Move the point of trust determination to __key_link() 2016-04-11 22:43:43 +01:00