Nitrokey / opcard-rs

OpenPGP card implementation
49 stars 1 forks source link

Wrong SELECT status code in termination/initialization state #154

Closed robin-nitrokey closed 1 year ago

robin-nitrokey commented 1 year ago

SELECT should return 6285 if the card has been terminated, see § 7.2.16 of the spec:

7.2.16 TERMINATE DF This optional command (announced in Life Cycle Status indicator in Historical bytes) sets the Life Cycle Status indicator to 03 and puts the card into initialisation state. The behaviour of the application is similar to the termination state, no commands can be used except SELECT, which return specific status bytes (6285).

sosthene-nitrokey commented 1 year ago

Uh, we can't return that because the Status enum does not contain this case, and it doesn't have a generic "any u16" fallback variant

sosthene-nitrokey commented 1 year ago

Relevant issue: https://github.com/ycrypto/iso7816/issues/10