All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: linux-integrity@vger.kernel.org, tpm2@lists.linux.dev
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Subject: Re: tpm2key.asn1 parent identification
Date: Sun, 14 Sep 2025 19:23:33 +0300	[thread overview]
Message-ID: <aMbsBX2uq6zOixSA@kernel.org> (raw)
In-Reply-To: <aMboFXNNX7WZaOaS@kernel.org>

On Sun, Sep 14, 2025 at 07:08:37PM +0300, Jarkko Sakkinen wrote:
> Hi,
> 
> In practice, while implementing tpm2sh and its self-contained TPM emulator
> called "MockTPM", I've noticed that 'tpm2key.asn1.' has a major bottleneck,
> but luckily it is easy to squash.
> 
> Parent handle should never be persisted, as it defies the existential
> reason of having a file format in the first place.
> 
> To address this issue I just added couple of optional fields to TPMKey:
> 
>   parentName   [6] EXPLICIT OCTET STRING OPTIONAL,
>   parentPubkey [7] EXPLICIT OCTET STRING OPTIONAL
> 
> By persisting this information TPM2_GetCapability + TPM2_ReadPublic can
> be used to acquire an appropriate handle.
> 
> I'd highly recommend to add this quirk to anything that processes this
> ASN.1 format.


Here's a proof of concept:

https://github.com/puavo-org/tpm2sh/commit/18ec3c2169b23523d8866c58fa7b8a89a79bd3d4

BR, Jarkko

  reply	other threads:[~2025-09-14 16:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-14 16:08 tpm2key.asn1 parent identification Jarkko Sakkinen
2025-09-14 16:23 ` Jarkko Sakkinen [this message]
2025-09-22 21:42   ` James Bottomley
2025-09-15  3:24 ` James Bottomley
2025-09-15 14:50   ` Jarkko Sakkinen
2025-09-15 18:08     ` Jarkko Sakkinen
2025-09-16  2:10       ` Jarkko Sakkinen
2025-09-16  2:19         ` Jarkko Sakkinen
2025-09-17  2:33       ` James Bottomley
2025-09-18 15:48         ` Jarkko Sakkinen
2025-09-18 17:35           ` Jarkko Sakkinen
2025-09-22  8:56             ` Jarkko Sakkinen
2025-09-22 21:31               ` James Bottomley
2025-09-23 14:25                 ` Jarkko Sakkinen
2025-09-23 14:37                   ` James Bottomley
2025-09-23 15:08                     ` 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=aMbsBX2uq6zOixSA@kernel.org \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=tpm2@lists.linux.dev \
    /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.