Skip to content

Commit 4a21b8a

Browse files
Merge pull request #618 from LedgerHQ/develop
App release 1.11.1
2 parents b18788f + fbca0de commit 4a21b8a

File tree

7 files changed

+14
-64
lines changed

7 files changed

+14
-64
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [1.11.1](https://github.com/ledgerhq/app-ethereum/compare/1.11.0...1.11.1) - 2024-07-26
9+
10+
### Fixed
11+
12+
- (network/clone) Wanchain
13+
- Refusal of EIP-712 messages after another transaction or message
14+
815
## [1.11.0](https://github.com/ledgerhq/app-ethereum/compare/1.10.4...1.11.0) - 2024-07-24
916

1017
### Added

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ include ./makefile_conf/chain/$(CHAIN).mk
3939

4040
APPVERSION_M = 1
4141
APPVERSION_N = 11
42-
APPVERSION_P = 0
42+
APPVERSION_P = 1
4343
APPVERSION = $(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)
4444

4545
# Application source files

src/ethUstream.c

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -103,26 +103,6 @@ static void processAccessList(txContext_t *context) {
103103
}
104104
}
105105

106-
static void processType(txContext_t *context) {
107-
if (context->currentFieldIsList) {
108-
PRINTF("Invalid type for RLP_TYPE\n");
109-
THROW(EXCEPTION);
110-
}
111-
if (context->currentFieldLength > MAX_INT256) {
112-
PRINTF("Invalid length for RLP_TYPE\n");
113-
THROW(EXCEPTION);
114-
}
115-
if (context->currentFieldPos < context->currentFieldLength) {
116-
uint32_t copySize =
117-
MIN(context->commandLength, context->currentFieldLength - context->currentFieldPos);
118-
copyTxData(context, NULL, copySize);
119-
}
120-
if (context->currentFieldPos == context->currentFieldLength) {
121-
context->currentField++;
122-
context->processingField = false;
123-
}
124-
}
125-
126106
static void processChainID(txContext_t *context) {
127107
if (context->currentFieldIsList) {
128108
PRINTF("Invalid type for RLP_CHAINID\n");
@@ -321,14 +301,6 @@ static bool processEIP1559Tx(txContext_t *context) {
321301
switch (context->currentField) {
322302
case EIP1559_RLP_CONTENT: {
323303
processContent(context);
324-
if ((context->processingFlags & TX_FLAG_TYPE) == 0) {
325-
context->currentField++;
326-
}
327-
break;
328-
}
329-
// This gets hit only by Wanchain
330-
case EIP1559_RLP_TYPE: {
331-
processType(context);
332304
break;
333305
}
334306
case EIP1559_RLP_CHAINID: {
@@ -377,13 +349,6 @@ static bool processEIP2930Tx(txContext_t *context) {
377349
switch (context->currentField) {
378350
case EIP2930_RLP_CONTENT:
379351
processContent(context);
380-
if ((context->processingFlags & TX_FLAG_TYPE) == 0) {
381-
context->currentField++;
382-
}
383-
break;
384-
// This gets hit only by Wanchain
385-
case EIP2930_RLP_TYPE:
386-
processType(context);
387352
break;
388353
case EIP2930_RLP_CHAINID:
389354
processChainID(context);
@@ -420,13 +385,6 @@ static bool processLegacyTx(txContext_t *context) {
420385
switch (context->currentField) {
421386
case LEGACY_RLP_CONTENT:
422387
processContent(context);
423-
if ((context->processingFlags & TX_FLAG_TYPE) == 0) {
424-
context->currentField++;
425-
}
426-
break;
427-
// This gets hit only by Wanchain
428-
case LEGACY_RLP_TYPE:
429-
processType(context);
430388
break;
431389
case LEGACY_RLP_NONCE:
432390
processNonce(context);
@@ -592,16 +550,12 @@ static parserStatus_e processTxInternal(txContext_t *context) {
592550
PRINTF("end of here\n");
593551
}
594552

595-
parserStatus_e processTx(txContext_t *context,
596-
const uint8_t *buffer,
597-
uint32_t length,
598-
uint32_t processingFlags) {
553+
parserStatus_e processTx(txContext_t *context, const uint8_t *buffer, uint32_t length) {
599554
parserStatus_e result;
600555
BEGIN_TRY {
601556
TRY {
602557
context->workBuffer = buffer;
603558
context->commandLength = length;
604-
context->processingFlags = processingFlags;
605559
result = processTxInternal(context);
606560
PRINTF("result: %d\n", result);
607561
}

src/ethUstream.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ typedef enum customStatus_e {
3636

3737
typedef customStatus_e (*ustreamProcess_t)(struct txContext_t *context);
3838

39-
#define TX_FLAG_TYPE 0x01
40-
4139
// First variant of every Tx enum.
4240
#define RLP_NONE 0
4341

@@ -49,7 +47,6 @@ typedef customStatus_e (*ustreamProcess_t)(struct txContext_t *context);
4947
typedef enum rlpLegacyTxField_e {
5048
LEGACY_RLP_NONE = RLP_NONE,
5149
LEGACY_RLP_CONTENT,
52-
LEGACY_RLP_TYPE, // For wanchain
5350
LEGACY_RLP_NONCE,
5451
LEGACY_RLP_GASPRICE,
5552
LEGACY_RLP_STARTGAS,
@@ -65,7 +62,6 @@ typedef enum rlpLegacyTxField_e {
6562
typedef enum rlpEIP2930TxField_e {
6663
EIP2930_RLP_NONE = RLP_NONE,
6764
EIP2930_RLP_CONTENT,
68-
EIP2930_RLP_TYPE, // For wanchain
6965
EIP2930_RLP_CHAINID,
7066
EIP2930_RLP_NONCE,
7167
EIP2930_RLP_GASPRICE,
@@ -80,7 +76,6 @@ typedef enum rlpEIP2930TxField_e {
8076
typedef enum rlpEIP1559TxField_e {
8177
EIP1559_RLP_NONE = RLP_NONE,
8278
EIP1559_RLP_CONTENT,
83-
EIP1559_RLP_TYPE, // For wanchain
8479
EIP1559_RLP_CHAINID,
8580
EIP1559_RLP_NONCE,
8681
EIP1559_RLP_MAX_PRIORITY_FEE_PER_GAS,
@@ -125,7 +120,6 @@ typedef struct txContext_t {
125120
uint32_t rlpBufferPos;
126121
const uint8_t *workBuffer;
127122
uint32_t commandLength;
128-
uint32_t processingFlags;
129123
ustreamProcess_t customProcessor;
130124
txContent_t *content;
131125
void *extra;
@@ -137,10 +131,7 @@ void initTx(txContext_t *context,
137131
txContent_t *content,
138132
ustreamProcess_t customProcessor,
139133
void *extra);
140-
parserStatus_e processTx(txContext_t *context,
141-
const uint8_t *buffer,
142-
uint32_t length,
143-
uint32_t processingFlags);
134+
parserStatus_e processTx(txContext_t *context, const uint8_t *buffer, uint32_t length);
144135
parserStatus_e continueTx(txContext_t *context);
145136
void copyTxData(txContext_t *context, uint8_t *out, uint32_t length);
146137
uint8_t readTxByte(txContext_t *context);

src/network.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static const network_info_t NETWORK_MAPPING[] = {
5151
{.chain_id = 336, .name = "Shiden", .ticker = "SDN"},
5252
{.chain_id = 369, .name = "PulseChain", .ticker = "PLS"},
5353
{.chain_id = 592, .name = "Astar", .ticker = "ASTR"},
54+
{.chain_id = 888, .name = "Wanchain", .ticker = "WAN"},
5455
{.chain_id = 1030, .name = "Conflux", .ticker = "CFX"},
5556
{.chain_id = 1088, .name = "Metis Andromeda", .ticker = "METIS"},
5657
{.chain_id = 1101, .name = "Polygon zkEVM", .ticker = "ETH"},

src_features/signMessageEIP712/ui_logic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ e_eip712_nfs ui_712_next_field(void) {
177177
handle_eip712_return_code(true);
178178
state = EIP712_FIELD_INCOMING;
179179
// So that later when we append to them, we start from an empty string
180-
explicit_bzero(strings.tmp.tmp, sizeof(strings.tmp.tmp));
181-
explicit_bzero(strings.tmp.tmp2, sizeof(strings.tmp.tmp2));
180+
explicit_bzero(&strings, sizeof(strings));
182181
}
183182
}
184183
return state;
@@ -622,6 +621,7 @@ bool ui_712_init(void) {
622621
if ((ui_ctx = MEM_ALLOC_AND_ALIGN_TYPE(*ui_ctx))) {
623622
explicit_bzero(ui_ctx, sizeof(*ui_ctx));
624623
ui_ctx->filtering_mode = EIP712_FILTERING_BASIC;
624+
explicit_bzero(&strings, sizeof(strings));
625625
} else {
626626
apdu_response_code = APDU_RESPONSE_INSUFFICIENT_MEMORY;
627627
}

src_features/signTx/cmd_signTx.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ void handleSign(uint8_t p1,
6969
PRINTF("Parser not initialized\n");
7070
THROW(0x6985);
7171
}
72-
txResult = processTx(&txContext,
73-
workBuffer,
74-
dataLength,
75-
(chainConfig->chainId == 888 ? TX_FLAG_TYPE : 0)); // Wanchain exception
72+
txResult = processTx(&txContext, workBuffer, dataLength);
7673
switch (txResult) {
7774
case USTREAM_SUSPENDED:
7875
break;

0 commit comments

Comments
 (0)