Skip to content

Use find_packages instead of listing each module independently - #36

Merged
keepkeyjon merged 1 commit into
keepkey:masterfrom
achow101:fix-setup
Jan 12, 2019
Merged

Use find_packages instead of listing each module independently#36
keepkeyjon merged 1 commit into
keepkey:masterfrom
achow101:fix-setup

Conversation

@achow101

Copy link
Copy Markdown
Contributor

This also fixes a bug where importing keepkeylib.client would error with ImportError: cannot import name 'messages_eos_pb2' as messages_eos_pb2 was not included in the original py_modules list. This will make such errors not happen as all modules and packages will be automatically detected.

@keepkeyjonkeepkeyjon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, good idea. LGTM.

@keepkeyjon
keepkeyjon merged commit 43fe80a into keepkey:masterJan 12, 2019
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.
Sign up for freeto 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.

2 participants

@achow101@keepkeyjon