Skip to content

Commit

Permalink
Fix CI failures
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel40791765 committed Nov 27, 2024
1 parent 8bb378e commit 3d56a44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 4 additions & 9 deletions crypto/rsa_extra/rsa_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1198,18 +1198,13 @@ TEST(RSATest, KeygenFailOnce) {
// GTEST issue: https://github.com/google/googletest/issues/1496.
#if !defined(OPENSSL_ANDROID)

static bool set_env(const std::string& name, const std::string& value) {
#if defined(OPENSSL_WINDOWS)
return SetEnvironmentVariableA(name.c_str(), value.c_str()) != 0;
#else
return setenv(name.c_str(), value.c_str(), 1) == 0;
#endif
}

// In the case of a FIPS build, expect abort() when |RSA_generate_key_fips|
// fails.
TEST(RSADeathTest, KeygenFailAndDie) {
ASSERT_TRUE(set_env("BORINGSSL_FIPS_BREAK_TEST", "RSA_PWCT"));
const char *const value = getenv("BORINGSSL_FIPS_BREAK_TEST");
if (!value || strcmp(value, "RSA_PWCT") != 0) {
GTEST_SKIP() << "Skipping BORINGSSL_FIPS_BREAK_TESTS RSA_PWCT Test.";
}

// Test that all supported key lengths abort when PWCTs fail.
for (const size_t bits : {2048, 3072, 4096}) {
Expand Down
6 changes: 5 additions & 1 deletion tests/ci/run_fips_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ if static_linux_supported || static_openbsd_supported; then
fips_build_and_test -DCMAKE_BUILD_TYPE=Release

echo "Testing AWS-LC static breakable release build"
fips_build_and_test -DFIPS=1 -DCMAKE_C_FLAGS="-DBORINGSSL_FIPS_BREAK_TESTS"
run_build -DFIPS=1 -DCMAKE_C_FLAGS="-DBORINGSSL_FIPS_BREAK_TESTS"
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))
Expand Down

0 comments on commit 3d56a44

Please sign in to comment.