test(eth): EIP-1559 + contract clear-sign signing-guard regression tests#23
Closed
BitHighlander wants to merge 1 commit into
Closed
test(eth): EIP-1559 + contract clear-sign signing-guard regression tests#23BitHighlander wants to merge 1 commit into
BitHighlander wants to merge 1 commit into
Conversation
…tract gate) Covers the firmware Ethereum signing pre-image / clear-sign correctness guards: - type=2 without chain_id is rejected (chain_id over-declared the RLP header) - type=2 with max_fee but no max_priority_fee still signs (priority is a mandatory 0x80-encoded field; Stage 1 and Stage 2 must agree) - type=2 carrying only gas_price, and legacy carrying max_fee_per_gas, are both rejected (typed envelope vs fee-field set must match) - a contract clear-sign handler selector with calldata streamed beyond the initial chunk signs the full data via the generic path instead of confirming a prefix (screen-level assertion verified on-device/emulator)
2 tasks
Owner
Author
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.
Adds
tests/test_msg_ethereum_signing_guards.pycovering the firmware Ethereum signing-correctness guards (firmware PR BitHighlander/keepkey-firmware#255):test_eip1559_requires_chain_id—type=2with nochain_idis rejected. (chain_id was counted in the RLP list length but hashed as nothing → wrong signer.)test_eip1559_no_priority_fee_signs—type=2withmax_fee_per_gasbut nomax_priority_fee_per_gasstill produces a valid signature. (priority fee is a mandatory0x80-encoded field; Stage 1 / Stage 2 must agree.)test_type2_without_max_fee_rejected/test_legacy_with_max_fee_rejected— the typed envelope (msg.type) and the fee-field set (has_max_fee_per_gas) must match; mismatches are rejected.test_contract_handler_streamed_calldata_signs_full_data— a clear-sign handler selector (SablierwithdrawFromSalary) with calldata streamed past the initial chunk signs the full data via the generic path instead of confirming only the prefix.Base is
feat/regression-tests-7.15.0-fixes(the branch the firmware alpha submodule pins). After merge, bump the firmwaredeps/python-keepkeysubmodule to pick these up in device CI.Note: the contract-gate test asserts signing completes over the full streamed calldata; the screen-level property (no clear-sign summary shown for streamed/oversized calldata) is verified on-device / on the emulator via DebugLink layout. Tests are gated
requires_firmware("7.15.1").