Skip to content

Commit

Permalink
Fix incompatibility with blind sign check
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Aug 23, 2024
1 parent 6c90220 commit 94ae409
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src_features/signTx/logic_signTx.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ __attribute__((noinline)) static bool finalize_parsing_helper(void) {
pluginFinalize.result = pluginProvideInfo.result;
}
if (pluginFinalize.result != ETH_PLUGIN_RESULT_FALLBACK) {
PRINTF("pluginFinalize.result %d successful\n", pluginFinalize.result);
// Handle the right interface
switch (pluginFinalize.uiType) {
case ETH_UI_TYPE_GENERIC:
Expand Down Expand Up @@ -423,6 +424,10 @@ __attribute__((noinline)) static bool finalize_parsing_helper(void) {
report_finalize_error();
return false;
}
} else if (G_swap_mode == SWAP_MODE_CROSSCHAIN_SUCCESS) {
PRINTF("Plugin swap_with_calldata fell back for UI with success\n");
// We are not bling signing, the data has been validated by the plugin
tmpContent.txContent.dataPresent = false;
}
}

Expand All @@ -441,12 +446,6 @@ __attribute__((noinline)) static bool finalize_parsing_helper(void) {
THROW(ERR_SILENT_MODE_CHECK_FAILED);
}

if (tmpContent.txContent.dataPresent && !N_storage.dataAllowed) {
report_finalize_error();
ui_error_blind_signing();
return false;
}

// Specific calldata check when in swap mode
if (G_called_from_swap) {
// Two success cases: we are in standard mode and no calldata was received
Expand All @@ -457,6 +456,13 @@ __attribute__((noinline)) static bool finalize_parsing_helper(void) {
}
}

if (tmpContent.txContent.dataPresent && !N_storage.dataAllowed) {
PRINTF("Data is present but not allowed\n");
report_finalize_error();
ui_error_blind_signing();
return false;
}

// Prepare destination address and amount to display
if (g_use_standard_ui) {
// Format the address in a temporary buffer, if in swap case compare it with validated
Expand Down

0 comments on commit 94ae409

Please sign in to comment.