Conversation
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
marked this pull request as ready for review
September 15, 2026 16:30
xorptr
reviewed
Sep 17, 2026
| if (strlen(output_file) > 0) { | ||
| output_ptr = fopen(output_file, "wb"); | ||
| if (output_ptr == NULL) { | ||
| printf("Error: %s, when attempting to open file: %s\n", strerror(errno), |
Collaborator
Author
There was a problem hiding this comment.
I updated this file to print errors to stderr.
- 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
force-pushed
the
htool-provisioning-no-get-encryption-key
branch
from
September 17, 2026 20:01
ec78556 to
217ba3c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add provisioning subcommands to htool: