1
0
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:
tychovrahe 2024-09-05 16:28:54 +02:00 committed by TychoVrahe
parent f3b78e9c7a
commit 422b376ebd

View File

@ -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
}