Skip to content

Commit d4d1ab7

Browse files
committed
Phase 3: Security and FIPS Compliance Audit
1 parent 575c107 commit d4d1ab7

52 files changed

Lines changed: 3995 additions & 232 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.wolfssl_known_macro_extras

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ CONFIG_WOLFSSL_TLS_VERSION_1_3
205205
CONFIG_WOLFTPM
206206
CONFIG_WOLFTPM_EXAMPLE_NAME_ESPRESSIF
207207
CONFIG_X86
208+
CONFIG_X86_32
208209
CONV_WITH_DIV
209210
CPA_CY_API_VERSION_NUM_MAJOR
210211
CPA_CY_API_VERSION_NUM_MINOR
@@ -255,6 +256,7 @@ ETHERNET_H
255256
EV_TRIGGER
256257
EXTERNAL_LOADER_APP
257258
FD_CLOEXEC
259+
FIPS_CODE_REVIEW
258260
FIPS_OPTEST_FULL_RUN_AT_MODULE_INIT
259261
FORCE_FAILURE_GETRANDOM
260262
FP_ECC_CONTROL

IDE/WIN-PQ-FIPSv7/README.txt

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Notes on the wolfSSL FIPS 140-3 v7.0.0 (Post-Quantum) Windows project
2+
3+
First, if you did not get the FIPS files with your archive, you must contact
4+
wolfSSL to obtain them.
5+
6+
The IDE/WIN-PQ-FIPSv7/wolfssl-fips.sln solution is for the FIPS 140-3 v7.0.0
7+
module. In addition to the classical algorithms it includes the post-quantum
8+
algorithms ML-KEM (FIPS 203), ML-DSA (FIPS 204), SLH-DSA (FIPS 205) and the
9+
stateful hash-based signatures LMS and XMSS (SP 800-208).
10+
11+
# Building the wolfssl-fips project
12+
13+
The wolfCrypt FIPS library for Windows is a part of the wolfSSL library. It
14+
must be built as a static library, for the moment.
15+
16+
The library project is built with Whole Program Optimization disabled. This is
17+
required so that necessary components of the library are not optimized away.
18+
There are two functions added to the library that are used as markers in
19+
memory for the in-core memory check of the code. WPO consolidates them into a
20+
single function. WPO also optimizes away the automatic FIPS entry function.
21+
22+
Each of the source files inside the FIPS boundary defines their own code and
23+
constant section. The code section names start with ".fipsA$" and the constant
24+
section names start with ".fipsB$". Each subsection has a letter to organize
25+
them in a specific order. This specific ordering puts marker functions and
26+
constants on either end of the boundary so it can be hashed.
27+
28+
29+
# In Core Memory Test
30+
31+
The In Core Memory test calculates a checksum (HMAC-SHA512 for the v7.0.0
32+
module) of the wolfCrypt FIPS library code and constant data and compares it
33+
with a known value in the code.
34+
35+
The following wolfCrypt FIPS project linker settings are required for the DLL Win32 configuration:
36+
1) The [Randomized Base Address setting (ASLR)](https://learn.microsoft.com/en-us/cpp/build/reference/dynamicbase-use-address-space-layout-randomization?view=msvc-170)
37+
needs to be disabled on all builds as the feature throws off the in-core memory calculation causing the test to fail.
38+
2) The [Incremental Link](https://learn.microsoft.com/en-us/cpp/build/reference/incremental-link-incrementally?view=msvc-170)
39+
option need turned off so function pointers go to actual code, not a jump instruction.
40+
3) The [FixedBaseAddress](https://learn.microsoft.com/en-us/cpp/build/reference/fixed-fixed-base-address?view=msvc-170)
41+
option to YES, which disables the support for ASLR.
42+
43+
The "verifyCore" check value in the source fips_test.c needs to be updated when
44+
building the code. The POS performs this check and the default failure callback
45+
will print out the calculated checksum. When developing your code, copy this
46+
value and paste it back into your code in the verifyCore initializer then
47+
rebuild the code. When statically linking, you may have to recalculate your
48+
check value when changing your application.
49+
50+
# Build Options
51+
52+
The default build options should be the proper default set of options:
53+
54+
* HAVE_FIPS
55+
* HAVE_FIPS_VERSION=7
56+
* HAVE_FIPS_VERSION_MINOR=0
57+
* HAVE_THREAD_LS
58+
* WOLFSSL_KEY_GEN
59+
* HAVE_AESGCM
60+
* HAVE_HASHDRBG
61+
* WOLFSSL_SHA384
62+
* WOLFSSL_SHA512
63+
* NO_PSK
64+
* NO_RC4
65+
* NO_DSA
66+
* NO_MD4
67+
* WOLFSSL_SHA224
68+
* WOLFSSL_SHA3
69+
* WC_RSA_PSS
70+
* WC_RSA_NO_PADDING
71+
* HAVE_ECC
72+
* ECC_SHAMIR
73+
* HAVE_ECC_CDH
74+
* ECC_TIMING_RESISTANT
75+
* TFM_TIMING_RESISTANT
76+
* WOLFSSL_AES_COUNTER
77+
* WOLFSSL_AES_DIRECT
78+
* HAVE_AES_ECB
79+
* HAVE_AESCCM
80+
* WOLFSSL_CMAC
81+
* HAVE_HKDF
82+
* WOLFSSL_VALIDATE_ECC_IMPORT
83+
* WOLFSSL_VALIDATE_FFC_IMPORT
84+
* HAVE_FFDHE_Q
85+
* NO_DES
86+
* NO_DES3
87+
* NO_MD5
88+
* NO_OLD_TLS
89+
* WOLFSSL_TLS13
90+
* HAVE_TLS_EXTENSIONS
91+
* HAVE_SUPPORTED_CURVES
92+
* GCM_TABLE_4BIT
93+
* WOLFSSL_NO_SHAKE256
94+
* WOLFSSL_VALIDATE_ECC_KEYGEN
95+
* WOLFSSL_ECDSA_SET_K
96+
* WOLFSSL_WOLFSSH
97+
* WOLFSSL_PUBLIC_MP
98+
* WC_RNG_SEED_CB
99+
* TFM_ECC256
100+
* ECC_USER_CURVES
101+
* HAVE_ECC192
102+
* HAVE_ECC224
103+
* HAVE_ECC256
104+
* HAVE_ECC384
105+
* HAVE_ECC521
106+
* HAVE_FFDHE_2048
107+
* HAVE_FFDHE_3072
108+
* HAVE_FFDHE_4096
109+
* HAVE_FFDHE_6144
110+
* HAVE_FFDHE_8192
111+
* FP_MAX_BITS 16384
112+
113+
The "NO" options explicitly disable algorithms that are not allowed in
114+
FIPS mode.
115+
116+
Additionally one may enable:
117+
118+
* WOLFSSL_AESNI
119+
* OPENSSL_EXTRA
120+
121+
These settings are defined in IDE/WIN-PQ-FIPSv7/user_settings.h.

IDE/WIN-PQ-FIPSv7/include.am

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# vim:ft=automake
2+
# included from Top Level Makefile.am
3+
# All paths should be given relative to the root
4+
5+
EXTRA_DIST+= IDE/WIN-PQ-FIPSv7/README.txt
6+
EXTRA_DIST+= IDE/WIN-PQ-FIPSv7/test.vcxproj
7+
EXTRA_DIST+= IDE/WIN-PQ-FIPSv7/wolfssl-fips.sln
8+
EXTRA_DIST+= IDE/WIN-PQ-FIPSv7/wolfssl-fips.vcxproj
9+
EXTRA_DIST+= IDE/WIN-PQ-FIPSv7/user_settings.h
10+
EXTRA_DIST+= IDE/WIN-PQ-FIPSv7/resource.h
11+
EXTRA_DIST+= IDE/WIN-PQ-FIPSv7/wolfssl-fips.rc

IDE/WIN-PQ-FIPSv7/resource.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//{{NO_DEPENDENCIES}}
2+
// Microsoft Visual C++ generated include file.
3+
// Used by wolfssl-fips.rc
4+
5+
// Next default values for new objects
6+
//
7+
#ifdef APSTUDIO_INVOKED
8+
#ifndef APSTUDIO_READONLY_SYMBOLS
9+
#define _APS_NEXT_RESOURCE_VALUE 101
10+
#define _APS_NEXT_COMMAND_VALUE 40001
11+
#define _APS_NEXT_CONTROL_VALUE 1001
12+
#define _APS_NEXT_SYMED_VALUE 101
13+
#endif
14+
#endif

0 commit comments

Comments
 (0)