Skip to content

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

Merged
BitHighlander merged 3 commits into
masterfrom
test/eth-signing-guards-master
Jun 29, 2026
Merged

test(eth): EIP-1559 + contract clear-sign signing-guard regression tests#25
BitHighlander merged 3 commits into
masterfrom
test/eth-signing-guards-master

Conversation

@BitHighlander

Copy link
Copy Markdown
Owner

Adds tests/test_msg_ethereum_signing_guards.py for the firmware Ethereum signing-correctness guards merged to firmware alpha (BitHighlander/keepkey-firmware#255):

  • test_eip1559_requires_chain_idtype=2 with no chain_id is rejected.
  • test_eip1559_no_priority_fee_signstype=2 + max_fee without max_priority_fee still produces a valid signature.
  • test_type2_without_max_fee_rejected / test_legacy_with_max_fee_rejected — typed envelope vs fee-field set must match.
  • test_contract_handler_streamed_calldata_signs_full_data — a clear-sign handler selector with calldata streamed past the initial chunk signs via the generic path instead of confirming the prefix.

Base is master (the lineage firmware alpha pins via deps/python-keepkey @ ae1d39ca), so these reach device CI once the firmware submodule is bumped. Supersedes #23, which was based on the diverged feat/regression-tests-7.15.0-fixes branch. Gated requires_firmware("7.15.1"); the contract-gate screen property is verified on emulator via DebugLink.

…tract gate)

Covers the firmware Ethereum signing pre-image / clear-sign correctness guards
(firmware PR BitHighlander/keepkey-firmware#255, merged to alpha):
- 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, rejected
- 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)
…ial chunk)

7.15 contract clear-sign handlers require the entire calldata in the initial
chunk (data_total == data_initial_chunk.size); transformERC20 calldata is
larger, so it now routes through the blind-sign path, which requires the
AdvancedMode policy. Set AdvancedMode and gate the test on 7.15.0. The signed
bytes are unchanged, so the asserted signature is unchanged.
…15 workaround)

The firmware now clear-signs transformERC20 at any calldata size (pinned 0x
proxy, bounded by displayed amounts) instead of forcing the blind-sign path, so
restore the original no-AdvancedMode test. Supersedes the interim AdvancedMode
workaround.
@BitHighlander
BitHighlander merged commit 3a72308 into master Jun 29, 2026
3 of 4 checks passed
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