test: return False for a too-short ECDSA signature #36186

pull fametrano wants to merge 1 commits into bitcoin:master from fametrano:test-verify-ecdsa-len changing 1 files +11 −2
  1. fametrano commented at 6:06 PM on September 7, 2026: contributor

    verify_ecdsa reads sig[1] before it checks len(sig) < 4, so a 0- or 1-byte signature raises IndexError instead of returning False, which the comment promises for any DER encoding error.

    Move the length check ahead of the byte access, and add a regression test.

  2. test: return False for a too-short ECDSA signature
    verify_ecdsa reads sig[1] before it checks len(sig) < 4, so a 0- or
    1-byte signature raises IndexError instead of returning False, which the
    comment promises for any DER encoding error. Move the length check
    first, and add a regression test.
    bea69bc600
  3. DrahtBot added the label Tests on Sep 7, 2026
  4. DrahtBot commented at 6:07 PM on September 7, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36186.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-09 07:56 UTC