From: James Bottomley <James.Bottomley@HansenPartnership.com> To: linux-integrity@vger.kernel.org Cc: Mimi Zohar <zohar@linux.ibm.com>, Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>, David Woodhouse <dwmw2@infradead.org>, keyrings@vger.kernel.org Subject: [PATCH v8 0/8] TPM 2.0 trusted keys with attached policy Date: Tue, 10 Mar 2020 05:15:59 +0000 [thread overview] Message-ID: <20200310051607.30334-1-James.Bottomley@HansenPartnership.com> (raw) In-Reply-To: <20200310050939.29251-1-James.Bottomley@HansenPartnership.com> This is a respin to separate patch 4 into the original three patches it was. I've done testing with each of the three splinters, so I think I've got the split correct. General cover letter: This patch updates the trusted key code to export keys in the ASN.1 format used by current TPM key tools (openssl_tpm2_engine and openconnect). It also simplifies the use of policy with keys because the ASN.1 format is designed to carry a description of how to construct the policy, with the result that simple policies (like authorization and PCR locking) can now be constructed and used in the kernel, bringing the TPM 2.0 policy use into line with how TPM 1.2 works. The key format is designed to be compatible with our two openssl engine implementations as well as with the format used by openconnect. I've added seal/unseal to my engine so I can use it for interoperability testing and I'll later use this for sealed symmetric keys via engine: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/openssl_tpm2_engine.git/ James --- James Bottomley (8): lib: add ASN.1 encoder oid_registry: Add TCG defined OIDS for TPM keys security: keys: trusted: fix TPM2 authorizations security: keys: trusted: use ASN.1 TPM2 key format for the blobs security: keys: trusted: Make sealed key properly interoperable security: keys: trusted: add PCR policy to TPM2 keys security: keys: trusted: add ability to specify arbitrary policy security: keys: trusted: implement counter/timer policy Documentation/security/keys/trusted-encrypted.rst | 64 ++- include/keys/trusted-type.h | 7 +- include/linux/asn1_encoder.h | 32 ++ include/linux/oid_registry.h | 5 + include/linux/tpm.h | 8 + lib/Makefile | 2 +- lib/asn1_encoder.c | 431 ++++++++++++++++++++ security/keys/Kconfig | 2 + security/keys/trusted-keys/Makefile | 2 +- security/keys/trusted-keys/tpm2-policy.c | 463 ++++++++++++++++++++++ security/keys/trusted-keys/tpm2-policy.h | 31 ++ security/keys/trusted-keys/tpm2key.asn1 | 23 ++ security/keys/trusted-keys/trusted_tpm1.c | 56 ++- security/keys/trusted-keys/trusted_tpm2.c | 370 +++++++++++++++-- 14 files changed, 1459 insertions(+), 37 deletions(-) create mode 100644 include/linux/asn1_encoder.h create mode 100644 lib/asn1_encoder.c create mode 100644 security/keys/trusted-keys/tpm2-policy.c create mode 100644 security/keys/trusted-keys/tpm2-policy.h create mode 100644 security/keys/trusted-keys/tpm2key.asn1 -- 2.16.4
WARNING: multiple messages have this Message-ID (diff)
From: James Bottomley <James.Bottomley@HansenPartnership.com> To: linux-integrity@vger.kernel.org Cc: Mimi Zohar <zohar@linux.ibm.com>, Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>, David Woodhouse <dwmw2@infradead.org>, keyrings@vger.kernel.org Subject: [PATCH v8 0/8] TPM 2.0 trusted keys with attached policy Date: Mon, 9 Mar 2020 22:15:59 -0700 [thread overview] Message-ID: <20200310051607.30334-1-James.Bottomley@HansenPartnership.com> (raw) This is a respin to separate patch 4 into the original three patches it was. I've done testing with each of the three splinters, so I think I've got the split correct. General cover letter: This patch updates the trusted key code to export keys in the ASN.1 format used by current TPM key tools (openssl_tpm2_engine and openconnect). It also simplifies the use of policy with keys because the ASN.1 format is designed to carry a description of how to construct the policy, with the result that simple policies (like authorization and PCR locking) can now be constructed and used in the kernel, bringing the TPM 2.0 policy use into line with how TPM 1.2 works. The key format is designed to be compatible with our two openssl engine implementations as well as with the format used by openconnect. I've added seal/unseal to my engine so I can use it for interoperability testing and I'll later use this for sealed symmetric keys via engine: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/openssl_tpm2_engine.git/ James --- James Bottomley (8): lib: add ASN.1 encoder oid_registry: Add TCG defined OIDS for TPM keys security: keys: trusted: fix TPM2 authorizations security: keys: trusted: use ASN.1 TPM2 key format for the blobs security: keys: trusted: Make sealed key properly interoperable security: keys: trusted: add PCR policy to TPM2 keys security: keys: trusted: add ability to specify arbitrary policy security: keys: trusted: implement counter/timer policy Documentation/security/keys/trusted-encrypted.rst | 64 ++- include/keys/trusted-type.h | 7 +- include/linux/asn1_encoder.h | 32 ++ include/linux/oid_registry.h | 5 + include/linux/tpm.h | 8 + lib/Makefile | 2 +- lib/asn1_encoder.c | 431 ++++++++++++++++++++ security/keys/Kconfig | 2 + security/keys/trusted-keys/Makefile | 2 +- security/keys/trusted-keys/tpm2-policy.c | 463 ++++++++++++++++++++++ security/keys/trusted-keys/tpm2-policy.h | 31 ++ security/keys/trusted-keys/tpm2key.asn1 | 23 ++ security/keys/trusted-keys/trusted_tpm1.c | 56 ++- security/keys/trusted-keys/trusted_tpm2.c | 370 +++++++++++++++-- 14 files changed, 1459 insertions(+), 37 deletions(-) create mode 100644 include/linux/asn1_encoder.h create mode 100644 lib/asn1_encoder.c create mode 100644 security/keys/trusted-keys/tpm2-policy.c create mode 100644 security/keys/trusted-keys/tpm2-policy.h create mode 100644 security/keys/trusted-keys/tpm2key.asn1 -- 2.16.4
next prev parent reply other threads:[~2020-03-10 5:15 UTC|newest] Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-10 5:09 [PATCH v8 0/8] TPM 2.0 trusted keys with attached policy James Bottomley 2020-03-10 5:09 ` James Bottomley 2020-03-10 5:09 ` [PATCH v8 1/8] lib: add ASN.1 encoder James Bottomley 2020-03-10 5:09 ` James Bottomley 2020-03-10 15:22 ` James Bottomley 2020-03-10 15:22 ` James Bottomley 2020-03-10 5:15 ` James Bottomley [this message] 2020-03-10 5:15 ` [PATCH v8 0/8] TPM 2.0 trusted keys with attached policy James Bottomley 2020-03-10 5:16 ` [PATCH v8 1/8] lib: add ASN.1 encoder James Bottomley 2020-03-10 5:16 ` James Bottomley 2020-03-19 19:16 ` Eric Biggers 2020-03-19 19:16 ` Eric Biggers 2020-03-10 5:16 ` [PATCH v8 2/8] oid_registry: Add TCG defined OIDS for TPM keys James Bottomley 2020-03-10 5:16 ` James Bottomley 2020-03-10 5:16 ` [PATCH v8 3/8] security: keys: trusted: fix TPM2 authorizations James Bottomley 2020-03-10 5:16 ` James Bottomley 2020-03-10 5:16 ` [PATCH v8 4/8] security: keys: trusted: use ASN.1 TPM2 key format for the blobs James Bottomley 2020-03-10 5:16 ` James Bottomley 2020-03-10 5:16 ` [PATCH v8 5/8] security: keys: trusted: Make sealed key properly interoperable James Bottomley 2020-03-10 5:16 ` James Bottomley 2020-03-10 5:16 ` [PATCH v8 6/8] security: keys: trusted: add PCR policy to TPM2 keys James Bottomley 2020-03-10 5:16 ` James Bottomley 2020-03-10 5:16 ` [PATCH v8 7/8] security: keys: trusted: add ability to specify arbitrary policy James Bottomley 2020-03-10 5:16 ` James Bottomley 2020-03-10 5:16 ` [PATCH v8 8/8] security: keys: trusted: implement counter/timer policy James Bottomley 2020-03-10 5:16 ` James Bottomley 2020-03-19 16:47 ` [PATCH v8 1/8] lib: add ASN.1 encoder David Howells 2020-03-19 17:31 ` James Bottomley 2020-03-19 17:31 ` James Bottomley 2020-03-19 19:12 ` David Howells 2020-03-19 20:07 ` James Bottomley 2020-03-19 20:07 ` James Bottomley 2020-03-19 16:48 ` [PATCH v8 2/8] oid_registry: Add TCG defined OIDS for TPM keys David Howells 2020-03-19 16:57 ` [PATCH v8 6/8] security: keys: trusted: add PCR policy to TPM2 keys David Howells 2020-03-19 18:59 ` James Bottomley 2020-03-19 18:59 ` James Bottomley
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200310051607.30334-1-James.Bottomley@HansenPartnership.com \ --to=james.bottomley@hansenpartnership.com \ --cc=dwmw2@infradead.org \ --cc=jarkko.sakkinen@linux.intel.com \ --cc=keyrings@vger.kernel.org \ --cc=linux-integrity@vger.kernel.org \ --cc=zohar@linux.ibm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.