Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/build-and-test-refactor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions test-refactor/posix/wh_test_posix_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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) {
Expand Down
12 changes: 7 additions & 5 deletions test/gen/wh_test_wolfboot_img_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
#include <stdint.h>
#include <stddef.h>

#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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion test/scripts/gen_wolfboot_test_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ cat > "$HEADER_FILE" << 'HEADER_TOP'
#include <stdint.h>
#include <stddef.h>

#include "wolfssl/wolfcrypt/types.h" /* for XALIGNED */

HEADER_TOP

# Helper function to convert binary to C array
Expand All @@ -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"
Expand Down
Loading