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

Wrong SELECT status code in termination/initialization state #154

Closed
robin-nitrokey opened this issue May 1, 2023 · 2 comments · Fixed by #155
Closed

Wrong SELECT status code in termination/initialization state #154

robin-nitrokey opened this issue May 1, 2023 · 2 comments · Fixed by #155
Labels
bug Something isn't working

Comments

@robin-nitrokey
Copy link
Member

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).

@robin-nitrokey robin-nitrokey added the bug Something isn't working label May 1, 2023
@sosthene-nitrokey
Copy link
Collaborator

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
Copy link
Collaborator

Relevant issue: trussed-dev/iso7816#10

robin-nitrokey added a commit that referenced this issue May 2, 2023
This patch changes the status code for SELECT APDUs to 6285 if the cade
is in termination/initialization state.

Fixes: #154
robin-nitrokey added a commit that referenced this issue May 2, 2023
This patch changes the status code for SELECT APDUs to 6285 if the card
is in termination/initialization state.

Fixes: #154
robin-nitrokey added a commit that referenced this issue May 2, 2023
This patch changes the status code for SELECT APDUs to 6285 if the card
is in termination/initialization state.

Fixes: #154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants