forked from Zondax/ledger-flare
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Merging develop to master #3
Merged
Merged
Conversation
This file contains 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
* update zxlib * bump version
* update deps * update coston network_id & add new chain ids * update snapshots
Stax/Flex Support and Support for Coston Testnet (chain_id = 16) for ETH transactions
* remove js package * add js submodule * update tests * update snapshots
* update submodules * add blindsign ui * update tests * update snapshots * update test and snapshots for sign hash * fix error return
New release
* update deps and submodules * coin asset depending on chain id * update zxlib * add blindsign required flag * update tests * update snapshots
* move files to evm folder * update remaining code structure * update fuzzer and tests * small argument fix
* add sign_personal * update js package * update snapshots
New release
New release
New Release
* add flare CLA extra verification * remove not needed DER signature from response * update zxlib * bump version * update fuzzer * update docs * update docs
Improve Blindsign UI
Comment on lines
+143
to
+218
switch (payloadType) { | ||
case P1_ETH_FIRST: | ||
tx_initialize(); | ||
tx_reset(); | ||
extract_eth_path(rx, OFFSET_DATA); | ||
// there is not warranties that the first chunk | ||
// contains the serialized path only; | ||
// so we need to offset the data to point to the first transaction | ||
// byte | ||
uint32_t path_len = sizeof(uint32_t) * hdPathEth_len; | ||
|
||
// plus the first offset data containing the path len | ||
data += path_len + 1; | ||
if (len < path_len) { | ||
THROW(APDU_CODE_WRONG_LENGTH); | ||
} | ||
|
||
// now process the chunk | ||
len -= path_len + 1; | ||
if (get_tx_rlp_len(data, len, &read, &to_read) != rlp_ok) { | ||
THROW(APDU_CODE_DATA_INVALID); | ||
} | ||
|
||
// get remaining data len | ||
max_len = saturating_add(read, to_read); | ||
max_len = MIN(max_len, len); | ||
|
||
added = tx_append(data, max_len); | ||
if (added != max_len) { | ||
THROW(APDU_CODE_OUTPUT_BUFFER_TOO_SMALL); | ||
} | ||
|
||
tx_initialized = true; | ||
|
||
// if the number of bytes read and the number of bytes to read | ||
// is the same as what we read... | ||
if ((saturating_add(read, to_read) - len) == 0) { | ||
return true; | ||
} | ||
return false; | ||
case P1_ETH_MORE: | ||
if (!tx_initialized) { | ||
THROW(APDU_CODE_TX_NOT_INITIALIZED); | ||
} | ||
|
||
uint64_t buff_len = tx_get_buffer_length(); | ||
uint8_t *buff_data = tx_get_buffer(); | ||
|
||
if (get_tx_rlp_len(buff_data, buff_len, &read, &to_read) != rlp_ok) { | ||
THROW(APDU_CODE_DATA_INVALID); | ||
} | ||
|
||
uint64_t rlp_read = buff_len - read; | ||
|
||
// either the entire buffer of the remaining bytes we expect | ||
uint64_t missing = to_read - rlp_read; | ||
max_len = len; | ||
|
||
if (missing < len) { | ||
max_len = missing; | ||
} | ||
added = tx_append(data, max_len); | ||
|
||
if (added != max_len) { | ||
tx_initialized = false; | ||
THROW(APDU_CODE_OUTPUT_BUFFER_TOO_SMALL); | ||
} | ||
|
||
// check if this chunk was the last one | ||
if (missing - len == 0) { | ||
tx_initialized = false; | ||
return true; | ||
} | ||
|
||
return false; | ||
} |
Check notice
Code scanning / CodeQL
Long switch case Note
Switch has at least one case that is too long: .
Switch has at least one case that is too long: .
0 (38 lines)
Error loading related location
Loading Switch has at least one case that is too long:
128 (34 lines)
Error loading related location
Loading Fixing Deprecation notice: v3 of the artifact actions
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.
No description provided.