Add option to use IV with DHUK wrapping, add user pin argument#140
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request adds support for initialization vectors (IV) when using DHUK (Device Hardware Unique Key) AES key wrapping functionality on STM32U5 devices, and enhances the example program with command-line argument support for user PIN specification.
- Introduces a new attribute
CKA_WOLFSSL_DHUK_IVfor storing IV data with DHUK objects - Updates AES initialization functions to set DHUK IV when available
- Modifies the key wrapping mechanism to accept IV parameters and use CBC mode instead of ECB
- Adds command-line argument parsing to the example program for user PIN input
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| wolfpkcs11/pkcs11.h | Defines new CKA_WOLFSSL_DHUK_IV attribute for DHUK IV support |
| src/internal.c | Adds DHUK IV fields to object structure and implements IV handling in AES operations |
| src/crypto.c | Registers the new DHUK IV attribute type and updates key wrapping to support IV parameters |
| examples/stm32_dhuk_aes_key.c | Refactors to support command-line user PIN input and demonstrates IV usage with CBC mode |
Comments suppressed due to low confidence (1)
src/crypto.c:700
- The preprocessor directive comment change from WOLFPKCS11_DHUK to WOLFSSL_STM32U5_DHUK should be consistent throughout the codebase to avoid confusion.
rv = WP11_Object_GetAttr(obj, CKA_SENSITIVE, &getVar, &getVarLen);
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
dgarske
approved these changes
Aug 21, 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.
No description provided.