Skip to content

attest: add derive subcommand for PCR-bound key derivation - #11

Merged
HarryR merged 2 commits into
mainfrom
attest-derive-subcommand
Nov 14, 2026
Merged

HarryR merged 2 commits into
mainfrom
attest-derive-subcommand

Conversation

@HarryR

@HarryR HarryR commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Split the vaportpm-attest CLI into attest [NONCE_HEX] and derive <LABEL> <LEN> [--exclude <PCRS>].
  • derive calls DeriveOps::derive_pcr_bound over PCRs 0-23 minus any excluded set, and prints hex. The same TPM at the same bound PCR state reproduces identical bytes; any change to a bound PCR changes the output.
  • --exclude exists for PCRs that move while the platform is unchanged (e.g. PCR5 after a loader rewrites the GPT on first boot), or that the caller does not want keys to follow. Excluding a PCR removes it from the binding, so keys survive changes to it -- choose deliberately.

Breaking change

The bare vaportpm-attest [NONCE_HEX] form is removed; use vaportpm-attest attest [NONCE_HEX]. Stdin and random-nonce fallbacks are unchanged.

Test plan

  • make ci
  • derive twice at the same PCR state -> identical output; extend a bound PCR -> different output; extend an excluded PCR -> unchanged

🤖 Generated with Claude Code

HarryR and others added 2 commits November 4, 2026 08:27
Split the CLI into subcommands:

  vaportpm-attest attest [NONCE_HEX]
  vaportpm-attest derive <LABEL> <LEN> [--exclude <PCRS>]

`derive` exposes DeriveOps::derive_pcr_bound, bound to PCRs 0-23 less any
--exclude'd (comma-separated, validated 0-23, no repeats) -- e.g. PCR5,
which moves when a loader rewrites the GPT on first boot. Output is hex.

Breaking: the bare `vaportpm-attest [NONCE_HEX]` form is gone; callers
must use `vaportpm-attest attest [NONCE_HEX]`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stage0 now builds its Secure Boot varstores with tools/mkvarstore.py
(stdlib only), so nothing runs virt-fw-vars, and pip was installed only
for it. Synced from stage0's canonical copy (workspace `make sync-harness`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HarryR
HarryR marked this pull request as ready for review November 14, 2026 05:55
@HarryR
HarryR merged commit 3f15960 into main Nov 14, 2026
1 check passed
@HarryR
HarryR deleted the attest-derive-subcommand branch November 14, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant