From 01014386c7ad1c653132e2477d847a3f576c071c Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Thu, 24 Jul 2025 14:38:45 +0200 Subject: [PATCH 1/9] Updated submodules wolfSSL: 5.8.2 wolfTPM: latest wolfHSM: latest wolfPKCS11: latest --- lib/wolfHSM | 2 +- lib/wolfPKCS11 | 2 +- lib/wolfTPM | 2 +- lib/wolfssl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/wolfHSM b/lib/wolfHSM index fda4b62e91..e2c0f46eed 160000 --- a/lib/wolfHSM +++ b/lib/wolfHSM @@ -1 +1 @@ -Subproject commit fda4b62e917a1382363079b19261a6a79290bbf9 +Subproject commit e2c0f46eedde9c2b20b56ea4d4d135d48a617e8d diff --git a/lib/wolfPKCS11 b/lib/wolfPKCS11 index bbbb2fda18..afb67e64b4 160000 --- a/lib/wolfPKCS11 +++ b/lib/wolfPKCS11 @@ -1 +1 @@ -Subproject commit bbbb2fda18abd89d81e4a3e308164a218edae17a +Subproject commit afb67e64b49356a81a478ad91dd0d53c1dbde01e diff --git a/lib/wolfTPM b/lib/wolfTPM index 0cd21b53c4..6cfe8001d7 160000 --- a/lib/wolfTPM +++ b/lib/wolfTPM @@ -1 +1 @@ -Subproject commit 0cd21b53c48e9e4aa05652fe20badcc4883c7f33 +Subproject commit 6cfe8001d79b7e4081dd0df7f596cdc8bdea1302 diff --git a/lib/wolfssl b/lib/wolfssl index 978a29da0b..decea12e22 160000 --- a/lib/wolfssl +++ b/lib/wolfssl @@ -1 +1 @@ -Subproject commit 978a29da0b76eb868748967f4cb74421dc2382a2 +Subproject commit decea12e223869c8f8f3ab5a53dc90b69f436eb2 From 90d8535189678bfb7568c6b1b51d8b3cb09c8d0d Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Thu, 24 Jul 2025 22:06:10 +0200 Subject: [PATCH 2/9] Update wolfssl to master --- lib/wolfssl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wolfssl b/lib/wolfssl index decea12e22..a06268f705 160000 --- a/lib/wolfssl +++ b/lib/wolfssl @@ -1 +1 @@ -Subproject commit decea12e223869c8f8f3ab5a53dc90b69f436eb2 +Subproject commit a06268f7050190600dd5353ec0d0a008ec3f0866 From a54f46415e9876f7fe43d25a6e1e581f82091dd0 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Tue, 29 Jul 2025 15:44:24 +0200 Subject: [PATCH 3/9] Added HAVE_UNISTD_H to TPM build in sim --- options.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options.mk b/options.mk index 5b335d7cae..cec95d8700 100644 --- a/options.mk +++ b/options.mk @@ -712,7 +712,7 @@ ifeq ($(WOLFTPM),1) SIM_TPM=1 endif ifeq ($(SIM_TPM),1) - CFLAGS+=-DWOLFTPM_SWTPM -DTPM_TIMEOUT_TRIES=0 -DHAVE_NETDB_H + CFLAGS+=-DWOLFTPM_SWTPM -DTPM_TIMEOUT_TRIES=0 -DHAVE_NETDB_H -DHAVE_UNISTD_H OBJS+=./lib/wolfTPM/src/tpm2_swtpm.o else # Use memory-mapped WOLFTPM on x86-64 From fbc52869515890d263bff49d5570699e1a71494e Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Tue, 29 Jul 2025 17:29:09 +0200 Subject: [PATCH 4/9] Updated footprint sizes --- tools/test.mk | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/test.mk b/tools/test.mk index 8bc86c9e4a..6944b499a7 100644 --- a/tools/test.mk +++ b/tools/test.mk @@ -961,39 +961,39 @@ test-all: clean test-size-all: - make test-size SIGN=NONE LIMIT=4824 NO_ARM_ASM=1 + make test-size SIGN=NONE LIMIT=4854 NO_ARM_ASM=1 make keysclean - make test-size SIGN=ED25519 LIMIT=11428 NO_ARM_ASM=1 + make test-size SIGN=ED25519 LIMIT=11458 NO_ARM_ASM=1 make keysclean - make test-size SIGN=ECC256 LIMIT=17968 NO_ARM_ASM=1 + make test-size SIGN=ECC256 LIMIT=18656 NO_ARM_ASM=1 make clean - make test-size SIGN=ECC256 NO_ASM=1 LIMIT=13536 NO_ARM_ASM=1 + make test-size SIGN=ECC256 NO_ASM=1 LIMIT=13566 NO_ARM_ASM=1 make keysclean - make test-size SIGN=RSA2048 LIMIT=11264 NO_ARM_ASM=1 + make test-size SIGN=RSA2048 LIMIT=11302 NO_ARM_ASM=1 make clean - make test-size SIGN=RSA2048 NO_ASM=1 LIMIT=11844 NO_ARM_ASM=1 + make test-size SIGN=RSA2048 NO_ASM=1 LIMIT=11882 NO_ARM_ASM=1 make keysclean - make test-size SIGN=RSA4096 LIMIT=11552 NO_ARM_ASM=1 + make test-size SIGN=RSA4096 LIMIT=11586 NO_ARM_ASM=1 make clean - make test-size SIGN=RSA4096 NO_ASM=1 LIMIT=12132 NO_ARM_ASM=1 + make test-size SIGN=RSA4096 NO_ASM=1 LIMIT=12166 NO_ARM_ASM=1 make keysclean - make test-size SIGN=ECC384 LIMIT=17464 NO_ARM_ASM=1 + make test-size SIGN=ECC384 LIMIT=18616 NO_ARM_ASM=1 make clean - make test-size SIGN=ECC384 NO_ASM=1 LIMIT=14912 NO_ARM_ASM=1 + make test-size SIGN=ECC384 NO_ASM=1 LIMIT=14942 NO_ARM_ASM=1 make keysclean - make test-size SIGN=ED448 LIMIT=13416 NO_ARM_ASM=1 + make test-size SIGN=ED448 LIMIT=13526 NO_ARM_ASM=1 make keysclean - make test-size SIGN=RSA3072 LIMIT=11404 NO_ARM_ASM=1 + make test-size SIGN=RSA3072 LIMIT=11444 NO_ARM_ASM=1 make clean - make test-size SIGN=RSA3072 NO_ASM=1 LIMIT=11948 NO_ARM_ASM=1 + make test-size SIGN=RSA3072 NO_ASM=1 LIMIT=11988 NO_ARM_ASM=1 make keysclean make test-size SIGN=LMS LMS_LEVELS=2 LMS_HEIGHT=5 LMS_WINTERNITZ=8 \ WOLFBOOT_SMALL_STACK=0 IMAGE_SIGNATURE_SIZE=2644 \ - IMAGE_HEADER_SIZE?=5288 LIMIT=7516 NO_ARM_ASM=1 + IMAGE_HEADER_SIZE?=5288 LIMIT=7546 NO_ARM_ASM=1 make keysclean make test-size SIGN=XMSS XMSS_PARAMS='XMSS-SHA2_10_256' \ IMAGE_SIGNATURE_SIZE=2500 IMAGE_HEADER_SIZE?=4096 \ - LIMIT=8292 NO_ARM_ASM=1 + LIMIT=8322 NO_ARM_ASM=1 make keysclean make clean make test-size SIGN=ML_DSA ML_DSA_LEVEL=2 LIMIT=18866 \ From ae97fca60d2ccec8d4b1dd12c4f8a36bd3bedcf1 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 30 Jul 2025 11:02:24 +0200 Subject: [PATCH 5/9] Updated wolfPKCS11 submodule + Fix visibility of clock_gettime for benchmark in test applications --- lib/wolfPKCS11 | 2 +- test-app/wcs/user_settings.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/wolfPKCS11 b/lib/wolfPKCS11 index afb67e64b4..ddeb8877d0 160000 --- a/lib/wolfPKCS11 +++ b/lib/wolfPKCS11 @@ -1 +1 @@ -Subproject commit afb67e64b49356a81a478ad91dd0d53c1dbde01e +Subproject commit ddeb8877d088796edc187e254068755628349d8e diff --git a/test-app/wcs/user_settings.h b/test-app/wcs/user_settings.h index 9140f2b17b..9d2799fdbf 100644 --- a/test-app/wcs/user_settings.h +++ b/test-app/wcs/user_settings.h @@ -26,6 +26,8 @@ #define H_USER_SETTINGS_ #include +#include +int clock_gettime (clockid_t clock_id, struct timespec *tp); #include "wolfboot/wc_secure.h" #define WOLFCRYPT_ONLY From 9b121f27ae90f718dc334703c667acdb3155fdba Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 30 Jul 2025 17:53:51 +0200 Subject: [PATCH 6/9] Updated wolfHSM to latest main --- lib/wolfHSM | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wolfHSM b/lib/wolfHSM index e2c0f46eed..e0b2019ea0 160000 --- a/lib/wolfHSM +++ b/lib/wolfHSM @@ -1 +1 @@ -Subproject commit e2c0f46eedde9c2b20b56ea4d4d135d48a617e8d +Subproject commit e0b2019ea0b945c24bcbf07eb6329c3fe3b9ca72 From 05642fd9d00e0059d4df3cff1bfe4a0b315e1a16 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Thu, 31 Jul 2025 11:10:08 +0200 Subject: [PATCH 7/9] Change toolchain for zynqmp build --- .github/workflows/test-build-aarch64.yml | 57 ++++++++++++++++++++++++ .github/workflows/test-configs.yml | 3 +- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-build-aarch64.yml diff --git a/.github/workflows/test-build-aarch64.yml b/.github/workflows/test-build-aarch64.yml new file mode 100644 index 0000000000..cae9ef7051 --- /dev/null +++ b/.github/workflows/test-build-aarch64.yml @@ -0,0 +1,57 @@ +name: Wolfboot Build workflow for AARCH64 + +on: + + workflow_call: + inputs: + arch: + required: true + type: string + config-file: + required: true + type: string + make-args: + required: false + type: string + +jobs: + + build: + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v4 + 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 dependencies + run: | + sudo apt-get install -y build-essential curl + + - name: Install cross compiler + run: | + curl -O https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/14.3.rel1/binrel/arm-gnu-toolchain-14.3.rel1-x86_64-aarch64-none-elf.tar.xz + tar xf arm-gnu-toolchain-14.3.rel1-x86_64-aarch64-none-elf.tar.xz -C /opt/ + echo "/opt/arm-gnu-toolchain-14.3.rel1-x86_64-aarch64-none-elf/bin" >> $GITHUB_PATH + + - 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 + run: | + make ${{inputs.make-args}} diff --git a/.github/workflows/test-configs.yml b/.github/workflows/test-configs.yml index 2f9dd289c4..5a79597407 100644 --- a/.github/workflows/test-configs.yml +++ b/.github/workflows/test-configs.yml @@ -464,11 +464,10 @@ jobs: config-file: ./config/examples/x86_64_efi.config zynqmp_test: - uses: ./.github/workflows/test-build.yml + uses: ./.github/workflows/test-build-aarch64.yml with: arch: aarch64 config-file: ./config/examples/zynqmp.config - make-args: CROSS_COMPILE=aarch64-linux-gnu- sim_wolfhsm_test: uses: ./.github/workflows/test-build.yml From 4c94a5266828516cb431a5f6024bc9162ae96ef9 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Thu, 31 Jul 2025 11:27:21 +0200 Subject: [PATCH 8/9] Added submodule initialization for pico-sdk --- .github/workflows/test-build-pico-sdk.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-build-pico-sdk.yml b/.github/workflows/test-build-pico-sdk.yml index 7c7668ae90..4ade7deec7 100644 --- a/.github/workflows/test-build-pico-sdk.yml +++ b/.github/workflows/test-build-pico-sdk.yml @@ -32,6 +32,11 @@ jobs: repository: raspberrypi/pico-sdk path: pico-sdk + - name: pico-sdk submodules initialization + run: | + cd pico-sdk + git submodule update --init --recursive + - 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 From 3d32c381b928d15d9ae5065b37a96abe13980446 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Thu, 31 Jul 2025 13:19:52 +0200 Subject: [PATCH 9/9] Rp2350: use absolute paths for linker scripts --- IDE/pico-sdk/rp2350/test-app/CMakeLists.txt | 5 +++-- IDE/pico-sdk/rp2350/wolfboot/CMakeLists.txt | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/IDE/pico-sdk/rp2350/test-app/CMakeLists.txt b/IDE/pico-sdk/rp2350/test-app/CMakeLists.txt index 789ded85cc..05269bc875 100644 --- a/IDE/pico-sdk/rp2350/test-app/CMakeLists.txt +++ b/IDE/pico-sdk/rp2350/test-app/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.13) -set(WOLFBOOT_PATH ../../../../) +set(WOLFBOOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../..") +get_filename_component(WOLFBOOT_PATH "${WOLFBOOT_PATH}" ABSOLUTE) set(CMAKE_CXX_COMPILER arm-none-eabi-gcc) set(LIB_PICO_RUNTIME_INIT=0) @@ -27,7 +28,7 @@ target_compile_options(blink PRIVATE ) target_compile_definitions(blink PRIVATE PICO_NO_RUNTIME=1) -pico_set_linker_script(blink ../../../../../hal/rp2350-app.ld) +pico_set_linker_script(blink ${WOLFBOOT_PATH}/hal/rp2350-app.ld) target_link_libraries(blink pico_stdlib) # create map/bin/hex/uf2 file etc. diff --git a/IDE/pico-sdk/rp2350/wolfboot/CMakeLists.txt b/IDE/pico-sdk/rp2350/wolfboot/CMakeLists.txt index f661a78ab3..805657d020 100644 --- a/IDE/pico-sdk/rp2350/wolfboot/CMakeLists.txt +++ b/IDE/pico-sdk/rp2350/wolfboot/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.13) -set(WOLFBOOT_PATH ../../../..) +set(WOLFBOOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../..") +get_filename_component(WOLFBOOT_PATH "${WOLFBOOT_PATH}" ABSOLUTE) set(CMAKE_CXX_COMPILER arm-none-eabi-gcc) include(${PICO_SDK_PATH}/pico_sdk_init.cmake) @@ -65,7 +66,7 @@ target_include_directories(wolfboot PRIVATE ) target_link_libraries(wolfboot pico_stdlib hardware_flash) -pico_set_linker_script(wolfboot ../../../../../hal/rp2350.ld) +pico_set_linker_script(wolfboot ${WOLFBOOT_PATH}/hal/rp2350.ld) pico_enable_stdio_usb(wolfboot 1) pico_enable_stdio_uart(wolfboot 0)