keyrings.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Ken Goldman <kgold@linux.ibm.com>,
	James Prestwood <prestwoj@gmail.com>,
	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: Re: [PATCH v5 4/6] security: keys: trusted: use ASN.1 TPM2 key format for the blobs
Date: Sun, 12 Jul 2020 21:54:32 +0000	[thread overview]
Message-ID: <1594590872.3446.33.camel@HansenPartnership.com> (raw)
In-Reply-To: <34d5fef9-1baf-83a8-3e54-5065ea96f412@linux.ibm.com>

On Sun, 2020-07-12 at 17:38 -0400, Ken Goldman wrote:
> On 2/27/2020 3:57 PM, James Prestwood wrote:
> > I am learning lots from this discussion, so thank you. I had
> > assumed that the parent key crypto had to match the child key, RSA
> > vs EC, but sounds like that is not the case. And yes, this sounds
> > like a much better way to go now that I have a bit more info on it.
> 
> I know this old.  Just FYI:
> 
> The TPM WG debated this for a while, but decided that the TPM should
> not enforce parent / child algorithm matching.  It's for the
> application to decide.

Heh, they're lucky they made that decision otherwise we'd likely have
been deprecating RSA keys (see below).

> I also note that parent keys wrap their child keys using a symmetric
> key, typically AES, not an RSA or ECC key.  The load time would be
> the  same for an ECC or RSA parent, because it's not using the
> asymmetric key.

But that's not actually the problem.  The problem is that if the
primary parent doesn't exist, it has to be created.  The TCG PC
provisioning guide did require that the RSA storage parent be
provisioned at 81000001 but that seems largely to be ignored, leading
to most TPM2 key using applications, like the TPM2 engines, having to
run TPM2_CreatePrimary themselves.  The time taken to run
TPM2_CreatePrimary for an RSA key is prohibitive, which is why we
always use EC parent keys.  If you look at both my engine and the Intel
one, there's simply no provision for creating RSA parents, although you
may use the NV version if it exists.

I also note that if we're using loadable, not importable keys which,
again, is the majority use case, we actually don't care about the
asymmetric part of the parent, so it would have been nice to have some
type of partial create primary where it only derived the symmetric key
and thus would save a huge amount of time for the RSA key and even a
bit of time for the EC one.

> This different from TPM 1.2, which always uses parent RSA wrapping.
> 
> The asymmetric key is used for:
> 
> 1 - import (key backup, using externally generated keys)
> 2 - Salted sessions
> 
> While both are useful, they're not typically used in a
> critical path.

There's a third critical advantage: because TPM 1.2 isn't crypto agile,
the parent is actually present in the TPM and doesn't have to be
created on the fly.

James

  reply	other threads:[~2020-07-12 21:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 10:18 [PATCH v5 0/6] TPM 2.0 trusted keys with attached policy James Bottomley
2020-01-30 10:18 ` [PATCH v5 1/6] lib: add ASN.1 encoder James Bottomley
2020-01-30 10:18 ` [PATCH v5 2/6] oid_registry: Add TCG defined OIDS for TPM keys James Bottomley
2020-01-30 10:18 ` [PATCH v5 3/6] security: keys: trusted fix tpm2 authorizations James Bottomley
2020-02-25 16:48   ` Jarkko Sakkinen
2020-02-26 15:15     ` Jarkko Sakkinen
2020-02-27  0:58     ` James Bottomley
2020-02-27 16:19       ` Jarkko Sakkinen
2020-02-27 16:21         ` James Bottomley
2020-02-27 17:49           ` James Bottomley
2020-03-02 11:08             ` Jarkko Sakkinen
2020-01-30 10:18 ` [PATCH v5 4/6] security: keys: trusted: use ASN.1 TPM2 key format for the blobs James Bottomley
2020-02-03 16:54   ` James Prestwood
2020-02-27  0:02     ` James Bottomley
2020-02-27  0:20       ` James Prestwood
2020-02-27  0:54         ` James Bottomley
2020-02-27 17:19           ` James Prestwood
2020-02-27 20:19             ` James Bottomley
2020-02-27 20:26               ` James Bottomley
2020-02-27 20:44                 ` James Prestwood
2020-02-27 20:57               ` James Prestwood
2020-07-12 21:38                 ` Ken Goldman
2020-07-12 21:54                   ` James Bottomley [this message]
2020-03-02 19:00               ` James Prestwood
2020-01-30 10:18 ` [PATCH v5 5/6] security: keys: trusted: add ability to specify arbitrary policy James Bottomley
2020-01-30 10:18 ` [PATCH v5 6/6] security: keys: trusted: implement counter/timer policy James Bottomley
2020-02-20 20:17 ` [PATCH v5 0/6] TPM 2.0 trusted keys with attached policy Jarkko Sakkinen

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=1594590872.3446.33.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=dwmw2@infradead.org \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=keyrings@vger.kernel.org \
    --cc=kgold@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=prestwoj@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).