Skip to content

fix: guard wc_Ed448PublicKeyToDer ed448_export_public call for FIPS<7#10416

Open
jackctj117 wants to merge 1 commit intowolfSSL:masterfrom
jackctj117:v6-fix
Open

fix: guard wc_Ed448PublicKeyToDer ed448_export_public call for FIPS<7#10416
jackctj117 wants to merge 1 commit intowolfSSL:masterfrom
jackctj117:v6-fix

Conversation

@jackctj117
Copy link
Copy Markdown
Contributor

This pull request introduces a conditional compilation change to the wc_Ed448PublicKeyToDer function in asn.c to improve compatibility with FIPS builds. Specifically, it adds a preprocessor check to handle the function call to wc_ed448_export_public differently based on the FIPS version.

Compatibility fix for FIPS builds:

  • In wolfcrypt/src/asn.c, the call to wc_ed448_export_public is now conditionally compiled: for FIPS version 3 less than 7.0.0, the key parameter is explicitly cast to non-const, addressing compatibility or API differences in those builds.

@jackctj117 jackctj117 self-assigned this May 6, 2026
Copilot AI review requested due to automatic review settings May 6, 2026 21:10
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10416

Scan targets checked: wolfcrypt-bugs, wolfcrypt-src

No new issues found in the changed files. ✅

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

This PR updates the Ed448 public-key DER export path in wolfcrypt/src/asn.c to better support older wolfCrypt FIPS v3 builds by conditionally adjusting the constness of the wc_ed448_export_public call to match API differences.

Changes:

  • Add a HAVE_FIPS && FIPS_VERSION3_LT(7,0,0) conditional around wc_ed448_export_public in wc_Ed448PublicKeyToDer.
  • For FIPS v3 < 7.0.0, cast key to non-const when calling wc_ed448_export_public (matching the existing Ed25519 pattern in the same file).

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

MemBrowse Memory Report

No memory changes detected for:

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.

3 participants