Extended signing support for Off-chain message signing#8
Open
0xMMBD wants to merge 3 commits intocompute-budget-rf-v2from
Open
Extended signing support for Off-chain message signing#80xMMBD wants to merge 3 commits intocompute-budget-rf-v2from
0xMMBD wants to merge 3 commits intocompute-budget-rf-v2from
Conversation
Member
0xMMBD
commented
Dec 14, 2023
- Off-chain message signing implemented according to: https://docs.solana.com/proposals/off-chain-message-signing
- Modified general item screens to fix memory issues on nanos
- Empty application domain will be displayed as "Domain not provided" instead of base58 representation
- Messages Includes changes for ComputeBudget instruction
jnwng
suggested changes
Dec 21, 2023
jnwng
left a comment
There was a problem hiding this comment.
still looks like this is missing Trent's original commit, so a bit hard to see what the adjustments are. but a couple of things to address
| CFLAGS += --coverage | ||
| endif | ||
|
|
||
| debug_CFLAGS = -g -fsanitize=address -fsanitize=undefined |
| 0x00, 0x00 | ||
|
|
||
| // Sysvars | ||
|
|
| * 4. Message format (1 byte) | ||
| * 5. Signer count (1 bytes) | ||
| * 6. Signers (signer_count * 32 bytes) - assume that only one signer is present | ||
| * 7. Message length (2 bytes) |
libsol/include/sol/parser.h
Outdated
| size_t instructions_length; | ||
| } MessageHeader; | ||
|
|
||
| //@TODO move to offchain message sign .h |
libsol/include/sol/string_utils.h
Outdated
| #include <stdbool.h> | ||
|
|
||
| bool is_data_utf8(const uint8_t *data, size_t length); | ||
| bool is_data_ascii(const uint8_t *data, size_t length); No newline at end of file |
| extern char G_transaction_summary_title[TITLE_SIZE]; | ||
|
|
||
| // Text buffer needs to be large enough to hold the longest possible message text to sign | ||
| //#define TEXT_BUFFER_LENGTH (OFFCHAIN_MESSAGE_MAXIMUM_MESSAGE_LENGTH - OFFCHAIN_MESSAGE_MINIMAL_HEADER_SIZE) |
libsol/parser.c
Outdated
Comment on lines
+155
to
+163
| * Field Start offset Length (bytes) | ||
| * Signing Domain 0x00 16 | ||
| * Header version 0x10 1 | ||
| * Application domain 0x11 32 | ||
| * Message format 0x31 1 | ||
| * Signer count 0x32 1 | ||
| * Signers 0x33 SIGNER_COUNT * 32 | ||
| * Message length 0x33 + SIGNER_CNT * 32 2 | ||
| */ |
Member
Author
There was a problem hiding this comment.
Member
Author
There was a problem hiding this comment.
I've changed it, I hope that it helps on you end, if not we can remove it and leave just the link
libsol/transaction_summary.c
Outdated
| } | ||
|
|
||
| /* | ||
| * Supress warning about const qualifier - changes required in ledger's SDK |
* fixed comments formatting * removed unnecessary whitespace changes
Member
Author
|
@jnwng Let us know if there is anything else to fix 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
