Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bigbrett
Copy link
Contributor

@bigbrett bigbrett commented Oct 16, 2025

Adds (requested) feature to use cached key as input to HKDF. Follow up to #204

Also makes some unrelated keycache input pointers const-correct

Copy link
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

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.

Copy link
Contributor

@billphipps billphipps left a 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.

@billphipps billphipps merged commit 6449396 into wolfSSL:main Oct 16, 2025
11 checks passed
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.

3 participants