mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-24 15:28:10 +00:00
legacy: get next u2f counter
This commit is contained in:
parent
23c4b97e48
commit
499eb8e628
@ -65,6 +65,7 @@ void fsm_msgApplyFlags(const ApplyFlags *msg);
|
|||||||
void fsm_msgRecoveryDevice(const RecoveryDevice *msg);
|
void fsm_msgRecoveryDevice(const RecoveryDevice *msg);
|
||||||
void fsm_msgWordAck(const WordAck *msg);
|
void fsm_msgWordAck(const WordAck *msg);
|
||||||
void fsm_msgSetU2FCounter(const SetU2FCounter *msg);
|
void fsm_msgSetU2FCounter(const SetU2FCounter *msg);
|
||||||
|
void fsm_msgGetNextU2FCounter(void);
|
||||||
|
|
||||||
// coin
|
// coin
|
||||||
void fsm_msgGetPublicKey(const GetPublicKey *msg);
|
void fsm_msgGetPublicKey(const GetPublicKey *msg);
|
||||||
|
@ -430,3 +430,21 @@ void fsm_msgSetU2FCounter(const SetU2FCounter *msg) {
|
|||||||
fsm_sendSuccess(_("U2F counter set"));
|
fsm_sendSuccess(_("U2F counter set"));
|
||||||
layoutHome();
|
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…
Reference in New Issue
Block a user