mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 23:48:12 +00:00
better UI for layoutSignMessage, layoutVerifyMessage and layoutCipherKeyValue
This commit is contained in:
parent
a6105fbcb8
commit
e9fd756daa
@ -518,6 +518,7 @@ void fsm_msgSignMessage(SignMessage *msg)
|
||||
fsm_deriveKey(node, msg->address_n, msg->address_n_count);
|
||||
|
||||
ecdsa_get_address(node->public_key, coin->address_type, resp->address);
|
||||
layoutProgressSwipe("Signing", 0, 0);
|
||||
if (transactionMessageSign(msg->message.bytes, msg->message.size, node->private_key, resp->address, resp->signature.bytes)) {
|
||||
resp->has_address = true;
|
||||
resp->has_signature = true;
|
||||
@ -532,6 +533,7 @@ void fsm_msgSignMessage(SignMessage *msg)
|
||||
void fsm_msgVerifyMessage(VerifyMessage *msg)
|
||||
{
|
||||
const char *address = msg->has_address ? msg->address : 0;
|
||||
layoutProgressSwipe("Verifying", 0, 0);
|
||||
if (msg->signature.size == 65 && transactionMessageVerify(msg->message.bytes, msg->message.size, msg->signature.bytes, address)) {
|
||||
layoutVerifyMessage(msg->message.bytes, msg->message.size);
|
||||
protectButton(ButtonRequestType_ButtonRequest_Other, true);
|
||||
|
@ -185,9 +185,9 @@ void layoutSignMessage(const uint8_t *msg, uint32_t len)
|
||||
}
|
||||
}
|
||||
|
||||
layoutDialogSwipe(DIALOG_ICON_QUESTION, "Cancel", "Confirm", NULL,
|
||||
layoutDialogSwipe(DIALOG_ICON_QUESTION, "Cancel", "Confirm",
|
||||
ascii ? "Sign text message?" : "Sign binary message?",
|
||||
str[0], str[1], str[2], str[3], NULL);
|
||||
str[0], str[1], str[2], str[3], NULL, NULL);
|
||||
}
|
||||
|
||||
void layoutVerifyMessage(const uint8_t *msg, uint32_t len)
|
||||
@ -227,9 +227,9 @@ void layoutVerifyMessage(const uint8_t *msg, uint32_t len)
|
||||
}
|
||||
}
|
||||
|
||||
layoutDialogSwipe(DIALOG_ICON_INFO, NULL, "OK", NULL,
|
||||
ascii ? "Message contents:" : "Bin message contents:",
|
||||
str[0], str[1], str[2], str[3], NULL);
|
||||
layoutDialogSwipe(DIALOG_ICON_INFO, NULL, "OK",
|
||||
ascii ? "Message contents" : "Binary message contents",
|
||||
str[0], str[1], str[2], str[3], NULL, NULL);
|
||||
}
|
||||
|
||||
void layoutCipherKeyValue(bool encrypt, const char *key)
|
||||
@ -247,7 +247,7 @@ void layoutCipherKeyValue(bool encrypt, const char *key)
|
||||
if (len > 48) {
|
||||
strlcpy(str[3], (char *)key + 48, 17);
|
||||
}
|
||||
layoutDialogSwipe(DIALOG_ICON_QUESTION, "Cancel", "Confirm", NULL,
|
||||
layoutDialogSwipe(DIALOG_ICON_QUESTION, "Cancel", "Confirm",
|
||||
encrypt ? "Encrypt?" : "Decrypt?",
|
||||
str[0], str[1], str[2], str[3], NULL);
|
||||
str[0], str[1], str[2], str[3], NULL, NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user