mirror of https://github.com/wolfSSL/wolfBoot.git
Addressed copilot's comments
parent
3118f7ad4e
commit
26552b5aed
|
|
@ -1401,6 +1401,7 @@ int wolfBoot_dualboot_candidate(void)
|
|||
|
||||
if (fallback_v < candidate_v) {
|
||||
wolfBoot_printf("Rollback to lower version not allowed\n");
|
||||
wolfBoot_erase_partition(candidate);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ void RAMFUNCTION wolfBoot_start(void)
|
|||
if ((max_v > 0U) && (active_v < max_v)) {
|
||||
wolfBoot_printf("Rollback to lower version not allowed\n");
|
||||
boot_panic();
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ((wolfBoot_open_image(&fw_image, active) < 0)
|
||||
|
|
|
|||
|
|
@ -210,6 +210,7 @@ START_TEST(test_invalid_update_rollback_to_older_boot_is_denied)
|
|||
|
||||
ck_assert_int_eq(wolfBoot_staged_ok, 0);
|
||||
ck_assert_int_eq(wolfBoot_panicked, 1);
|
||||
ck_assert_ptr_eq((void *)wolfBoot_stage_address, (void *)0xFFFFFFFF);
|
||||
cleanup_flash();
|
||||
}
|
||||
END_TEST
|
||||
|
|
|
|||
|
|
@ -380,6 +380,7 @@ START_TEST (test_invalid_update_type) {
|
|||
wolfBoot_start();
|
||||
ck_assert(!wolfBoot_staged_ok);
|
||||
ck_assert_int_eq(wolfBoot_panicked, 1);
|
||||
ck_assert_int_eq(get_version_ramloaded(), 2);
|
||||
cleanup_flash();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue