@@ -7,6 +7,7 @@ SPI_CHIP=SST25VF080B
77SPI_OPTIONS=SPI_FLASH =1 WOLFBOOT_PARTITION_SIZE=0x80000 WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x00000 WOLFBOOT_PARTITION_SWAP_ADDRESS=0x80000
88SIGN_ARGS =
99SIGN_ENC_ARGS =
10+ DELTA_DATA_SIZE? =2000
1011
1112# python version only supported using
1213# KEYGEN_TOOL="python3 $(WOLFBOOT_ROOT)/tools/keytools/keygen.py"
@@ -159,6 +160,28 @@ test-sim-external-flash-with-update: wolfboot.bin test-app/image.elf FORCE
159160 $(Q )$(BINASSEMBLE ) external_flash.dd 0 test-app/image_v$(TEST_UPDATE_VERSION ) _signed.bin \
160161 $(WOLFBOOT_PARTITION_SIZE ) erased_sec.dd
161162
163+ test-sim-external-flash-with-enc-delta-update-extradata:DELTA_UPDATE_OPTIONS =--delta test-app/image_v1_signed.bin
164+ test-sim-external-flash-with-enc-delta-update-extradata:SIGN_ENC_ARGS =--encrypt /tmp/enc_key.der --aes128
165+ test-sim-external-flash-with-enc-delta-update-extradata : wolfboot.bin test-app/image.elf FORCE
166+ @printf " 0123456789abcdef0123456789abcdef0123456789abcdef" > /tmp/enc_key.der
167+ $(Q )$(SIGN_TOOL ) $(SIGN_OPTIONS ) test-app/image.elf $(PRIVATE_KEY ) 1
168+ $(Q ) cp test-app/image_v1_signed.bin test-app/image_v1_signed.bak
169+ $(Q ) rm -f test-app/image.elf test-app/app_sim.o
170+ $(Q ) make -C test-app delta-extra-data DELTA_DATA_SIZE=$(DELTA_DATA_SIZE )
171+ $(Q ) cp test-app/image_v1_signed.bak test-app/image_v1_signed.bin
172+ $(Q )$(SIGN_TOOL ) $(SIGN_OPTIONS ) $(SIGN_ENC_ARGS ) test-app/image.elf $(PRIVATE_KEY ) $(TEST_UPDATE_VERSION )
173+ $(Q )$(SIGN_TOOL ) $(SIGN_ARGS ) $(DELTA_UPDATE_OPTIONS ) $(SIGN_ENC_ARGS ) \
174+ test-app/image.elf $(PRIVATE_KEY ) $(TEST_UPDATE_VERSION )
175+ $(Q ) dd if=/dev/zero bs=$$(($(WOLFBOOT_PARTITION_SIZE ) ) ) count=1 2> /dev/null | tr " \000" " \377" > v1_part.dd
176+ $(Q ) dd if=test-app/image_v1_signed.bin bs=256 of=v1_part.dd conv=notrunc
177+ $(Q )$(BINASSEMBLE ) internal_flash.dd \
178+ 0 wolfboot.bin \
179+ $$(($(WOLFBOOT_PARTITION_BOOT_ADDRESS ) - $(ARCH_FLASH_OFFSET ) ) ) v1_part.dd
180+ $(Q ) dd if=/dev/zero bs=$$(($(WOLFBOOT_SECTOR_SIZE ) ) ) count=1 2> /dev/null | tr " \000" " \377" > erased_sec.dd
181+ $(Q )$(BINASSEMBLE ) external_flash.dd 0 test-app/image_v$(TEST_UPDATE_VERSION ) _signed_diff_encrypted.bin \
182+ $(WOLFBOOT_PARTITION_SIZE ) erased_sec.dd
183+ $(Q ) ls -l test-app/* .bin
184+
162185
163186test-sim-external-flash-with-enc-update:SIGN_ENC_ARGS =--encrypt /tmp/enc_key.der --aes128
164187test-sim-external-flash-with-enc-update : wolfboot.bin test-app/image.elf FORCE
0 commit comments