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

Small fixes #104

Merged
merged 2 commits into from
Nov 20, 2023
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
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
Loading