Skip to content

Commit 78e4275

Browse files
bigbrettdanielinux
authored andcommittedNov 13, 2024
Initial wolfHSM support for simulator and AURIX TC3xx
1 parent 03aae5a commit 78e4275

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4272
-2155
lines changed
 

‎.github/workflows/test-configs.yml

+6
Original file line numberDiff line numberDiff line change
@@ -433,3 +433,9 @@ jobs:
433433
arch: aarch64
434434
config-file: ./config/examples/zynqmp.config
435435
make-args: CROSS_COMPILE=aarch64-linux-gnu-
436+
437+
sim_wolfhsm_test:
438+
uses: ./.github/workflows/test-build.yml
439+
with:
440+
arch: host
441+
config-file: ./config/examples/sim-wolfHSM.config
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: wolfHSM simulator test
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
wolfhsm_simulator_test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
submodules: true
17+
18+
- name: Workaround for sources.list
19+
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list
20+
21+
- name: Update repository
22+
run: sudo apt-get update
23+
24+
- name: make clean
25+
run: |
26+
make distclean
27+
28+
- name: Select config (wolfHSM simulator)
29+
run: |
30+
cp config/examples/sim-wolfHSM.config .config
31+
32+
- name: Build tools
33+
run: |
34+
make -C tools/keytools && make -C tools/bin-assemble
35+
36+
- name: Build wolfboot.elf
37+
run: |
38+
make clean && make test-sim-internal-flash-with-update
39+
40+
# checkout and build wolfHSM examples repo
41+
- name: Checkout wolfHSM-examples
42+
uses: actions/checkout@v3
43+
with:
44+
repository: wolfssl/wolfHSM-examples
45+
path: wolfHSM-examples
46+
47+
- name: Build example POSIX TCP server
48+
run: cd wolfHSM-examples/posix/tcp/wh_server_tcp && make WOLFSSL_DIR=../../../../lib/wolfssl WOLFHSM_DIR=../../../../lib/wolfHSM
49+
50+
# Start the server in the background
51+
- name: Run POSIX TCP server
52+
run: |
53+
cd wolfHSM-examples/posix/tcp/wh_server_tcp
54+
./Build/wh_server_tcp.elf --client 12 --id 255 --key ../../../../wolfboot_signing_private_key_pub.der &
55+
TCP_SERVER_PID=$!
56+
echo "TCP_SERVER_PID=$TCP_SERVER_PID" >> $GITHUB_ENV
57+
58+
# Run the sunny day update test against the server
59+
- name: Run sunny day update test
60+
run: |
61+
tools/scripts/sim-sunnyday-update.sh
62+
63+
# Kill the server if it is still running
64+
- name: Kill POSIX TCP server
65+
run: |
66+
kill $TCP_SERVER_PID

0 commit comments

Comments
 (0)
Please sign in to comment.