Skip to content

Commit

Permalink
Remove expectation of leading byte in swap address parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Jan 13, 2025
1 parent 8b29ff0 commit 8163338
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/swap/handle_check_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit 8163338

Please sign in to comment.