Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve swap #134

Merged
merged 6 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions app/src/apdu_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 0 additions & 2 deletions app/src/common/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions app/src/swap/handle_check_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@


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;
}

// Reset result
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};
Expand Down
2 changes: 1 addition & 1 deletion deps/ledger-zxlib
Binary file modified tests_zemu/snapshots/fl-mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-mainmenu/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-mainmenu/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-mainmenu/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/st-mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/st-mainmenu/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/st-mainmenu/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/st-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/x-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/x-mainmenu/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading