mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-20 11:32:04 +00:00
ethereum: support full range 32bit chain_id (#399)
This commit is contained in:
parent
809e313beb
commit
d114665da7
@ -202,7 +202,9 @@ static void send_signature(void)
|
|||||||
msg_tx_request.has_data_length = false;
|
msg_tx_request.has_data_length = false;
|
||||||
|
|
||||||
msg_tx_request.has_signature_v = true;
|
msg_tx_request.has_signature_v = true;
|
||||||
if (chain_id) {
|
if (chain_id > MAX_CHAIN_ID) {
|
||||||
|
msg_tx_request.signature_v = v;
|
||||||
|
} else if (chain_id) {
|
||||||
msg_tx_request.signature_v = v + 2 * chain_id + 35;
|
msg_tx_request.signature_v = v + 2 * chain_id + 35;
|
||||||
} else {
|
} else {
|
||||||
msg_tx_request.signature_v = v + 27;
|
msg_tx_request.signature_v = v + 27;
|
||||||
@ -464,7 +466,7 @@ void ethereum_signing_init(EthereumSignTx *msg, const HDNode *node)
|
|||||||
|
|
||||||
/* eip-155 chain id */
|
/* eip-155 chain id */
|
||||||
if (msg->has_chain_id) {
|
if (msg->has_chain_id) {
|
||||||
if (msg->chain_id < 1 || msg->chain_id > MAX_CHAIN_ID) {
|
if (msg->chain_id < 1) {
|
||||||
fsm_sendFailure(Failure_FailureType_Failure_DataError, _("Chain Id out of bounds"));
|
fsm_sendFailure(Failure_FailureType_Failure_DataError, _("Chain Id out of bounds"));
|
||||||
ethereum_signing_abort();
|
ethereum_signing_abort();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user