Merge pull request #68 from wolfSSL/fix-lastresort-update

Fix last-resort update
keil
David Garske 2020-07-09 09:46:39 -07:00 committed by GitHub
commit 9ea5002122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -266,8 +266,18 @@ void RAMFUNCTION wolfBoot_start(void)
(wolfBoot_verify_integrity(&boot) < 0) ||
(wolfBoot_verify_authenticity(&boot) < 0)) {
if (wolfBoot_update(1) < 0) {
/* panic: no boot option available. */
while(1)
/* panic */;
;
} else {
/* Emergency update successful, try to re-open boot image */
if ((wolfBoot_open_image(&boot, PART_BOOT) < 0) ||
(wolfBoot_verify_integrity(&boot) < 0) ||
(wolfBoot_verify_authenticity(&boot) < 0)) {
/* panic: something went wrong after the emergency update */
while(1)
;
}
}
}
hal_prepare_boot();