Skip to content

Commit d927422

Browse files
authored
Merge pull request #269 from aidangarske/fips-ready-ci
Initial support for fips ready CI testing
2 parents d2f1fdf + f90ee2b commit d927422

3 files changed

Lines changed: 80 additions & 4 deletions

File tree

.github/workflows/cmdline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ jobs:
4444
openssl-install/bin
4545
4646
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
47-
# Normally we would fail on cache miss, but we rebuild below
47+
# Normally we would fail on cache miss, but we rebuild below
4848
# for the DEBUG build.
4949
fail-on-cache-miss: false
5050

5151
# If not yet built this version, build it now
5252
- name: Build wolfProvider
5353
# Only run the test for a cache miss. On hit, we've already run the test.
54-
if: steps.wolfprov-cache-restore.cache-hit != 'true'
54+
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
5555
run: |
5656
${{ matrix.debug }} OPENSSL_TAG=${{ matrix.openssl_ref }} WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh
5757

.github/workflows/fips-ready.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: FIPS Ready Bundle Test
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
fips_ready_test:
17+
name: FIPS Ready Bundle Test
18+
runs-on: ubuntu-22.04
19+
timeout-minutes: 20
20+
strategy:
21+
matrix:
22+
wolfssl_bundle_ref: [ '5.8.2' ]
23+
openssl_ref: [ 'openssl-3.5.0' ]
24+
force_fail: ['WOLFPROV_FORCE_FAIL=1', '']
25+
steps:
26+
- name: Checkout wolfProvider
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 1
30+
31+
- name: Download FIPS Ready Bundle
32+
run: |
33+
# Download FIPS ready bundle from wolfSSL website
34+
BUNDLE_URL="https://www.wolfssl.com/wolfssl-${{matrix.wolfssl_bundle_ref}}-gplv3-fips-ready.zip"
35+
36+
wget -O wolfssl-fips-ready.zip "$BUNDLE_URL"
37+
unzip wolfssl-fips-ready.zip
38+
39+
# Find the extracted directory (build script requires directory, not zip)
40+
BUNDLE_DIR=$(find . -maxdepth 1 -type d -name "*fips-ready*" | head -n 1)
41+
if [ -z "$BUNDLE_DIR" ]; then
42+
echo "ERROR: Could not find FIPS ready bundle directory after extraction"
43+
ls -la
44+
exit 1
45+
fi
46+
47+
echo "FIPS_BUNDLE_PATH=$(pwd)/$BUNDLE_DIR" >> $GITHUB_ENV
48+
echo "Found FIPS bundle directory at: $BUNDLE_DIR"
49+
50+
- name: Build wolfProvider with FIPS Ready Bundle
51+
run: |
52+
./scripts/build-wolfprovider.sh --fips-bundle="$FIPS_BUNDLE_PATH" \
53+
--fips-version=ready --wolfssl-ver=v${{matrix.wolfssl_bundle_ref}}-stable
54+
55+
- name: Run FIPS Command Tests
56+
run: |
57+
# Run cmd tests to verify functionality
58+
export WOLFSSL_ISFIPS=1
59+
export ${{matrix.force_fail}}
60+
61+
${{ matrix.force_fail }} ./scripts/cmd_test/do-cmd-tests.sh

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,23 @@ export LD_LIBRARY_PATH=/usr/local/ssl/lib
136136
make check
137137
```
138138

139+
## Building with FIPS
140+
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.
142+
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-version=ready --distclean
154+
```
155+
139156
## Testing
140157

141158
### Unit Tests
@@ -153,8 +170,6 @@ To run the command tests:
153170
To run the cipher suite testing:
154171
* `./scripts/test-wp-cs.sh`
155172

156-
157173
## Debugging
158174

159175
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.
160-

0 commit comments

Comments
 (0)