diff --git a/app/Makefile.version b/app/Makefile.version index bcc598e2..c14d390f 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=2 # This is the `spec_version` field of `Runtime` APPVERSION_N=36 # This is the patch version of this release -APPVERSION_P=0 +APPVERSION_P=1 diff --git a/app/src/apdu_handler.c b/app/src/apdu_handler.c index e105c7c8..d8ea8b66 100644 --- a/app/src/apdu_handler.c +++ b/app/src/apdu_handler.c @@ -213,6 +213,11 @@ __Z_INLINE void handleSign(volatile uint32_t *flags, volatile uint32_t *tx, uint const int error_msg_length = strnlen(error_msg, sizeof(G_io_apdu_buffer)); MEMCPY(G_io_apdu_buffer, error_msg, error_msg_length); *tx += (error_msg_length); + +#ifdef HAVE_SWAP + // Finalize the transaction with failure status + finalize_exchange_sign_transaction(false); +#endif THROW(APDU_CODE_DATA_INVALID); } diff --git a/app/src/common/main.c b/app/src/common/main.c index e5fffe48..1aa885c0 100644 --- a/app/src/common/main.c +++ b/app/src/common/main.c @@ -104,8 +104,6 @@ __attribute__((section(".boot"))) int main(int arg0) { } #endif } else { - // The app has been launched from the dashboard - // G_swap_state.called_from_swap = false; BEGIN_TRY { TRY diff --git a/app/src/swap/handle_check_address.c b/app/src/swap/handle_check_address.c index abcfcd95..aa694e2b 100644 --- a/app/src/swap/handle_check_address.c +++ b/app/src/swap/handle_check_address.c @@ -23,7 +23,7 @@ void handle_check_address(check_address_parameters_t *params) { - if (params == NULL || params->address_to_check == 0) { + if (params == NULL || params->address_to_check == NULL) { return; } @@ -31,17 +31,17 @@ void handle_check_address(check_address_parameters_t *params) { params->result = 0; // Address parameters have the following structure - // 00 byte |path length (1 byte) | bip32 path (4 * pathLength bytes) + // path length (1 byte) | bip32 path (4 * pathLength bytes) // Get the path uint32_t bip32_path[HDPATH_LEN_DEFAULT] = {0}; - uint8_t bip32_path_length = params->address_parameters[1]; + uint8_t bip32_path_length = params->address_parameters[0]; if (bip32_path_length != HDPATH_LEN_DEFAULT) { return; } for (uint32_t i = 0; i < HDPATH_LEN_DEFAULT; i++) { - readU32BE(params->address_parameters + 2 + (i * 4), &bip32_path[i]); + readU32BE(params->address_parameters + 1 + (i * 4), &bip32_path[i]); } char address_computed[100] = {0}; diff --git a/deps/ledger-zxlib b/deps/ledger-zxlib index fec0d14a..8cbcc06b 160000 --- a/deps/ledger-zxlib +++ b/deps/ledger-zxlib @@ -1 +1 @@ -Subproject commit fec0d14a886c9ce711867022d1eae52e95cdc19b +Subproject commit 8cbcc06bfa901c2b8f3f16c2af4131e5823b8fdf diff --git a/tests_zemu/snapshots/fl-mainmenu/00001.png b/tests_zemu/snapshots/fl-mainmenu/00001.png index d99974e5..e6f1d24b 100644 Binary files a/tests_zemu/snapshots/fl-mainmenu/00001.png and b/tests_zemu/snapshots/fl-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00002.png b/tests_zemu/snapshots/fl-mainmenu/00002.png index d11676f2..02efff58 100644 Binary files a/tests_zemu/snapshots/fl-mainmenu/00002.png and b/tests_zemu/snapshots/fl-mainmenu/00002.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00003.png b/tests_zemu/snapshots/fl-mainmenu/00003.png index d99974e5..e6f1d24b 100644 Binary files a/tests_zemu/snapshots/fl-mainmenu/00003.png and b/tests_zemu/snapshots/fl-mainmenu/00003.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00004.png b/tests_zemu/snapshots/fl-mainmenu/00004.png index 2e16e816..eb069535 100644 Binary files a/tests_zemu/snapshots/fl-mainmenu/00004.png and b/tests_zemu/snapshots/fl-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00004.png b/tests_zemu/snapshots/s-mainmenu/00004.png index f8eaa3ab..90083478 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00004.png and b/tests_zemu/snapshots/s-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00010.png b/tests_zemu/snapshots/s-mainmenu/00010.png index f8eaa3ab..90083478 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00010.png and b/tests_zemu/snapshots/s-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00004.png b/tests_zemu/snapshots/sp-mainmenu/00004.png index 4010934e..a4f87ae6 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00004.png and b/tests_zemu/snapshots/sp-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00010.png b/tests_zemu/snapshots/sp-mainmenu/00010.png index 4010934e..a4f87ae6 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00010.png and b/tests_zemu/snapshots/sp-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00001.png b/tests_zemu/snapshots/st-mainmenu/00001.png index 8970f4ff..760ca878 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00001.png and b/tests_zemu/snapshots/st-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00002.png b/tests_zemu/snapshots/st-mainmenu/00002.png index 3acaa479..fc993f10 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00002.png and b/tests_zemu/snapshots/st-mainmenu/00002.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00003.png b/tests_zemu/snapshots/st-mainmenu/00003.png index 8970f4ff..760ca878 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00003.png and b/tests_zemu/snapshots/st-mainmenu/00003.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00004.png b/tests_zemu/snapshots/st-mainmenu/00004.png index 31a583fb..c817133f 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00004.png and b/tests_zemu/snapshots/st-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00004.png b/tests_zemu/snapshots/x-mainmenu/00004.png index 4010934e..a4f87ae6 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00004.png and b/tests_zemu/snapshots/x-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00010.png b/tests_zemu/snapshots/x-mainmenu/00010.png index 4010934e..a4f87ae6 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00010.png and b/tests_zemu/snapshots/x-mainmenu/00010.png differ