|
|
@ -64,7 +64,6 @@ void show_unplug(const char *line1, const char *line2) {
|
|
|
|
"You may now", "unplug your Trezor.", NULL);
|
|
|
|
"You may now", "unplug your Trezor.", NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if !BOOTLOADER_QA
|
|
|
|
|
|
|
|
static void show_unofficial_warning(const uint8_t *hash) {
|
|
|
|
static void show_unofficial_warning(const uint8_t *hash) {
|
|
|
|
// On production bootloader, show warning and wait for user
|
|
|
|
// On production bootloader, show warning and wait for user
|
|
|
|
// to accept or reject it
|
|
|
|
// to accept or reject it
|
|
|
@ -94,7 +93,6 @@ static void show_unofficial_warning(const uint8_t *hash) {
|
|
|
|
delay(100000000);
|
|
|
|
delay(100000000);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void __attribute__((noreturn)) load_app(int signed_firmware) {
|
|
|
|
static void __attribute__((noreturn)) load_app(int signed_firmware) {
|
|
|
|
// zero out SRAM
|
|
|
|
// zero out SRAM
|
|
|
@ -161,11 +159,7 @@ int main(void) {
|
|
|
|
uint8_t fingerprint[32] = {0};
|
|
|
|
uint8_t fingerprint[32] = {0};
|
|
|
|
int signed_firmware = signatures_match(hdr, fingerprint);
|
|
|
|
int signed_firmware = signatures_match(hdr, fingerprint);
|
|
|
|
if (SIG_OK != signed_firmware) {
|
|
|
|
if (SIG_OK != signed_firmware) {
|
|
|
|
#if BOOTLOADER_QA
|
|
|
|
|
|
|
|
show_halt("Unsigned firmware", "Won't run on QA device");
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
show_unofficial_warning(fingerprint);
|
|
|
|
show_unofficial_warning(fingerprint);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if !PRODUCTION && !BOOTLOADER_QA && !DEBUG_T1_SIGNATURES
|
|
|
|
#if !PRODUCTION && !BOOTLOADER_QA && !DEBUG_T1_SIGNATURES
|
|
|
|
// try to avoid bricking board SWD debug by accident
|
|
|
|
// try to avoid bricking board SWD debug by accident
|
|
|
|