diff --git a/core/embed/bootloader/main.c b/core/embed/bootloader/main.c index 38316db30c..71b61d05e1 100644 --- a/core/embed/bootloader/main.c +++ b/core/embed/bootloader/main.c @@ -257,7 +257,7 @@ static void check_bootloader_version(void) { NULL); ensure(sectrue * (0 == memcmp(bits, bits2, FLASH_OTP_BLOCK_SIZE)), - "Bootloader downgraded"); + "Bootloader downgrade protection"); } #endif @@ -479,27 +479,27 @@ int bootloader_main(void) { } ensure(read_vendor_header((const uint8_t *)FIRMWARE_START, &vhdr), - "invalid vendor header"); + "Firmware is corrupted"); - ensure(check_vendor_header_keys(&vhdr), "invalid vendor header signature"); + ensure(check_vendor_header_keys(&vhdr), "Firmware is corrupted"); - ensure(check_vendor_header_lock(&vhdr), "unauthorized vendor keys"); + ensure(check_vendor_header_lock(&vhdr), "Unauthorized vendor keys"); hdr = read_image_header((const uint8_t *)(FIRMWARE_START + vhdr.hdrlen), FIRMWARE_IMAGE_MAGIC, FIRMWARE_IMAGE_MAXSIZE); ensure(hdr == (const image_header *)(FIRMWARE_START + vhdr.hdrlen) ? sectrue : secfalse, - "invalid firmware header"); + "Firmware is corrupted"); - ensure(check_image_model(hdr), "wrong firmware model"); + ensure(check_image_model(hdr), "Wrong firmware model"); ensure(check_image_header_sig(hdr, vhdr.vsig_m, vhdr.vsig_n, vhdr.vpub), - "invalid firmware signature"); + "Firmware is corrupted"); ensure(check_image_contents(hdr, IMAGE_HEADER_SIZE + vhdr.hdrlen, FIRMWARE_SECTORS, FIRMWARE_SECTORS_COUNT), - "invalid firmware hash"); + "Firmware is corrupted"); // if all VTRUST flags are unset = ultimate trust => skip the procedure @@ -537,4 +537,4 @@ int bootloader_main(void) { return 0; } -void HardFault_Handler(void) { error_shutdown("INTERNAL ERROR!", "(HF)"); } +void HardFault_Handler(void) { error_shutdown("INTERNAL ERROR", "(HF)"); } diff --git a/core/embed/firmware/main.c b/core/embed/firmware/main.c index f26091df30..d56ac9df77 100644 --- a/core/embed/firmware/main.c +++ b/core/embed/firmware/main.c @@ -184,7 +184,7 @@ int main(void) { // MicroPython default exception handler void __attribute__((noreturn)) nlr_jump_fail(void *val) { - error_shutdown("INTERNAL ERROR!", "(UE)"); + error_shutdown("INTERNAL ERROR", "(UE)"); } // interrupt handlers @@ -192,19 +192,19 @@ void __attribute__((noreturn)) nlr_jump_fail(void *val) { void NMI_Handler(void) { // Clock Security System triggered NMI if ((RCC->CIR & RCC_CIR_CSSF) != 0) { - error_shutdown("INTERNAL ERROR!", "(CS)"); + error_shutdown("INTERNAL ERROR", "(CS)"); } } -void HardFault_Handler(void) { error_shutdown("INTERNAL ERROR!", "(HF)"); } +void HardFault_Handler(void) { error_shutdown("INTERNAL ERROR", "(HF)"); } -void MemManage_Handler_MM(void) { error_shutdown("INTERNAL ERROR!", "(MM)"); } +void MemManage_Handler_MM(void) { error_shutdown("INTERNAL ERROR", "(MM)"); } -void MemManage_Handler_SO(void) { error_shutdown("INTERNAL ERROR!", "(SO)"); } +void MemManage_Handler_SO(void) { error_shutdown("INTERNAL ERROR", "(SO)"); } -void BusFault_Handler(void) { error_shutdown("INTERNAL ERROR!", "(BF)"); } +void BusFault_Handler(void) { error_shutdown("INTERNAL ERROR", "(BF)"); } -void UsageFault_Handler(void) { error_shutdown("INTERNAL ERROR!", "(UF)"); } +void UsageFault_Handler(void) { error_shutdown("INTERNAL ERROR", "(UF)"); } __attribute__((noreturn)) void reboot_to_bootloader() { jump_to_with_flag(BOOTLOADER_START + IMAGE_HEADER_SIZE, diff --git a/core/embed/rust/src/trezorhal/fatal_error.rs b/core/embed/rust/src/trezorhal/fatal_error.rs index aaae4bd2e4..b5ba27bf49 100644 --- a/core/embed/rust/src/trezorhal/fatal_error.rs +++ b/core/embed/rust/src/trezorhal/fatal_error.rs @@ -19,7 +19,7 @@ pub fn __fatal_error(_expr: &str, _msg: &str, _file: &str, _line: u32, _func: &s #[cfg(not(feature = "bootloader"))] pub fn __fatal_error(_expr: &str, msg: &str, _file: &str, _line: u32, _func: &str) -> ! { - screen_fatal_error("FATAL ERROR", msg, "PLEASE VISIT\nTREZOR.IO/RSOD"); + screen_fatal_error("INTERNAL_ERROR", msg, "PLEASE VISIT\nTREZOR.IO/RSOD"); shutdown() } diff --git a/core/embed/rust/src/ui/model_tt/bootloader/mod.rs b/core/embed/rust/src/ui/model_tt/bootloader/mod.rs index 72c4466c91..4417b282ca 100644 --- a/core/embed/rust/src/ui/model_tt/bootloader/mod.rs +++ b/core/embed/rust/src/ui/model_tt/bootloader/mod.rs @@ -320,7 +320,7 @@ extern "C" fn screen_wipe_success() { let mut frame = ResultScreen::new( &RESULT_WIPE, Icon::new(CHECK40), - "Trezor reset\nsuccessfully.", + "Trezor reset\nsuccessfully", RECONNECT_MESSAGE, true, ); @@ -332,7 +332,7 @@ extern "C" fn screen_wipe_fail() { let mut frame = ResultScreen::new( &RESULT_WIPE, Icon::new(WARNING40), - "Trezor reset was\nnot successful.", + "Trezor reset was\nnot successful", RECONNECT_MESSAGE, true, ); @@ -364,7 +364,7 @@ extern "C" fn screen_install_fail() { let mut frame = ResultScreen::new( &RESULT_FW_INSTALL, Icon::new(WARNING40), - "Firmware installation was\nnot successful.", + "Firmware installation was not successful", RECONNECT_MESSAGE, true, ); @@ -375,7 +375,7 @@ fn screen_install_success_bld(msg: &'static str, complete_draw: bool) { let mut frame = ResultScreen::new( &RESULT_FW_INSTALL, Icon::new(CHECK40), - "Firmware installed\nsuccessfully.", + "Firmware installed\nsuccessfully", msg, complete_draw, ); @@ -386,7 +386,7 @@ fn screen_install_success_initial(msg: &'static str, complete_draw: bool) { let mut frame = ResultScreen::new( &RESULT_INITIAL, Icon::new(CHECK40), - "Firmware installed\nsuccessfully.", + "Firmware installed\nsuccessfully", msg, complete_draw, ); diff --git a/core/embed/trezorhal/common.c b/core/embed/trezorhal/common.c index 7c93505e98..59f30fbd0b 100644 --- a/core/embed/trezorhal/common.c +++ b/core/embed/trezorhal/common.c @@ -89,12 +89,12 @@ __fatal_error(const char *expr, const char *msg, const char *file, int line, #ifdef FANCY_FATAL_ERROR char buf[256] = {0}; mini_snprintf(buf, sizeof(buf), "%s: %d", file, line); - screen_fatal_error_rust("FATAL ERROR", msg != NULL ? msg : buf, + screen_fatal_error_rust("INTERNAL ERROR", msg != NULL ? msg : buf, "PLEASE VISIT\nTREZOR.IO/RSOD"); display_refresh(); #else display_print_color(COLOR_WHITE, COLOR_FATAL_ERROR); - display_printf("\nFATAL ERROR:\n"); + display_printf("\nINTERNAL ERROR:\n"); if (expr) { display_printf("expr: %s\n", expr); } diff --git a/core/embed/unix/common.c b/core/embed/unix/common.c index 0c7440808a..204d6dc79e 100644 --- a/core/embed/unix/common.c +++ b/core/embed/unix/common.c @@ -85,16 +85,18 @@ __fatal_error(const char *expr, const char *msg, const char *file, int line, msg = "Unknown error"; char buf[256] = {0}; snprintf(buf, sizeof(buf), "%s: %d", file, line); - screen_fatal_error_rust("FATAL ERROR", buf, "PLEASE VISIT\nTREZOR.IO/RSOD"); + screen_fatal_error_rust("INTERNAL ERROR", buf, + "PLEASE VISIT\nTREZOR.IO/RSOD"); } else { - screen_fatal_error_rust("FATAL ERROR", msg, "PLEASE VISIT\nTREZOR.IO/RSOD"); + screen_fatal_error_rust("INTERNAL ERROR", msg, + "PLEASE VISIT\nTREZOR.IO/RSOD"); } display_refresh(); #else display_print_color(COLOR_WHITE, COLOR_FATAL_ERROR); - display_printf("\nFATAL ERROR:\n"); - printf("\nFATAL ERROR:\n"); + display_printf("\nINTERNAL ERROR:\n"); + printf("\nINTERNAL ERROR:\n"); if (expr) { display_printf("expr: %s\n", expr); printf("expr: %s\n", expr);