HomePhabricator

test: add vectors for the SIGHASH single bug

Description

test: add vectors for the SIGHASH single bug

Summary:
We take a mainnet transaction knwon to trigger the sighash_single bug (txid: 99fc1e5c753459808bac56435b3d45f2fcf0dd73016ea14460d63e9ddf353714), and we pass it to SignatureHash function with two different sighash types:

  • SINGLE (pre-UAHF tx): in this case the signature hash is 1 for any flag combination
  • SINGLE | FORKID (0x03 | 0x40 = 0x43 = 67): in this case the signature hash is 1 only if the SCRIPT_ENABLE_SIGHASH_FORKID flag is not set

This is done for input index 2, for a transaction that has only one output, thus triggering the nOut out of range issue.

Test Plan: ninja check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18851

Details

Provenance
PiRKAuthored on Thu, Oct 30, 12:00
PiRKPushed on Fri, Oct 31, 09:57
Reviewer
Restricted Project
Differential Revision
D18851: test: add vectors for the SIGHASH single bug
Parents
rABC35443bae6a87: [ecash-agora] Specify ecash-wallet as a dep and not a dev dep
Branches
Unknown
Tags
Unknown