Skip to content

Add Ed25519/Ed448 support to EVP layer#10135

Open
lealem47 wants to merge 5 commits intowolfSSL:masterfrom
lealem47:nid_ED
Open

Add Ed25519/Ed448 support to EVP layer#10135
lealem47 wants to merge 5 commits intowolfSSL:masterfrom
lealem47:nid_ED

Conversation

@lealem47
Copy link
Copy Markdown
Contributor

@lealem47 lealem47 commented Apr 6, 2026

Description

  • Adds Ed25519/Ed448 support to the EVP_PKEY layer (and testing)
  • Fix bug in d2iTryAltDhKey that caused RSAk, ECCk and DH to be the only usable algs in d2i_PUBKEY()/d2i_PrivateKey()
  • Fix NGINX regression with Ed25519k/Ed448k certs by mapping their OIDs in oid2nid(). The oid2nid() path previously wasn't hit for this builds as --enable-opensslall was only recently added to --enable-nginx

Fixes zd#21503 and zd#21514

Testing

Tested by customer and new unit tests

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@lealem47 lealem47 self-assigned this Apr 6, 2026
Copilot AI review requested due to automatic review settings April 6, 2026 16:10
Copy link
Copy Markdown
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

Note

Copilot was unable to run its full agentic suite in this review.

Adds missing Ed25519/Ed448 OID↔NID mappings to avoid regressions when Ed25519k/Ed448k certificates are processed via the oid2nid() path (notably impacting NGINX/OpenVPN scenarios).

Changes:

  • Map WC_NID_ED25519/WC_NID_ED448 to ED25519k/ED448k in nid2oid().
  • Map ED25519k/ED448k to WC_NID_ED25519/WC_NID_ED448 in oid2nid().
  • Add build-flag guards (HAVE_ED25519, HAVE_ED448) around the new switch cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

lealem47 added 3 commits April 6, 2026 12:28
 When wc_DhKeyDecode() rejected the input, d2iTryAltDhKey() returned 0
 after freeing the DH object. d2i_evp_pkey_try() treats any value >= 0
 as success, so a non-DH input would stop the probe chain at the DH
 step and never reach the Falcon, Dilithium, Ed25519, or Ed448 probes
 that follow. d2i_PUBKEY()/d2i_PrivateKey() consequently returned NULL
 for any key type past DH in the chain.
  - Add WC_EVP_PKEY_ED25519 / WC_EVP_PKEY_ED448 type constants and
   matching EVP_PKEY_ED25519 / EVP_PKEY_ED448 OpenSSL aliases.
  - Extend WOLFSSL_EVP_PKEY with ed25519/ed448 fields and ownership
   bits, and free them in wolfSSL_EVP_PKEY_free().
  - Add d2i probe functions that accept both SubjectPublicKeyInfo /
   PKCS#8 PrivateKeyInfo encodings and raw 32/57-byte key material,
   and hook them into the d2i_evp_pkey_try() chain.
  - Map the Ed25519/Ed448 signature OIDs in the relevant lookups and
   teach the PEM key-format dispatch and SSL_CTX_use_PrivateKey
   switch about the new types.
Copilot AI review requested due to automatic review settings April 6, 2026 19:05
@lealem47 lealem47 changed the title Add Ed25519/Ed448 cases to oid2nid() oidKeyType switch Add Ed25519/Ed448 support to EVP layer Apr 6, 2026
@lealem47 lealem47 requested a review from julek-wolfssl April 6, 2026 19:14
Copy link
Copy Markdown
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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 13 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants