Skip to content

Commit 707bfe9

Browse files
authored
Merge pull request #357 from ColtonWilley/wp_openssl_fips_baseline
Initial implementation of opensl FIPS baseline process
2 parents a4f708c + 26fb139 commit 707bfe9

Some content is hidden

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

52 files changed

+13109
-220
lines changed

README.md

Lines changed: 58 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -3,238 +3,78 @@
33

44
wolfProvider is a library that can be used as a Provider in OpenSSL.
55

6-
## Features
7-
8-
* MD5-1
9-
* SHA-1
10-
* SHA-224
11-
* SHA-256
12-
* SHA-384
13-
* SHA-512
14-
* SHA-512/224
15-
* SHA-512/256
16-
* SHA3-224
17-
* SHA3-256
18-
* SHA3-384
19-
* SHA3-512
20-
* SHAKE 256
21-
* AES
22-
* 128, 192, and 256 bit keys
23-
* ECB
24-
* CBC
25-
* CTR
26-
* GCM
27-
* CCM
28-
* DRBG
29-
* RSA, RSA-PSS
30-
* Signing, Verification
31-
* Asymmetric Encrypt, Decrypt
32-
* Key generation
33-
* DH
34-
* ECC
35-
* ECDSA
36-
* ECDH
37-
* Key generation
38-
* Curve P-192
39-
* Curve P-224
40-
* Curve P-256
41-
* Curve P-384
42-
* Curve P-521
43-
* HMAC
44-
* CMAC
45-
* GMAC
46-
* HKDF
47-
* PBKDF2
48-
* PKCS12 PBKDF2
49-
* TLS1_3 KDF
50-
* TLS1 PRF
51-
52-
## Building
53-
The quickest method is to use the `scripts/build-wolfprovider.sh` script as follows:
54-
55-
```
56-
./scripts/build-wolfprovider.sh
57-
```
58-
59-
It will retrieve the dependencies and compile them as necessary. To use other than the default (such as different releases) you can set various environment variables prior to calling the script:
60-
61-
```
62-
OPENSSL_TAG=openssl-3.5.0 WOLFSSL_TAG=v5.8.0-stable WOLFPROV_DEBUG=1 scripts/build-wolfprovider.sh
63-
```
64-
65-
Or you can set them with variables like so:
66-
67-
```
68-
./scripts/build-wolfprovider.sh --debug --openssl-ver=openssl-3.5.0 --wolfssl-ver=v5.8.0-stable
69-
```
70-
71-
To clean the build, use the following:
72-
```
73-
./scripts/build-wolfprovider.sh --clean
74-
```
75-
76-
To remove all source directories, use the following:
77-
```
78-
./scripts/build-wolfprovider.sh --distclean
79-
```
80-
81-
Alternatively, you can manually compile each component using the following guide.
82-
83-
### OpenSSL
84-
85-
```
86-
git clone --depth=1 -b openssl-3.0.0 https://github.com/openssl/openssl.git
87-
cd openssl
88-
./config no-fips shared
89-
make
90-
sudo make install
91-
```
92-
93-
### wolfSSL
94-
95-
```
96-
git clone https://github.com/wolfssl/wolfssl.git
97-
cd wolfssl
98-
./autogen.sh
99-
./configure --enable-opensslcoexist --enable-cmac --enable-keygen --enable-sha --enable-des3 --enable-aesctr --enable-aesccm --enable-x963kdf --enable-compkey CPPFLAGS="-DHAVE_AES_ECB -DWOLFSSL_AES_DIRECT -DWC_RSA_NO_PADDING -DWOLFSSL_PUBLIC_MP -DHAVE_PUBLIC_FFDHE -DWOLFSSL_DH_EXTRA -DWOLFSSL_PSS_LONG_SALT -DWOLFSSL_PSS_SALT_LEN_DISCOVER -DRSA_MIN_SIZE=1024" --enable-certgen --enable-aeskeywrap --enable-enckeys --enable-base16 --with-eccminsz=192
100-
make
101-
sudo make install
102-
```
103-
104-
Add `--enable-aesgcm-stream` if available for better AES-GCM support.
105-
Add `--enable-curve25519` to include support for X25519 Key Exchange.
106-
Add `--enable-curve448` to include support for X448 Key Exchange.
107-
Add `--enable-ed25519` to include support for Ed25519 signatures and certificates..
108-
Add `--enable-ed448` to include support for Ed448 signature and certificates.
109-
110-
Add `--enable-pwdbased` to the configure command above if PKCS#12 is used in OpenSSL.
111-
112-
Add to CPPFLAGS `-DHAVE_FFDHE_6144 -DHAVE_FFDHE_8192 -DFP_MAX_BITS=16384` to enable predefined 6144-bit and 8192-bit DH parameters.
113-
114-
Add to `--enable-hmac-copy` if performing HMAC repeatedly with the same key to improve performance. (Available with wolfSSL 5.7.8+.)
115-
116-
Add `--enable-sp=yes,asm' '--enable-sp-math-all'` to use SP Integer maths. Replace `-DFP_MAX_BITS=16384` with -DSP_INT_BITS=8192` when used.
117-
118-
Remove `-DWOLFSSL_PSS_LONG_SALT -DWOLFSSL_PSS_SALT_LEN_DISCOVER` and add `--enable-fips=v2` to the configure command above if building from a FIPS v2 bundle and not the git repository. Change `--enable-fips=v2` to `--enable-fips=ready` if using a FIPS Ready bundle.
119-
120-
If '--with-eccminsz=192' is not supported by wolfSSL, add '-DECC_MIN_KEY_SZ=192' to the CPPFLAGS.
6+
## Supported OpenSSL Versions
1217

122-
### wolfProvider
8+
wolfProvider supports all release versions of OpenSSL 3.x
1239

124-
```
125-
./autogen.sh
126-
./configure
127-
make
128-
```
10+
## Replace Default Mode
12911

130-
To build using a different OpenSSL installation directory (e.g. one at /usr/local/ssl) use:
12+
wolfProvider can be configured to replace OpenSSL's default provider, making wolfSSL's
13+
cryptographic implementations the default for all OpenSSL operations. This ensures
14+
applications use wolfSSL crypto without code changes. See the [Integration Guide](docs/INTEGRATION_GUIDE.md) for details.
13115

132-
```
133-
./configure --with-openssl=/usr/local/ssl
134-
make
135-
export LD_LIBRARY_PATH=/usr/local/ssl/lib
136-
make check
137-
```
16+
## Documentation
13817

139-
## Building with FIPS
18+
Information on how to configure, build, and test wolfProvider can be found here:
14019

141-
To build and test with our prebuilt FIPS bundle, use the following command to build wolfProvider with FIPS enabled. You can refer to `.github/workflows/fips-ready.yml` for the workflow that does this.
20+
- [wolfProvider FIPS Integration Guide](docs/FIPS_INTEGRATION_GUIDE.md) - FIPS baseline and production builds
21+
- [wolfProvider Integration Guide](docs/INTEGRATION_GUIDE.md) - General integration and replace-default mode
14222

143-
Go to our website to download the FIPS bundle. [here](https://www.wolfssl.com/download/) and select wolfssl-5.8.2-gplv3-fips-ready.zip.
144-
145-
or you can use wget to download the FIPS bundle like so:
146-
```
147-
wget -O wolfssl-fips-ready.zip https://www.wolfssl.com/wolfssl-5.8.2-gplv3-fips-ready.zip
148-
unzip wolfssl-fips-ready.zip
149-
```
150-
151-
Then use the following command to build wolfProvider with FIPS enabled.
152-
```
153-
./scripts/build-wolfprovider.sh --fips-bundle="path/to/fips-bundle" --fips-check=ready --distclean
154-
```
155-
156-
## Building with Replace Default
157-
158-
wolfProvider can be configured to replace OpenSSL's default provider, making wolfProvider the default cryptographic provider for all OpenSSL operations. This is useful for applications that want to use wolfSSL's cryptographic implementations without modifying their code.
159-
160-
### Replace Default vs. Standard Provider Mode
161-
162-
Replace default mode is fundamentally different from the standard provider approach:
163-
164-
**Standard Provider Mode:** When wolfProvider is loaded as a standard provider alongside OpenSSL's default provider, applications can still access OpenSSL's native crypto implementations in several ways:
165-
- When an application explicitly requests a specific provider (e.g., "default") for an algorithm
166-
- When wolfProvider doesn't implement a particular algorithm, OpenSSL falls back to its built-in implementations
167-
- If the execution environment does not pick up the specified configuration file enabling
168-
use of wolfProvider
169-
170-
**Replace Default Mode:** This mode patches OpenSSL to disable many of these fallback paths.
171-
When replace default is enabled:
172-
- wolfProvider becomes the primary cryptographic provider
173-
- Requests for the "default" provider are redirected to wolfProvider
174-
- Requests for the "fips" provider are redirected to wolfProvider
175-
- Requests for the "wolfProvider" provider are redirected to wolfProvider
176-
- This ensures maximum use of wolfSSL's cryptographic implementations for testing and validation
177-
178-
This makes replace default mode particularly useful for comprehensive testing scenarios where you want to ensure that wolfSSL's implementations are being used throughout the entire system.
179-
180-
### Basic Replace Default
181-
182-
To build wolfProvider as a replacement for OpenSSL's default provider:
183-
184-
```bash
185-
./scripts/build-wolfprovider.sh --replace-default
186-
```
187-
188-
This patches OpenSSL so that wolfProvider becomes the default provider.
189-
190-
### Replace Default with Testing Support
191-
192-
For unit testing with replace-default enabled, you need additional support to load the real OpenSSL default provider alongside wolfProvider. This requires both flags:
193-
194-
```bash
195-
./scripts/build-wolfprovider.sh --replace-default --enable-replace-default-testing
196-
```
197-
198-
### Important Notes
199-
200-
**For `--replace-default`:**
201-
- Can be used standalone in production or testing environments
202-
- Makes wolfProvider the default cryptographic provider
203-
204-
**For `--enable-replace-default-testing`:**
205-
**Warning:** This option patches OpenSSL to export internal symbols that are not part of the public API. This configuration:
206-
- Should only be used for development and testing
207-
- Is not suitable for production deployments
208-
209-
### Examples
210-
211-
Build with replace-default only:
212-
```bash
213-
./scripts/build-wolfprovider.sh --replace-default
214-
```
23+
## Features
21524

216-
Build with replace-default and unit testing support:
217-
```bash
218-
./scripts/build-wolfprovider.sh --replace-default --enable-replace-default-testing
219-
```
25+
### Digests
26+
* MD5
27+
* SHA-1
28+
* SHA-2: SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256
29+
* SHA-3: SHA3-224, SHA3-256, SHA3-384, SHA3-512
30+
* SHAKE-256
31+
32+
### Symmetric Ciphers
33+
* AES (128, 192, 256-bit keys)
34+
* ECB, CBC, CTR, CFB, CTS
35+
* GCM, CCM (AEAD)
36+
* Key Wrap
37+
* 3DES-CBC
38+
39+
### MACs
40+
* HMAC
41+
* CMAC
42+
* GMAC
22043

221-
## Testing
44+
### KDFs
45+
* HKDF
46+
* PBKDF2
47+
* PKCS12 KDF
48+
* TLS 1.3 KDF
49+
* TLS1 PRF
50+
* KBKDF
51+
* KRB5 KDF
22252

223-
### Unit Tests
53+
### Random
54+
* CTR-DRBG
55+
* Hash-DRBG
22456

225-
To run automated unit tests:
226-
* `make test`
57+
### RSA
58+
* Signing, Verification (PKCS#1 v1.5, PSS)
59+
* Encryption, Decryption
60+
* Key generation
22761

228-
### Command Tests
62+
### DH
63+
* Key exchange
64+
* Key generation
22965

230-
To run the command tests:
231-
* `./scripts/cmd_test/do-cmd-tests.sh`
66+
### ECC
67+
* ECDSA (signing, verification)
68+
* ECDH (key exchange)
69+
* Key generation
70+
* Curves: P-192, P-224, P-256, P-384, P-521
23271

233-
### Integration Tests
72+
### Curve25519/448
73+
* X25519, X448 (key exchange)
74+
* Ed25519, Ed448 (signatures)
23475

235-
To run the cipher suite testing:
236-
* `./scripts/test-wp-cs.sh`
23776

238-
## Debugging
77+
## Support
23978

240-
To enable wolfProvider debug logging, build with `--debug` which enables exit messages, error messages, and informational messages. If you want to filter logging a certain way or increase detail level, set `WOLFPROV_LOG_LEVEL_FILTER` and `WOLFPROV_LOG_COMPONENTS_FILTER` in `include/wolfprovider/wp_logging.h` as needed. See comments in that file for examples.
79+
- [GitHub Issues](https://github.com/wolfssl/wolfProvider/issues)
80+
- [wolfSSL Support](https://www.wolfssl.com/products/support-and-maintenance/)

0 commit comments

Comments
 (0)