From: William Lallemand Date: Thu, 3 Dec 2026 14:55:54 +0000 (+0000) Subject: SCRIPTS: honor FIPS mode when building AWS-LC X-Git-Url: https://git.kaiwu.me/web/http/static/%7B@url%7D?a=commitdiff_plain;h=87845593c1e159e660fab67fdecb0e4571ed64dc;p=haproxy.git SCRIPTS: honor FIPS mode when building AWS-LC The AWS-LC FIPS workflow passes FIPS=1 with AWS_LC_VERSION, but the shared build helper ignored it and always disabled Go and Perl code generation. Consequently the jobs built non-FIPS libraries and left HAProxy's FIPS-specific code paths untested despite appearing to cover them. This was introduced by d572a131a7 ("CI: github: add AWS-LC FIPS testing workflow"), which added the workflow without updating the build helper. Pass the FIPS setting to CMake and enable the required generators for FIPS builds. Append -fips to the installed-version marker only in FIPS mode, leaving the build directory and workflow cache key unchanged. This fix should be backported to 3.5. --- diff --git a/scripts/build-ssl.sh b/scripts/build-ssl.sh index 5421b0555..5b5b0e072 100755 --- a/scripts/build-ssl.sh +++ b/scripts/build-ssl.sh @@ -6,6 +6,7 @@ BUILDSSL_TMPDIR=${BUILDSSL_TMPDIR:-/tmp/download-cache} QUICTLS_URL=${QUICTLS_URL:-https://github.com/quictls/openssl} WOLFSSL_DEBUG=${WOLFSSL_DEBUG:-0} GIT_TYPE=${GIT_TYPE:-commit} +FIPS=${FIPS:-0} @@ -150,21 +151,32 @@ download_aws_lc () { } build_aws_lc () { - if [ "$(cat ${BUILDSSL_DESTDIR}/.aws_lc-version)" != "${AWS_LC_VERSION}" ]; then + fips_suffix= + if [ "${FIPS}" -eq 1 ]; then + fips_suffix=-fips + fi + if [ "$(cat ${BUILDSSL_DESTDIR}/.aws_lc-version)" != "${AWS_LC_VERSION}${fips_suffix}" ]; then mkdir -p "${BUILDSSL_TMPDIR}/aws-lc-${AWS_LC_VERSION}/" tar zxf "${BUILDSSL_TMPDIR}/aws-lc-${AWS_LC_VERSION}.tar.gz" -C "${BUILDSSL_TMPDIR}/aws-lc-${AWS_LC_VERSION}/" --strip-components=1 ( cd "${BUILDSSL_TMPDIR}/aws-lc-${AWS_LC_VERSION}/" mkdir -p build cd build + # FIPS mode requires Go and Perl to generate the module and its integrity hash. + if [ "${FIPS}" -eq 1 ]; then + disable_codegen=0 + else + disable_codegen=1 + fi cmake -version - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=1 -DDISABLE_GO=1 -DDISABLE_PERL=1 \ + cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=1 -DFIPS=${FIPS} \ + -DDISABLE_GO=${disable_codegen} -DDISABLE_PERL=${disable_codegen} \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_RPATH=${BUILDSSL_DESTDIR}/lib \ -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=${BUILDSSL_DESTDIR} .. make -j$(nproc) make install ) - echo "${AWS_LC_VERSION}" > "${BUILDSSL_DESTDIR}/.aws_lc-version" + echo "${AWS_LC_VERSION}${fips_suffix}" > "${BUILDSSL_DESTDIR}/.aws_lc-version" fi }