Skip to content

[htool] Add missing RoT provisioning commands - #296

Merged
rkr35 merged 7 commits into
google:mainfrom
willyzha:htool-provisioning-no-get-encryption-key
Sep 30, 2026
Merged

rkr35 merged 7 commits into
google:mainfrom
willyzha:htool-provisioning-no-get-encryption-key

Conversation

@willyzha

Copy link
Copy Markdown
Collaborator

Add provisioning subcommands to htool:

  • provisioning write: Write a provisioning blob to RoT storage from a binary file.
  • provisioning store_secrets: Store encrypted secrets to the RoT from a binary file.
  • provisioning load_mldsa_key: Load an ML-DSA key onto the RoT from a binary file.
  • provisioning validate_and_sign: Add optional --output flag to save the signed payload.

@willyzha
willyzha marked this pull request as ready for review September 15, 2026 16:30
Comment thread examples/host_commands.h Outdated
Comment thread examples/htool.c Outdated
Comment thread examples/htool.c Outdated
Comment thread examples/htool_provisioning.c Outdated
Comment thread examples/htool_provisioning.h Outdated
@willyzha
willyzha force-pushed the htool-provisioning-no-get-encryption-key branch from ec78556 to 217ba3c Compare September 17, 2026 20:01
@willyzha
willyzha requested a review from xorptr September 22, 2026 02:15
Add provisioning subcommands to htool:
- provisioning write: Write a provisioning blob to RoT storage from a binary file.
- provisioning store_secrets: Store encrypted secrets to the RoT from a binary file.
- provisioning load_mldsa_key: Load an ML-DSA key onto the RoT from a binary file.
- provisioning validate_and_sign: Add optional --output flag to save the signed payload.
- Document that the request header's `command` field holds a value
  from enum hoth_key_provisioning_command.
- Clarify that --key takes a raw 1312-byte ML-DSA-44 public key, not
  PEM or DER.
- Reword the store_secrets description: secrets are encrypted *with*
  the provisioning encryption key.
- Send error messages to stderr, consistent with the newer code in
  this file and the rest of the codebase.
Follows the convention used by chipinfo, payload_status and
opentitan_version: the host command codes and wire structs now live in
protocol/provisioning.h next to the code that uses them, and the device
I/O moves to protocol/provisioning.c.

examples/htool_provisioning.c keeps flag parsing, file I/O, the
security-version gate and user-facing output. Status codes, message text
and ordering are unchanged, so the existing tests pass with only the
crc32 -> libhoth_provisioning_crc32 rename. The rename is required
because protocol/provisioning.h is an installed header and a bare crc32
symbol would collide with zlib.

The mix of libhoth_hostcmd_exec (log read, validate-and-sign) and
libhoth_hostcmd_exec_v2 (write, commit, key provisioning) is carried
over as-is to keep this change behaviour-preserving.
@willyzha
willyzha force-pushed the htool-provisioning-no-get-encryption-key branch from 7bdbb11 to c4f7985 Compare September 25, 2026 17:15
@rkr35
rkr35 self-requested a review September 29, 2026 19:14
Comment thread protocol/provisioning.c
Comment thread protocol/provisioning.c
@rkr35
rkr35 removed their request for review September 29, 2026 20:06
@rkr35
rkr35 merged commit 281996d into google:main Sep 30, 2026
10 checks passed
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.

4 participants