legacy: get next u2f counter

pull/700/head
Tomas Susanka 5 years ago
parent 23c4b97e48
commit 499eb8e628

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

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

Loading…
Cancel
Save