Skip to content

Commit cf9dcf6

Browse files
Merge pull request #33 from BitHighlander/fix/715-atlas-coverage
test(atlas): catalogue the four 7.15 areas the report could not see
2 parents 9f3b176 + 295dac4 commit cf9dcf6

9 files changed

Lines changed: 2768 additions & 41 deletions

scripts/generate-test-report.py

Lines changed: 515 additions & 16 deletions
Large diffs are not rendered by default.

tests/test_msg_bitcoin_only_variant.py

Lines changed: 650 additions & 0 deletions
Large diffs are not rendered by default.

tests/test_msg_ethereum_clear_signing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,8 @@ def test_advanced_mode_gate(self):
11021102
to=AAVE_V3_POOL, value=0, data=data, chain_id=1)
11031103
self.fail("Expected Failure — blind signing disabled")
11041104
except CallException as e:
1105-
self.assertIn("Blind signing disabled", str(e))
1105+
self.assertIn("Arbitrary contract data signing disabled by policy",
1106+
str(e))
11061107

11071108
# ON → raw-data confirm path → signs
11081109
self.client.apply_policy("AdvancedMode", 1)
@@ -1156,7 +1157,8 @@ def test_cancel_clears_metadata_not_reused(self):
11561157
to=AAVE_V3_POOL, value=0, data=data, chain_id=chain_id)
11571158
self.fail("Expected Failure — stale metadata must not be reused")
11581159
except CallException as e:
1159-
self.assertIn("Blind signing disabled", str(e))
1160+
self.assertIn("Arbitrary contract data signing disabled by policy",
1161+
str(e))
11601162

11611163

11621164
# ── LoadClearsignSigner — the phase-1 trust path ───────────────────

tests/test_msg_ethereum_clearsign_additive.py

Lines changed: 363 additions & 0 deletions
Large diffs are not rendered by default.

tests/test_msg_ethereum_signtx.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ def test_ethereum_signtx_data(self):
101101
def test_ethereum_blind_sign_blocked(self):
102102
"""AdvancedMode OFF + contract data = device refuses to sign (7.15+).
103103
104-
OLED shows 'Blind signing disabled' then Failure.
104+
OLED shows the blind-sign refusal, then Failure. The wire message is
105+
7.14.2's "Arbitrary contract data signing disabled by policy", which
106+
replaced alpha's shorter "Blind signing disabled" -- it names WHICH
107+
policy refused and what it refused.
105108
"""
106109
self.requires_firmware("7.15.0")
107110
self.requires_fullFeature()
@@ -121,7 +124,8 @@ def test_ethereum_blind_sign_blocked(self):
121124
)
122125
self.fail("Expected Failure -- blind signing should be blocked")
123126
except CallException as e:
124-
self.assertIn("Blind signing disabled", str(e))
127+
self.assertIn("Arbitrary contract data signing disabled by policy",
128+
str(e))
125129

126130
def test_ethereum_blind_sign_allowed(self):
127131
"""AdvancedMode ON + contract data = device shows BLIND SIGNATURE warning (7.15+).

tests/test_msg_resetdevice.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,20 @@ def test_reset_device_dice(self):
193193
self.assertEqual(' '.join(mnemonic), expected_mnemonic)
194194

195195
def test_reset_reentry_disarms_entropy_ack(self):
196-
"""An aborted reset must not leave EntropyAck armed.
196+
"""An abandoned reset must never leave EntropyAck armed.
197197
198-
Regression: reset_init aborts (dice cancel, PIN mismatch, ...) left
199-
awaiting_entropy set from an earlier run while zeroing int_entropy,
200-
so a following EntropyAck derived the seed from
198+
Regression this guards: reset_init aborts (dice cancel, PIN mismatch,
199+
...) left awaiting_entropy set from an earlier run while zeroing
200+
int_entropy, so a following EntropyAck derived the seed from
201201
sha256(0*32 || host_bytes) -- entirely host-chosen.
202+
203+
7.15 closes it EARLIER and more strongly than the original fix did.
204+
#429 replaced the separate awaiting_entropy flag with a single armed
205+
(kind) ceremony, and setup_stage() now REFUSES to open a second
206+
ceremony on top of an armed one. So the re-entry this test used to
207+
perform is rejected outright rather than being allowed and then
208+
disarmed -- there is no second ceremony to leave armed. Both halves are
209+
asserted below: the refusal, and then the original property.
202210
"""
203211
self.requires_firmware("7.15.0")
204212
self.client.wipe_device()
@@ -212,16 +220,20 @@ def test_reset_reentry_disarms_entropy_ack(self):
212220
label='first'))
213221
self.assertIsInstance(ret, proto.EntropyRequest)
214222

215-
# Re-enter with dice, then abort from the host.
223+
# Re-entry is REFUSED while a ceremony is armed. This is the #429
224+
# guard; before it, the second ResetDevice was accepted and the code
225+
# had to remember to disarm the first one.
216226
ret = self.client.call_raw(proto.ResetDevice(display_random=False,
217227
strength=256,
218228
passphrase_protection=False,
219229
pin_protection=False,
220230
language='english',
221231
label='second',
222232
dice_entropy=True))
223-
self.assertIsInstance(ret, proto.ButtonRequest)
224-
self.assertEqual(ret.code, proto_types.ButtonRequest_DiceRoll)
233+
self.assertIsInstance(ret, proto.Failure)
234+
self.assertIn('middle of setup', ret.message)
235+
236+
# Abandon the FIRST ceremony the way the host is told to.
225237
ret = self.client.call_raw(proto.Cancel())
226238
self.assertIsInstance(ret, proto.Failure)
227239

0 commit comments

Comments
 (0)