Repository navigation
fix(key-wallet)!: check child indexes in the dip9 path builders - #1323
Conversation
The `DerivationPath` builders in `dip9.rs` built `ChildNumber::Hardened` and `ChildNumber::Normal` straight from caller `u32`s, skipping the 31-bit check. An account of `0x8000_0000` built the same path as account 0, and an address index of `0x8000_0000` or more built a non-canonical normal child, while `DerivationPath::from_str` and `AccountType::derivation_path` reject both. The builders now go through `from_hardened_idx` / `from_normal_idx` and return the error, like `application_encryption_path` already did. BREAKING CHANGE: the `dip9` `DerivationPath` builders that take indexes return `Result<DerivationPath, Error>`. Closes #1297
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1323 +/- ##
==========================================
- Coverage 85.00% 84.99% -0.01%
==========================================
Files 267 267
Lines 67675 67671 -4
==========================================
- Hits 57525 57518 -7
- Misses 10150 10153 +3
|
|
Bots are done — your move: post |
The
DerivationPathbuilders indip9.rsbuiltChildNumber::HardenedandChildNumber::Normalstraight from calleru32s, skipping the 31-bit check. An account of0x8000_0000built the same path as account 0, and an address index of0x8000_0000or more built a non-canonical normal child, whileDerivationPath::from_strandAccountType::derivation_pathreject both.The builders now go through
from_hardened_idx/from_normal_idxand return the error, likeapplication_encryption_pathalready did. A test covers0x7fff_ffffagainst0x8000_0000for the account and address index ofbip_44_payment_path.Breaking: the
dip9DerivationPathbuilders that take indexes returnResult<DerivationPath, Error>.Closes #1297
PR Hygiene ·
df51f3f/self-reviewedkey-wallet(key-wallet/src/bip32.rs,key-wallet/src/dip9.rs) — QuantumExplorer or xdustinfaceWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.