Change wrap object size argument to be in/out instead of in#241
Merged
bigbrett merged 3 commits intowolfSSL:mainfrom Nov 14, 2025
Merged
Change wrap object size argument to be in/out instead of in#241bigbrett merged 3 commits intowolfSSL:mainfrom
bigbrett merged 3 commits intowolfSSL:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements issue #196 by changing wrap/unwrap function size arguments from input-only to input/output parameters. This allows callers to provide a buffer size and receive back the actual size of the wrapped/unwrapped object, which may be smaller than the buffer.
Key changes:
- Function signatures updated to use pointer parameters for size arguments (e.g.,
uint16_t wrappedKeySz→uint16_t* wrappedKeySz) - Constants renamed from
WOLFHSM_KEYWRAP_*toWH_KEYWRAP_*prefix for consistency - New
WH_KEYWRAP_AES_GCM_HEADER_SIZEconstant added to simplify size calculations
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfhsm/wh_common.h | Renamed constants to use WH_ prefix and added new header size constant |
| wolfhsm/wh_client.h | Updated function signatures and documentation for in/out size parameters |
| src/wh_client_keywrap.c | Implemented pointer-based size handling with buffer overflow checks and actual size returns |
| src/wh_server_keystore.c | Updated to use renamed constants and improved validation logic for wrapped key metadata |
| test/wh_test_multiclient.c | Updated test calls to pass size variables by reference |
| test/wh_test_keywrap.c | Updated test code to use new API signatures and renamed constants |
| test/wh_test_crypto.c | Updated usage policy test to pass size by reference |
| examples/demo/client/wh_demo_client_keywrap.c | Updated demo to use new pointer-based size parameters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bigbrett
requested changes
Nov 14, 2025
Contributor
|
@AlexLanzano also need to fix CI |
a633525 to
c97e7be
Compare
bigbrett
approved these changes
Nov 14, 2025
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.
Implements #196