Skip to content

Commit b44f1b3

Browse files
committed
test(reset): display_random is accepted and ignored
Firmware no longer renders the Internal Entropy screen -- internal entropy is seed pre-image material, and a host that supplies ext_entropy and reads that screen once can compute SHA256(shown || ext) and derive the seed. test_reset_device_pin and test_failed_pin asserted the ButtonRequest for that screen, so they failed against the new firmware. Rather than dropping display_random from the request, they keep sending it =True and now assert the NEXT message is PinMatrixRequest -- which is a direct test of the compatibility claim: the field stays decodable on the wire and changes nothing. Verified 6/6 against an emulator built from the paired firmware branch.
1 parent a8e4126 commit b44f1b3

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

tests/test_msg_resetdevice.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,11 @@ def test_reset_device_pin(self):
245245
language='english',
246246
label='test'))
247247

248-
self.assertIsInstance(ret, proto.ButtonRequest)
249-
self.client.debug.press_yes()
250-
ret = self.client.call_raw(proto.ButtonAck())
251-
248+
# display_random=True above is deliberate: the field stays in the wire
249+
# schema for host compatibility but production firmware ignores it,
250+
# because internal entropy is seed pre-image material. A host that
251+
# sets it must get a NORMAL reset -- no Internal Entropy screen -- so
252+
# the very next message is the PIN request, not a ButtonRequest.
252253
self.assertIsInstance(ret, proto.PinMatrixRequest)
253254

254255
# Enter PIN for first time
@@ -318,10 +319,11 @@ def test_failed_pin(self):
318319
language='english',
319320
label='test'))
320321

321-
self.assertIsInstance(ret, proto.ButtonRequest)
322-
self.client.debug.press_yes()
323-
ret = self.client.call_raw(proto.ButtonAck())
324-
322+
# display_random=True above is deliberate: the field stays in the wire
323+
# schema for host compatibility but production firmware ignores it,
324+
# because internal entropy is seed pre-image material. A host that
325+
# sets it must get a NORMAL reset -- no Internal Entropy screen -- so
326+
# the very next message is the PIN request, not a ButtonRequest.
325327
self.assertIsInstance(ret, proto.PinMatrixRequest)
326328

327329
# Enter PIN for first time

0 commit comments

Comments
 (0)