Skip to content

Commit

Permalink
Ensure local symbols doesn't change the module hash
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhop committed Feb 5, 2025
1 parent 7965343 commit c869ea2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/ci/run_fips_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,24 @@ if static_linux_supported || static_openbsd_supported; then

echo "Testing AWS-LC static breakable release build"
run_build -DFIPS=1 -DCMAKE_C_FLAGS="-DBORINGSSL_FIPS_BREAK_TESTS"
./util/fipstools/test-break-kat.sh
export BORINGSSL_FIPS_BREAK_TEST="RSA_PWCT"
${BUILD_ROOT}/crypto/crypto_test --gtest_filter="RSADeathTest.KeygenFailAndDie"
unset BORINGSSL_FIPS_BREAK_TEST

cd $SRC_ROOT
MODULE_HASH=$(./util/fipstools/test-break-kat.sh |\
(egrep "Hash of module was:.* ([a-f0-9]*)" || true))
MODULE_HASH=$(go run util/fipstools/break-hash.go "${BUILD_ROOT}/test_build_dir/util/fipstools/test_fips" ./libcrypto.so | \
egrep "Hash of module was:.* ([a-f0-9]*)")

echo "Testing AWS-LC static breakable release build while keeping local symbols"
echo "to check that module hash didn't change."
run_build -DFIPS=1 -DKEEP_ASM_LOCAL_SYMBOLS=1 -DCMAKE_C_FLAGS="-DBORINGSSL_FIPS_BREAK_TESTS"
cd $SRC_ROOT
./util/fipstools/test-break-kat.sh || grep -i hash
MODULE_HASH_LOCALSYMS=$(./util/fipstools/test-break-kat.sh |\
(egrep "Hash of module was:.* ([a-f0-9]*)" || true))
MODULE_HASH_LOCALSYMS=$(go run util/fipstools/break-hash.go "${BUILD_ROOT}/test_build_dir/util/fipstools/test_fips" ./libcrypto.so | \
egrep "Hash of module was:.* ([a-f0-9]*)")
if [ "$MODULE_HASH" == "$MODULE_HASH_LOCALSYMS" ]; then
echo "Module hash didn't change"
else
echo "Module hashed changed with local symbols unexpectedly"
exit 1
fi

# These build parameters may be needed by our aws-lc-fips-sys Rust package
Expand Down

0 comments on commit c869ea2

Please sign in to comment.