diff --git a/.github/workflows/build-and-test-refactor.yml b/.github/workflows/build-and-test-refactor.yml index 27a0889ac..ede56b24c 100644 --- a/.github/workflows/build-and-test-refactor.yml +++ b/.github/workflows/build-and-test-refactor.yml @@ -12,14 +12,19 @@ permissions: jobs: build: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - # List host CPU info - - name: Host CPU info - run: cat /proc/cpuinfo + # List host info + - name: Host info + run: uname -a # List compiler version - name: List compiler version diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index fa8d55807..346142e0d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -12,14 +12,19 @@ permissions: jobs: build: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - # List host CPU info - - name: Host CPU info - run: cat /proc/cpuinfo + # List host info + - name: Host info + run: uname -a # List compiler version - name: List compiler version diff --git a/test-refactor/posix/wh_test_posix_main.c b/test-refactor/posix/wh_test_posix_main.c index 50f0839eb..3d8c6083e 100644 --- a/test-refactor/posix/wh_test_posix_main.c +++ b/test-refactor/posix/wh_test_posix_main.c @@ -55,7 +55,8 @@ * meaningful (or portable) on bare-metal client targets. */ #if defined(WOLFHSM_CFG_THREADSAFE) \ && defined(WOLFHSM_CFG_GLOBAL_KEYS) \ - && !defined(WOLFHSM_CFG_NO_CRYPTO) + && !defined(WOLFHSM_CFG_NO_CRYPTO) \ + && !defined(__APPLE__) /* pthread_barrier_t unavailable on macOS */ #include "wh_test_posix_threadsafe_stress.h" #endif @@ -204,7 +205,8 @@ static void* _clientThread(void* arg) #if defined(WOLFHSM_CFG_THREADSAFE) \ && defined(WOLFHSM_CFG_GLOBAL_KEYS) \ - && !defined(WOLFHSM_CFG_NO_CRYPTO) + && !defined(WOLFHSM_CFG_NO_CRYPTO) \ + && !defined(__APPLE__) /* pthread_barrier_t unavailable on macOS */ /* Run the POSIX-only stress test after the portable client * group so a failure there doesn't mask earlier results. */ if (_clientRc == 0) { diff --git a/test/gen/wh_test_wolfboot_img_data.h b/test/gen/wh_test_wolfboot_img_data.h index 153b9e5bb..f6e3370c8 100644 --- a/test/gen/wh_test_wolfboot_img_data.h +++ b/test/gen/wh_test_wolfboot_img_data.h @@ -31,8 +31,10 @@ #include #include +#include "wolfssl/wolfcrypt/types.h" /* for XALIGNED */ + /* wolfBoot signed header (RSA4096+SHA256, 1024 bytes) */ -static const uint8_t wolfboot_test_header[] = { +XALIGNED(4) static const uint8_t wolfboot_test_header[] = { 0x57, 0x4f, 0x4c, 0x46, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x08, 0x00, 0xbc, 0xff, 0xa9, 0x69, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, @@ -121,7 +123,7 @@ static const uint8_t wolfboot_test_header[] = { 0xff, 0xff, 0xff, 0xff}; /* Dummy firmware payload (16384 bytes) */ -static const uint8_t wolfboot_test_firmware[] = { +XALIGNED(4) static const uint8_t wolfboot_test_firmware[] = { 0x62, 0xa3, 0x47, 0xf2, 0xbc, 0xc9, 0x67, 0x1a, 0xe6, 0xe0, 0xff, 0x77, 0xb6, 0x3a, 0x07, 0x8f, 0xfb, 0xa3, 0x13, 0xef, 0xfb, 0xef, 0x6d, 0x7e, 0x9f, 0xb7, 0x88, 0xb1, 0xeb, 0x57, 0x4d, 0x8d, 0x4f, 0x48, 0x96, 0xda, @@ -1490,7 +1492,7 @@ static const uint8_t wolfboot_test_firmware[] = { 0x1c, 0x5d, 0xb6, 0xea}; /* RSA4096 signing public key (DER format) */ -static const uint8_t wolfboot_test_pubkey_der[] = { +XALIGNED(4) static const uint8_t wolfboot_test_pubkey_der[] = { 0x30, 0x82, 0x02, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0f, 0x00, 0x30, 0x82, 0x02, 0x0a, 0x02, 0x82, 0x02, 0x01, 0x00, 0xa0, 0x27, 0x67, @@ -1539,7 +1541,7 @@ static const uint8_t wolfboot_test_pubkey_der[] = { 0x78, 0x4b, 0x64, 0xbf, 0x9b, 0x02, 0x03, 0x01, 0x00, 0x01}; /* wolfBoot signed header with cert chain (RSA4096+SHA256, 4096 bytes) */ -static const uint8_t wolfboot_test_cert_chain_header[] = { +XALIGNED(4) static const uint8_t wolfboot_test_cert_chain_header[] = { 0x57, 0x4f, 0x4c, 0x46, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x08, 0x00, 0xbc, 0xff, 0xa9, 0x69, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, @@ -1884,7 +1886,7 @@ static const uint8_t wolfboot_test_cert_chain_header[] = { 0xff, 0xff, 0xff, 0xff}; /* Root CA certificate (DER format, RSA4096) */ -static const uint8_t wolfboot_test_root_ca_cert_der[] = { +XALIGNED(4) static const uint8_t wolfboot_test_root_ca_cert_der[] = { 0x30, 0x82, 0x05, 0xe5, 0x30, 0x82, 0x03, 0xcd, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x7d, 0xb6, 0xbe, 0xc6, 0x84, 0xed, 0xb9, 0x8c, 0xdb, 0x53, 0x8e, 0x51, 0xac, 0x89, 0x50, 0x8e, 0x33, 0x16, 0xfe, 0x4d, 0x30, diff --git a/test/scripts/gen_wolfboot_test_data.sh b/test/scripts/gen_wolfboot_test_data.sh index f19843744..55f77f9cc 100755 --- a/test/scripts/gen_wolfboot_test_data.sh +++ b/test/scripts/gen_wolfboot_test_data.sh @@ -200,6 +200,8 @@ cat > "$HEADER_FILE" << 'HEADER_TOP' #include #include +#include "wolfssl/wolfcrypt/types.h" /* for XALIGNED */ + HEADER_TOP # Helper function to convert binary to C array @@ -209,7 +211,7 @@ bin_to_c_array() { local description=$3 echo "/* $description */" >> "$HEADER_FILE" - echo "static const uint8_t ${varname}[] = {" >> "$HEADER_FILE" + echo "XALIGNED(4) static const uint8_t ${varname}[] = {" >> "$HEADER_FILE" xxd -i < "$infile" >> "$HEADER_FILE" echo "};" >> "$HEADER_FILE" echo "" >> "$HEADER_FILE"