TPM2 (Trusted Platform Module) userspace development
 help / color / mirror / Atom feed
From: Patrick Ohly <patrick.ohly at intel.com>
To: tpm2@lists.01.org
Subject: Re: [tpm2] using TPM2 NVRAM for storing LUKS password
Date: Thu, 09 Nov 2017 16:10:29 +0100	[thread overview]
Message-ID: <1510240229.22094.34.camel@intel.com> (raw)
In-Reply-To: e4f51676-5366-dc0d-86af-43014599bec4@linux.vnet.ibm.com

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

On Thu, 2017-11-09 at 09:55 -0500, Stefan Berger wrote:
> On 11/09/2017 07:53 AM, Patrick Ohly wrote:
> > I'm unsure whether this is an issue in tpm2.0-tools, in swtpm2, or
> > my
> > usage of both. Let me describe in more details what commands are
> > used.
> > 
> > The virtual TPM gets initialized with:
> >      swtpm_setup_oe.sh --tpm2 --tpm-state ... --createe
> 
> swtpm_setup.sh, which this one seems to be derived from, should only
> be 
> run once to simulate the TPM manufacturing. It's destructive to
> existing 
> TPM 2 state. Are you running this every time?

It's run once before the test, with a clean --tpm-state test. Then
follow the install part, the reboot, and then booting into the
installed image.

> > The commands that run as part of installation are:
> >      tpm2_takeownership -o ownerpass -e endorsepass -l lockpass
> >      tpm2_nvdefine -x 0x1500001 -s 40 -a 0x40000001 -t 0x80020002
> > -P ownerpass
> >      tpm2_nvwrite -x 0x1500001 -a 0x40000001 -f
> > /dev/shm/keydir.sVrmLQ/keyfile -P ownerpass
> >      52 45 46 4b 49 54 5f 30 70 e6 2b b9 ca 0c 1c 00 1d 6d eb 58 a1
> > 7a cf 0d 1d 71 46 bc fd 7a 80 a0 8f 8b 0a 30 fc 89 9b db
> > 
> >      tpm2_nvlist
> >      1 NV indexes defined.
> > 
> >        0. NV Index: 0x1500001
> >        {
> >      	    Hash algorithm(nameAlg):11
> >           	    The Index attributes(attributes):0xa0020002
> >           	    The size of the data area(dataSize):40
> >         }
> > 
> >      tpm2_nvreadlock -x 0x1500001 -a 0x40000001 -P ownerpass
> > 
> > 
> > Then the initramfs does:
> >      tpm2_nvlist
> >      0 NV indexes defined.
> > 
> >      tpm2_nvread -x 0x1500001 -a 0x40000001 -s 40 -o 0 -P ownerpass
> >      ERROR: Failed to read NVRAM area at index 0x1500001
> > (22020097). Error:0x28b
> 
> I did all of this with the latest versions of libtpms and swtpm and
> it works fine for me.

Which TPM tools (project and revision?) did you use?

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.



             reply	other threads:[~2017-11-09 15:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09 15:10 Patrick Ohly [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-11-27 11:50 [tpm2] using TPM2 NVRAM for storing LUKS password Stefan Berger
2017-11-27 10:03 Patrick Ohly
2017-11-10 15:27 Stefan Berger
2017-11-10 12:53 Patrick Ohly
2017-11-10 12:44 Patrick Ohly
2017-11-10 12:04 Stefan Berger
2017-11-10 11:53 Stefan Berger
2017-11-10  9:07 Patrick Ohly
2017-11-09 20:43 Patrick Ohly
2017-11-09 20:40 Patrick Ohly
2017-11-09 19:51 Patrick Ohly
2017-11-09 15:25 flihp
2017-11-09 15:17 Stefan Berger
2017-11-09 14:12 Javier Martinez Canillas
2017-11-09 12:53 Patrick Ohly

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=1510240229.22094.34.camel@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