Repository navigation
Implement CKM_AES_KEY_WRAP_PKCS7 - #501
Merged
Merged
Conversation
Member
Author
|
@ab PTAL |
simo5
force-pushed
the
aes_key_wrap_pkcs7
branch
3 times, most recently
from
September 11, 2026 15:49
3b850fd to
209d2ff
Compare
Jakuje
reviewed
Sep 14, 2026
simo5
force-pushed
the
aes_key_wrap_pkcs7
branch
from
September 14, 2026 18:54
209d2ff to
8dc60cd
Compare
Implement the CKM_AES_KEY_WRAP_PKCS7 mechanism for AES encryption and decryption operations. The implementation buffers data, applies PKCS#7 padding to 8-byte boundaries before key wrapping, and verifies and strips padding after unwrapping. Operations using this mechanism are marked as not approved when FIPS mode is enabled. Unit tests covering round-trips, error conditions, and test vectors are included. Assisted-by: Gemini:Gemini 3.8 Flash Signed-off-by: Simo Sorce <simo@redhat.com>
Rename AES_KWP_BLOCK to AES_KW_SEMIBLOCK across AES Key Wrap implementations. In AES Key Wrap terminology, 64-bit half-blocks are referred to as semiblocks, and the value is used by multiple key wrap modes rather than just KWP. Assisted-by: Gemini:Gemini 3.8 Flash Signed-off-by: Simo Sorce <simo@redhat.com>
Replace the variable-time PKCS#7 padding check in AES key unwrap with a constant-time evaluation of all valid padding patterns over the final semiblock. This prevents potential timing side channels during padding validation. Also add an upfront buffer size check and expand test coverage to cover all padding lengths. Assisted-by: Gemini:Gemini 3.8 Flash Signed-off-by: Simo Sorce <simo@redhat.com>
Signed-off-by: Simo Sorce <simo@redhat.com>
simo5
force-pushed
the
aes_key_wrap_pkcs7
branch
from
September 14, 2026 20:10
8dc60cd to
c798d87
Compare
Jakuje
approved these changes
Sep 15, 2026
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.
Description
Adds the missing CKM_AES_KEY_WRAP_PKCS7 implementation, this mechanism is identical to the deprecated CKM_AES_KEY_WRAP_PAD and can be used do unwrap keys wrapped with that mechanism.
I believe this supersedes #448
Checklist
Reviewer's checklist: