mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-22 05:10:56 +00:00
parent
1bc1bb1e77
commit
e019ab5557
@ -210,6 +210,23 @@ static HDNode *fsm_getDerivedNode(const char *curve, const uint32_t *address_n,
|
|||||||
return &node;
|
return &node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool fsm_layoutAddress(const char *address, const char *desc, bool ignorecase, const uint32_t *address_n, size_t address_n_count)
|
||||||
|
{
|
||||||
|
bool qrcode = false;
|
||||||
|
for (;;) {
|
||||||
|
layoutAddress(address, desc, qrcode, ignorecase, address_n, address_n_count);
|
||||||
|
if (protectButton(ButtonRequestType_ButtonRequest_Address, false)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (protectAbortedByInitialize) {
|
||||||
|
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
||||||
|
layoutHome();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
qrcode = !qrcode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void fsm_msgInitialize(Initialize *msg)
|
void fsm_msgInitialize(Initialize *msg)
|
||||||
{
|
{
|
||||||
(void)msg;
|
(void)msg;
|
||||||
@ -795,13 +812,8 @@ void fsm_msgGetAddress(GetAddress *msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool qrcode = false;
|
if (!fsm_layoutAddress(address, desc, msg->script_type == InputScriptType_SPENDWITNESS, msg->address_n, msg->address_n_count)) {
|
||||||
for (;;) {
|
return;
|
||||||
layoutAddress(address, desc, qrcode, msg->script_type == InputScriptType_SPENDWITNESS, msg->address_n, msg->address_n_count);
|
|
||||||
if (protectButton(ButtonRequestType_ButtonRequest_Address, false)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
qrcode = !qrcode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -833,13 +845,8 @@ void fsm_msgEthereumGetAddress(EthereumGetAddress *msg)
|
|||||||
char address[43] = { '0', 'x' };
|
char address[43] = { '0', 'x' };
|
||||||
ethereum_address_checksum(resp->address.bytes, address + 2);
|
ethereum_address_checksum(resp->address.bytes, address + 2);
|
||||||
|
|
||||||
bool qrcode = false;
|
if (!fsm_layoutAddress(address, desc, false, msg->address_n, msg->address_n_count)) {
|
||||||
for (;;) {
|
return;
|
||||||
layoutAddress(address, desc, qrcode, false, msg->address_n, msg->address_n_count);
|
|
||||||
if (protectButton(ButtonRequestType_ButtonRequest_Address, false)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
qrcode = !qrcode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1256,13 +1263,8 @@ void fsm_msgNEMGetAddress(NEMGetAddress *msg)
|
|||||||
strlcpy(desc, network, sizeof(desc));
|
strlcpy(desc, network, sizeof(desc));
|
||||||
strlcat(desc, ":", sizeof(desc));
|
strlcat(desc, ":", sizeof(desc));
|
||||||
|
|
||||||
bool qrcode = false;
|
if (!fsm_layoutAddress(resp->address, desc, true, msg->address_n, msg->address_n_count)) {
|
||||||
for (;;) {
|
return;
|
||||||
layoutAddress(resp->address, desc, qrcode, true, msg->address_n, msg->address_n_count);
|
|
||||||
if (protectButton(ButtonRequestType_ButtonRequest_Address, false)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
qrcode = !qrcode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user