Conversation
Add subcommands under 'htool security' for managing attestation keys on devices supporting SecurityV2: - unload_attestation_key (Major 1, Minor 3) - gen_attestation_key_v1 (Major 1, Minor 15) - gen_attestation_key_v2 (Major 1, Minor 18) - load_attestation_key (Major 1, Minor 1) - load_attestation_key_from_csr_v1 (Major 1, Minor 16) - provision_attestation_key (one-shot unload + gen_v1 + load_from_csr_v1) Include unit tests covering success and error paths for each command.
willyzha
marked this pull request as ready for review
September 15, 2026 20:21
read_exact_file rejects any input file that is not exactly the expected length, and the generated outputs are always fixed size, but the flag descriptions did not say what those sizes are. Spell them out so the requirement is discoverable from --help instead of only from a failure message. wrapped key 88 bytes attestation key CSR v1 256 bytes attestation key CSR v2 192 bytes CA-signed certificate 192 bytes Help text only; no behaviour change.
htool_security_certificates.c was the only file in this area still
sending every diagnostic to stdout, which mixes error text into piped
certificate output and diverges from the 23 of 33 files under examples/
that already use stderr. All 28 prints in the file are error paths, so
convert them wholesale rather than leaving the file half-and-half.
Two message defects fixed while here:
- "Unknown Alias Key Version received: %d" had no trailing newline.
- Two "Returned status %d, while trying" messages had a doubled
space and were split mid-phrase across string literals.
No test asserts on stdout or stderr, and no status codes change.
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 subcommands under 'htool security' for managing attestation keys on devices supporting SecurityV2:
Include unit tests covering success and error paths for each command.