Repository navigation
Supply the FIPS build settings for Windows - #468
ColtonWilley wants to merge 2 commits into
Conversation
c3f0ce5 to
f128a03
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The settings omit enabling DH for FIPS v7+ bundles, and the documentation incorrectly assumes commercial FIPS version 5.
2 open findings
What changed in this PR
Adds Windows-specific FIPS build settings and documents the corresponding Visual Studio workflow.
Changes:
- Adds shared FIPS configuration macros.
- Expands Windows build, runtime, FIPS, and test instructions.
- Includes the new header in distributions.
| File | Description |
|---|---|
IDE/WINVS/user_settings-fips.h |
Defines Windows FIPS build macros. |
IDE/WINVS/README.md |
Documents Windows and FIPS procedures. |
IDE/WINVS/include.am |
Distributes the new settings header. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
configure sets a group of macros on Linux that a Windows FIPS build silently omits. Nothing fails at build time; the gaps surface as run-time failures, including encrypted PKCS#8 and RSA-PSS interop with OpenSSL. Ship them as IDE/WINVS/user_settings-fips.h, included at the end of the bundle's IDE/WIN10/user_settings.h so wolfSSL and wolfProvider compile against the same one. The README gains the FIPS procedure: enabling FIPS in the bundle, the v143 retarget, naming the .vcxproj rather than the .sln MSBuild 17 cannot load, building the test app that reports the in-core hash, and the overrides the unit tests need. It also records that DLL Release|x64 and DLL Debug|x64 are the approved FIPS configurations and that their project settings are correct as shipped. No source or project files change.
f128a03 to
08666b5
Compare
aidangarske
left a comment
There was a problem hiding this comment.
Skoll Code Review
Scan type: review
Overall recommendation: REQUEST_CHANGES
Findings: 3 total — 3 posted, 0 skipped
3 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [High] Enable automatic RSA-PSS salt discovery —
IDE/WINVS/user_settings-fips.h:58-59 - [High] Do not advertise out-of-boundary DH as FIPS approved —
IDE/WINVS/user_settings-fips.h:45-55 - [Medium] Add configuration-contract coverage for the FIPS overlay —
IDE/WINVS/user_settings-fips.h:21-68
Review generated by Skoll
| #define WC_DH_INITIAL_RUNTIME_ENABLEMENT 1 | ||
| #endif | ||
|
|
||
| /* Required for RSA_PSS_SALTLEN_MAX. */ |
There was a problem hiding this comment.
Enable automatic RSA-PSS salt discovery
The new overlay defines WOLFSSL_PSS_LONG_SALT but omits WOLFSSL_PSS_SALT_LEN_DISCOVER, even though wolfSSL's --enable-wolfprovider configuration and the existing Windows provider settings define both. Consequently, wp_pss_salt_len_to_wc() converts OpenSSL's RSA_PSS_SALTLEN_AUTO to the mathematical maximum rather than RSA_PSS_SALT_LEN_DISCOVER. Verification then rejects valid OpenSSL-generated signatures using a non-maximum salt, including the common digest-length salt. This leaves the Windows FIPS build with the RSA-PSS interoperability failure the PR is intended to fix.
Suggested fix: Define WOLFSSL_PSS_SALT_LEN_DISCOVER and verify an OpenSSL-generated RSA-PSS signature with RSA_PSS_SALTLEN_AUTO using a digest-length salt.
Basis: wolfSSL manual, WOLFSSL_PSS_SALT_LEN_DISCOVER: the macro makes RSA-PSS verification recover the salt length from the encoded padding instead of requiring a caller-supplied length.
Suggestion:
| /* Required for RSA_PSS_SALTLEN_MAX. */ | |
| /* Required for RSA_PSS_SALTLEN_MAX and automatic salt discovery. */ | |
| #define WOLFSSL_PSS_LONG_SALT | |
| #define WOLFSSL_PSS_SALT_LEN_DISCOVER |
| /* wolfProvider hardcodes the old OID values. */ | ||
| #define WOLFSSL_OLD_OID_SUM | ||
|
|
||
| /* Match --enable-dh. wolfCrypt requires an explicit opt-in for FIPS v7+. */ |
There was a problem hiding this comment.
Do not advertise out-of-boundary DH as FIPS approved
These settings force DH on for FIPS v7 and enable it at runtime, although wolfSSL documents DH as outside the v7 FIPS module boundary. In a HAVE_FIPS build, src/wp_wolfprov.c registers every enabled implementation with provider=wolfprov,fips=yes; therefore the newly enabled DH key-management and key-exchange implementations are returned for fips=yes queries despite being outside the validated module. Applications relying on that property can unknowingly perform a non-validated DH operation.
Suggested fix: For FIPS v7, either leave DH disabled or register the outside-boundary DH implementations without fips=yes; confirm the selected behavior against each bundle's Security Policy.
Basis: OpenSSL OSSL_PROVIDER-FIPS(7) defines fips=yes as selecting FIPS-approved implementations, while wolfSSL's FIPS v7 documentation states that DH is outside the FIPS module boundary.
| * along with wolfProvider. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| /* What configure supplies for a wolfSSL FIPS build on Linux. Include this at the |
There was a problem hiding this comment.
Add configuration-contract coverage for the FIPS overlay
The new overlay controls ABI-affecting sp_int layout and version-dependent feature gates, but the PR adds no automated check that includes it under representative commercial and FIPS Ready macro sets. Manual Windows build instructions do not detect missing or incorrectly advertised features before release.
Suggested fix: Add a preprocessor configuration test for representative FIPS versions, plus interoperability coverage for RSA-PSS automatic salt verification and the expected DH property registration.


Windows has no configure step, so the macros configure sets for a FIPS build are missing.
Adds IDE/WINVS/user_settings-fips.h with those macros. It is included at the end of the bundle's IDE/WIN10/user_settings.h, so wolfSSL and wolfProvider compile against the same file.
README documents the FIPS build procedure and the overrides the unit tests need against a FIPS bundle.