All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fuchs, Andreas <andreas.fuchs at sit.fraunhofer.de>
To: tpm2@lists.01.org
Subject: Re: [tpm2] Conflicting TPM2 engines and storage formats
Date: Tue, 02 Oct 2018 17:21:16 +0000	[thread overview]
Message-ID: <9F48E1A823B03B4790B7E6E69430724D0142675FE1@EXCH2010B.sit.fraunhofer.de> (raw)
In-Reply-To: 1538498826.14607.10.camel@HansenPartnership.com

[-- Attachment #1: Type: text/plain, Size: 3484 bytes --]

Hi James,

thanks for joining it.

What do you put into the octet strings for public and private key ?
The marshalled TPM2Bs according to TPM spec or a different encoding ?

What's the template for the primary key ?

What's the content of the CommandPolicy octet string ?

Thanks,
Andreas
________________________________________
From: James Bottomley [James.Bottomley(a)hansenpartnership.com]
Sent: Tuesday, October 02, 2018 18:47
To: David Woodhouse; Fuchs, Andreas; tpm2(a)lists.01.org; Nikos Mavrogiannopoulos
Subject: Re: [tpm2] Conflicting TPM2 engines and storage formats

On Tue, 2018-10-02 at 17:38 +0100, David Woodhouse wrote:
> On Tue, 2018-10-02 at 16:20 +0000, Fuchs, Andreas wrote:
> > Hi David,
> >
> > unfortuantely, the engines are diferent as much as their license
> > and underlying TSSes.
> > tpm2-tss (which is TCG spec conformant) and IBM's proprietary
> > OpenSource TSS.
> >
> > The tpm2-tss-engine is newer and BSD-license, whilst James's is
> > (L?)GPL.
> > Thus, we could not just take his and add a second underlying TSS
> > but had to
> > implement a completely new one to get rid of the license terms.
> > So we had to come up with our own storage format.
> > I also cannot look at James's codebase to not become tainted with
> > GPL copyleft.
> >
> > That's why we chose a different engine name and made sure to label
> > PEM differently,
> > so we don't get compatibility messes.
> >
> > If you'd like to propose a different storage format for tpm2-tss-
> > engine, please
> > provide me with a format. Maybe we can fit it into the first 0.1
> > release.
> > (but that would have to happen VERY quickly, i.e. the next 2
> > weeks).
>
> Ultimately, our aim should be for people to be able to use the same
> PEM
> file regardless of which software stack they're using. I'll be fixing
> up GnuTLS client code to use the same files, much as I did for TPMv1
> PEM files a while ago.
>
> https://mta.openssl.org/pipermail/openssl-dev/2016-December/008936.ht
> ml
>  covers the format that James implemented.

Actually, there's been an extension for policy since then (and a
removal of one of the superfluous optionals) so this is the current
ASN.1 format:

TPMKey ::= SEQUENCE {
        type            OBJECT IDENTIFIER
        emptyAuth       [0] EXPLICIT BOOLEAN OPTIONAL
        parent          [1] EXPLICIT INTEGER OPTIONAL
        pubkey
        [2] EXPLICIT OCTET STRING OPTIONAL
        policy          [3] EXPLICIT SEQUENCE OF TPMPolicy OPTIONAL
        privkey         OCTET STRING
}

TPMPolicy ::= SEQUENCE {
        CommandCode             [0] EXPLICIT INTEGER
        CommandPolicy           [1] EXPLICIT OCTET STRING
}

> I think we also need to agree on which key is used as the parent by
> default. I'm guessing that's the reason I couldn't get my manual PEM
> file conversion to work in Github issue #11.

The idea of using an RSA parent at 81000001 is documented in the PC
provisioning guide issued by the TCG.  That's the one I've used in the
past.  However, most modern TPMs aren't provisioned this way yet, so:

> I believe openssl_tpm2_engine generates a P-256 primary key and uses
> that as the parent.

If you don't specify a parent in create_tpm2_key then we assume the
storage primary (which we deposit in the key file as TPM_RH_OWNER
[40000001]) and derive the P-256 EC key from it with TPM2_CreatePrimary
every time its used.

James


             reply	other threads:[~2018-10-02 17:21 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 17:21 Fuchs, Andreas [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-10-12 15:54 [tpm2] Conflicting TPM2 engines and storage formats Fuchs, Andreas
2018-10-12 15:19 David Woodhouse
2018-10-12  9:16 Fuchs, Andreas
2018-10-12  6:08 David Woodhouse
2018-10-12  5:55 David Woodhouse
2018-10-11 22:25 David Woodhouse
2018-10-11 20:15 David Woodhouse
2018-10-11 18:48 David Woodhouse
2018-10-11 18:40 David Woodhouse
2018-10-11 18:31 David Woodhouse
2018-10-11 18:07 David Woodhouse
2018-10-11 17:34 David Woodhouse
2018-10-11 15:41 Fuchs, Andreas
2018-10-08 10:15 David Woodhouse
2018-10-05 15:46 David Woodhouse
2018-10-05 15:34 Fuchs, Andreas
2018-10-05 15:31 David Woodhouse
2018-10-05 15:24 Fuchs, Andreas
2018-10-05 15:22 Fuchs, Andreas
2018-10-05 14:59 David Woodhouse
2018-10-05 14:36 Fuchs, Andreas
2018-10-05 11:59 David Woodhouse
2018-10-05 10:27 David Woodhouse
2018-10-05 10:19 Fuchs, Andreas
2018-10-05  9:44 Fuchs, Andreas
2018-10-04 16:17 David Woodhouse
2018-10-04 16:04 Fuchs, Andreas
2018-10-04 10:58 Roberts, William C
2018-10-03 20:47 David Woodhouse
2018-10-03 11:06 David Woodhouse
2018-10-03 10:47 David Woodhouse
2018-10-03 10:35 David Woodhouse
2018-10-02 18:58 David Woodhouse
2018-10-02 17:18 Fuchs, Andreas
2018-10-02 16:38 David Woodhouse
2018-10-02 16:20 Fuchs, Andreas
2018-10-01 20:10 David Woodhouse

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=9F48E1A823B03B4790B7E6E69430724D0142675FE1@EXCH2010B.sit.fraunhofer.de \
    --to=tpm2@lists.01.org \
    /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.