From 87ea47b0ce1d22105f9bfdda5a850dd321ed788c Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Tue, 20 Aug 2024 10:24:20 -0400 Subject: [PATCH 1/2] Add CI for FreeBSD --- .github/workflows/actions-ci.yml | 34 ++++++++++++++++++- .github/workflows/cross-test.yml | 1 + ...{run_openbsd_tests.sh => run_bsd_tests.sh} | 0 3 files changed, 34 insertions(+), 1 deletion(-) rename tests/ci/{run_openbsd_tests.sh => run_bsd_tests.sh} (100%) diff --git a/.github/workflows/actions-ci.yml b/.github/workflows/actions-ci.yml index dfc0686527..7797f2e6f5 100644 --- a/.github/workflows/actions-ci.yml +++ b/.github/workflows/actions-ci.yml @@ -445,7 +445,7 @@ jobs: cd $(pwd) export PATH="${HOME}/bin:${PATH}" env - tests/ci/run_openbsd_tests.sh ${{ matrix.args }} + tests/ci/run_bsd_tests.sh ${{ matrix.args }} EOF gcc-4_8: needs: [sanity-test-run] @@ -490,3 +490,35 @@ jobs: # echo ${env:SDEROOT} # .\tests\ci\run_windows_tests.bat "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 true # + freebsd-13: + if: github.repository_owner == 'aws' + needs: [sanity-test-run] + name: FreeBSD ${{ matrix.version }} test + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: + - '13.3' + - '14.1' + steps: + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + - name: Prepare VM + uses: cross-platform-actions/action@v0.25.0 + env: + AWS_LC_SSL_TEST_RUNNER_PEEK_ROUNDS: 5 + AWS_LC_GO_TEST_TIMEOUT: 90m + GOFLAGS: "-buildvcs=false" + with: + environment_variables: 'AWS_LC_SSL_TEST_RUNNER_PEEK_ROUNDS AWS_LC_GO_TEST_TIMEOUT GOFLAGS' + operating_system: freebsd + architecture: x86-64 + version: ${{ matrix.version }} + shell: bash + memory: 16G + cpu_count: 4 + run: | + sudo pkg install -y git gmake cmake go ninja + tests/ci/run_bsd_tests.sh diff --git a/.github/workflows/cross-test.yml b/.github/workflows/cross-test.yml index 097e9ae5f6..ea282128d4 100644 --- a/.github/workflows/cross-test.yml +++ b/.github/workflows/cross-test.yml @@ -109,3 +109,4 @@ jobs: env: CFLAGS: "-Wno-string-compare" run: tests/ci/run_cross_tests.sh s390x s390x-ibm-linux-gnu "-DCMAKE_BUILD_TYPE=Release" + diff --git a/tests/ci/run_openbsd_tests.sh b/tests/ci/run_bsd_tests.sh similarity index 100% rename from tests/ci/run_openbsd_tests.sh rename to tests/ci/run_bsd_tests.sh From f918b3a6fe7c41c410a262f4da80eaa47c407065 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Fri, 23 Aug 2024 16:07:10 -0400 Subject: [PATCH 2/2] S2N-BIGNUM for FreeBSD --- crypto/curve25519/internal.h | 2 +- crypto/fipsmodule/bn/exponentiation.c | 2 +- crypto/fipsmodule/bn/montgomery.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/curve25519/internal.h b/crypto/curve25519/internal.h index 6e43c2e09d..02d2e4b819 100644 --- a/crypto/curve25519/internal.h +++ b/crypto/curve25519/internal.h @@ -29,7 +29,7 @@ extern "C" { #if ((defined(OPENSSL_X86_64) && !defined(MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX)) || \ defined(OPENSSL_AARCH64)) && \ (defined(OPENSSL_LINUX) || defined(OPENSSL_APPLE) || \ - defined(OPENSSL_OPENBSD)) && \ + defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD)) && \ !defined(OPENSSL_NO_ASM) #define CURVE25519_S2N_BIGNUM_CAPABLE #endif diff --git a/crypto/fipsmodule/bn/exponentiation.c b/crypto/fipsmodule/bn/exponentiation.c index 28bd51dacd..c164b49dcf 100644 --- a/crypto/fipsmodule/bn/exponentiation.c +++ b/crypto/fipsmodule/bn/exponentiation.c @@ -121,7 +121,7 @@ #if !defined(OPENSSL_NO_ASM) && \ (defined(OPENSSL_LINUX) || defined(OPENSSL_APPLE) || \ - defined(OPENSSL_OPENBSD)) && \ + defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD)) && \ defined(OPENSSL_AARCH64) #include "../../../third_party/s2n-bignum/include/s2n-bignum_aws-lc.h" diff --git a/crypto/fipsmodule/bn/montgomery.c b/crypto/fipsmodule/bn/montgomery.c index 2abd3df4d3..f5ea838cdf 100644 --- a/crypto/fipsmodule/bn/montgomery.c +++ b/crypto/fipsmodule/bn/montgomery.c @@ -124,7 +124,7 @@ #if !defined(OPENSSL_NO_ASM) && \ (defined(OPENSSL_LINUX) || defined(OPENSSL_APPLE) || \ - defined(OPENSSL_OPENBSD)) && \ + defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD)) && \ defined(OPENSSL_AARCH64) && defined(OPENSSL_BN_ASM_MONT) #include "../../../third_party/s2n-bignum/include/s2n-bignum_aws-lc.h"