-
Notifications
You must be signed in to change notification settings - Fork 147
57 lines (50 loc) · 1.81 KB
/
test-library.yml
File metadata and controls
57 lines (50 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: wolfBoot as Library test
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
jobs:
test-lib:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
math: [SPMATH=1 WOLFBOOT_SMALL_STACK=0,
SPMATH=1 WOLFBOOT_SMALL_STACK=1,
SPMATHALL=1 WOLFBOOT_SMALL_STACK=0,
SPMATHALL=1 WOLFBOOT_SMALL_STACK=1,
SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=0,
SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=1]
asym: [ed25519, ecc256, ecc384, ecc521, rsa2048, rsa3072, rsa4096, ed448]
hash: [sha256, sha384, sha3]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: make clean
run: |
make keysclean && make -C tools/keytools clean && rm -f include/target.h
- name: Build test-lib
env:
ASYM: ${{ matrix.asym }}
HASH: ${{ matrix.hash }}
run: |
cp config/examples/library.config .config
make keytools
./tools/keytools/keygen --${{ matrix.asym }} -g wolfboot_signing_private_key.der
echo "Test" > test.bin
./tools/keytools/sign --${{ matrix.asym }} --${{ matrix.hash }} test.bin wolfboot_signing_private_key.der 1
# Convert asym and hash to upper case
make test-lib SIGN=${ASYM^^} HASH=${HASH^^}
- name: Run test-lib
run: |
./test-lib test_v1_signed.bin
./test-lib test_v1_signed.bin 2>&1 | grep "Firmware Valid"
- name: Run test-lib (expect failure)
run: |
# Corrupt signed binary
truncate -s -1 test_v1_signed.bin
echo "A" >> test_v1_signed.bin
./test-lib test_v1_signed.bin
./test-lib test_v1_signed.bin 2>&1 | grep "Failure"