• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rust-bitcoin / rust-bitcoin / 13822336239
83%

Build:
DEFAULT BRANCH: master
Ran 12 Mar 2025 10:00PM UTC
Jobs 1
Files 126
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Mar 2025 09:59PM UTC coverage: 83.045% (-0.004%) from 83.049%
13822336239

push

github

apoelstra
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

Uncovered Changes

Lines Coverage ∆ File
9
84.65
-0.25% bitcoin/src/bip32.rs
Jobs
ID Job ID Ran Files Coverage
1 13822336239.1 12 Mar 2025 10:00PM UTC 126
83.04
GitHub Action Run
Source Files on build 13822336239
  • Tree
  • List 126
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #13822336239
  • 1f745714 on github
  • Prev Build on master (#13813702872)
  • Next Build on master (#13823557936)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc