Wolfhsm no keystore#798
Draft
bigbrett wants to merge 3 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR removes support for “local keystore public keys” in wolfHSM client mode and introduces a WOLFBOOT_NO_KEYSTORE build path to avoid compiling/linking the built-in keystore when wolfHSM is the source of trust.
Changes:
- Make wolfHSM client builds always use HSM-resident public keys and drop
WOLFBOOT_USE_WOLFHSM_PUBKEY_IDconfiguration. - Add
WOLFBOOT_NO_KEYSTOREbuild logic and guard keystore-dependent code paths accordingly. - Update wolfHSM documentation to reflect the new configuration behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/image.c | Adjusts signature verification and authenticity checks to support HSM-only keying and optional “no keystore” builds. |
| options.mk | Forces --nolocalkeys and removes conditional WOLFBOOT_USE_WOLFHSM_PUBKEY_ID behavior for wolfHSM client builds. |
| docs/wolfHSM.md | Removes WOLFBOOT_USE_WOLFHSM_PUBKEY_ID docs and clarifies key sourcing in client mode. |
| Makefile | Adds WOLFHSM_NO_KEYSTORE logic and defines WOLFBOOT_NO_KEYSTORE to omit keystore linkage when applicable. |
Comments suppressed due to low confidence (1)
src/image.c:1
- When
WOLFBOOT_NO_KEYSTOREis defined, the per-partition key authorization check is entirely bypassed. If the HSM policy is guaranteed to enforce equivalent constraints, that should be made explicit in code via a compile-time constraint (e.g., requireWOLFBOOT_CERT_CHAIN_VERIFYand/or a specific HSM policy flag whenWOLFBOOT_NO_KEYSTOREis set). Otherwise, consider introducing an HSM-backed partition/key-usage check so you don’t lose this authorization control in no-keystore builds.
/* image.c
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+252
to
254
| #if defined(WOLFBOOT_ENABLE_WOLFHSM_CLIENT) || \ | ||
| (defined(WOLFBOOT_ENABLE_WOLFHSM_SERVER) && \ | ||
| defined(WOLFBOOT_CERT_CHAIN_VERIFY)) |
Comment on lines
+282
to
+286
| #else /* WOLFBOOT_CERT_CHAIN_VERIFY */ | ||
| #if defined(WOLFBOOT_ENABLE_WOLFHSM_CLIENT) | ||
| ret = wh_Client_EccSetKeyId(&ecc, hsmKeyIdPubKey); | ||
| #endif | ||
| #endif /* WOLFBOOT_USE_WOLFHSM_PUBKEY_ID */ | ||
| #endif /* !WOLFBOOT_CERT_CHAIN_VERIFY */ |
Comment on lines
+471
to
473
| #if defined(WOLFBOOT_ENABLE_WOLFHSM_CLIENT) || \ | ||
| (defined(WOLFBOOT_ENABLE_WOLFHSM_SERVER) && \ | ||
| defined(WOLFBOOT_CERT_CHAIN_VERIFY)) |
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.
No description provided.