use Failure_PinMismatch where it makes sense (ChangePin, ResetDevice, RecoveryDevice)

This commit is contained in:
Pavol Rusnak 2018-02-20 17:48:19 +01:00
parent 909f158c84
commit fc7189f801
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 6 additions and 3 deletions

View File

@ -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();

View File

@ -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;
}

View File

@ -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;
}