-
Notifications
You must be signed in to change notification settings - Fork 26
HKDF cached key support #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for using cached keys as input key material for HKDF operations, allowing keys already stored in the HSM to be used directly without passing key data from the client. This extends HKDF functionality by distinguishing between input key IDs (keyIdIn) and output key IDs (keyIdOut).
- Introduces keyIdIn parameter to specify cached input key material
- Updates HKDF request/response structures to separate input and output key IDs
- Adds server-side logic to retrieve and use cached keys for HKDF operations
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wolfhsm/wh_message_crypto.h | Splits keyId field into keyIdIn and keyIdOut in HKDF request/response structures |
| wolfhsm/wh_client_crypto.h | Updates function signatures to include keyIdIn parameter with documentation |
| src/wh_message_crypto.c | Updates serialization to handle separate keyIdIn and keyIdOut fields |
| src/wh_server_crypto.c | Implements cached key retrieval logic for HKDF input key material |
| src/wh_client_crypto.c | Updates client API implementation to pass keyIdIn parameter |
| src/wh_client_cryptocb.c | Updates crypto callback to use WH_KEYID_ERASED for keyIdIn parameter |
| test/wh_test_crypto.c | Adds test case verifying cached input key functionality |
| examples/demo/client/wh_demo_client_crypto.h | Adds function declaration for new demo |
| examples/demo/client/wh_demo_client_crypto.c | Implements demo showing cached input key usage |
| examples/demo/client/wh_demo_client_all.c | Integrates new demo into demo suite |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
billphipps
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Consider freshen key instead of read key API.
Adds (requested) feature to use cached key as input to HKDF. Follow up to #204
Also makes some unrelated keycache input pointers const-correct