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

Add support for bigger than expected response sizes #201

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Add support for bigger than expected response sizes #201

merged 1 commit into from
Feb 13, 2024

Conversation

petteri-huusko-op
Copy link
Contributor

This should fix issue #174

@petteri-huusko-op
Copy link
Contributor Author

This fix is based on Finnish E-ID card spec (FINEID S1) Chapter 3.3.
https://dvv.fi/documents/16079645/17324992/S1v40+(1).pdf/56a167fe-9f26-1fda-7d76-cfbbb29d184e/S1v40+(1).pdf?t=1679058112446

I don't have access to the actual ISO 7816 spec, but the above document cites it as normative source.

If my understanding is correct, the spec calls for to use GET RESPONSE (INS 0xC0) to read a command response in cases where the response length is unknown or greater than 256.

I do not have a list of commands which may have unknown length, so the implementation here reads while commands response sw1 indicates more data available (i.e. while sw1 == 0x61).

This works at least with the sample Finnish E-ID documents at my disposal.

@AndyQ AndyQ merged commit a480d05 into AndyQ:main Feb 13, 2024
@AndyQ
Copy link
Owner

AndyQ commented Feb 13, 2024

Thanks for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants