|
Ran
|
Jobs
1
|
Files
126
|
Run time
1min
|
Badge
README BADGES
|
push
github
Merge rust-bitcoin/rust-bitcoin#4230: Fix BIP32 validation for private keys and master key constraints (#4195) <a class=hub.com/rust-bitcoin/rust-bitcoin/commit/<a class="double-link" href="https://git"><a class=hub.com/rust-bitcoin/rust-bitcoin/commit/<a class="double-link" href="https://git"><a class=hub.com/rust-bitcoin/rust-bitcoin/commit/8f74b823ab8ef44bde7d003f8ba43fbe44dbef3e">8f74b823a Add validation for private key format and master key constraints (Erick Cestari) Pull request description: This PR addresses issue #4195 by adding proper validation when decoding extended private keys: ### Changes - Add validation to ensure byte 45 is zero as required by BIP-32 specification for private keys - For master keys (depth=0), add validation to ensure parent fingerprint is zero - For master keys (depth=0), add validation to ensure child number is zero - Add corresponding error types to handle these validation failures - Add unit tests to verify each validation rule ### Validation Rationale These checks improve security by rejecting malformed extended keys that could potentially lead to unexpected behavior. As noted in the issue discussion, these validations are explicitly required by the BIP-32 specification. ### Testing Added three new unit tests to verify each validation rule: - test_reject_xpriv_with_non_zero_byte_at_index_45 - test_reject_xpriv_with_zero_depth_and_non_zero_index - test_reject_xpriv_with_zero_depth_and_non_zero_parent_fingerprint Fixes #4195 ACKs for top commit: jrakibi: ACK 8f74b823ab8ef44bde7d003f8ba43fbe44dbef3e tcharding: ACK 8f74b823ab8ef44bde7d003f8ba43fbe44dbef3e apoelstra: ACK 8f74b823ab8ef44bde7d003f8ba43fbe44dbef3e; successfully ran local tests Tree-SHA512: 6a013e491d981a99ee50d512c3cb01a3023
38 of 47 new or added lines in 1 file covered. (80.85%)
21678 of 26104 relevant lines covered (83.04%)
16853.35 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 9 |
84.65 |
-0.25% | bitcoin/src/bip32.rs |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 13822336239.1 | 126 |
83.04 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|