mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-21 21:00:58 +00:00
fix(core/bootloader): reporting bootloader lock state on U5
[no changelog]
This commit is contained in:
parent
f3b78e9c7a
commit
422b376ebd
@ -37,10 +37,16 @@ secbool secret_ensure_initialized(void) {
|
||||
}
|
||||
|
||||
secbool secret_bootloader_locked(void) {
|
||||
#ifdef FIRMWARE
|
||||
return (TAMP->BKP8R != 0) * sectrue;
|
||||
#if defined BOOTLOADER || defined BOARDLOADER
|
||||
return secret_optiga_present();
|
||||
#else
|
||||
return sectrue;
|
||||
const volatile uint32_t *reg1 = &TAMP->BKP8R;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (reg1[i] != 0) {
|
||||
return sectrue;
|
||||
}
|
||||
}
|
||||
return secfalse;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user