Skip to content

Supply the FIPS build settings for Windows - #468

Open
ColtonWilley wants to merge 2 commits into
wolfSSL:masterfrom
ColtonWilley:winvs-fips-user-settings
Open

ColtonWilley wants to merge 2 commits into
wolfSSL:masterfrom
ColtonWilley:winvs-fips-user-settings

Conversation

@ColtonWilley

Copy link
Copy Markdown
Contributor

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.

Comment thread IDE/WINVS/README.md Resolved
Comment thread IDE/WINVS/user_settings-fips.h Resolved
Comment thread IDE/WINVS/user_settings-fips.h Resolved
Comment thread IDE/WINVS/user_settings-fips.h Resolved
Copilot AI balanced review requested due to automatic review settings October 7, 2026 19:23
@ColtonWilley
ColtonWilley force-pushed the winvs-fips-user-settings branch from c3f0ce5 to f128a03 Compare October 7, 2026 19:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.

Comment thread IDE/WINVS/user_settings-fips.h Resolved
Comment thread IDE/WINVS/README.md Resolved
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.
@ColtonWilley
ColtonWilley force-pushed the winvs-fips-user-settings branch from f128a03 to 08666b5 Compare December 1, 2026 19:28

@aidangarske aidangarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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. */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

Suggested change
/* 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+. */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

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.

4 participants