HomePhabricator

psbt: check that various indexes and amounts are within bounds

Description

psbt: check that various indexes and amounts are within bounds

Summary:

  • Don't calculate tx fees for PSBTs with invalid money values

In decodepsbt if an invalid amount is seen, don't calculate the fee
but still show the invalid value in the decode.

In analyze psbt, if an invalid amount is seen, set the next step to
be the creator as the creator needs to remake the transaction so that
it is valid.

  • psbt: check output index is within bounds before accessing

This is a backport of Core PR17156

Because we only have segwit style UTXO due to our signature algorithm, some checks and test case are not relevent to us.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: PiRK

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

Details

Provenance
Andrew Chow <achow101-github@achow101.com>Authored on Oct 15 2019, 21:15
deadalnixCommitted on Oct 24 2020, 18:53
deadalnixPushed on Oct 24 2020, 18:53
Reviewer
PiRK
Differential Revision
D8092: psbt: check that various indexes and amounts are within bounds
Parents
rABC41e566cae16c: [backport#14696 2/2] New regression testing for CVE-2018-17144, CVE-2012-2459…
Branches
Unknown
Tags
Unknown