kernel-hacking-2024-linux-s.../include/crypto
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
..
internal crypto: aead - move aead_request_cast helper to aead.h 2016-02-06 15:33:22 +08:00
ablk_helper.h crypto: create generic version of ablk_helper 2013-09-24 06:02:24 +10:00
aead.h crypto: doc - update AEAD AD handling 2016-02-17 04:07:54 +08:00
aes.h
akcipher.h crypto: doc - add akcipher API 2016-02-17 04:07:53 +08:00
algapi.h crypto: hash - Remove crypto_hash interface 2016-02-06 15:33:20 +08:00
authenc.h crypto: authenc - Export key parsing helper function 2013-10-16 20:56:25 +08:00
b128ops.h
blowfish.h
cast5.h crypto: cast5/cast6 - move lookup tables to shared module 2012-12-06 17:16:26 +08:00
cast6.h crypto: cast5/cast6 - move lookup tables to shared module 2012-12-06 17:16:26 +08:00
cast_common.h crypto: cast5/cast6 - move lookup tables to shared module 2012-12-06 17:16:26 +08:00
chacha20.h crypto: chacha20 - Export common ChaCha20 helpers 2015-07-17 21:20:21 +08:00
cryptd.h crypto: cryptd - Add missing aead.h inclusion 2015-05-13 10:31:46 +08:00
crypto_wq.h
ctr.h
des.h crypto: des_3des - add x86-64 assembly implementation 2014-06-20 21:27:58 +08:00
drbg.h crypto: drbg - remove FIPS 140-2 continuous test 2016-01-25 22:42:11 +08:00
gf128mul.h
hash.h crypto: hash - Add helpers to return alg and driver names 2016-02-06 15:33:13 +08:00
hash_info.h keys, trusted: select hash algorithm for TPM2 chips 2015-12-20 15:27:12 +02:00
if_alg.h crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path 2016-01-18 18:16:32 +08:00
lrw.h
mcryptd.h crypto: sha-mb - multibuffer crypto infrastructure 2014-08-25 20:32:25 +08:00
md5.h crypto: hash - add zero length message hash for shax and md5 2015-12-22 20:43:35 +08:00
null.h crypto: null - Add default null skcipher 2015-05-22 11:25:55 +08:00
padlock.h
pcrypt.h
pkcs7.h PKCS#7: Make trust determination dependent on contents of trust keyring 2016-04-06 16:14:24 +01:00
poly1305.h crypto: poly1305 - Export common Poly1305 helpers 2015-07-17 21:20:26 +08:00
public_key.h KEYS: Move the point of trust determination to __key_link() 2016-04-11 22:43:43 +01:00
rng.h crypto: doc - Fix typo in crypto-API.xml 2015-06-04 15:05:08 +08:00
scatterwalk.h crypto: replace scatterwalk_sg_chain with sg_chain 2015-08-17 08:12:54 -06:00
serpent.h
sha.h crypto: hash - add zero length message hash for shax and md5 2015-12-22 20:43:35 +08:00
sha1_base.h crypto: sha1 - implement base layer for SHA-1 2015-04-10 21:39:39 +08:00
sha256_base.h crypto: sha256 - implement base layer for SHA-256 2015-04-10 21:39:39 +08:00
sha512_base.h crypto: sha512 - implement base layer for SHA-512 2015-04-10 21:39:39 +08:00
skcipher.h crypto: skcipher - Fix driver name helper 2016-02-06 15:33:13 +08:00
twofish.h
vmac.h crypto: vmac - Make VMAC work when blocks aren't aligned 2012-10-15 22:33:20 +08:00
xts.h crypto: xts - consolidate sanity check for keys 2016-02-17 04:07:51 +08:00