mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-27 01:48:17 +00:00
refactor u2f dialogs into a separate function
This commit is contained in:
parent
ad2bab0186
commit
041eaa5e4b
@ -335,3 +335,7 @@ void layoutSignIdentity(const IdentityType *identity, const char *challenge)
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
void layoutU2FDialog(const char *verb, const char *appid) {
|
||||
layoutDialog(DIALOG_ICON_QUESTION, "Cancel", verb, NULL, verb, "U2F security key?", "", appid, "", NULL);
|
||||
}
|
||||
|
@ -40,5 +40,6 @@ void layoutDecryptMessage(const uint8_t *msg, uint32_t len, const char *address)
|
||||
void layoutAddress(const char *address, const char *desc);
|
||||
void layoutPublicKey(const uint8_t *pubkey);
|
||||
void layoutSignIdentity(const IdentityType *identity, const char *challenge);
|
||||
void layoutU2FDialog(const char *verb, const char *appid);
|
||||
|
||||
#endif
|
||||
|
@ -568,9 +568,7 @@ void u2f_register(const APDU *a)
|
||||
// error: testof-user-presence is required
|
||||
send_u2f_error(U2F_SW_CONDITIONS_NOT_SATISFIED);
|
||||
buttonUpdate(); // Clear button state
|
||||
layoutDialog(DIALOG_ICON_QUESTION, "Cancel", "Register",
|
||||
NULL, "Register U2F", "security key",
|
||||
"", getReadableAppId(req->appId), "", NULL);
|
||||
layoutU2FDialog("Register", getReadableAppId(req->appId));
|
||||
dialog_timeout = U2F_TIMEOUT;
|
||||
last_req_state = REG;
|
||||
return;
|
||||
@ -701,9 +699,7 @@ void u2f_authenticate(const APDU *a)
|
||||
// error: testof-user-presence is required
|
||||
send_u2f_error(U2F_SW_CONDITIONS_NOT_SATISFIED);
|
||||
buttonUpdate(); // Clear button state
|
||||
layoutDialog(DIALOG_ICON_QUESTION, "Cancel", "Authenticate", NULL,
|
||||
"Authenticate U2F", "security key",
|
||||
"", getReadableAppId(req->appId), "", NULL);
|
||||
layoutU2FDialog("Authenticate", getReadableAppId(req->appId));
|
||||
dialog_timeout = U2F_TIMEOUT;
|
||||
last_req_state = AUTH;
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user