Skip to content

Commit

Permalink
fix(legacy): make use of Ethereum required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
matejcik committed Sep 2, 2021
1 parent fbdd218 commit 9079d2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 1 addition & 5 deletions legacy/firmware/ethereum.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,6 @@ static void layoutEthereumFee(const uint8_t *value, uint32_t value_len,
*/

static bool ethereum_signing_check(const EthereumSignTx *msg) {
if (!msg->has_gas_price || !msg->has_gas_limit) {
return false;
}

size_t tolen = msg->has_to ? strlen(msg->to) : 0;

if (tolen != 42 && tolen != 40 && tolen != 0) {
Expand Down Expand Up @@ -589,7 +585,7 @@ void ethereum_signing_txack(const EthereumTxAck *tx) {
return;
}

if (data_left > 0 && (!tx->has_data_chunk || tx->data_chunk.size == 0)) {
if (data_left > 0 && tx->data_chunk.size == 0) {
fsm_sendFailure(FailureType_Failure_DataError,
_("Empty data chunk received"));
ethereum_signing_abort();
Expand Down
3 changes: 0 additions & 3 deletions legacy/firmware/fsm_msg_ethereum.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ void fsm_msgEthereumSignMessage(const EthereumSignMessage *msg) {
}

void fsm_msgEthereumVerifyMessage(const EthereumVerifyMessage *msg) {
CHECK_PARAM(msg->has_address, _("No address provided"));
CHECK_PARAM(msg->has_message, _("No message provided"));

if (ethereum_message_verify(msg) != 0) {
fsm_sendFailure(FailureType_Failure_DataError, _("Invalid signature"));
return;
Expand Down

0 comments on commit 9079d2f

Please sign in to comment.