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

Adjust limits (for STAX) #97

Merged
merged 4 commits into from
Jan 17, 2025
Merged

Adjust limits (for STAX) #97

merged 4 commits into from
Jan 17, 2025

Conversation

andreibancioiu
Copy link
Contributor

@andreibancioiu andreibancioiu commented Jan 15, 2025

Allocation of tx_hash_context.current_value (bounded by MAX_VALUE_LEN):

While enc_len is bounded by MAX_DISPLAY_DATA_SIZE:

For STAX, MAX_DISPLAY_DATA_SIZE = 256, thus memmove(encoded, tx_hash_context.current_value, enc_len); fails to correctly copy the data (destination buffer is too short). This leads to an error when decoding it as base64 (within verify_data).

For Nano S, MAX_DISPLAY_DATA_SIZE = 64, issue not present.

Fix: ensure that MAX_DISPLAY_DATA_SIZE <= MAX_VALUE_LEN on all devices.

@andreibancioiu andreibancioiu self-assigned this Jan 15, 2025
@andreibancioiu andreibancioiu merged commit 569c319 into relayed-v3-support Jan 17, 2025
31 checks passed
@andreibancioiu andreibancioiu deleted the stax-limits branch January 17, 2025 12:13
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.

3 participants