Repository navigation
Rust wrapper: fix more FIPS v5 compatibility situations and doc tests - #12048
Open
holtrop-wolfssl wants to merge 1 commit into
Open
holtrop-wolfssl wants to merge 1 commit into
holtrop-wolfssl wants to merge 1 commit into
Conversation
|
Contributor
There was a problem hiding this comment.
🟡 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
holtrop-wolfssl
force-pushed
the
rust-crate-fipsv5-fixes
branch
from
November 6, 2026 20:25
9e91126 to
4eace97
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.


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 keepand commercial release bundle 5.2.3 (wolfssl 5.9.4) environments.Checklist