1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-30 17:21:21 +00:00

feat(legacy): Introduce post-message cleanup.

This commit is contained in:
Andrew Kozlik 2023-01-02 20:25:37 +01:00 committed by matejcik
parent a1afadfd01
commit 0b3216146e
3 changed files with 12 additions and 0 deletions

View File

@ -416,6 +416,16 @@ void fsm_abortWorkflows(void) {
#endif
}
void fsm_postMsgCleanup(MessageType message_type) {
if (message_type != MessageType_MessageType_DoPreauthorized) {
authorization_type = 0;
}
if (message_type != MessageType_MessageType_UnlockPath) {
unlock_path = 0;
}
}
bool fsm_layoutPathWarning(void) {
layoutDialogSwipe(&bmp_icon_warning, _("Abort"), _("Continue"), NULL,
_("Wrong address path"), _("for selected coin."), NULL,

View File

@ -161,5 +161,6 @@ bool fsm_getOwnershipId(uint8_t *script_pubkey, size_t script_pubkey_size,
uint8_t ownership_id[32]);
void fsm_abortWorkflows(void);
void fsm_postMsgCleanup(MessageType message_type);
#endif

View File

@ -62,6 +62,7 @@ void MessageProcessFunc(char type, char dir, uint16_t msg_id, void *ptr) {
while (m->type) {
if (type == m->type && dir == m->dir && msg_id == m->msg_id) {
m->process_func(ptr);
fsm_postMsgCleanup(msg_id);
return;
}
m++;