Repository navigation
Supply the FIPS build settings for Windows #468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,68 @@ | ||||||||||
| /* user_settings-fips.h | ||||||||||
| * | ||||||||||
| * Copyright (C) 2006-2026 wolfSSL Inc. | ||||||||||
| * | ||||||||||
| * This file is part of wolfProvider. | ||||||||||
| * | ||||||||||
| * wolfProvider is free software; you can redistribute it and/or modify | ||||||||||
| * it under the terms of the GNU General Public License as published by | ||||||||||
| * the Free Software Foundation; either version 3 of the License, or | ||||||||||
| * (at your option) any later version. | ||||||||||
| * | ||||||||||
| * wolfProvider is distributed in the hope that it will be useful, | ||||||||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||
| * GNU General Public License for more details. | ||||||||||
| * | ||||||||||
| * You should have received a copy of the GNU General Public License | ||||||||||
| * 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 | ||||||||||
| * end of the bundle's IDE\WIN10\user_settings.h -- wolfSSL and wolfProvider must | ||||||||||
| * compile against the same one. */ | ||||||||||
|
|
||||||||||
| #ifndef WOLFPROV_USER_SETTINGS_FIPS_H | ||||||||||
| #define WOLFPROV_USER_SETTINGS_FIPS_H | ||||||||||
|
|
||||||||||
| #ifndef HAVE_FIPS | ||||||||||
| #error "Enable FIPS in user_settings.h before including user_settings-fips.h" | ||||||||||
| #endif | ||||||||||
|
|
||||||||||
| /* The bundle enables this under HAVE_FIPS; configure does not. */ | ||||||||||
| #undef OPENSSL_EXTRA | ||||||||||
|
|
||||||||||
| /* --enable-opensslcoexist */ | ||||||||||
| #define OPENSSL_COEXIST | ||||||||||
| #define NO_OLD_WC_NAMES | ||||||||||
| #define NO_OLD_SSL_NAMES | ||||||||||
| #define NO_OLD_SHA_NAMES | ||||||||||
| #define NO_OLD_MD5_NAME | ||||||||||
|
|
||||||||||
| /* wolfProvider hardcodes the old OID values. */ | ||||||||||
| #define WOLFSSL_OLD_OID_SUM | ||||||||||
|
|
||||||||||
| /* Match --enable-dh. wolfCrypt requires an explicit opt-in for FIPS v7+. */ | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Suggested fix: For FIPS v7, either leave DH disabled or register the outside-boundary DH implementations without |
||||||||||
| #undef NO_DH | ||||||||||
| #ifndef HAVE_DH | ||||||||||
| #define HAVE_DH | ||||||||||
| #endif | ||||||||||
| #define WOLFSSL_DH_EXTRA | ||||||||||
| /* A FIPS Ready build can select v7 after reading user_settings.h. */ | ||||||||||
| #if defined(WOLFSSL_FIPS_READY) || \ | ||||||||||
| (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 7)) | ||||||||||
| #undef WC_DH_INITIAL_RUNTIME_ENABLEMENT | ||||||||||
| #define WC_DH_INITIAL_RUNTIME_ENABLEMENT 1 | ||||||||||
| #endif | ||||||||||
|
|
||||||||||
| /* Required for RSA_PSS_SALTLEN_MAX. */ | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enable automatic RSA-PSS salt discovery The new overlay defines Suggested fix: Define Suggestion:
Suggested change
|
||||||||||
| #define WOLFSSL_PSS_LONG_SALT | ||||||||||
|
|
||||||||||
| /* Match the FIPS SP math build's sp_int layout after clearing OPENSSL_EXTRA. */ | ||||||||||
| #define WOLFSSL_SP_INT_NEGATIVE | ||||||||||
|
|
||||||||||
| #ifdef _M_X64 | ||||||||||
| #define WOLFSSL_X86_64_BUILD | ||||||||||
|
aidangarske marked this conversation as resolved.
Resolved
|
||||||||||
| #endif | ||||||||||
|
|
||||||||||
| #endif /* WOLFPROV_USER_SETTINGS_FIPS_H */ | ||||||||||
There was a problem hiding this comment.
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_intlayout 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.