Skip to content

test(reset): display_random is accepted and ignored - #211

Open
BitHighlander wants to merge 1 commit into
keepkey:reconcile/upstream-syncfrom
BitHighlander:fix/display-random-ignored
Open

test(reset): display_random is accepted and ignored#211
BitHighlander wants to merge 1 commit into
keepkey:reconcile/upstream-syncfrom
BitHighlander:fix/display-random-ignored

Conversation

@BitHighlander

Copy link
Copy Markdown
Contributor

Pairs with firmware BitHighlander/keepkey-firmware#336, which stops rendering the Internal Entropy screen.

Why the firmware changed

Internal entropy is seed pre-image material. A host that supplies ext_entropy and reads that screen once computes SHA256(shown || ext_entropy) and derives the seed. Note this is unaffected by dice entropy — the displayed value is already post-mix, so dice change nothing about the leak.

Why these tests failed

test_reset_device_pin and test_failed_pin sent display_random=True and asserted the resulting ButtonRequest before the PIN matrix. That screen no longer exists, so both failed — this was the only red job on #336.

The fix

Rather than dropping display_random from the requests, they still send it =True and now assert the next message is PinMatrixRequest. That turns a broken assertion into a direct test of the compatibility claim: the field stays decodable on the wire and changes nothing observable.

Verification

6/6 in test_msg_resetdevice.py against an emulator built from the paired firmware branch — including test_reset_device_dice, confirming dice entropy and the entropy-screen removal coexist. Firmware side was 14/14 green with python-integration-tests included, and #336 has since merged to alpha.

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.
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