Repository navigation
Add server-side expected ID check - #558
Merged
Merged
Conversation
bigbrett
commented
Nov 3, 2026
Contributor
- Adds server-side check for expected client ID on a given server context
- Adds server-side comm-connect callback for enforcing user-specified constraints on connect
…tional binding constraints
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the COMM INIT client identity controls.
No open issues 🎉
What changed in this PR
Adds server-side client identity controls to wolfHSM’s COMM INIT handshake, allowing applications to restrict which client ID can bind to a channel.
Changes:
- Adds an optional expected client ID and application callback, checked before updating the connection’s binding.
- Tests ID validation, callback rejection, check ordering, and reconnect behavior in both test suites.
- Documents identity enforcement and updates the quickstart to bind its channel to client 1.
| File | Description |
|---|---|
wolfhsm/wh_server.h |
Defines the COMM INIT callback and adds configuration and context fields. |
wolfhsm/wh_comm.h |
Adds expected client ID fields to server communication structures. |
test/wh_test_clientserver.c |
Adds client ID binding and callback tests to the existing suite. |
test-refactor/wh_test_list.c |
Registers the new client ID binding test. |
test-refactor/misc/wh_test_client_id_binding.c |
Adds equivalent coverage in the refactored test suite. |
src/wh_server.c |
Validates configured IDs and enforces ID and callback checks during COMM INIT. |
src/wh_comm.c |
Copies the configured expected client ID into the server context. |
docs/src/5-Features.md |
Explains client identity controls and their role in namespace isolation. |
docs/src/3-Quickstart.md |
Configures an expected client ID and explains channel binding. |
Review effort: Balanced
billphipps
approved these changes
Nov 3, 2026
billphipps
left a comment
Contributor
There was a problem hiding this comment.
Excellent additional feature!
JacobBarthelmeh
approved these changes
Nov 3, 2026
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.