mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 12:00:59 +00:00
bootloader: lock flash/turn off sdcard when header invalid
This commit is contained in:
parent
74db11cbfc
commit
300daa4513
@ -87,7 +87,9 @@ bool copy_sdcard(void)
|
|||||||
|
|
||||||
image_header hdr;
|
image_header hdr;
|
||||||
if (!image_parse_header((const uint8_t *)buf, &hdr)) {
|
if (!image_parse_header((const uint8_t *)buf, &hdr)) {
|
||||||
BOOTLOADER_PRINTLN("wrong header");
|
BOOTLOADER_PRINTLN("invalid header");
|
||||||
|
sdcard_power_off();
|
||||||
|
HAL_FLASH_Lock();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user