Skip to content

Commit

Permalink
Test, fix, and simplify ATR parsing
Browse files Browse the repository at this point in the history
Added
-----

* Add `ATR.py` test cases. Code coverage of `ATR.py` is now 100%
* Add type annotations to everything in `ATR.py`.

Changed
-------

* `SmartcardException` will be raised if the ATR is less than 2 bytes.

Fixed
-----

* The ATR `checksumOK` attribute is now guaranteed to exist.
  If there is no checksum, `checksumOK` will be set to `None`.

  Previously, the attribute would only exist if a checksum existed.

* The checksum byte will now always be rendered if it exists.

  Previously, if the checksum byte was `0x00`, it would not be rendered.

Removed
-------

* Remove the `__main__` code in `ATR.py`.

  All of the ATRs are present in the test suite.

Deprecated
----------

* The ATR hasTA/hasTB/hasTC/hasTD attributes are deprecated.

  Users may compare items in the TA/TB/TC/TD attributes to `None`.

* The ATR `dump()` method is deprecated.

  Users may call the new `render()` method and print the result.
  • Loading branch information
kurtmckee committed Oct 20, 2024
1 parent 099a282 commit affdbd3
Show file tree
Hide file tree
Showing 2 changed files with 485 additions and 261 deletions.
Loading

0 comments on commit affdbd3

Please sign in to comment.