Uh oh!
There was an error while loading. Please reload this page.
Use find_packages instead of listing each module independently - #36
Merged
Conversation
BitHighlander added a commit
to BitHighlander/python-keepkey
that referenced
this pull request
Jul 16, 2026
…rify Maya signatures
Addresses three review findings on this stack.
1) Bindings were generated from a STALE protocol. The device-protocol submodule
was pinned at 2ec999a9 — the same commit that lacks LoadClearsignSigner's
icon fields and Hive 1614–1617 — so build_pb.sh regenerated incomplete
bindings. Bump the pin to f7b4580 and regenerate:
- messages_ethereum_pb2.py: LoadClearsignSigner now exposes icon,
icon_width, icon_height, persist (was key_id/pubkey/alias only, so
constructing with icon raised ValueError).
- messages_pb2.py: real MessageType_HiveSign{Message,Operations} /
Signed{Message,Operations} = 1614–1617 constants. mapping.py's manual
wire-id table was masking their absence.
client.load_clearsign_signer() now accepts icon/icon_width/icon_height/
persist and documents the RLE contract (was RAM-only, no icon).
2) The icon wire contract was mis-documented (device-protocol#36 fixes the
proto). Adds TestClearsignSignerIcon: a reference RLE decoder traced from
draw_bitmap_mono_rle(), the published golden vector (03 FF FF 00, w=2 h=2
-> FF FF FF 00), RUN/LITERAL packets, n==0 and truncation rejects, the
icon/dims/persist round-trip, and text-only identities. Also asserts the
arithmetic that forces RLE: a packed 1bpp 64x64 needs 512 bytes > the
384-byte cap, so the previously documented packed format was impossible.
3) The two Maya EVM tests asserted only v and 32-byte r/s lengths, so a wrong
digest, calldata or key would still pass. (The weakening predates 560b897 —
its parent already had the structural asserts; the router change inherited
them.) Replace with recover_eth_signer(): rebuild the EIP-155 sighash from
the exact tx fields, recover the signer from (v,r,s), and assert it equals
the device's own address for the path. Verified offline: a good signature
recovers to the signer, and tampered calldata does NOT — so the tests now
actually fail on a wrong digest. Recovery keeps them correct across router
changes without re-freezing r/s vectors.
Offline suites: 26 passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This also fixes a bug where importing
keepkeylib.clientwould error withImportError: cannot import name 'messages_eos_pb2'asmessages_eos_pb2was not included in the originalpy_moduleslist. This will make such errors not happen as all modules and packages will be automatically detected.