Skip to content

Commit c31a213

Browse files
philljjdanielinux
authored andcommitted
XMSS wolfBoot support: add renode-nrf52 test case.
1 parent 8dcf0de commit c31a213

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

.github/workflows/test-renode-nrf52.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ jobs:
5858
- name: Renode Tests LMS-8-5-5
5959
run: ./tools/renode/docker-test.sh "SIGN=LMS LMS_LEVELS=2 LMS_HEIGHT=5 LMS_WINTERNITZ=8 WOLFBOOT_SMALL_STACK=0 IMAGE_SIGNATURE_SIZE=2644 IMAGE_HEADER_SIZE=5288"
6060

61+
# XMSS TEST
62+
- name: Renode Tests XMSS-SHA2_10_256
63+
run: ./tools/renode/docker-test.sh "SIGN=XMSS XMSS_PARAMS='XMSS-SHA2_10_256' WOLFBOOT_SMALL_STACK=0 IMAGE_SIGNATURE_SIZE=2500 IMAGE_HEADER_SIZE=5000"
64+
6165
- name: Upload Output Dir
6266
uses: actions/upload-artifact@v2
6367
with:

tools/config.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ifeq ($(ARCH),)
3434
LMS_LEVELS?=0
3535
LMS_HEIGHT?=0
3636
LMS_WINTERNITZ?=0
37-
XMSS_PARAMS?=XMSS-SHA2_10_256
37+
XMSS_PARAMS?='XMSS-SHA2_10_256'
3838
NO_MPU?=0
3939
ENCRYPT?=0
4040
ENCRYPT_WITH_CHACHA?=0

tools/scripts/renode-test-update.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@ if (echo $TEST_OPTIONS | grep "LMS" &>/dev/null); then
3737
cd ../../.. || exit 2
3838
fi
3939

40+
if (echo $TEST_OPTIONS | grep "XMSS" &>/dev/null); then
41+
# Need git.
42+
apt install -y git
43+
44+
# wolfSSL needs to be on latest master for XMSS support. Also, we need to
45+
# add the wolfssl module as a safe directory so docker can use it.
46+
git config --global --add safe.directory /workspace/lib/wolfssl || exit 2
47+
cd lib/wolfssl && git checkout master && git pull && cd ../.. || exit 2
48+
49+
50+
# Need to clone the hash-sigs repo, and patch it for wolfBoot build.
51+
cd lib || exit 2
52+
git clone https://github.com/XMSS/xmss-reference.git xmss || exit 2
53+
cd xmss && git checkout 171ccbd26f098542a67eb5d2b128281c80bd71a6 && \
54+
git apply ../../tools/xmss/0001-Patch-to-support-wolfSSL-xmss-reference-integration.patch &&\
55+
cd ../../ || exit 2
56+
fi
57+
4058
make distclean
4159
make -C tools/keytools
4260
make -C tools/test-expect-version

tools/test-renode.mk

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ RENODE_BINASSEMBLE=tools/bin-assemble/bin-assemble
2020
LMS_OPTS=LMS_LEVELS=2 LMS_HEIGHT=5 LMS_WINTERNITZ=8 WOLFBOOT_SMALL_STACK=0 \
2121
IMAGE_SIGNATURE_SIZE=2644 IMAGE_HEADER_SIZE=5288
2222

23+
XMSS_OPTS=XMSS_PARAMS='XMSS-SHA2_10_256' WOLFBOOT_SMALL_STACK=0 \
24+
IMAGE_SIGNATURE_SIZE=2500 IMAGE_HEADER_SIZE=5000
25+
2326
# python version only supported using
2427
# KEYGEN_TOOL="python3 $(WOLFBOOT_ROOT)/tools/keytools/keygen.py"
2528
ifeq ("$(KEYGEN_TOOL)","")
@@ -97,6 +100,10 @@ ifeq ($(SIGN),LMS)
97100
SIGN_ARGS+= --lms
98101
endif
99102

103+
ifeq ($(SIGN),XMSS)
104+
SIGN_ARGS+= --xmss
105+
endif
106+
100107
ifeq ($(HASH),SHA256)
101108
SIGN_ARGS+= --sha256
102109
endif
@@ -260,6 +267,9 @@ renode-factory-rsa4096: FORCE
260267
renode-factory-lms: FORCE
261268
make renode-factory SIGN=LMS $(LMS_OPTS)
262269

270+
renode-factory-xmss: FORCE
271+
make renode-factory SIGN=XMSS $(XMSS_OPTS)
272+
263273
renode-factory-all: FORCE
264274
${Q}make keysclean
265275
${Q}make renode-factory-ed25519
@@ -303,6 +313,9 @@ renode-update-rsa4096: FORCE
303313
renode-update-lms: FORCE
304314
make renode-update SIGN=LMS $(LMS_OPTS)
305315

316+
renode-update-xmss: FORCE
317+
make renode-update SIGN=XMSS $(XMSS_OPTS)
318+
306319
renode-no-downgrade-ed25519: FORCE
307320
make renode-no-downgrade SIGN=ED448
308321

@@ -324,6 +337,9 @@ renode-no-downgrade-rsa4096: FORCE
324337
renode-no-downgrade-lms: FORCE
325338
make renode-no-downgrade SIGN=LMS $(LMS_OPTS)
326339

340+
renode-no-downgrade-xmss: FORCE
341+
make renode-no-downgrade SIGN=XMSS $(XMSS_OPTS)
342+
327343
renode-corrupted-ed25519: FORCE
328344
make renode-corrupted SIGN=ED448
329345

@@ -345,6 +361,9 @@ renode-corrupted-rsa4096: FORCE
345361
renode-corrupted-lms: FORCE
346362
make renode-corrupted SIGN=LMS $(LMS_OPTS)
347363

364+
renode-corrupted-xmss: FORCE
365+
make renode-corrupted SIGN=XMSS $(XMSS_OPTS)
366+
348367
renode-boot-time-all: FORCE
349368
tools/scripts/renode-test-all.sh 2>/dev/null |grep "BOOT TIME"
350369

@@ -368,6 +387,7 @@ renode-update-all: FORCE
368387
${Q}make keysclean
369388
${Q}make renode-update-lms RENODE_PORT=55164
370389
${Q}make keysclean
390+
${Q}make renode-update-xmss RENODE_PORT=55165
371391
${Q}echo All tests in $@ OK!
372392

373393
renode-no-downgrade-all: FORCE
@@ -389,6 +409,8 @@ renode-no-downgrade-all: FORCE
389409
${Q}make renode-no-downgrade SIGN=NONE RENODE_PORT=55163
390410
${Q}make keysclean
391411
${Q}make renode-no-downgrade-lms RENODE_PORT=55164
412+
${Q}make keysclean
413+
${Q}make renode-no-downgrade-xmss RENODE_PORT=55165
392414
${Q}echo All tests in $@ OK!
393415

394416
renode-corrupted-all: FORCE
@@ -410,6 +432,8 @@ renode-corrupted-all: FORCE
410432
${Q}make renode-corrupted SIGN=NONE RENODE_PORT=55163
411433
${Q}make keysclean
412434
${Q}make renode-corrupted-lms RENODE_PORT=55164
435+
${Q}make keysclean
436+
${Q}make renode-corrupted-xmss RENODE_PORT=55165
413437
${Q}echo All tests in $@ OK!
414438

415439
renode-update-all-armored: FORCE

0 commit comments

Comments
 (0)