Skip to content

Commit f58c4cf

Browse files
committed
chore: update planning test gates
1 parent 1688716 commit f58c4cf

5 files changed

Lines changed: 60 additions & 36 deletions

File tree

keepkeylib/client.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,14 +1661,18 @@ def ton_sign_tx(self, address_n, raw_tx):
16611661

16621662
# ── Zcash Address Display ─────────────────────────────────
16631663
@expect(zcash_proto.ZcashAddress)
1664-
def zcash_display_address(self, address_n, address, ak, nk, rivk,
1665-
account=None, expected_seed_fingerprint=None):
1664+
def zcash_display_address(self, address_n, address=None, ak=None, nk=None,
1665+
rivk=None, account=None,
1666+
expected_seed_fingerprint=None):
16661667
"""Display a Zcash unified address on the device for user confirmation.
16671668
16681669
Args:
16691670
address_n: ZIP-32 derivation path [32', 133', account']
1670-
address: unified address string ("u1...")
1671-
ak, nk, rivk: 32-byte FVK components for verification
1671+
address: optional unified address string ("u1..."). If omitted,
1672+
the device derives the default Orchard-only UA from seed/account.
1673+
ak, nk, rivk: optional 32-byte FVK components for host-supplied
1674+
address verification. Required by firmware when address is
1675+
provided.
16721676
account: account index (alternative to full path)
16731677
expected_seed_fingerprint: optional 32-byte ZIP-32 §6.1 seed
16741678
fingerprint. If provided, device verifies the match before
@@ -1678,7 +1682,15 @@ def zcash_display_address(self, address_n, address, ak, nk, rivk,
16781682
ZcashAddress with .address and .seed_fingerprint of the
16791683
attesting device.
16801684
"""
1681-
kwargs = dict(address_n=address_n, address=address, ak=ak, nk=nk, rivk=rivk)
1685+
kwargs = dict(address_n=address_n)
1686+
if address is not None:
1687+
kwargs['address'] = address
1688+
if ak is not None:
1689+
kwargs['ak'] = ak
1690+
if nk is not None:
1691+
kwargs['nk'] = nk
1692+
if rivk is not None:
1693+
kwargs['rivk'] = rivk
16821694
if account is not None:
16831695
kwargs['account'] = account
16841696
if expected_seed_fingerprint is not None:

scripts/generate-test-report.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -775,15 +775,15 @@ def parse_junit(path):
775775
'cause fund loss or invalid transactions on the block-lattice.',
776776
[])]),
777777

778-
# ===== 7.14 NEW FEATURES =====
779-
('V', 'EVM Clear-Signing', '7.14.0',
778+
# ===== 7.15.1 NEW FEATURES =====
779+
('V', 'EVM Clear-Signing', '7.15.1',
780780
'NEW: Verified transaction metadata for EVM contracts. Host sends a signed blob with contract '
781781
'name, function, and decoded parameters. Device verifies blob signature against trusted key, '
782-
'then shows human-readable details with VERIFIED icon. Blind-sign policy gating is deferred '
783-
'to firmware 7.15+.',
782+
'then shows human-readable details with VERIFIED icon. Blind-sign policy gating ships with '
783+
'firmware 7.15.1+.',
784784
[
785785
'CLEAR-SIGN: Signed metadata -> verify signature -> VERIFIED icon + method + decoded args',
786-
'BLIND SIGN: No metadata + AdvancedMode on -> contract data signed (no gate until 7.15+)',
786+
'BLIND SIGN: No metadata + AdvancedMode on -> contract data signed after policy gate',
787787
],
788788
[
789789
('V1', 'test_msg_ethereum_clear_signing', 'test_valid_metadata_returns_verified',
@@ -808,7 +808,7 @@ def parse_junit(path):
808808
('V8', 'test_msg_ethereum_signtx', 'test_ethereum_blind_sign_allowed',
809809
'Blind sign permitted (AdvancedMode ON)',
810810
'Contract data with AdvancedMode enabled. Device allows signing. '
811-
'Blind-sign blocking deferred to 7.15+.',
811+
'Blind-sign policy gating covered in 7.15.1+.',
812812
[]),
813813
]),
814814

tests/test_msg_ethereum_clear_signing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ class TestEthereumClearSigning(common.KeepKeyTest):
411411

412412
def setUp(self):
413413
super().setUp()
414-
self.requires_firmware("7.14.0")
414+
self.requires_firmware("7.15.1")
415415
self.requires_message("EthereumTxMetadata")
416416
self.setup_mnemonic_nopin_nopassphrase()
417417

tests/test_msg_ethereum_signtx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_ethereum_blind_sign_blocked(self):
100100
101101
OLED shows 'Blind signing disabled' then Failure.
102102
"""
103-
self.requires_firmware("7.15.0")
103+
self.requires_firmware("7.15.1")
104104
self.requires_fullFeature()
105105
self.setup_mnemonic_nopin_nopassphrase()
106106
self.client.apply_policy("AdvancedMode", 0)
@@ -124,7 +124,7 @@ def test_ethereum_blind_sign_allowed(self):
124124
125125
OLED shows 'BLIND SIGNATURE' before signing.
126126
"""
127-
self.requires_firmware("7.14.0")
127+
self.requires_firmware("7.15.1")
128128
self.requires_fullFeature()
129129
self.setup_mnemonic_nopin_nopassphrase()
130130
self.client.apply_policy("AdvancedMode", 1)

tests/test_msg_zcash_display_address.py

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
# Hardened offset
1616
H = 0x80000000
1717

18+
ORCHARD_ONLY_UA_ACCOUNT_0 = (
19+
"u1uzslnccvrw4r2y2kgjz7fm477xcnzge9z45scm4e6l6c63ren0ru29teedxw5vxu7c8xch"
20+
"p3ec2pu3wkgldc5zphwtm4w3fchcwrl26c"
21+
)
22+
1823

1924
class TestMsgZcashDisplayAddress(common.KeepKeyTest):
2025
"""Test Zcash unified address display and verification."""
@@ -24,6 +29,20 @@ def setUp(self):
2429
self.requires_firmware("7.15.0")
2530
self.requires_message("ZcashDisplayAddress")
2631

32+
def test_zcash_display_address_device_derived(self):
33+
"""Device derives and displays the Orchard-only UA from seed/account."""
34+
self.setup_mnemonic_allallall()
35+
36+
resp = self.client.zcash_display_address(
37+
address_n=[H + 32, H + 133, H + 0],
38+
account=0,
39+
)
40+
41+
self.assertIsInstance(resp, zcash_proto.ZcashAddress)
42+
self.assertEqual(resp.address, ORCHARD_ONLY_UA_ACCOUNT_0)
43+
self.assertTrue(resp.HasField("seed_fingerprint"))
44+
self.assertEqual(len(resp.seed_fingerprint), 32)
45+
2746
def test_zcash_display_address_basic(self):
2847
"""Verify a unified address using FVK components from the device."""
2948
self.setup_mnemonic_allallall()
@@ -37,23 +56,18 @@ def test_zcash_display_address_basic(self):
3756
self.assertIsNotNone(fvk_resp.nk)
3857
self.assertIsNotNone(fvk_resp.rivk)
3958

40-
# Use a placeholder unified address -- real address construction
41-
# requires librustzcash (host-side). The firmware verifies the FVK
42-
# matches its own derivation, not the address encoding.
43-
# For a real test, construct a proper unified address externally.
44-
resp = self.client.call(
45-
zcash_proto.ZcashDisplayAddress(
46-
address_n=[H + 32, H + 133, H + 0],
47-
account=0,
48-
address="u1placeholder",
49-
ak=fvk_resp.ak,
50-
nk=fvk_resp.nk,
51-
rivk=fvk_resp.rivk,
52-
)
59+
resp = self.client.zcash_display_address(
60+
address_n=[H + 32, H + 133, H + 0],
61+
account=0,
62+
address=ORCHARD_ONLY_UA_ACCOUNT_0,
63+
ak=fvk_resp.ak,
64+
nk=fvk_resp.nk,
65+
rivk=fvk_resp.rivk,
5366
)
5467

5568
# Device should verify FVK matches and return the address
5669
self.assertIsInstance(resp, zcash_proto.ZcashAddress)
70+
self.assertEqual(resp.address, ORCHARD_ONLY_UA_ACCOUNT_0)
5771

5872
def test_zcash_display_address_wrong_fvk_rejected(self):
5973
"""Device rejects address when FVK doesn't match its own derivation."""
@@ -64,15 +78,13 @@ def test_zcash_display_address_wrong_fvk_rejected(self):
6478

6579
# Send bogus FVK -- device should reject
6680
with pytest.raises(CallException):
67-
self.client.call(
68-
zcash_proto.ZcashDisplayAddress(
69-
address_n=[H + 32, H + 133, H + 0],
70-
account=0,
71-
address="u1placeholder",
72-
ak=b'\x00' * 32,
73-
nk=b'\x00' * 32,
74-
rivk=b'\x00' * 32,
75-
)
81+
self.client.zcash_display_address(
82+
address_n=[H + 32, H + 133, H + 0],
83+
account=0,
84+
address=ORCHARD_ONLY_UA_ACCOUNT_0,
85+
ak=b'\x00' * 32,
86+
nk=b'\x00' * 32,
87+
rivk=b'\x00' * 32,
7688
)
7789

7890

0 commit comments

Comments
 (0)