@@ -319,13 +319,14 @@ static int strcasecmp_workaround(const char *str1, const char *str2) {
319
319
return 0 ;
320
320
}
321
321
322
- void finalizeParsing (bool direct ) {
322
+ __attribute__(( noinline )) static void finalize_parsing_helper (bool direct , bool * use_standard_UI ) {
323
323
char displayBuffer [50 ];
324
324
uint8_t decimals = WEI_TO_ETHER ;
325
325
uint64_t chain_id = get_tx_chain_id ();
326
326
const char * ticker = get_displayable_ticker (& chain_id );
327
327
ethPluginFinalize_t pluginFinalize ;
328
- bool use_standard_UI = true;
328
+
329
+ * use_standard_UI = true;
329
330
330
331
// Verify the chain
331
332
if (chainConfig -> chainId != ETHEREUM_MAINNET_CHAINID ) {
@@ -396,7 +397,7 @@ void finalizeParsing(bool direct) {
396
397
switch (pluginFinalize .uiType ) {
397
398
case ETH_UI_TYPE_GENERIC :
398
399
// Use the dedicated ETH plugin UI
399
- use_standard_UI = false;
400
+ * use_standard_UI = false;
400
401
tmpContent .txContent .dataPresent = false;
401
402
// Add the number of screens + the number of additional screens to get the total
402
403
// number of screens needed.
@@ -405,7 +406,7 @@ void finalizeParsing(bool direct) {
405
406
break ;
406
407
case ETH_UI_TYPE_AMOUNT_ADDRESS :
407
408
// Use the standard ETH UI as this plugin uses the amount/address UI
408
- use_standard_UI = true;
409
+ * use_standard_UI = true;
409
410
tmpContent .txContent .dataPresent = false;
410
411
if ((pluginFinalize .amount == NULL ) || (pluginFinalize .address == NULL )) {
411
412
PRINTF ("Incorrect amount/address set by plugin\n" );
@@ -443,7 +444,7 @@ void finalizeParsing(bool direct) {
443
444
}
444
445
445
446
// User has just validated a swap but ETH received apdus about a non standard plugin / contract
446
- if (G_called_from_swap && !use_standard_UI ) {
447
+ if (G_called_from_swap && !* use_standard_UI ) {
447
448
PRINTF ("ERR_SILENT_MODE_CHECK_FAILED, G_called_from_swap\n" );
448
449
THROW (ERR_SILENT_MODE_CHECK_FAILED );
449
450
}
@@ -457,7 +458,7 @@ void finalizeParsing(bool direct) {
457
458
}
458
459
459
460
// Prepare destination address and amount to display
460
- if (use_standard_UI ) {
461
+ if (* use_standard_UI ) {
461
462
// Format the address in a temporary buffer, if in swap case compare it with validated
462
463
// address, else commit it
463
464
address_to_string (tmpContent .txContent .destination ,
@@ -532,11 +533,14 @@ void finalizeParsing(bool direct) {
532
533
// Prepare network field
533
534
get_network_as_string (strings .common .network_name , sizeof (strings .common .network_name ));
534
535
PRINTF ("Network: %s\n" , strings .common .network_name );
536
+ }
535
537
538
+ void finalizeParsing (bool direct ) {
539
+ bool use_standard_UI ;
536
540
bool no_consent_check ;
537
-
538
- // If called from swap, the user as already validated a standard transaction
539
- // We have already checked the fields of this transaction above
541
+ finalize_parsing_helper ( direct , & use_standard_UI );
542
+ // If called from swap, the user has already validated a standard transaction
543
+ // And we have already checked the fields of this transaction above
540
544
no_consent_check = G_called_from_swap && use_standard_UI ;
541
545
542
546
#ifdef NO_CONSENT
0 commit comments