aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-03-21 10:26:29 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-21 10:26:29 -0700
commit9d8e7007dc7c4d7c8366739bbcd3f5e51dcd470f (patch)
tree635a83b715495ce6473f5dcaa77779ae7b7cf418 /include
parentLinux 5.17 (diff)
parenttpm: use try_get_ops() in tpm-space.c (diff)
downloadlinux-dev-9d8e7007dc7c4d7c8366739bbcd3f5e51dcd470f.tar.xz
linux-dev-9d8e7007dc7c4d7c8366739bbcd3f5e51dcd470f.zip
Merge tag 'tpmdd-next-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd
Pull tpm updates from Jarkko Sakkinen: "In order to split the work a bit we've aligned with David Howells more or less that I take more hardware/firmware aligned keyring patches, and he takes care more of the framework aligned patches. For TPM the patches worth of highlighting are the fixes for refcounting provided by Lino Sanfilippo and James Bottomley. Eric B. has done a bunch obvious (but important) fixes but there's one a bit controversial: removal of asym_tpm. It was added in 2018 when TPM1 was already declared as insecure and world had moved on to TPM2. I don't know how this has passed all the filters but I did not have a chance to see the patches when they were out. I simply cannot commit to maintaining this because it was from all angles just wrong to take it in the first place to the mainline kernel. Nobody should use this module really for anything. Finally, there is a new keyring '.machine' to hold MOK keys ('Machine Owner Keys'). In the mok side MokListTrustedRT UEFI variable can be set, from which kernel knows that MOK keys are kernel trusted keys and they are populated to the machine keyring. This keyring linked to the secondary trusted keyring, which means that can be used like any kernel trusted keys. This keyring of course can be used to hold other MOK'ish keys in other platforms in future" * tag 'tpmdd-next-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: (24 commits) tpm: use try_get_ops() in tpm-space.c KEYS: asymmetric: properly validate hash_algo and encoding KEYS: asymmetric: enforce that sig algo matches key algo KEYS: remove support for asym_tpm keys tpm: fix reference counting for struct tpm_chip integrity: Only use machine keyring when uefi_check_trust_mok_keys is true integrity: Trust MOK keys if MokListTrustedRT found efi/mokvar: move up init order KEYS: Introduce link restriction for machine keys KEYS: store reference to machine keyring integrity: add new keyring handler for mok keys integrity: Introduce a Linux keyring called machine integrity: Fix warning about missing prototypes KEYS: trusted: Avoid calling null function trusted_key_exit KEYS: trusted: Fix trusted key backends when building as module tpm: xen-tpmfront: Use struct_size() helper KEYS: x509: remove dead code that set ->unsupported_sig KEYS: x509: remove never-set ->unsupported_key flag KEYS: x509: remove unused fields KEYS: x509: clearly distinguish between key and signature algorithms ...
Diffstat (limited to 'include')
-rw-r--r--include/crypto/asym_tpm_subtype.h19
-rw-r--r--include/keys/system_keyring.h14
2 files changed, 14 insertions, 19 deletions
diff --git a/include/crypto/asym_tpm_subtype.h b/include/crypto/asym_tpm_subtype.h
deleted file mode 100644
index 48198c36d6b9..000000000000
--- a/include/crypto/asym_tpm_subtype.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#ifndef _LINUX_ASYM_TPM_SUBTYPE_H
-#define _LINUX_ASYM_TPM_SUBTYPE_H
-
-#include <linux/keyctl.h>
-
-struct tpm_key {
- void *blob;
- u32 blob_len;
- uint16_t key_len; /* Size in bits of the key */
- const void *pub_key; /* pointer inside blob to the public key bytes */
- uint16_t pub_key_len; /* length of the public key */
-};
-
-struct tpm_key *tpm_key_create(const void *blob, uint32_t blob_len);
-
-extern struct asymmetric_key_subtype asym_tpm_subtype;
-
-#endif /* _LINUX_ASYM_TPM_SUBTYPE_H */
diff --git a/include/keys/system_keyring.h b/include/keys/system_keyring.h
index 6acd3cf13a18..2419a735420f 100644
--- a/include/keys/system_keyring.h
+++ b/include/keys/system_keyring.h
@@ -38,6 +38,20 @@ extern int restrict_link_by_builtin_and_secondary_trusted(
#define restrict_link_by_builtin_and_secondary_trusted restrict_link_by_builtin_trusted
#endif
+#ifdef CONFIG_INTEGRITY_MACHINE_KEYRING
+extern int restrict_link_by_builtin_secondary_and_machine(
+ struct key *dest_keyring,
+ const struct key_type *type,
+ const union key_payload *payload,
+ struct key *restrict_key);
+extern void __init set_machine_trusted_keys(struct key *keyring);
+#else
+#define restrict_link_by_builtin_secondary_and_machine restrict_link_by_builtin_trusted
+static inline void __init set_machine_trusted_keys(struct key *keyring)
+{
+}
+#endif
+
extern struct pkcs7_message *pkcs7;
#ifdef CONFIG_SYSTEM_BLACKLIST_KEYRING
extern int mark_hash_blacklisted(const char *hash);