Skip to content

Commit 5bead1e

Browse files
chore: ddcommon fips feature
1 parent 8f89f91 commit 5bead1e

4 files changed

Lines changed: 64 additions & 29 deletions

File tree

Cargo.lock

Lines changed: 24 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ddcommon/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,5 @@ use_webpki_roots = ["hyper-rustls/webpki-roots"]
7676
# Enable this feature to enable stubbing of cgroup
7777
# php directly import this crate and uses functions gated by this feature for their test
7878
cgroup_testing = []
79+
# FIPS mode uses the FIPS-compliant cryptographic provider
80+
fips = ["https", "hyper-rustls/fips"]

local-linux.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ RUN apt-get update && \
1313
protobuf-compiler \
1414
docker.io \
1515
sudo \
16-
&& rm -rf /var/lib/apt/lists/*
16+
wget \
17+
&& rm -rf /var/lib/apt/lists/* \
18+
&& wget -O go1.24.2.linux-arm64.tar.gz https://go.dev/dl/go1.24.2.linux-arm64.tar.gz \
19+
&& tar -C /usr/local -xzf go1.24.2.linux-arm64.tar.gz
1720

1821
# Docker-in-Docker configuration (necessary for integration tests)
1922
RUN mkdir -p /var/lib/docker

scripts/verify_fips_deps.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
# verify_fips_deps.sh
3+
# Script to verify that the fips feature doesn't include ring and uses the proper crypto library
4+
# Usage: ./verify_fips_deps.sh [package_name] (defaults to ddcommon if not specified)
5+
6+
set -e
7+
8+
# Default to ddcommon if no package is specified
9+
PACKAGE=${1:-ddcommon}
10+
11+
echo "Checking ${PACKAGE} with fips feature..."
12+
13+
# Check if aws-lc-fips-sys is included with FIPS feature
14+
FIPS_SYS_COUNT=$(cargo tree -p ${PACKAGE} --features fips | grep -c "aws-lc-fips-sys" || true)
15+
16+
if [ "$FIPS_SYS_COUNT" -eq 0 ]; then
17+
echo "❌ ERROR: aws-lc-fips-sys is not included when fips feature is enabled"
18+
exit 1
19+
else
20+
echo "✅ aws-lc-fips-sys is correctly included with fips feature"
21+
fi
22+
23+
# Check if ring is included with FIPS feature (should not be)
24+
RING_COUNT=$(cargo tree -p ${PACKAGE} --features fips | grep -c "ring" || true)
25+
26+
if [ "$RING_COUNT" -eq 0 ]; then
27+
echo "✅ ring is correctly NOT included with fips feature"
28+
else
29+
echo "❌ ERROR: ring is included when fips feature is enabled"
30+
exit 1
31+
fi
32+
33+
echo "All checks passed! ${PACKAGE} FIPS feature doesn't include ring."
34+
exit 0

0 commit comments

Comments
 (0)