Skip to content

Commit ee10ca2

Browse files
Merge pull request #544 from LedgerHQ/fix/apa/blind_signing_regression
Fix blind-signing regression
2 parents a76940b + 30067d6 commit ee10ca2

File tree

18 files changed

+814
-556
lines changed

18 files changed

+814
-556
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ 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.10.4](https://github.com/ledgerhq/app-ethereum/compare/1.10.3...1.10.4) - 2023-02-16
8+
## [1.10.4](https://github.com/ledgerhq/app-ethereum/compare/1.10.3...1.10.4) - 2023-03-08
99

1010
### Added
1111

src_features/signTx/logic_signTx.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,13 @@ static int strcasecmp_workaround(const char *str1, const char *str2) {
316316
return 0;
317317
}
318318

319-
__attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool *use_standard_UI) {
319+
__attribute__((noinline)) static bool finalize_parsing_helper(bool direct, bool *use_standard_UI) {
320320
char displayBuffer[50];
321321
uint8_t decimals = WEI_TO_ETHER;
322322
uint64_t chain_id = get_tx_chain_id();
323323
const char *ticker = get_displayable_ticker(&chain_id, chainConfig);
324324
ethPluginFinalize_t pluginFinalize;
325325

326-
*use_standard_UI = true;
327-
328326
// Verify the chain
329327
if (chainConfig->chainId != ETHEREUM_MAINNET_CHAINID) {
330328
uint64_t id = get_tx_chain_id();
@@ -334,7 +332,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
334332
reset_app_context();
335333
reportFinalizeError(direct);
336334
if (!direct) {
337-
return;
335+
return false;
338336
}
339337
}
340338
}
@@ -358,7 +356,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
358356
PRINTF("Plugin finalize call failed\n");
359357
reportFinalizeError(direct);
360358
if (!direct) {
361-
return;
359+
return false;
362360
}
363361
}
364362
// Lookup tokens if requested
@@ -384,7 +382,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
384382
PRINTF("Plugin provide token call failed\n");
385383
reportFinalizeError(direct);
386384
if (!direct) {
387-
return;
385+
return false;
388386
}
389387
}
390388
pluginFinalize.result = pluginProvideInfo.result;
@@ -409,7 +407,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
409407
PRINTF("Incorrect amount/address set by plugin\n");
410408
reportFinalizeError(direct);
411409
if (!direct) {
412-
return;
410+
return false;
413411
}
414412
}
415413
memmove(tmpContent.txContent.value.value, pluginFinalize.amount, 32);
@@ -425,7 +423,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
425423
PRINTF("ui type %d not supported\n", pluginFinalize.uiType);
426424
reportFinalizeError(direct);
427425
if (!direct) {
428-
return;
426+
return false;
429427
}
430428
}
431429
}
@@ -450,7 +448,7 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
450448
reportFinalizeError(direct);
451449
ui_warning_contract_data();
452450
if (!direct) {
453-
return;
451+
return false;
454452
}
455453
}
456454

@@ -530,12 +528,16 @@ __attribute__((noinline)) static void finalize_parsing_helper(bool direct, bool
530528
// Prepare network field
531529
get_network_as_string(strings.common.network_name, sizeof(strings.common.network_name));
532530
PRINTF("Network: %s\n", strings.common.network_name);
531+
return true;
533532
}
534533

535534
void finalizeParsing(bool direct) {
536-
bool use_standard_UI;
535+
bool use_standard_UI = true;
537536
bool no_consent_check;
538-
finalize_parsing_helper(direct, &use_standard_UI);
537+
538+
if (!finalize_parsing_helper(direct, &use_standard_UI)) {
539+
return;
540+
}
539541
// If called from swap, the user has already validated a standard transaction
540542
// And we have already checked the fields of this transaction above
541543
no_consent_check = G_called_from_swap && use_standard_UI;

0 commit comments

Comments
 (0)