From 542dddb6a7323f3ef42e82c6c30df223f7762e02 Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Mon, 16 Nov 2026 16:21:19 -0700 Subject: [PATCH] Define BUILDING_WOLFSSL for MSVC non-DLL configurations --- IDE/WIN-PQ-FIPSv7/wolfssl-fips.vcxproj | 8 ++++---- IDE/WIN-SRTP-KDF-140-3/wolfssl-fips.vcxproj | 8 ++++---- IDE/WIN/wolfssl-fips.vcxproj | 8 ++++---- IDE/WIN10/README.txt | 6 +++++- IDE/WIN10/wolfssl-fips.vcxproj | 8 ++++---- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/IDE/WIN-PQ-FIPSv7/wolfssl-fips.vcxproj b/IDE/WIN-PQ-FIPSv7/wolfssl-fips.vcxproj index f28d0dbafe6..922750a31c1 100644 --- a/IDE/WIN-PQ-FIPSv7/wolfssl-fips.vcxproj +++ b/IDE/WIN-PQ-FIPSv7/wolfssl-fips.vcxproj @@ -133,7 +133,7 @@ Disabled .\;..\..\;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level4 @@ -165,7 +165,7 @@ Disabled .\;..\..\;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level4 @@ -198,7 +198,7 @@ MaxSpeed true .\;..\..\;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 @@ -229,7 +229,7 @@ MaxSpeed true .\;..\..\;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 diff --git a/IDE/WIN-SRTP-KDF-140-3/wolfssl-fips.vcxproj b/IDE/WIN-SRTP-KDF-140-3/wolfssl-fips.vcxproj index 65bb39fffa2..1383e0c82fd 100644 --- a/IDE/WIN-SRTP-KDF-140-3/wolfssl-fips.vcxproj +++ b/IDE/WIN-SRTP-KDF-140-3/wolfssl-fips.vcxproj @@ -133,7 +133,7 @@ Disabled $(SolutionDir)XXX-fips-test\IDE\WIN-SRTP-KDF-140-3;$(SolutionDir)XXX-fips-test;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level4 @@ -165,7 +165,7 @@ Disabled $(SolutionDir)XXX-fips-test\IDE\WIN-SRTP-KDF-140-3;$(SolutionDir)XXX-fips-test;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level4 @@ -198,7 +198,7 @@ MaxSpeed true $(SolutionDir)XXX-fips-test\IDE\WIN-SRTP-KDF-140-3;$(SolutionDir)XXX-fips-test;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 @@ -229,7 +229,7 @@ MaxSpeed true $(SolutionDir)XXX-fips-test\IDE\WIN-SRTP-KDF-140-3;$(SolutionDir)XXX-fips-test;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 diff --git a/IDE/WIN/wolfssl-fips.vcxproj b/IDE/WIN/wolfssl-fips.vcxproj index cd003c9ce1c..9f2f74c4e9e 100644 --- a/IDE/WIN/wolfssl-fips.vcxproj +++ b/IDE/WIN/wolfssl-fips.vcxproj @@ -133,7 +133,7 @@ Disabled ./;../../;%(AdditionalIncludeDirectories) - HAVE_FIPS;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + HAVE_FIPS;BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level4 @@ -165,7 +165,7 @@ Disabled ./;../../;%(AdditionalIncludeDirectories) - HAVE_FIPS;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + HAVE_FIPS;BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level4 @@ -196,7 +196,7 @@ MaxSpeed true ./;../../;%(AdditionalIncludeDirectories) - WIN32;HAVE_FIPS;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + WIN32;HAVE_FIPS;BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 @@ -227,7 +227,7 @@ MaxSpeed true ./;../../;%(AdditionalIncludeDirectories) - HAVE_FIPS;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + HAVE_FIPS;BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 diff --git a/IDE/WIN10/README.txt b/IDE/WIN10/README.txt index 20a8b4c70ca..df2c280a2ec 100644 --- a/IDE/WIN10/README.txt +++ b/IDE/WIN10/README.txt @@ -41,10 +41,14 @@ build the C implementations only. # Selecting the FIPS version The wolfssl-fips project does not put HAVE_FIPS on the compiler command line. -It defines only WOLFSSL_USER_SETTINGS (plus BUILDING_WOLFSSL and WOLFSSL_DLL +It defines only WOLFSSL_USER_SETTINGS and BUILDING_WOLFSSL (plus WOLFSSL_DLL for the DLL configurations) and picks everything else up from IDE/WIN10/user_settings.h. +BUILDING_WOLFSSL must be defined for every library configuration, static as +well as DLL, and must not be added to user_settings.h or to application +projects. + The top of user_settings.h has one block per module version. All of them are disabled as shipped, so a version must be enabled before the library will build in FIPS mode: diff --git a/IDE/WIN10/wolfssl-fips.vcxproj b/IDE/WIN10/wolfssl-fips.vcxproj index 4d9cfb995a6..57f03078931 100644 --- a/IDE/WIN10/wolfssl-fips.vcxproj +++ b/IDE/WIN10/wolfssl-fips.vcxproj @@ -133,7 +133,7 @@ Disabled ./;../../;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level4 @@ -165,7 +165,7 @@ Disabled ./;../../;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level4 @@ -196,7 +196,7 @@ MaxSpeed true ./;../../;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 @@ -227,7 +227,7 @@ MaxSpeed true ./;../../;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) MultiThreadedDLL true Level3