From 072ca020cfcd767b15a1b617adfb76bbc9b01fd7 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 23 May 2016 19:36:28 +0100 Subject: [PATCH] Clarify field limits in EthereumSignTx --- protob/messages.proto | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/protob/messages.proto b/protob/messages.proto index 67356edf86..8a07ccf34d 100644 --- a/protob/messages.proto +++ b/protob/messages.proto @@ -592,6 +592,7 @@ message TxAck { /** * Request: Ask device to sign transaction * All fields are optional from the protocol's point of view. Each field defaults to value `0` if missing. + * Note: the first at most 1024 bytes of data MUST be transmitted as part of this message. * @next PassphraseRequest * @next PinMatrixRequest * @next EthereumTxRequest @@ -599,11 +600,11 @@ message TxAck { */ message EthereumSignTx { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node - optional bytes nonce = 2; // 256 bit unsigned big endian - optional bytes gas_price = 3; // 256 bit unsigned big endian (in wei) - optional bytes gas_limit = 4; // 256 bit unsigned big endian + optional bytes nonce = 2; // <=256 bit unsigned big endian + optional bytes gas_price = 3; // <=256 bit unsigned big endian (in wei) + optional bytes gas_limit = 4; // <=256 bit unsigned big endian optional bytes to = 5; // 160 bit address hash - optional bytes value = 6; // 256 bit unsigned big endian (in wei) + optional bytes value = 6; // <=256 bit unsigned big endian (in wei) optional bytes data_initial_chunk = 7; // The initial data chunk (<= 1024 bytes) optional uint32 data_length = 8; // Length of transaction payload } @@ -611,15 +612,15 @@ message EthereumSignTx { /** * Response: Device asks for more data from transaction payload, or returns the signature. * If data_length is set, device awaits that many more bytes of payload. - * Otherwise, the signature_* fields contain the computed transaction signature. + * Otherwise, the signature_* fields contain the computed transaction signature. All three fields will be present. * @prev EthereumSignTx * @next EthereumTxAck */ message EthereumTxRequest { - optional uint32 data_length = 1; // Number of bytes being requested + optional uint32 data_length = 1; // Number of bytes being requested (<= 1024) optional uint32 signature_v = 2; // Computed signature (recovery parameter, limited to 27 or 28) - optional bytes signature_r = 3; // Computed signature - optional bytes signature_s = 4; // Computed signature + optional bytes signature_r = 3; // Computed signature R component (256 bit) + optional bytes signature_s = 4; // Computed signature S component (256 bit) } /** @@ -628,7 +629,7 @@ message EthereumTxRequest { * @next EthereumTxRequest */ message EthereumTxAck { - optional bytes data_chunk = 1; // Bytes from transaction payload + optional bytes data_chunk = 1; // Bytes from transaction payload (<= 1024 bytes) } ///////////////////////