mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-10 23:40:58 +00:00
use Failure_PinMismatch where it makes sense (ChangePin, ResetDevice, RecoveryDevice)
This commit is contained in:
parent
909f158c84
commit
fc7189f801
@ -155,6 +155,9 @@ void fsm_sendFailure(FailureType code, const char *text)
|
|||||||
case FailureType_Failure_NotInitialized:
|
case FailureType_Failure_NotInitialized:
|
||||||
text = _("Device not initialized");
|
text = _("Device not initialized");
|
||||||
break;
|
break;
|
||||||
|
case FailureType_Failure_PinMismatch:
|
||||||
|
text = _("PIN mismatch");
|
||||||
|
break;
|
||||||
case FailureType_Failure_FirmwareError:
|
case FailureType_Failure_FirmwareError:
|
||||||
text = _("Firmware error");
|
text = _("Firmware error");
|
||||||
break;
|
break;
|
||||||
@ -366,7 +369,7 @@ void fsm_msgChangePin(ChangePin *msg)
|
|||||||
if (protectChangePin()) {
|
if (protectChangePin()) {
|
||||||
fsm_sendSuccess(_("PIN changed"));
|
fsm_sendSuccess(_("PIN changed"));
|
||||||
} else {
|
} else {
|
||||||
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
fsm_sendFailure(FailureType_Failure_PinMismatch, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
layoutHome();
|
layoutHome();
|
||||||
|
@ -415,7 +415,7 @@ void recovery_init(uint32_t _word_count, bool passphrase_protection, bool pin_pr
|
|||||||
|
|
||||||
if (!dry_run) {
|
if (!dry_run) {
|
||||||
if (pin_protection && !protectChangePin()) {
|
if (pin_protection && !protectChangePin()) {
|
||||||
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
fsm_sendFailure(FailureType_Failure_PinMismatch, NULL);
|
||||||
layoutHome();
|
layoutHome();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ void reset_init(bool display_random, uint32_t _strength, bool passphrase_protect
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pin_protection && !protectChangePin()) {
|
if (pin_protection && !protectChangePin()) {
|
||||||
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
fsm_sendFailure(FailureType_Failure_PinMismatch, NULL);
|
||||||
layoutHome();
|
layoutHome();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user