linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: dhowells@redhat.com, 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:12:05 +0000	[thread overview]
Message-ID: <3192644.1584645125@warthog.procyon.org.uk> (raw)
In-Reply-To: <1584639086.3610.28.camel@HansenPartnership.com>

James Bottomley <James.Bottomley@HansenPartnership.com> wrote:

> > I wonder if it's worth appending a note to the comment that if
> > indefinite length encoding is selected, then the result is not DER-
> > compliant and may not be CER-compliant since you're advertising
> > BER/DER/CER.
> 
> We only encode definite length currently, so the comment is superfluous
> (and probably confusing if you don't know the difference between
> DER/BER and CER).  Let's add something like this iff we ever start to
> use indefinite lengths in the encoder.

Your code appears to actually do indefinite length encoding if -1 is passed as
len to asn1_encode_tag().  The kdoc says:

	To encode in place pass a NULL @string and -1 for @len; all this will
	do is add an indefinite length tag and update the data pointer to the
	place where the tag contents should be placed.

Granted, your patches might not use it, but you're making a generic ASN.1
encoder library.

David


  parent reply	other threads:[~2020-03-19 19:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-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 ` [PATCH v8 3/8] security: keys: trusted: fix TPM2 authorizations 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 ` [PATCH v8 5/8] security: keys: trusted: Make sealed key properly interoperable 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 ` [PATCH v8 7/8] security: keys: trusted: add ability to specify arbitrary policy James Bottomley
2020-03-10  5:16 ` [PATCH v8 8/8] security: keys: trusted: implement counter/timer policy 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 19:12   ` David Howells [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2020-03-10  5:09 [PATCH v8 0/8] TPM 2.0 trusted keys with attached policy James Bottomley
2020-03-10  5:09 ` [PATCH v8 1/8] lib: add ASN.1 encoder James Bottomley
2020-03-10 15:22   ` 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=3192644.1584645125@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --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 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).