Skip to content

client ID fixes#362

Open
bigbrett wants to merge 1 commit into
wolfSSL:mainfrom
bigbrett:client-id-alias
Open

client ID fixes#362
bigbrett wants to merge 1 commit into
wolfSSL:mainfrom
bigbrett:client-id-alias

Conversation

@bigbrett
Copy link
Copy Markdown
Contributor

Fixes F-2280

Copilot AI review requested due to automatic review settings May 12, 2026 20:31
@bigbrett bigbrett changed the title Guard against client ID aliasing, fix examples client ID fixes May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_MAX and documents the valid client_id range.
  • Enforces client_id range checks during server INIT handling.
  • Updates tests and documentation examples to use valid client_id values 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.

Comment thread test/wh_test_posix_threadsafe_stress.c
Comment thread docs/src/chapter05.md
Comment thread docs/src/chapter05.md
Comment thread wolfhsm/wh_keyid.h
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #362

Scan targets checked: wolfhsm-core-bugs, wolfhsm-src

No new issues found in the changed files. ✅

@bigbrett bigbrett marked this pull request as ready for review May 12, 2026 21:38
@bigbrett bigbrett requested a review from padelsbach May 12, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants