All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-integrity@vger.kernel.org, Mimi Zohar <zohar@linux.ibm.com>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	David Woodhouse <dwmw2@infradead.org>,
	keyrings@vger.kernel.org
Subject: Re: [PATCH v8 1/8] lib: add ASN.1 encoder
Date: Thu, 19 Mar 2020 19:16:08 +0000	[thread overview]
Message-ID: <20200319191608.GC86395@gmail.com> (raw)
In-Reply-To: <20200310051607.30334-2-James.Bottomley@HansenPartnership.com>

On Mon, Mar 09, 2020 at 10:16:00PM -0700, James Bottomley wrote:
> We have a need in the TPM2 trusted keys to return the ASN.1 form of
> the TPM key blob so it can be operated on by tools outside of the
> kernel.  The specific tools are the openssl_tpm2_engine, openconnect
> and the Intel tpm2-tss-engine.  To do that, we have to be able to read
> and write the same binary key format the tools use.  The current ASN.1
> decoder does fine for reading, but we need pieces of an ASN.1 encoder
> to write the key blob in binary compatible form.
> 
> For backwards compatibility, the trusted key reader code will still
> accept the two TPM2B quantities that it uses today, but the writer
> will only output the ASN.1 form.
> 
> The current implementation only encodes the ASN.1 bits we actually need.
[...]
> diff --git a/lib/Makefile b/lib/Makefile
> index 611872c06926..1a9169ef2bed 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -237,7 +237,7 @@ obj-$(CONFIG_INTERVAL_TREE_TEST) += interval_tree_test.o
>  
>  obj-$(CONFIG_PERCPU_TEST) += percpu_test.o
>  
> -obj-$(CONFIG_ASN1) += asn1_decoder.o
> +obj-$(CONFIG_ASN1) += asn1_decoder.o asn1_encoder.o
>  
>  obj-$(CONFIG_FONT_SUPPORT) += fonts/
>  

Shouldn't there be separate kconfig options CONFIG_ASN1_DECODER and
CONFIG_ASN1_ENCODER so that the kernel doesn't get bloated for most users, who
will only need the decoder?

- Eric

WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-integrity@vger.kernel.org, Mimi Zohar <zohar@linux.ibm.com>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	David Woodhouse <dwmw2@infradead.org>,
	keyrings@vger.kernel.org
Subject: Re: [PATCH v8 1/8] lib: add ASN.1 encoder
Date: Thu, 19 Mar 2020 12:16:08 -0700	[thread overview]
Message-ID: <20200319191608.GC86395@gmail.com> (raw)
In-Reply-To: <20200310051607.30334-2-James.Bottomley@HansenPartnership.com>

On Mon, Mar 09, 2020 at 10:16:00PM -0700, James Bottomley wrote:
> We have a need in the TPM2 trusted keys to return the ASN.1 form of
> the TPM key blob so it can be operated on by tools outside of the
> kernel.  The specific tools are the openssl_tpm2_engine, openconnect
> and the Intel tpm2-tss-engine.  To do that, we have to be able to read
> and write the same binary key format the tools use.  The current ASN.1
> decoder does fine for reading, but we need pieces of an ASN.1 encoder
> to write the key blob in binary compatible form.
> 
> For backwards compatibility, the trusted key reader code will still
> accept the two TPM2B quantities that it uses today, but the writer
> will only output the ASN.1 form.
> 
> The current implementation only encodes the ASN.1 bits we actually need.
[...]
> diff --git a/lib/Makefile b/lib/Makefile
> index 611872c06926..1a9169ef2bed 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -237,7 +237,7 @@ obj-$(CONFIG_INTERVAL_TREE_TEST) += interval_tree_test.o
>  
>  obj-$(CONFIG_PERCPU_TEST) += percpu_test.o
>  
> -obj-$(CONFIG_ASN1) += asn1_decoder.o
> +obj-$(CONFIG_ASN1) += asn1_decoder.o asn1_encoder.o
>  
>  obj-$(CONFIG_FONT_SUPPORT) += fonts/
>  

Shouldn't there be separate kconfig options CONFIG_ASN1_DECODER and
CONFIG_ASN1_ENCODER so that the kernel doesn't get bloated for most users, who
will only need the decoder?

- Eric

  parent reply	other threads:[~2020-03-19 19:16 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 ` [PATCH v8 0/8] TPM 2.0 trusted keys with attached policy James Bottomley
2020-03-10  5:15   ` 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 16:47     ` 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 19:16     ` Eric Biggers [this message]
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-19 16:48     ` David Howells
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-19 16:57     ` David Howells
2020-03-19 18:59       ` James Bottomley
2020-03-19 18:59         ` 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

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=20200319191608.GC86395@gmail.com \
    --to=ebiggers@kernel.org \
    --cc=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: link
Be 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.