Skip to content

Rust wrapper: fix more FIPS v5 compatibility situations and doc tests - #12048

Open
holtrop-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
holtrop-wolfssl:rust-crate-fipsv5-fixes
Open

holtrop-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
holtrop-wolfssl:rust-crate-fipsv5-fixes

Conversation

@holtrop-wolfssl

Copy link
Copy Markdown
Contributor

Description

Fix to build, link, and pass unit and doc tests in both FIPS v5.2.1 (current linuxv5 fips-check) and commercial bundle for 5.2.3.

Testing

Built and ran full test suite in both fips-check.sh linuxv5 keep and commercial release bundle 5.2.3 (wolfssl 5.9.4) environments.

Checklist

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

@holtrop-wolfssl holtrop-wolfssl self-assigned this Nov 6, 2026
Copilot AI balanced review requested due to automatic review settings November 6, 2026 19:32
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

FIPS v5 configurations defining only HAVE_FIPS_VERSION are misdetected, leaving RNG::reseed() enabled despite its hidden C symbol and PSS verification disabled.

2 open issues
What changed in this PR

This PR improves the Rust wolfCrypt wrapper’s compatibility with FIPS v5.2.1 and v5.2.3, adjusting API availability and documentation examples.

Changes:

  • Broaden FIPS version detection and related RNG/RSA API gates.
  • Use detected availability for RSA RNG binding and remove the fallback declaration.
  • Update doctests with FIPS permissions, compatible feature gates, and a longer PBKDF2 password.
File Description
wrapper/​rust/​wolfssl-wolfcrypt/​build.rs Generalize FIPS v5 detection and metadata.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​sys.rs Remove the fallback RSA RNG declaration.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​rsa.rs Adjust PSS and RNG gates; update doctests.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​random.rs Disable reseeding across FIPS v5 builds.
wrapper/​rust/​wolfssl-wolfcrypt/​tests/​test_random.rs Align reseed test availability with the API.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​prf.rs Enable FIPS private-key access in doctests.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​pbkdf2_password_hash.rs Use a longer password in the example.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​kdf.rs Add FIPS permission setup to the SSH KDF example.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​hkdf.rs Add FIPS permission setup to HKDF examples.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​ecc.rs Add FIPS permission setup to ECC examples.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​dh.rs Add FIPS permission setup to DH examples.

Review effort: Balanced

Comment thread wrapper/rust/wolfssl-wolfcrypt/build.rs Resolved
Comment thread wrapper/rust/wolfssl-wolfcrypt/build.rs Resolved
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