Skip to content

Commit f8cbad0

Browse files
committed
Add final sanity checks to boot paths
F/2570
1 parent 9265fe7 commit f8cbad0

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/update_disk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@ void RAMFUNCTION wolfBoot_start(void)
559559
#ifdef WOLFBOOT_HOOK_BOOT
560560
wolfBoot_hook_boot(&os_image);
561561
#endif
562+
#ifndef WOLFBOOT_SKIP_BOOT_VERIFY
563+
PART_SANITY_CHECK(&os_image);
564+
#endif
562565
#ifdef DISK_ENCRYPT
563566
disk_decrypted_header_clear(dec_hdr);
564567
disk_crypto_clear();

src/update_flash_hwswap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ void RAMFUNCTION wolfBoot_start(void)
113113
hal_prepare_boot();
114114
#ifdef WOLFBOOT_HOOK_BOOT
115115
wolfBoot_hook_boot(&fw_image);
116+
#endif
117+
#ifndef WOLFBOOT_SKIP_BOOT_VERIFY
118+
PART_SANITY_CHECK(&fw_image);
116119
#endif
117120
do_boot((void *)(WOLFBOOT_PARTITION_BOOT_ADDRESS + IMAGE_HEADER_SIZE));
118121
}

src/update_ram.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ void RAMFUNCTION wolfBoot_start(void)
406406
#ifdef WOLFBOOT_HOOK_BOOT
407407
wolfBoot_hook_boot(&os_image);
408408
#endif
409+
#ifndef WOLFBOOT_SKIP_BOOT_VERIFY
410+
PART_SANITY_CHECK(&os_image);
411+
#endif
409412
#ifdef MMU
410413
do_boot((uint32_t*)load_address,
411414
(uint32_t*)dts_addr);

0 commit comments

Comments
 (0)