@@ -52,7 +52,7 @@ TESTS:=unit-parser unit-fdt unit-extflash unit-string unit-spi-flash unit-aes128
5252 unit-update-flash-hook \
5353 unit-update-flash-self-update \
5454 unit-update-flash-enc unit-update-ram unit-update-ram-enc unit-update-ram-enc-nopart unit-update-ram-nofixed unit-update-ram-noramboot unit-update-flash-hwswap unit-pkcs11_store unit-psa_store unit-disk \
55- unit-update-disk unit-multiboot unit-boot-x86-fsp unit-loader-tpm-init unit-qspi-flash unit-fwtpm-stub unit-tpm-rsa-exp \
55+ unit-update-disk unit-update-disk-oob unit- multiboot unit-boot-x86-fsp unit-loader-tpm-init unit-qspi-flash unit-fwtpm-stub unit-tpm-rsa-exp \
5656 unit-image-nopart unit-image-sha384 unit-image-sha3-384 unit-store-sbrk \
5757 unit-tpm-blob unit-policy-create unit-policy-sign unit-rot-auth unit-sdhci-response-bits \
5858 unit-sdhci-disk-unaligned unit-sign-encrypted-output \
@@ -186,7 +186,15 @@ unit-update-ram-nofixed:CFLAGS+=-DMOCK_PARTITIONS -DWOLFBOOT_NO_SIGN \
186186 -DWOLFBOOT_RAMBOOT_MAX_SIZE=WOLFBOOT_PARTITION_SIZE \
187187 -DWOLFBOOT_ORIGIN=MOCK_ADDRESS_BOOT \
188188 -DBOOTLOADER_PARTITION_SIZE=WOLFBOOT_PARTITION_SIZE
189- unit-update-disk:CFLAGS+ =-DMOCK_PARTITIONS -DPRINTF_ENABLED \
189+ # Bound the non-FSP disk load to this test's 64-byte load_buffer (TEST_PAYLOAD_SIZE),
190+ # the cap update_disk.c now requires; all images here are exactly that size.
191+ unit-update-disk:CFLAGS+ =-DMOCK_PARTITIONS -DPRINTF_ENABLED -DWOLFBOOT_RAMBOOT_MAX_SIZE=0x40 \
192+ -DWOLFBOOT_ORIGIN=MOCK_ADDRESS_BOOT -DBOOTLOADER_PARTITION_SIZE=WOLFBOOT_PARTITION_SIZE
193+ # Non-FSP disk-boot OOB regression (CRIT-03). WOLFBOOT_RAMBOOT_MAX_SIZE is the
194+ # cap the loader applies to the unauthenticated header fw_size before loading to
195+ # RAM, the same bound update_disk.c and update_ram.c enforce.
196+ unit-update-disk-oob:CFLAGS+ =-DMOCK_PARTITIONS -DPRINTF_ENABLED \
197+ -DWOLFBOOT_RAMBOOT_MAX_SIZE=0x1000 \
190198 -DWOLFBOOT_ORIGIN=MOCK_ADDRESS_BOOT -DBOOTLOADER_PARTITION_SIZE=WOLFBOOT_PARTITION_SIZE
191199unit-string:CFLAGS+ =-fno-builtin
192200
@@ -511,6 +519,9 @@ unit-update-flash-hwswap: ../../include/target.h unit-update-flash-hwswap.c
511519unit-update-disk : ../../include/target.h unit-update-disk.c
512520 gcc -o $@ unit-update-disk.c $(CFLAGS ) $(LDFLAGS )
513521
522+ unit-update-disk-oob : ../../include/target.h unit-update-disk-oob.c
523+ gcc -o $@ unit-update-disk-oob.c $(CFLAGS ) $(LDFLAGS )
524+
514525unit-pkcs11_store : ../../include/target.h unit-pkcs11_store.c
515526 gcc -o $@ $(WOLFCRYPT_SRC ) unit-pkcs11_store.c $(CFLAGS ) $(WOLFCRYPT_CFLAGS ) $(LDFLAGS )
516527
0 commit comments