Skip to content

Commit

Permalink
Fix wrong APDU length test
Browse files Browse the repository at this point in the history
  • Loading branch information
agrojean-ledger committed Nov 20, 2023
1 parent bbff701 commit edad71b
Showing 1 changed file with 3 additions and 3 deletions.
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 edad71b

Please sign in to comment.