From fc7189f801f8457cc49bafbacbe546dc3f72d460 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 20 Feb 2018 17:48:19 +0100 Subject: [PATCH] use Failure_PinMismatch where it makes sense (ChangePin, ResetDevice, RecoveryDevice) --- firmware/fsm.c | 5 ++++- firmware/recovery.c | 2 +- firmware/reset.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/firmware/fsm.c b/firmware/fsm.c index 9d1422f850..f05d80fba6 100644 --- a/firmware/fsm.c +++ b/firmware/fsm.c @@ -155,6 +155,9 @@ void fsm_sendFailure(FailureType code, const char *text) case FailureType_Failure_NotInitialized: text = _("Device not initialized"); break; + case FailureType_Failure_PinMismatch: + text = _("PIN mismatch"); + break; case FailureType_Failure_FirmwareError: text = _("Firmware error"); break; @@ -366,7 +369,7 @@ void fsm_msgChangePin(ChangePin *msg) if (protectChangePin()) { fsm_sendSuccess(_("PIN changed")); } else { - fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL); + fsm_sendFailure(FailureType_Failure_PinMismatch, NULL); } } layoutHome(); diff --git a/firmware/recovery.c b/firmware/recovery.c index e2f955647b..7348748527 100644 --- a/firmware/recovery.c +++ b/firmware/recovery.c @@ -415,7 +415,7 @@ void recovery_init(uint32_t _word_count, bool passphrase_protection, bool pin_pr if (!dry_run) { if (pin_protection && !protectChangePin()) { - fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL); + fsm_sendFailure(FailureType_Failure_PinMismatch, NULL); layoutHome(); return; } diff --git a/firmware/reset.c b/firmware/reset.c index 797837818f..e44370ee78 100644 --- a/firmware/reset.c +++ b/firmware/reset.c @@ -60,7 +60,7 @@ void reset_init(bool display_random, uint32_t _strength, bool passphrase_protect } if (pin_protection && !protectChangePin()) { - fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL); + fsm_sendFailure(FailureType_Failure_PinMismatch, NULL); layoutHome(); return; }