test: add a test case for Ethereum cross-signing support
What changed, and why it matters
This commit only adds a new automated test to the Trezor firmware test suite. It checks that a non-Ethereum network can still use the standard Ethereum account derivation path when signing a transaction. No product code was changed, so this cannot introduce a security vulnerability or fix one in the firmware itself.
No security action needed. Review as normal test coverage addition.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a single pytest test function, test_slip44_cross_sign, in tests/device_tests/ethereum/test_definitions.py, and corresponding UI test fixture hashes in tests/ui_tests/fixtures.json. The test constructs an external network definition with chain_id=999 and slip44=1, then signs an Ethereum transaction using the mainnet derivation path m/44h/60h/0h/0/0. This exercises the existing ‘cross-signing’ behavior where a non-mainnet network is allowed to use Ethereum’s SLIP-44 coin type. No firmware or library code is modified.
Changed components
tests/device_tests/ethereum/test_definitions.pytests/ui_tests/fixtures.jsonInspect captured patch +15 / −0
diff --git a/tests/device_tests/ethereum/test_definitions.py b/tests/device_tests/ethereum/test_definitions.py
index 88425e9d..71ab62bc 100644
--- a/tests/device_tests/ethereum/test_definitions.py
+++ b/tests/device_tests/ethereum/test_definitions.py
@@ -70,6 +70,16 @@ def test_slip44_external(session: Session) -> None:
)
+def test_slip44_cross_sign(session: Session) -> None:
+ # any non-Ethereum mainnet network can use Ethereum derivation paths
+ network = definitions.encode_eth_network(chain_id=999, slip44=1)
+ params = DEFAULT_TX_PARAMS.copy()
+ params.update(n=parse_path("m/44h/60h/0h/0/0"), chain_id=999)
+ ethereum.sign_tx(
+ session, **params, definitions=definitions.make_eth_defs(network, None)
+ )
+
+
def test_slip44_external_disallowed(session: Session) -> None:
# network definition does not allow a different SLIP44
network = definitions.encode_eth_network(chain_id=66666, slip44=66666)
diff --git a/tests/ui_tests/fixtures.json b/tests/ui_tests/fixtures.json
index 200c6cb9..cc53487a 100644
--- a/tests/ui_tests/fixtures.json
+++ b/tests/ui_tests/fixtures.json
@@ -435,6 +435,7 @@
"T1B1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_getaddress]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"T1B1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_sign_typed_data_hash]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"T1B1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_signmessage]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+"T1B1_en_ethereum-test_definitions.py::test_slip44_cross_sign": "3ecd2cef053f02a85c379846db8d8d877dafb6acb275b71c23c339e828ef959d",
"T1B1_en_ethereum-test_definitions.py::test_slip44_disallowed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"T1B1_en_ethereum-test_definitions.py::test_slip44_external": "3ecd2cef053f02a85c379846db8d8d877dafb6acb275b71c23c339e828ef959d",
"T1B1_en_ethereum-test_definitions.py::test_slip44_external_disallowed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
@@ -5181,6 +5182,7 @@
"T2T1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_getaddress]": "8b1ccc0dbd6e6e3d02a896650ab90dd332ba4edbbcc4095e0fbb6a96e5256f75",
"T2T1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_sign_typed_data]": "8b1ccc0dbd6e6e3d02a896650ab90dd332ba4edbbcc4095e0fbb6a96e5256f75",
"T2T1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_signmessage]": "8b1ccc0dbd6e6e3d02a896650ab90dd332ba4edbbcc4095e0fbb6a96e5256f75",
+"T2T1_en_ethereum-test_definitions.py::test_slip44_cross_sign": "766db3ee2a8ea23548171b929b6427b08747c6b62533925eb30bd7cbdb0b54ae",
"T2T1_en_ethereum-test_definitions.py::test_slip44_disallowed": "8b1ccc0dbd6e6e3d02a896650ab90dd332ba4edbbcc4095e0fbb6a96e5256f75",
"T2T1_en_ethereum-test_definitions.py::test_slip44_external": "766db3ee2a8ea23548171b929b6427b08747c6b62533925eb30bd7cbdb0b54ae",
"T2T1_en_ethereum-test_definitions.py::test_slip44_external_disallowed": "8b1ccc0dbd6e6e3d02a896650ab90dd332ba4edbbcc4095e0fbb6a96e5256f75",
@@ -14770,6 +14772,7 @@
"T3B1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_getaddress]": "1477d62e338f4d7c1bfac2fc5d2fc231218da5768666c11482dc1f83229506f3",
"T3B1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_sign_typed_data]": "1477d62e338f4d7c1bfac2fc5d2fc231218da5768666c11482dc1f83229506f3",
"T3B1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_signmessage]": "1477d62e338f4d7c1bfac2fc5d2fc231218da5768666c11482dc1f83229506f3",
+"T3B1_en_ethereum-test_definitions.py::test_slip44_cross_sign": "2609d9c8eee6fc13b5fdd1cbd2782268d7255afffb1eb0ab7b3d57287be6c58a",
"T3B1_en_ethereum-test_definitions.py::test_slip44_disallowed": "1477d62e338f4d7c1bfac2fc5d2fc231218da5768666c11482dc1f83229506f3",
"T3B1_en_ethereum-test_definitions.py::test_slip44_external": "2609d9c8eee6fc13b5fdd1cbd2782268d7255afffb1eb0ab7b3d57287be6c58a",
"T3B1_en_ethereum-test_definitions.py::test_slip44_external_disallowed": "1477d62e338f4d7c1bfac2fc5d2fc231218da5768666c11482dc1f83229506f3",
@@ -24236,6 +24239,7 @@
"T3T1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_getaddress]": "cb8641952bec9e793e7d19f281a85a0ca1be2c3397ca5c0cf4ee7ad905429984",
"T3T1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_sign_typed_data]": "cb8641952bec9e793e7d19f281a85a0ca1be2c3397ca5c0cf4ee7ad905429984",
"T3T1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_signmessage]": "cb8641952bec9e793e7d19f281a85a0ca1be2c3397ca5c0cf4ee7ad905429984",
+"T3T1_en_ethereum-test_definitions.py::test_slip44_cross_sign": "1b68a018029425b71dfd3d44bbbfc6951dd7ecdca7271b1f492f670701d42044",
"T3T1_en_ethereum-test_definitions.py::test_slip44_disallowed": "cb8641952bec9e793e7d19f281a85a0ca1be2c3397ca5c0cf4ee7ad905429984",
"T3T1_en_ethereum-test_definitions.py::test_slip44_external": "6f8314457708946ee987620d55840184e65c8183e9695587768950633707cc99",
"T3T1_en_ethereum-test_definitions.py::test_slip44_external_disallowed": "cb8641952bec9e793e7d19f281a85a0ca1be2c3397ca5c0cf4ee7ad905429984",
@@ -34097,6 +34101,7 @@
"T3W1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_getaddress]": "931d9afceb0ba1e4faae891775819277242d889644d5c0c5863fc8c9fcf859b1",
"T3W1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_sign_typed_data]": "931d9afceb0ba1e4faae891775819277242d889644d5c0c5863fc8c9fcf859b1",
"T3W1_en_ethereum-test_definitions.py::test_method_external_mismatch[_call_signmessage]": "931d9afceb0ba1e4faae891775819277242d889644d5c0c5863fc8c9fcf859b1",
+"T3W1_en_ethereum-test_definitions.py::test_slip44_cross_sign": "1b1821ec8d4856140abe2de31452f1c872f7c376b15411c3576e3d5fedf509fd",
"T3W1_en_ethereum-test_definitions.py::test_slip44_disallowed": "931d9afceb0ba1e4faae891775819277242d889644d5c0c5863fc8c9fcf859b1",
"T3W1_en_ethereum-test_definitions.py::test_slip44_external": "b2138262182c0c5ebb9d6e215a6dc9361c13ffd8be6ff07a2f13cf43470a4f2f",
"T3W1_en_ethereum-test_definitions.py::test_slip44_external_disallowed": "931d9afceb0ba1e4faae891775819277242d889644d5c0c5863fc8c9fcf859b1",
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.