Skip to content

Commit

Permalink
Added simulator testing for all combinations of algorithms, fast/sp a…
Browse files Browse the repository at this point in the history
…nd small stack.
  • Loading branch information
dgarske committed Sep 22, 2023
1 parent b9db966 commit b795257
Show file tree
Hide file tree
Showing 38 changed files with 100 additions and 100 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,47 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true

- name: Workaround for sources.list
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list

- name: Update repository
run: sudo apt-get update

- name: Install cross compilers
run: |
sudo apt-get install -y gcc-arm-none-eabi gcc-aarch64-linux-gnu gcc-powerpc-linux-gnu gnu-efi
- name: make clean
run: |
make distclean
- name: Select config
run: |
cp ${{inputs.config-file}} .config
- name: Build tools
run: |
make -C tools/keytools && make -C tools/bin-assemble
- name: Build wolfboot
- name: Build wolfboot (default)
run: |
make ${{inputs.make-args}}
- name: Build wolfboot ECC256 SHA2-256
run: |
make keysclean && make SIGN=ECC256 HASH=SHA256 ${{inputs.make-args}}
- name: Build wolfboot ECC384 SHA2-384
run: |
make keysclean && make SIGN=ECC384 HASH=SHA384 ${{inputs.make-args}}
- name: Build wolfboot ECC384 SHA2-256
run: |
make keysclean && make SIGN=ECC384 HASH=SHA256 ${{inputs.make-args}}
- name: Build wolfboot RSA2048 SHA2-256
run: |
make keysclean && make SIGN=RSA2048 HASH=SHA256 ${{inputs.make-args}}
- name: Build wolfboot RSA3072 SHA2-384
run: |
make keysclean && make SIGN=RSA3072 HASH=SHA384 ${{inputs.make-args}}
- name: Build wolfboot RSA4096 SHA3
# TPM does not support SHA3
run: |
make keysclean && make SIGN=RSA4096 HASH=SHA3 WOLFTPM=0 ${{inputs.make-args}}
- name: Build wolfboot ED25519 SHA2-256
run: |
make keysclean && make SIGN=ED25519 HASH=SHA256 ${{inputs.make-args}}
- name: Build wolfboot ED448
run: |
make keysclean && make SIGN=ED448 ${{inputs.make-args}}
14 changes: 14 additions & 0 deletions .github/workflows/test-configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ jobs:
arch: host
config-file: ./config/examples/sim.config

sim_nosmallstack_test:
uses: ./.github/workflows/test-build.yml
with:
arch: host
config-file: ./config/examples/sim.config
make-args: WOLFBOOT_SMALL_STACK=0 WOLFBOOT_HUGE_STACK=1

sim_spmath_test:
uses: ./.github/workflows/test-build.yml
with:
arch: host
config-file: ./config/examples/sim.config
make-args: WOLFBOOT_SMALL_STACK=0 WOLFBOOT_HUGE_STACK=1 SPMATH=1

stm32f4_small_blocks_uart_update_test:
uses: ./.github/workflows/test-build.yml
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-keytools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
- name: Select config
run: |
cp config/examples/sim-ecc.config .config && make include/target.h
cp config/examples/sim.config .config && make include/target.h
- name: Build tools
run: |
make -C tools/keytools && make -C tools/bin-assemble
- name: Build wolfboot
run: |
make ${{inputs.make-args}}
make SIGN=ECC256 HASH=SHA256
- name: Generate external key
run: |
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Build wolfboot
run: |
make ${{inputs.make-args}}
make SIGN=ED25519 HASH=SHA256
- name: Generate external key
run: |
Expand Down Expand Up @@ -107,15 +107,15 @@ jobs:
- name: Select config
run: |
cp config/examples/sim-rsa.config .config && make include/target.h
cp config/examples/sim.config .config && make include/target.h
- name: Build tools
run: |
make -C tools/keytools && make -C tools/bin-assemble
- name: Build wolfboot
run: |
make ${{inputs.make-args}}
make SIGN=RSA2048 HASH=SHA256
- name: Generate external key
run: |
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ stage1/loader_stage1.bin: FORCE
@echo "\t[BIN] $@"
$(Q)$(MAKE) -C $(dir $@) $(notdir $@)

test-lib: $(OBJS)
$(Q)$(CC) $(CFLAGS) -o $@ $^
test-lib: include/target.h $(OBJS)
$(Q)$(CC) $(CFLAGS) -o $@ $(OBJS)

wolfboot.efi: wolfboot.elf
@echo "\t[BIN] $@"
Expand Down
3 changes: 3 additions & 0 deletions arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,12 @@ ifeq ($(DUALBANK_SWAP),1)
UPDATE_OBJS:=src/update_flash_hwswap.o
endif

# Set default update object (if not library)
ifneq ($(TARGET),library)
ifeq ($(UPDATE_OBJS),)
UPDATE_OBJS:=./src/update_flash.o
endif
endif

## wolfBoot origin
ifeq ($(WOLFBOOT_ORIGIN),)
Expand Down
6 changes: 3 additions & 3 deletions config/examples/kontron_vx3060_s2.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARCH=x86_64
TARGET=kontron_vx3060_s2
WOLFBOOT_SMALL_STACK=0
SIGN=ECC384
HASH=SHA384
WOLFBOOT_SMALL_STACK?=0
SIGN?=ECC384
HASH?=SHA384
DEBUG=1
SPMATH=1
ENCRYPTION=0
Expand Down
4 changes: 1 addition & 3 deletions config/examples/library.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
ARCH=
NO_LOADER=1
USE_GCC_HEADLESS=0
# ends up double including this to work around defaulting to update_flash
UPDATE_OBJS:=hal/library.o
TARGET=library
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SIGN?=ED25519
HASH?=SHA256
IMAGE_HEADER_SIZE?=256
Expand Down
2 changes: 1 addition & 1 deletion config/examples/sim-delta-update.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SPI_FLASH=0
DEBUG=1
DELTA_UPDATES=1
Expand Down
18 changes: 0 additions & 18 deletions config/examples/sim-ecc.config

This file was deleted.

2 changes: 1 addition & 1 deletion config/examples/sim-encrypt-delta-update.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SPI_FLASH=0
EXT_FLASH=1
ENCRYPT=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SPI_FLASH=0
EXT_FLASH=1
ENCRYPT=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SPI_FLASH=0
EXT_FLASH=1
ENCRYPT=1
Expand Down
2 changes: 1 addition & 1 deletion config/examples/sim-encrypt-nvm-writeonce-update.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SPI_FLASH=0
EXT_FLASH=1
ENCRYPT=1
Expand Down
2 changes: 1 addition & 1 deletion config/examples/sim-encrypt-update.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SPI_FLASH=0
EXT_FLASH=1
ENCRYPT=1
Expand Down
2 changes: 1 addition & 1 deletion config/examples/sim-lms.config
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ HASH?=SHA256
LMS_LEVELS=2
LMS_HEIGHT=5
LMS_WINTERNITZ=8
WOLFBOOT_SMALL_STACK=0
WOLFBOOT_SMALL_STACK?=0
SPI_FLASH=0
DEBUG=0
DELTA_UPDATES=0
Expand Down
2 changes: 1 addition & 1 deletion config/examples/sim-nvm-writeonce-flags-home-invert.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SPI_FLASH=0
EXT_FLASH=1
DEBUG=1
Expand Down
2 changes: 1 addition & 1 deletion config/examples/sim-nvm-writeonce-flags-home.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SPI_FLASH=0
DEBUG=1
# it should be multiple of system page size
Expand Down
2 changes: 1 addition & 1 deletion config/examples/sim-nvm-writeonce.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SPI_FLASH=0
DEBUG=1
NVM_FLASH_WRITEONCE=1
Expand Down
19 changes: 0 additions & 19 deletions config/examples/sim-rsa.config

This file was deleted.

2 changes: 1 addition & 1 deletion config/examples/sim-tpm-keystore.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SIGN?=ECC256
HASH?=SHA256
SPI_FLASH=0
DEBUG=0
WOLFTPM=1
WOLFTPM?=1

# sizes should be multiple of system page size
WOLFBOOT_PARTITION_SIZE=0x40000
Expand Down
2 changes: 1 addition & 1 deletion config/examples/sim-tpm-measured.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SIGN?=ECC256
HASH?=SHA256
SPI_FLASH=0
DEBUG=0
WOLFTPM=1
WOLFTPM?=1

# sizes should be multiple of system page size
WOLFBOOT_PARTITION_SIZE=0x40000
Expand Down
2 changes: 1 addition & 1 deletion config/examples/sim-tpm-seal.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SIGN?=ECC256
HASH?=SHA256
SPI_FLASH=0
DEBUG=0
WOLFTPM=1
WOLFTPM?=1

# sizes should be multiple of system page size
WOLFBOOT_PARTITION_SIZE=0x40000
Expand Down
2 changes: 1 addition & 1 deletion config/examples/sim-tpm.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SIGN?=ECC256
HASH?=SHA256
SPI_FLASH=0
DEBUG=0
WOLFTPM=1
WOLFTPM?=1
# enable offloading of asymmetric verify to TPM
WOLFBOOT_TPM_VERIFY?=1

Expand Down
3 changes: 2 additions & 1 deletion config/examples/sim.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
WOLFBOOT_SMALL_STACK?=1
SPI_FLASH=0
DEBUG=1
SPMATH?=0

# sizes should be multiple of system page size
WOLFBOOT_PARTITION_SIZE=0x40000
Expand Down
4 changes: 2 additions & 2 deletions config/examples/stm32l4-cube.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TARGET=stm32l4
SIGN=ECC256
HASH=SHA256
SIGN?=ECC256
HASH?=SHA256
DEBUG?=0
VTOR?=1
CORTEX_M0?=0
Expand Down
4 changes: 2 additions & 2 deletions config/examples/stm32wb-delta-enc-ext.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TARGET=stm32wb
SIGN=ECC256
HASH=SHA256
SIGN?=ECC256
HASH?=SHA256
WOLFBOOT_SECTOR_SIZE=0x1000
WOLFBOOT_PARTITION_SIZE=0x20000
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x0800C000
Expand Down
4 changes: 2 additions & 2 deletions config/examples/stm32wb-delta-ext.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TARGET=stm32wb
SIGN=ECC256
HASH=SHA256
SIGN?=ECC256
HASH?=SHA256
WOLFBOOT_SECTOR_SIZE=0x1000
WOLFBOOT_PARTITION_SIZE=0x20000
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x0800C000
Expand Down
4 changes: 2 additions & 2 deletions config/examples/stm32wb-delta.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TARGET=stm32wb
SIGN=ECC256
HASH=SHA256
SIGN?=ECC256
HASH?=SHA256
WOLFBOOT_SECTOR_SIZE=0x1000
WOLFBOOT_PARTITION_SIZE=0x20000
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x0800C000
Expand Down
4 changes: 2 additions & 2 deletions config/examples/stm32wb-pka-1mb.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TARGET=stm32wb
SIGN=ECC256
HASH=SHA256
SIGN?=ECC256
HASH?=SHA256
WOLFBOOT_SECTOR_SIZE=0x1000
WOLFBOOT_PARTITION_SIZE=0x7B800
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x08008000
Expand Down
Loading

0 comments on commit b795257

Please sign in to comment.