Skip to content

Use big-endian for long APDUs data length in header #283

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bigspider
Copy link
Contributor

The standard expects a 7-bytes header with the length expressed as a 0 followed by a 2-byte length in big-endian. The Rust SDK is incorrectly using little-endian.

This is technically a breaking change - but no Rust app currently uses long APDUs.

One example of an app in C using long APDUs (with the correct big-endian length encoding) is app-security-key, which decodes the APDU here.

@bigspider bigspider requested a review from yogh333 August 25, 2025 09:40
Copy link
Contributor

@yogh333 yogh333 left a comment

Choose a reason for hiding this comment

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

LGTM, do not forget to bump version !

@bigspider
Copy link
Contributor Author

LGTM, do not forget to bump version !

We can batch it with the changes in the next release, not urgent!

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