-
Notifications
You must be signed in to change notification settings - Fork 30
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
Suggestion: declare explicit support of ASCII
-only charset at SDK level
#124
Comments
dj8yfo
changed the title
Suggestion: propagate error type in
Suggestion: declare explicit support of Jan 25, 2024
MultiFieldReview::show
ASCII
-only charset at SDK level
This was referenced Mar 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this line https://github.com/LedgerHQ/ledger-device-rust-sdk/blob/master/ledger_device_sdk/src/ui/gadgets.rs#L831 can be changed to
Probably two additional checks can be added after line https://github.com/LedgerHQ/ledger-device-rust-sdk/blob/master/ledger_device_sdk/src/ui/gadgets.rs#L693 to assert that
name
andvalue
fields ofField
are comprised only of ASCII chars (https://doc.rust-lang.org/std/primitive.str.html#method.is_ascii), and returningErr(FieldError::NonASCIIChar)
otherwise.It appears to me that reflecting the fact, that non-ascii charsets are not supported, with types is more robust than displaying randomly blank chunks without any indication to user, why this happens.
MultiFieldReview::show()
can be unwrapped as well at the call sites, ifledger-device-rust-sdk
user doesn't want to bother with handling errors,or the known error variants can be matched and handled, and e.g. a widget displayed to user, stating that
Error: non-ASCII payload is not supported
and a corresponding APDU status returned, refusing to continue to process.The text was updated successfully, but these errors were encountered: