1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-13 19:18:56 +00:00

legacy: get next u2f counter

This commit is contained in:
Tomas Susanka 2019-11-12 15:47:50 +00:00
parent 23c4b97e48
commit 499eb8e628
2 changed files with 19 additions and 0 deletions

View File

@ -65,6 +65,7 @@ void fsm_msgApplyFlags(const ApplyFlags *msg);
void fsm_msgRecoveryDevice(const RecoveryDevice *msg);
void fsm_msgWordAck(const WordAck *msg);
void fsm_msgSetU2FCounter(const SetU2FCounter *msg);
void fsm_msgGetNextU2FCounter(void);
// coin
void fsm_msgGetPublicKey(const GetPublicKey *msg);

View File

@ -430,3 +430,21 @@ void fsm_msgSetU2FCounter(const SetU2FCounter *msg) {
fsm_sendSuccess(_("U2F counter set"));
layoutHome();
}
void fsm_msgGetNextU2FCounter() {
layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), NULL,
_("Do you want to"), _("increase and retrieve"),
_("the U2F counter?"), NULL, NULL, NULL);
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) {
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
layoutHome();
return;
}
uint32_t counter = config_nextU2FCounter();
RESP_INIT(NextU2FCounter);
resp->has_u2f_counter = true;
resp->u2f_counter = counter;
msg_write(MessageType_MessageType_NextU2FCounter, resp);
layoutHome();
}