Skip to content

Commit a09babb

Browse files
committed
enforce skip-verify prerequisites
F/2256
1 parent 830869c commit a09babb

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

include/wolfboot/wolfboot.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,15 @@ extern "C" {
185185
#endif
186186
#endif /* WOLFBOOT_SELF_HEADER */
187187

188+
#if defined(WOLFBOOT_SKIP_BOOT_VERIFY) && !defined(WOLFBOOT_SELF_HEADER)
189+
#error "WOLFBOOT_SKIP_BOOT_VERIFY requires WOLFBOOT_SELF_HEADER"
190+
#endif
191+
192+
#if defined(WOLFBOOT_SKIP_BOOT_VERIFY) && \
193+
!defined(WOLFBOOT_SELF_UPDATE_MONOLITHIC)
194+
#error "WOLFBOOT_SKIP_BOOT_VERIFY requires WOLFBOOT_SELF_UPDATE_MONOLITHIC"
195+
#endif
196+
188197
#ifdef BIG_ENDIAN_ORDER
189198
# define WOLFBOOT_MAGIC 0x574F4C46 /* WOLF */
190199
# define WOLFBOOT_MAGIC_TRAIL 0x424F4F54 /* BOOT */

options.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,12 @@ ifeq ($(ALLOW_DOWNGRADE),1)
710710
endif
711711

712712
ifeq ($(WOLFBOOT_SKIP_BOOT_VERIFY),1)
713+
ifneq ($(WOLFBOOT_SELF_HEADER),1)
714+
$(error WOLFBOOT_SKIP_BOOT_VERIFY=1 requires WOLFBOOT_SELF_HEADER=1)
715+
endif
716+
ifneq ($(SELF_UPDATE_MONOLITHIC),1)
717+
$(error WOLFBOOT_SKIP_BOOT_VERIFY=1 requires SELF_UPDATE_MONOLITHIC=1)
718+
endif
713719
CFLAGS+=-D"WOLFBOOT_SKIP_BOOT_VERIFY"
714720
endif
715721

tools/unit-tests/unit-update-disk.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#define WOLFBOOT_UPDATE_DISK
22
#define WOLFBOOT_SKIP_BOOT_VERIFY
3+
#define WOLFBOOT_SELF_UPDATE_MONOLITHIC
4+
#define WOLFBOOT_SELF_HEADER
35
#define EXT_ENCRYPTED
46
#define ENCRYPT_WITH_CHACHA
57
#define HAVE_CHACHA

0 commit comments

Comments
 (0)