client ID fixes#362
Open
bigbrett wants to merge 1 commit into
Open
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.
Adds explicit bounds enforcement for client_id to prevent aliasing in the 4-bit whKeyId USER field, and updates tests/docs accordingly (Fixes F-2280).
Changes:
- Introduces
WH_CLIENT_ID_MAXand documents the validclient_idrange. - Enforces
client_idrange checks during server INIT handling. - Updates tests and documentation examples to use valid
client_idvalues and adds boundary tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfhsm/wh_keyid.h | Defines WH_CLIENT_ID_MAX and clarifies API expectations for clientId. |
| src/wh_server.c | Rejects INIT requests with out-of-range client_id. |
| test/wh_test_clientserver.c | Adds a sequential test to confirm INIT rejects aliasing/out-of-range IDs. |
| test/wh_test_posix_threadsafe_stress.c | Adjusts stress-test client_id generation to a valid range (partially). |
| docs/src/chapter03.md | Updates example client_id to a valid value and documents the range. |
| docs/src/chapter05.md | Updates example client_id to a valid value and documents the range. |
| docs/src-ja/chapter03.md | Japanese docs: updates example client_id and range note. |
| docs/src-ja/chapter05.md | Japanese docs: updates example client_id and range note. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #362
Scan targets checked: wolfhsm-core-bugs, wolfhsm-src
No new issues found in the changed files. ✅
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.
Fixes F-2280