You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a go at sealing a secret using a PCR policy using command-line tpm2-tools. After piecing together some scattered references It wasn't too hard getting it working. The command sequence I ended up with (comments welcome) is:
Click to show
Example seals secret to current value of sha256:5 PCR
-p, --auth=AUTH:
Optional auth value to use for the key specified by -c.
-S, --session=FILE:
The session created using tpm2_startauthsession.
<...>
Sessions
When using a policy session to authorize the use of an object, prefix the option argument with the session
keyword. Then indicate a path to a session file that was created with tpm2_startauthsession(1). Optionally,
if the session requires an auth value to be sent with the session handle (eg policy password), then append a
+ and a string as described in the Passwords section.
Examples
To use a session context file called session.ctx.
session:session.ctx
Which raises several objections:
the object passed to -c is not "a key" as the description for -p suggests, but an encrypted blob.
I used tpm2_startauthsession to satisfy the PCR policy, so I naively assumed that to pass the policy to tpm2_unseal I should use -S session.ctx. Not so. Even though -p discusses auth and does not mention sessions, I'm supposed to somehow "just know" that session:session.ctx is the expected way to pass the policy session to this command.
The "Sessions" section (much lower in the manpage), once properly decrypted by the reader, tells you what you're supposed to do. But it is not explicit about what it's talking about (i.e. ".. to authorize the used of an object using -p"), nor is "the option argument" really explain this. In the example, why show "session:session.ctx" instead of the far clearer "-p session:session.ctx", that way, someone at least stand a chance of figuring out how to use the tool from the manpage, instead of frantically googling for an StackExchange question on the subject (which I had to do).
The text was updated successfully, but these errors were encountered:
SharkOverBite
changed the title
DOC: manpage complaints
DOC: tpm2_unseal manpage complaints (PCR Policy Un/Sealing)
Jul 14, 2024
I had a go at sealing a secret using a PCR policy using command-line tpm2-tools. After piecing together some scattered references It wasn't too hard getting it working. The command sequence I ended up with (comments welcome) is:
Click to show
Example seals secret to current value of sha256:5 PCR
seal.sh
unseal.sh
The gripe I have, and what took a bit of googling to figure out was the last command
Here's what tpm2_unseal(1) says:
Which raises several objections:
-S session.ctx
. Not so. Even though-p
discusses auth and does not mention sessions, I'm supposed to somehow "just know" thatsession:session.ctx
is the expected way to pass the policy session to this command.The text was updated successfully, but these errors were encountered: