Conversation
…sts for nanos/nanox devices
There are issues with PIL working under ragger to parse stax screens.
There are issues with PIL working under ragger to parse flex screens.
| #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 |
There was a problem hiding this comment.
That util functions are required for parsing off chain payload
| "\xff" \ | ||
| "solana offchain" | ||
|
|
||
| static int check_buffer_length(Parser *parser, size_t num) { |
There was a problem hiding this comment.
Moved out to common_byte_strings.h
| item->title = title; | ||
| item->application_domain = value; | ||
| } | ||
|
|
There was a problem hiding this comment.
New item required for showing app domain
| #define MAX_OFFCHAIN_MESSAGE_LENGTH PACKET_DATA_SIZE | ||
|
|
||
| // Assuming that only one signer | ||
| #define OFFCHAIN_MESSAGE_HEADER_LENGTH 85 |
There was a problem hiding this comment.
It is 85 (16+1+32+1+1+32*1+2)
sign domain + version + app domain + format + signer count + signer pub keys + length
| #define CASSERT(predicate, file) _impl_CASSERT_LINE(predicate, __LINE__, file) | ||
| #define _impl_PASTE(a, b) a##b | ||
| #define _impl_CASSERT_LINE(predicate, line, file) \ | ||
| typedef char _impl_PASTE(assertion_failed_##file##_, line)[2 * !!(predicate) -1]; |
There was a problem hiding this comment.
Macros required for off chain message signing logic
| return get_pubkey_index(&signer_pubkey, | ||
| header->pubkeys, | ||
| header->pubkeys_header.num_required_signatures, | ||
| signer_index); |
There was a problem hiding this comment.
Refactored version of the same function
There was a problem hiding this comment.
Core of Off Chain Message Signing
| } | ||
| return -1; | ||
| } | ||
|
|
There was a problem hiding this comment.
Helper function, moved out from other parts of code for readability
| else: | ||
| raise ValueError() | ||
|
|
||
| if len(message) <= MAX_LEN: |
There was a problem hiding this comment.
Removed the length check because the Ledger should handle that, instead of comparing it in the tests.
| data += self.version.to_bytes(1, byteorder='little') | ||
| # Include padded app_domain | ||
| data += self.app_domain | ||
| # Serialize message |
There was a problem hiding this comment.
Added missing fields
| OFFCHAIN_MESSAGE_APPLICATION_DOMAIN_LENGTH, | ||
| G_transaction_summary_text, | ||
| TEXT_BUFFER_LENGTH)); | ||
| break; |
There was a problem hiding this comment.
Handling new item type
Checklist
develop