Skip to content

test(eth): EIP-1559 + contract clear-sign signing-guard regression tests#23

Closed
BitHighlander wants to merge 1 commit into
feat/regression-tests-7.15.0-fixesfrom
test/eth-signing-guards
Closed

test(eth): EIP-1559 + contract clear-sign signing-guard regression tests#23
BitHighlander wants to merge 1 commit into
feat/regression-tests-7.15.0-fixesfrom
test/eth-signing-guards

Conversation

@BitHighlander

Copy link
Copy Markdown
Owner

Adds tests/test_msg_ethereum_signing_guards.py covering the firmware Ethereum signing-correctness guards (firmware PR BitHighlander/keepkey-firmware#255):

  • test_eip1559_requires_chain_idtype=2 with no chain_id is rejected. (chain_id was counted in the RLP list length but hashed as nothing → wrong signer.)
  • test_eip1559_no_priority_fee_signstype=2 with max_fee_per_gas but no max_priority_fee_per_gas still produces a valid signature. (priority fee is a mandatory 0x80-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 (Sablier withdrawFromSalary) 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 firmware deps/python-keepkey submodule 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").

…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)
@BitHighlander

Copy link
Copy Markdown
Owner Author

Superseded by the master-based PR — #23 was branched off the diverged feat/regression-tests-7.15.0-fixes, but firmware alpha pins deps/python-keepkey on the master lineage (ae1d39c). Re-opened against master.

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.

1 participant