diff --git a/legacy/firmware/fsm.c b/legacy/firmware/fsm.c index b744a92cf..0cee204b2 100644 --- a/legacy/firmware/fsm.c +++ b/legacy/firmware/fsm.c @@ -368,6 +368,18 @@ void fsm_msgRebootToBootloader(void) { #endif } +bool fsm_layoutPathWarning(void) { + layoutDialogSwipe(&bmp_icon_warning, _("Abort"), _("Continue"), NULL, + _("Wrong address path"), _("for selected coin."), NULL, + _("Continue at your"), _("own risk!"), NULL); + if (!protectButton(ButtonRequestType_ButtonRequest_UnknownDerivationPath, + false)) { + fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL); + return false; + } + return true; +} + #include "fsm_msg_coin.h" #include "fsm_msg_common.h" #include "fsm_msg_crypto.h" diff --git a/legacy/firmware/fsm.h b/legacy/firmware/fsm.h index 3dfd195a9..7e6ce78ed 100644 --- a/legacy/firmware/fsm.h +++ b/legacy/firmware/fsm.h @@ -140,4 +140,6 @@ void fsm_msgRebootToBootloader(void); bool fsm_layoutSignMessage(const uint8_t *msg, uint32_t len); bool fsm_layoutVerifyMessage(const uint8_t *msg, uint32_t len); +bool fsm_layoutPathWarning(void); + #endif diff --git a/legacy/firmware/fsm_msg_coin.h b/legacy/firmware/fsm_msg_coin.h index b36cadb53..71f4afcc3 100644 --- a/legacy/firmware/fsm_msg_coin.h +++ b/legacy/firmware/fsm_msg_coin.h @@ -164,12 +164,7 @@ static bool fsm_checkCoinPath(const CoinInfo *coin, InputScriptType script_type, return false; } - layoutDialogSwipe(&bmp_icon_warning, _("Abort"), _("Continue"), NULL, - _("Wrong address path"), _("for selected coin."), NULL, - _("Continue at your"), _("own risk!"), NULL); - if (!protectButton(ButtonRequestType_ButtonRequest_UnknownDerivationPath, - false)) { - fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL); + if (!fsm_layoutPathWarning()) { layoutHome(); return false; } diff --git a/legacy/firmware/signing.c b/legacy/firmware/signing.c index 53a910c84..497ddb6bc 100644 --- a/legacy/firmware/signing.c +++ b/legacy/firmware/signing.c @@ -762,12 +762,7 @@ static bool derive_node(TxInputType *tinput) { return false; } - layoutDialogSwipe(&bmp_icon_warning, _("Abort"), _("Continue"), NULL, - _("Wrong address path"), _("for selected coin."), NULL, - _("Continue at your"), _("own risk!"), NULL); - if (!protectButton(ButtonRequestType_ButtonRequest_UnknownDerivationPath, - false)) { - fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL); + if (!fsm_layoutPathWarning()) { signing_abort(); return false; }