chore(legacy): handle AppError failure type
What changed, and why it matters
This commit adds a missing human-readable error message for a new failure type called 'AppError' in the older Trezor (legacy) firmware. Without this change, if the device encountered an AppError it would fall through to a generic 'Firmware error' message, which could confuse users or support staff. The patch itself is defensive and does not introduce a vulnerability.
No immediate security action required. Treat as routine maintenance. If auditing, verify that FailureType_Failure_AppError is produced only by application-level conditions and that no sensitive data is passed through the text parameter elsewhere.
Security signals we found
Missing enum case in failure-reporting path
Potential misclassification of runtime errors to users
No memory safety, cryptographic, or authorization changes
Evidence from the diff
In legacy/firmware/fsm.c, the fsm_sendFailure() switch statement gains a case for FailureType_Failure_AppError returning the localized string ‘App error’. Previously the enum value was unhandled, so control would reach the default/bottom case and report ‘Firmware error’. The change is a straightforward message-mapping fix with no logic or memory-safety changes.
Changed components
legacy/firmware/fsm.cfsm_sendFailure()FailureType enum handlingInspect captured patch +3 / −0
### legacy/firmware/fsm.c
@@ -201,6 +201,9 @@ void fsm_sendFailure(FailureType code, const char *text)
case FailureType_Failure_InProgress:
text = _("Operation in progress");
break;
+ case FailureType_Failure_AppError:
+ text = _("App error");
+ break;
case FailureType_Failure_FirmwareError:
text = _("Firmware error");
break;Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.