File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -685,6 +685,10 @@ ifeq ($(ALLOW_DOWNGRADE),1)
685685 CFLAGS+ = -D"ALLOW_DOWNGRADE"
686686endif
687687
688+ ifeq ($(WOLFBOOT_SKIP_BOOT_VERIFY ) ,1)
689+ CFLAGS+ =-D"WOLFBOOT_SKIP_BOOT_VERIFY"
690+ endif
691+
688692ifeq ($(NVM_FLASH_WRITEONCE ) ,1)
689693 CFLAGS+ = -D"NVM_FLASH_WRITEONCE"
690694endif
Original file line number Diff line number Diff line change @@ -425,6 +425,7 @@ void RAMFUNCTION wolfBoot_start(void)
425425 }
426426 os_image .fw_base = (uint8_t * )load_address ;
427427
428+ #ifndef WOLFBOOT_SKIP_BOOT_VERIFY
428429 wolfBoot_printf ("Checking image integrity..." );
429430 BENCHMARK_START ();
430431 if (wolfBoot_verify_integrity (& os_image ) != 0 ) {
@@ -446,6 +447,10 @@ void RAMFUNCTION wolfBoot_start(void)
446447 failures = 0 ;
447448 break ; /* Success case */
448449 }
450+ #else
451+ failures = 0 ;
452+ break ; /* Skip verification, boot directly */
453+ #endif
449454 } while (failures < MAX_FAILURES );
450455
451456 if (failures ) {
Original file line number Diff line number Diff line change @@ -1346,6 +1346,7 @@ void RAMFUNCTION wolfBoot_start(void)
13461346 wolfBoot_printf ("Booting version: 0x%x\n" ,
13471347 wolfBoot_get_blob_version (boot .hdr ));
13481348
1349+ #ifndef WOLFBOOT_SKIP_BOOT_VERIFY
13491350 if (bootRet < 0
13501351 || (wolfBoot_verify_integrity (& boot ) < 0 )
13511352 || (wolfBoot_verify_authenticity (& boot ) < 0 )
@@ -1377,6 +1378,11 @@ void RAMFUNCTION wolfBoot_start(void)
13771378 }
13781379 }
13791380 PART_SANITY_CHECK (& boot );
1381+ #else
1382+ if (bootRet < 0 ) {
1383+ wolfBoot_panic ();
1384+ }
1385+ #endif
13801386
13811387#ifdef WOLFBOOT_ELF_FLASH_SCATTER
13821388 unsigned long entry ;
Original file line number Diff line number Diff line change @@ -51,10 +51,12 @@ void RAMFUNCTION wolfBoot_start(void)
5151 boot_panic ();
5252
5353 for (;;) {
54- if ((wolfBoot_open_image (& fw_image , active ) < 0 ) ||
55- (wolfBoot_verify_integrity (& fw_image ) < 0 ) ||
56- (wolfBoot_verify_authenticity (& fw_image ) < 0 )) {
57-
54+ if ((wolfBoot_open_image (& fw_image , active ) < 0 )
55+ #ifndef WOLFBOOT_SKIP_BOOT_VERIFY
56+ || (wolfBoot_verify_integrity (& fw_image ) < 0 )
57+ || (wolfBoot_verify_authenticity (& fw_image ) < 0 )
58+ #endif
59+ ) {
5860 /* panic if authentication fails and no backup */
5961 if (!wolfBoot_fallback_is_possible ())
6062 boot_panic ();
Original file line number Diff line number Diff line change @@ -192,6 +192,7 @@ void RAMFUNCTION wolfBoot_start(void)
192192 goto backup_on_failure ;
193193 }
194194
195+ #ifndef WOLFBOOT_SKIP_BOOT_VERIFY
195196 /* Verify image integrity (hash check) */
196197 wolfBoot_printf ("Checking integrity..." );
197198 BENCHMARK_START ();
@@ -211,6 +212,7 @@ void RAMFUNCTION wolfBoot_start(void)
211212 goto backup_on_failure ;
212213 }
213214 BENCHMARK_END ("done" );
215+ #endif
214216
215217 {
216218 /* Success - integrity and signature valid */
You can’t perform that action at this time.
0 commit comments