Linux Integrity Measurement development
 help / color / mirror / Atom feed
* Seal/Unseal trusted keys against PCR policy
@ 2022-12-27  4:14 Sughosh Ganu
  2022-12-27 15:40 ` James Bottomley
  0 siblings, 1 reply; 14+ messages in thread
From: Sughosh Ganu @ 2022-12-27  4:14 UTC (permalink / raw)
  To: linux-integrity; +Cc: James Bottomley

hi,
I am looking to use PCR policy to seal and unseal trusted keys. I
tried using the interface described in the documentation [1], but I
get an unseal error at the time of a key load operation. I came across
a thread [2] which is pretty much the error that I get. As per my
understanding of what James had explained on that thread, the API was
broken for TPM2.0 based devices. Has that since been fixed. If so, has
there been a change in the user interface for sealing and unsealing
the trusted keys.

Here are the steps that I follow.

# tpm2_createpolicy --policy-pcr --pcr-list sha256:10 --policy
pcr10_bin.policy > pcr.policy

# cat pcr.policy
16ef916486174ed6f68b09629d2920dd7493d0918fff1247420934c3836100d3

#keyctl add trusted kmk-pcr "new 32 keyhandle=0x81000001 hash=sha256
policydigest=`cat pcr.policy`" @u
588568314

# keyctl pipe 588568314 > kmk-pcr.blob

On a reboot (or even w/o a reboot, after deleting the key)
#keyctl add trusted kmk-pcr "load `cat kmk-pcr.blob`
keyhandle=0x81000001 hash=sha256 policydigest=`cat pcr.policy`" @u
add_key: Operation not permitted

My setup is a Qemu arm64 virt platform running Debian11, linux kernel
built with current master branch, and swtpm 2.0 implementation as the
TPM backend.

-sughosh

[1] - Documentation/security/keys/trusted-encrypted.rst
[2] - https://lore.kernel.org/linux-integrity/20191206212031.GE9971@linux.intel.com/T/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-01-11 14:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-27  4:14 Seal/Unseal trusted keys against PCR policy Sughosh Ganu
2022-12-27 15:40 ` James Bottomley
2022-12-28 20:40   ` Sughosh Ganu
2022-12-28 22:48     ` James Bottomley
2022-12-29  8:42       ` Sughosh Ganu
2023-01-06 21:52       ` Ken Goldman
2023-01-06 22:23         ` William Roberts
2023-01-06 23:07           ` James Bottomley
     [not found]             ` <CAFftDdrnoc7zsxqLGuGDVK9fh1xh3E3dT2+9rKm7BPr114ZjFA@mail.gmail.com>
2023-01-11 12:19               ` Sughosh Ganu
2023-01-11 12:31                 ` James Bottomley
2023-01-11 13:50                   ` William Roberts
2023-01-11 14:42                     ` James Bottomley
2023-01-06 23:17           ` Ken Goldman
2023-01-07  0:38             ` William Roberts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox