Skip to content

Rust wrapper: FIPS v6 support - #12212

Open
gasbytes wants to merge 1 commit into
wolfSSL:masterfrom
gasbytes:rust-crate-fips-v6-fixes
Open

gasbytes wants to merge 1 commit into
wolfSSL:masterfrom
gasbytes:rust-crate-fips-v6-fixes

Conversation

@gasbytes

@gasbytes gasbytes commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Makes the Rust wrapper build and pass its tests against the FIPS v6 module. The v6 module skips some key checks that newer wolfSSL does, so the Ed25519/Ed448 wrappers now do them. Tests and doc examples now account for v6 differences.

Also tested locally with v5-like modules and fips-ready.

@gasbytes gasbytes self-assigned this Nov 20, 2026
Copilot AI balanced review requested due to automatic review settings November 20, 2026 14:43

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

Unconditional public-key copies in the Ed25519 and Ed448 wrappers overwrite imported public components, causing check_key() to accept mismatched private/public key pairs.

2 open issues
What changed in this PR

This PR adapts the Rust wolfCrypt wrapper for FIPS v6 compatibility, adding wrapper-side validation and updating tests and documentation examples for module differences.

Changes:

  • Adjusts FIPS detection, RSA API availability, and read-only pointer compatibility.
  • Adds Ed25519/Ed448 key-export and prehash checks, plus public-key storage handling.
  • Updates RNG reseeding expectations and enables private-key access in FIPS documentation examples.
File Description
wrapper/​rust/​wolfssl-wolfcrypt/​tests/​test_random.rs Adjusts reseeding expectations for FIPS v6.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​rsa.rs Broadens RSA-PSS verification availability.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​random.rs Updates the reseeding example for FIPS differences.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​pbkdf2_password_hash.rs Enables FIPS private-key access in the example.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​mlkem.rs Updates examples for FIPS private-key access.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​mlkem_kem.rs Updates the KEM example for FIPS private-key access.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​mldsa.rs Updates examples for FIPS private-key access.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​lib.rs Adds a pointer helper for older C signatures.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​kdf.rs Updates derivation examples for FIPS private-key access.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​ed448.rs Adds compatibility checks, key storage, and example updates.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​ed25519.rs Adds compatibility checks, key storage, and example updates.
wrapper/​rust/​wolfssl-wolfcrypt/​src/​ecc.rs Updates examples for FIPS private-key access.
wrapper/​rust/​wolfssl-wolfcrypt/​build.rs Detects FIPS v6 and exports RSA RNG-setting availability.

Review effort: Balanced

@gasbytes gasbytes changed the title Rust wrapper: build and pass tests against the FIPS v6 module Rust wrapper: FIPS v6 support Nov 20, 2026
@gasbytes
gasbytes force-pushed the rust-crate-fips-v6-fixes branch from 93fc641 to a3b652c Compare November 20, 2026 15:11
@gasbytes
gasbytes marked this pull request as ready for review November 20, 2026 15:11
@github-actions

Copy link
Copy Markdown

retest this please

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

zephyr-frdm_rw612

  • FLASH: datas +16 B, log_const_area -8 B, rodata +108 B, text +13,496 B (+4.8%, 296,076 B / 67,108,864 B, total: 0% used)
  • RAM: bss +49 B, datas +16 B (+0.1%, 58,423 B / 983,040 B, total: 6% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

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