From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Cc: trousers-tech@lists.sourceforge.net,
tpmdd-devel@lists.sourceforge.net,
David Woodhouse <dwmw2@infradead.org>,
openssl-dev@openssl.org,
GnuTLS development list <gnutls-devel@lists.gnutls.org>
Subject: Re: [gnutls-devel] Proposal for the ASN.1 form of TPM1.2 and TPM2 keys
Date: Sun, 25 Dec 2016 15:47:32 -0800 [thread overview]
Message-ID: <1482709652.3394.15.camel@HansenPartnership.com> (raw)
In-Reply-To: <CAJU7zaL2WGnBgCnx_EQ7wNnaYpaUK8BfbX40Gm85zamnFYfhgA@mail.gmail.com>
On Sun, 2016-12-25 at 22:08 +0100, Nikos Mavrogiannopoulos wrote:
> On Sun, Dec 25, 2016 at 7:44 PM, James Bottomley
> <James.Bottomley@hansenpartnership.com> wrote:
> > > TPMKey ::= SEQUENCE {
> > > type OBJECT IDENTIFIER
> > > version [0] IMPLICIT INTEGER OPTIONAL
> > > emptyAuth [1] IMPLICIT BOOLEAN OPTIONAL
> > > parent [2] IMPLICIT INTEGER OPTIONAL
> > > publicKey [3] IMPLICIT OCTET STRING OPTIONAL
> > > privateKey OCTET STRING
> > > extensions [4] EXPLICIT Extensions OPTIONAL
> > > }
> >
> > Actually, that's the utility of ASN.1, once you use tagging, you
> > don't have to do this. The structure above is identical to:
> >
> > TPMKey ::= SEQUENCE {
> > type OBJECT IDENTIFIER
> > version [0] IMPLICIT INTEGER OPTIONAL
> > emptyAuth [1] IMPLICIT BOOLEAN OPTIONAL
> > parent [2] IMPLICIT INTEGER OPTIONAL
> > publicKey [3] IMPLICIT OCTET STRING OPTIONAL
> > privateKey OCTET STRING
> > }
> >
> > If tag 4 isn't present because optional tags are not coded when not
> > present, so you can expand any ASN.1 structure as long as you have
> > a clue from the version number that you should be looking for the
> > optional extras. The point being I don't have to specify the
> > expansion now, I can wait until we need it.
>
> How would that work for example if you want to add an additional
> field with information on the type of the key for example (key
> usage)? You would add the tag 4 as you say, and then all the previous
> parsers written with the initial description will fail parsing the
> new structure. X.509 (==PKIX) is only expandable via the extensions
> field which is already defined. If you add a field to it, no parser
> would be able to read the certificate.
Um, well, you only want backwards compatibility, you don't really want
forward compatibility. Assuming something extends the structure and
adds version v2, why would it matter that an old v1 application can't
read a v2 structure because it doesn't understand the tag 4? Even if
it could it can't make use of the extra fields and something nasty will
happen. What you want is that the new v2 application can parse both
the v2 structure and the old v1 one, but it's advantageous that a v1
application fails with a v2 structure because it prevents cockups.
James
--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
next prev parent reply other threads:[~2016-12-25 23:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-23 18:06 Proposal for the ASN.1 form of TPM1.2 and TPM2 keys James Bottomley
2016-12-23 20:12 ` Richard Levitte
[not found] ` <20161223.211218.817856866219152234.levitte-MCmKBN63+BlAfugRpC6u6w@public.gmane.org>
2016-12-23 20:22 ` [openssl-dev] " James Bottomley
2016-12-24 13:25 ` Nikos Mavrogiannopoulos
[not found] ` <CAJU7zaKjXhKJ-3PJD6XrLW2hTixEqL0B56epbqG3trw3jmXjVg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-24 16:13 ` [gnutls-devel] " James Bottomley
2016-12-25 9:18 ` Nikos Mavrogiannopoulos
2016-12-25 18:44 ` [gnutls-devel] " James Bottomley
2016-12-25 21:08 ` Nikos Mavrogiannopoulos
2016-12-25 23:47 ` James Bottomley [this message]
2016-12-26 7:18 ` Nikos Mavrogianopoulos
[not found] ` <F37418F5-0ECC-4F8B-981A-2ED74FAADA51-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-12-26 18:13 ` [gnutls-devel] " James Bottomley
2016-12-26 20:13 ` Nikos Mavrogianopoulos
[not found] ` <671CBF50-E114-4FD1-995A-523C7B63F8D5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-12-29 23:57 ` [gnutls-devel] " James Bottomley
2016-12-27 15:35 ` Erwann Abalea
2016-12-30 15:40 ` Ken Goldman
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=1482709652.3394.15.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=dwmw2@infradead.org \
--cc=gnutls-devel@lists.gnutls.org \
--cc=nmav@gnutls.org \
--cc=openssl-dev@openssl.org \
--cc=tpmdd-devel@lists.sourceforge.net \
--cc=trousers-tech@lists.sourceforge.net \
/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.