Skip to content

Commit

Permalink
Merge pull request #104 from LedgerHQ/small-fixes
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
agrojean-ledger authored Nov 20, 2023
2 parents c40e21e + edad71b commit 8464a2c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
9 changes: 0 additions & 9 deletions src/ui/bagl_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,6 @@ int ui_display_address() {
G_context.state = STATE_NONE;
return io_send_sw(SW_BAD_STATE);
}

char bip32_path[60] = {0};
if (!bip32_path_format(G_context.bip32_path,
G_context.bip32_path_len,
bip32_path,
sizeof(bip32_path))) {
return io_send_sw(SW_DISPLAY_BIP32_PATH_FAIL);
}

memset(g_address, 0, sizeof(g_address));
uint8_t address[ADDRESS_LEN] = {0};
if (!address_from_pubkey(G_context.pk_info.raw_public_key, address, sizeof(address))) {
Expand Down
9 changes: 0 additions & 9 deletions src/ui/nbgl_display_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ int ui_display_address() {
G_context.state = STATE_NONE;
return io_send_sw(SW_BAD_STATE);
}

char bip32_path[60] = {0};
if (!bip32_path_format(G_context.bip32_path,
G_context.bip32_path_len,
bip32_path,
sizeof(bip32_path))) {
return io_send_sw(SW_DISPLAY_BIP32_PATH_FAIL);
}

memset(g_address, 0, sizeof(g_address));
uint8_t address[ADDRESS_LEN] = {0};
if (!address_from_pubkey(G_context.pk_info.raw_public_key, address, sizeof(address))) {
Expand Down
6 changes: 3 additions & 3 deletions tests/test_error_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ def test_wrong_p1p2(backend):

# Ensure the app returns an error when a bad data length is used
def test_wrong_data_length(backend):
# APDUs must be at least 5 bytes: CLA, INS, P1, P2, Lc.
# APDUs must be at least 4 bytes: CLA, INS, P1, P2.
with pytest.raises(ExceptionRAPDU) as e:
backend.exchange_raw(b"E0030000")
backend.exchange_raw(bytes.fromhex("E00300"))
assert e.value.status == Errors.SW_WRONG_DATA_LENGTH
# APDUs advertises a too long length
with pytest.raises(ExceptionRAPDU) as e:
backend.exchange_raw(b"E003000005")
backend.exchange_raw(bytes.fromhex("E003000005"))
assert e.value.status == Errors.SW_WRONG_DATA_LENGTH


Expand Down

0 comments on commit 8464a2c

Please sign in to comment.