TPM2 (Trusted Platform Module) userspace development
 help / color / mirror / Atom feed
From: Tadeusz Struk <tadeusz.struk at intel.com>
To: tpm2@lists.01.org
Subject: Re: [tpm2] seal and unseal data based on a PCR value
Date: Wed, 20 Jun 2018 16:22:38 -0700	[thread overview]
Message-ID: <81ffef76-14d0-2769-35a5-bc4188300dd4@intel.com> (raw)
In-Reply-To: 20180620204223.GA2642@carbon

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

On 06/20/2018 01:42 PM, Petko Manolov wrote:
> I know this one has been asked many times, but i could not find a definitive 
> howto, exact steps, etc.
> 
> This project requires that a piece of data is being sealed to a TPM2 based on a 
> PCR value and then unsealed from TBoot.  I've harvested some bits an pieces from 
> various discussions and still can't build a coherent picture in my mind.
> 
> What would be the best place to start reading up on this?

The steps to do this using the System API would be

1. Make sure PCRs state are in a know good state i.e. system is healthy.
2. Call TPM2_StartAuthSession() to create Policy session
3. Call TPM2_PolicyPCR() selecting the PCRs you want to include and the session created in step 2.
4. Call TPM2_Create() using the session created in step 2.
5. Optionally TPM2_Load() to load the data created in 4 into TPM.

This is result in a key "sealed" in the TPM, which can only be unsealed when the PCR are in the same state when the key was created.
The steps to unseal the key/data:

1. Call TPM2_StartAuthSession() to create Policy session
2. Call TPM2_PolicyPCR() selecting the session created in step 1
3. Call TPM2_Unseal() selecting the session created in step 1

Thanks,
-- 
Tadeusz

             reply	other threads:[~2018-06-20 23:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 23:22 Tadeusz Struk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-06-21 17:38 [tpm2] seal and unseal data based on a PCR value Petko Manolov
2018-06-20 23:11 Roberts, William C
2018-06-20 20:42 Petko Manolov

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=81ffef76-14d0-2769-35a5-bc4188300dd4@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox