Repository navigation
Validate BIP32 seed length before master key generation - #162
Harshil-1603 wants to merge 5 commits into
Conversation
Assisted-by: OpenAI gpt-6.1-sol
Assisted-by: OpenAI gpt-6.1-sol
Assisted-by: OpenAI gpt-6.1-sol
Assisted-by: OpenAI gpt-6.1-sol
|
Tested ACK 025a993: embit now raises |
|
ACK at 025a993 with intention to squash into 1 commit, rebase and merge atop branch "hardened" In the context of generating a master wallet, bip32 clearly states:
|
odudex
left a comment
There was a problem hiding this comment.
Fix is correct
Some nits, none blocking:
- Changelog section. The entry sits under ### Fixed, but it's a behaviour change that can break callers.
hardenedfiles similar "now rejects" entries under ### Changed, so I'd move it there while resolving the merge conflict (tohardenedbranch). - Could be squashed. Squashing the 4 commits on merge could also make the changelog conflict disappear into one resolution.
Assisted-by: OpenAI Codex
|
ACK at fb791e0 with intention to merge all 5 commits into "hardened", (two commit conflicts resolved for CHANGELOG.md by me, so really 4 commits plus merge-commit) just after pr124 Thank you harshil, odudex, and fametrano. |
|
ACK at fb791e0 |
miketlk
left a comment
There was a problem hiding this comment.
All looks good to me, but I'd squash the two latest commits modifying CHANGELOG.md.
Fixes #127.
HDKey.from_seed()currently derives a master key even from an empty seed. Validate the length before HMAC generation and raiseHDErroroutside the 16–64 byte range specified by BIP32. Update the docstring, API documentation, and changelog to describe the accepted range.Tests reject lengths 0, 1, 15, 65, and 128, and accept 16, 17, 32, 63, and 64 bytes. Existing BIP32 derivation vectors remain unchanged. This tightens behavior for callers that previously supplied seeds outside the BIP32 range.
Validation on CPython 3.11.15 with the repository's hash-pinned CI dependencies:
git diff --checkpassed.MicroPython and the other Python versions in the CI matrix were not run locally.
AI assistance: implementation and validation were assisted by OpenAI Codex (gpt-6.1-sol).