Repository navigation
kmgmt: import the public key for any keypair selection - #513
Open
ColtonWilley wants to merge 2 commits into
Open
ColtonWilley wants to merge 2 commits into
ColtonWilley wants to merge 2 commits into
Conversation
OpenSSL's hybrid KEM keymgmt imports the X25519 public key with selection DOMAIN_PARAMETERS|PRIVATE_KEY. wp_ecx_import dropped it, so with wolfProvider and default both loaded a TLS 1.3 server rejected X25519MLKEM768 key shares. Read PUB_KEY whenever a keypair bit is set, as OpenSSL does; same for ML-KEM.
X25519 (test_ecx_import_pub_with_priv_selection) and ML-KEM (roundtrip test) public key import with selection DOMAIN_PARAMETERS|PRIVATE_KEY.
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in the narrow import changes and targeted regression tests; tests were not executed.
No open issues 🎉
What changed in this PR
This PR fixes wolfProvider’s public-key imports for OpenSSL hybrid KEMs, addressing TLS 1.3 X25519MLKEM768 key-share rejection when wolfProvider and the default provider are both loaded.
Changes:
- Allow ECX and ML-KEM public-key imports when either keypair selection bit is set.
- Add regression coverage for public-key imports using
DOMAIN_PARAMETERS | PRIVATE_KEY.
| File | Description |
|---|---|
test/unit.h |
Declare the new X25519 regression test. |
test/unit.c |
Register the X25519 regression test. |
test/test_mlkem.c |
Extend roundtrip coverage to private-selection public-key imports. |
test/test_ecx.c |
Verify X25519 public-key import with private-key selection. |
src/wp_mlkem_kmgmt.c |
Read public-key parameters for either keypair selection bit. |
src/wp_ecx_kmgmt.c |
Apply the same selection handling to ECX imports. |
Review effort: Balanced
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.
OpenSSL's hybrid KEM keymgmt imports the X25519 public key with
DOMAIN_PARAMETERS|PRIVATE_KEYselection, butwp_ecx_importonly readPUB_KEYwhen thePUBLIC_KEYbit was set. With wolfProvider and the default provider both loaded, a TLS 1.3 server therefore rejected every X25519MLKEM768 key share withillegal_parameter. ECX and ML-KEM import now read the public key for any keypair selection, matchingossl_ecx_key_fromdata.