Repository navigation
dh: register DH also as dhKeyAgreement and its OID - #507
Open
MarkAtwood wants to merge 1 commit into
Open
MarkAtwood wants to merge 1 commit into
MarkAtwood wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused alias change and regression coverage have no identified blocking issues.
0 open findings
What changed in this PR
Aligns wolfProvider’s DH aliases with OpenSSL’s default provider to prevent name-fetch failures during concurrent first use. No cryptographic behavior changes.
Changes:
- Registers
dhKeyAgreementand its OID as DH aliases. - Adds regression coverage for alias parity and concurrent first-use lookups.
| File | Description |
|---|---|
| test/unit.h | Declares the new DH regression test. |
| test/unit.c | Registers the regression test. |
| test/test_dh.c | Tests alias parity and concurrent DH lookups. |
| include/wolfprovider/alg_funcs.h | Adds the DH name and OID aliases. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
MarkAtwood
force-pushed
the
dh-name-dhkeyagreement
branch
from
October 7, 2026 23:45
f0d1472 to
fe51b22
Compare
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.
wolfprovider registers DH as "DH" only, openssl's default provider uses
DH:dhKeyAgreement:1.2.840.113549.1.3.1and libcrypto fetches bydhKeyAgreementfromEVP_PKEY_CTX_new_id(EVP_PKEY_DH)andEVP_PKEY_set1_DH()keys. single threaded it works because the legacy name copy aliases it, but that copy isn't locked, so threads hitting a fresh libctx together can lose the alias for good:fix gives WP_NAMES_DH the openssl names, same pattern as RSA and EC, no crypto changes.
test_dh_name_dhkeyagreementchecks the names against the default provider and races 8 threads in 20 fresh libctxs, fails without the fix. tested on cd8836f, openssl 3.5.4, wolfssl 5.9.4, default, replace-default, and fips ready all pass