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

Improvements in commands parsing support #97

Merged
merged 3 commits into from
Dec 5, 2023
Merged

Conversation

kingofpayne
Copy link
Contributor

@kingofpayne kingofpayne commented Nov 28, 2023

Translation from an ApduHeader to a custom command type can now return different status words, which are then automatically sent as reply to the host by the SDK.

This allows to implement complex parsing logic which may return appropriate error status words depending on which APDU header fields are invalid (invalid class, invalid instruction, bad P1 or P2, etc.).

Added a check to reject automatically too short APDUs, so SDK users don't have to do this check in the app code.

@agrojean-ledger
Copy link
Contributor

@kingofpayne this needs to be rebased following the merge of #98

Translation from an ApduHeader to a custom command type can now return
different status words, which are then automatically sent as reply to
the host by the SDK.

This allows to implement complex parsing logic which may return
appropriate error status words depending on which APDU header fields
are invalid (invalid class, invalid instruction, bad P1 or P2, etc.).

Added a check to reject automatically too short APDUs, so SDK users
don't have to do this check in the app code.
Data field length is now checked in decode_event so SDK users do not
need to perform this verification in the app.
@kingofpayne kingofpayne force-pushed the better-commands-parsing branch from d9cfe22 to d7e20b2 Compare December 4, 2023 11:11
@kingofpayne
Copy link
Contributor Author

Rebased.

Copy link
Contributor

@xchapron-ledger xchapron-ledger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not forget to bump the crate version.

@yogh333 yogh333 merged commit bc64f70 into master Dec 5, 2023
@yogh333 yogh333 deleted the better-commands-parsing branch December 5, 2023 14:47
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.

5 participants