Merge pull request #618 from LedgerHQ/develop

App release 1.11.1
This commit is contained in:
apaillier-ledger
2024-07-26 16:06:29 +02:00
committed by GitHub
7 changed files with 14 additions and 64 deletions

View File

@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [1.11.1](https://github.com/ledgerhq/app-ethereum/compare/1.11.0...1.11.1) - 2024-07-26
### Fixed
- (network/clone) Wanchain
- Refusal of EIP-712 messages after another transaction or message
## [1.11.0](https://github.com/ledgerhq/app-ethereum/compare/1.10.4...1.11.0) - 2024-07-24
### Added

View File

@@ -39,7 +39,7 @@ include ./makefile_conf/chain/$(CHAIN).mk
APPVERSION_M = 1
APPVERSION_N = 11
APPVERSION_P = 0
APPVERSION_P = 1
APPVERSION = $(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)
# Application source files

View File

@@ -103,26 +103,6 @@ static void processAccessList(txContext_t *context) {
}
}
static void processType(txContext_t *context) {
if (context->currentFieldIsList) {
PRINTF("Invalid type for RLP_TYPE\n");
THROW(EXCEPTION);
}
if (context->currentFieldLength > MAX_INT256) {
PRINTF("Invalid length for RLP_TYPE\n");
THROW(EXCEPTION);
}
if (context->currentFieldPos < context->currentFieldLength) {
uint32_t copySize =
MIN(context->commandLength, context->currentFieldLength - context->currentFieldPos);
copyTxData(context, NULL, copySize);
}
if (context->currentFieldPos == context->currentFieldLength) {
context->currentField++;
context->processingField = false;
}
}
static void processChainID(txContext_t *context) {
if (context->currentFieldIsList) {
PRINTF("Invalid type for RLP_CHAINID\n");
@@ -321,14 +301,6 @@ static bool processEIP1559Tx(txContext_t *context) {
switch (context->currentField) {
case EIP1559_RLP_CONTENT: {
processContent(context);
if ((context->processingFlags & TX_FLAG_TYPE) == 0) {
context->currentField++;
}
break;
}
// This gets hit only by Wanchain
case EIP1559_RLP_TYPE: {
processType(context);
break;
}
case EIP1559_RLP_CHAINID: {
@@ -377,13 +349,6 @@ static bool processEIP2930Tx(txContext_t *context) {
switch (context->currentField) {
case EIP2930_RLP_CONTENT:
processContent(context);
if ((context->processingFlags & TX_FLAG_TYPE) == 0) {
context->currentField++;
}
break;
// This gets hit only by Wanchain
case EIP2930_RLP_TYPE:
processType(context);
break;
case EIP2930_RLP_CHAINID:
processChainID(context);
@@ -420,13 +385,6 @@ static bool processLegacyTx(txContext_t *context) {
switch (context->currentField) {
case LEGACY_RLP_CONTENT:
processContent(context);
if ((context->processingFlags & TX_FLAG_TYPE) == 0) {
context->currentField++;
}
break;
// This gets hit only by Wanchain
case LEGACY_RLP_TYPE:
processType(context);
break;
case LEGACY_RLP_NONCE:
processNonce(context);
@@ -592,16 +550,12 @@ static parserStatus_e processTxInternal(txContext_t *context) {
PRINTF("end of here\n");
}
parserStatus_e processTx(txContext_t *context,
const uint8_t *buffer,
uint32_t length,
uint32_t processingFlags) {
parserStatus_e processTx(txContext_t *context, const uint8_t *buffer, uint32_t length) {
parserStatus_e result;
BEGIN_TRY {
TRY {
context->workBuffer = buffer;
context->commandLength = length;
context->processingFlags = processingFlags;
result = processTxInternal(context);
PRINTF("result: %d\n", result);
}

View File

@@ -36,8 +36,6 @@ typedef enum customStatus_e {
typedef customStatus_e (*ustreamProcess_t)(struct txContext_t *context);
#define TX_FLAG_TYPE 0x01
// First variant of every Tx enum.
#define RLP_NONE 0
@@ -49,7 +47,6 @@ typedef customStatus_e (*ustreamProcess_t)(struct txContext_t *context);
typedef enum rlpLegacyTxField_e {
LEGACY_RLP_NONE = RLP_NONE,
LEGACY_RLP_CONTENT,
LEGACY_RLP_TYPE, // For wanchain
LEGACY_RLP_NONCE,
LEGACY_RLP_GASPRICE,
LEGACY_RLP_STARTGAS,
@@ -65,7 +62,6 @@ typedef enum rlpLegacyTxField_e {
typedef enum rlpEIP2930TxField_e {
EIP2930_RLP_NONE = RLP_NONE,
EIP2930_RLP_CONTENT,
EIP2930_RLP_TYPE, // For wanchain
EIP2930_RLP_CHAINID,
EIP2930_RLP_NONCE,
EIP2930_RLP_GASPRICE,
@@ -80,7 +76,6 @@ typedef enum rlpEIP2930TxField_e {
typedef enum rlpEIP1559TxField_e {
EIP1559_RLP_NONE = RLP_NONE,
EIP1559_RLP_CONTENT,
EIP1559_RLP_TYPE, // For wanchain
EIP1559_RLP_CHAINID,
EIP1559_RLP_NONCE,
EIP1559_RLP_MAX_PRIORITY_FEE_PER_GAS,
@@ -125,7 +120,6 @@ typedef struct txContext_t {
uint32_t rlpBufferPos;
const uint8_t *workBuffer;
uint32_t commandLength;
uint32_t processingFlags;
ustreamProcess_t customProcessor;
txContent_t *content;
void *extra;
@@ -137,10 +131,7 @@ void initTx(txContext_t *context,
txContent_t *content,
ustreamProcess_t customProcessor,
void *extra);
parserStatus_e processTx(txContext_t *context,
const uint8_t *buffer,
uint32_t length,
uint32_t processingFlags);
parserStatus_e processTx(txContext_t *context, const uint8_t *buffer, uint32_t length);
parserStatus_e continueTx(txContext_t *context);
void copyTxData(txContext_t *context, uint8_t *out, uint32_t length);
uint8_t readTxByte(txContext_t *context);

View File

@@ -51,6 +51,7 @@ static const network_info_t NETWORK_MAPPING[] = {
{.chain_id = 336, .name = "Shiden", .ticker = "SDN"},
{.chain_id = 369, .name = "PulseChain", .ticker = "PLS"},
{.chain_id = 592, .name = "Astar", .ticker = "ASTR"},
{.chain_id = 888, .name = "Wanchain", .ticker = "WAN"},
{.chain_id = 1030, .name = "Conflux", .ticker = "CFX"},
{.chain_id = 1088, .name = "Metis Andromeda", .ticker = "METIS"},
{.chain_id = 1101, .name = "Polygon zkEVM", .ticker = "ETH"},

View File

@@ -177,8 +177,7 @@ e_eip712_nfs ui_712_next_field(void) {
handle_eip712_return_code(true);
state = EIP712_FIELD_INCOMING;
// So that later when we append to them, we start from an empty string
explicit_bzero(strings.tmp.tmp, sizeof(strings.tmp.tmp));
explicit_bzero(strings.tmp.tmp2, sizeof(strings.tmp.tmp2));
explicit_bzero(&strings, sizeof(strings));
}
}
return state;
@@ -622,6 +621,7 @@ bool ui_712_init(void) {
if ((ui_ctx = MEM_ALLOC_AND_ALIGN_TYPE(*ui_ctx))) {
explicit_bzero(ui_ctx, sizeof(*ui_ctx));
ui_ctx->filtering_mode = EIP712_FILTERING_BASIC;
explicit_bzero(&strings, sizeof(strings));
} else {
apdu_response_code = APDU_RESPONSE_INSUFFICIENT_MEMORY;
}

View File

@@ -69,10 +69,7 @@ void handleSign(uint8_t p1,
PRINTF("Parser not initialized\n");
THROW(0x6985);
}
txResult = processTx(&txContext,
workBuffer,
dataLength,
(chainConfig->chainId == 888 ? TX_FLAG_TYPE : 0)); // Wanchain exception
txResult = processTx(&txContext, workBuffer, dataLength);
switch (txResult) {
case USTREAM_SUSPENDED:
break;