-
Notifications
You must be signed in to change notification settings - Fork 37.7k
[0.19] psbt: check that various indexes and amounts are within bounds #18079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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. Github-Pull: bitcoin#17156 Rebased-From: f1ef7f0
Looks like this needs some changes: wallet/test/psbt_wallet_tests.cpp: In member function ‘void psbt_wallet_tests::psbt_updater_test::test_method()’:
wallet/test/psbt_wallet_tests.cpp:77:48: error: ‘class CWallet’ has no member named ‘GetSigningProvider’
const SigningProvider* provider = m_wallet.GetSigningProvider(ws1, sigdata);
^
make[2]: *** [wallet/test/test_test_bitcoin-psbt_wallet_tests.o] Error 1 |
Github-Pull: bitcoin#17156 Rebased-From: deaa6dd
3cae9b6
to
f5fb7fc
Compare
Fixed ( |
Backport looks good to me, backported test looks good to me (and passes). |
… within bounds f5fb7fc psbt: check output index is within bounds before accessing (Andrew Chow) 1cf77a2 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Backport of #17156, non-trivial due to crossing the refactor in #17371 ACKs for top commit: laanwj: ACK f5fb7fc Tree-SHA512: 7aabf9a6b8a8e287a26dfbf73a437a3bc55177bef8fc5149d822ef81b8ef2458e1d718c3a19c73532c5cef0f9bd8144574c7fad90ca89f13a08b44edf3a2656d
The checks correctly detect the case when the sum of amounts of inputs or outputs (rather than individual amounts) exceed MoneyRange, but as AFAICT the tests do not test for these conditions. Here's two test PSBT that exhibit the conditions, please use them to add to the tests if you'd like: sum of input amounts is out of valid range: sum of output amounts is out of valid range: |
- [0.19] wallet: Reset reused transactions cache bitcoin#18083 - 0.19: Backports bitcoin#17792 - psbt: handle unspendable psbts bitcoin#17524 - qt: Fix comparison function signature bitcoin#17634 - psbt: check that various indexes and amounts are within bounds bitcoin#17156 - [0.19] psbt: check that various indexes and amounts are within bounds bitcoin#18079 - [0.19] Final backports for 0.19.1 bitcoin#17988 - Bug: IsUsedDestination shouldn't use key id as script id for ScriptHash bitcoin#17924 - qt: Fix deprecated QCharRef usage bitcoin#18101 - gui: Throttle GUI update pace when -reindex bitcoin#18121 - gui: Fix race in WalletModel::pollBalanceChanged bitcoin#18123 - gui: Fix unintialized WalletView::progressDialog bitcoin#18062 - Bugfix: GUI: Hide the HD/encrypt icons earlier so they get re-shown if another wallet is open bitcoin#18007 - bug-fix macos: give free bytes to F_PREALLOCATE bitcoin#17887 - test: add missing #include to fix compiler errors bitcoin#17980 - zmq: Fix due to invalid argument and multiple notifiers bitcoin#17445
…nts are within bounds f5fb7fc psbt: check output index is within bounds before accessing (Andrew Chow) 1cf77a2 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Backport of bitcoin#17156, non-trivial due to crossing the refactor in bitcoin#17371 ACKs for top commit: laanwj: ACK f5fb7fc Tree-SHA512: 7aabf9a6b8a8e287a26dfbf73a437a3bc55177bef8fc5149d822ef81b8ef2458e1d718c3a19c73532c5cef0f9bd8144574c7fad90ca89f13a08b44edf3a2656d
…nts are within bounds f5fb7fc psbt: check output index is within bounds before accessing (Andrew Chow) 1cf77a2 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Backport of bitcoin#17156, non-trivial due to crossing the refactor in bitcoin#17371 ACKs for top commit: laanwj: ACK f5fb7fc Tree-SHA512: 7aabf9a6b8a8e287a26dfbf73a437a3bc55177bef8fc5149d822ef81b8ef2458e1d718c3a19c73532c5cef0f9bd8144574c7fad90ca89f13a08b44edf3a2656d
…nts are within bounds f5fb7fc psbt: check output index is within bounds before accessing (Andrew Chow) 1cf77a2 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Backport of bitcoin#17156, non-trivial due to crossing the refactor in bitcoin#17371 ACKs for top commit: laanwj: ACK f5fb7fc Tree-SHA512: 7aabf9a6b8a8e287a26dfbf73a437a3bc55177bef8fc5149d822ef81b8ef2458e1d718c3a19c73532c5cef0f9bd8144574c7fad90ca89f13a08b44edf3a2656d
…nts are within bounds f5fb7fc psbt: check output index is within bounds before accessing (Andrew Chow) 1cf77a2 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Backport of bitcoin#17156, non-trivial due to crossing the refactor in bitcoin#17371 ACKs for top commit: laanwj: ACK f5fb7fc Tree-SHA512: 7aabf9a6b8a8e287a26dfbf73a437a3bc55177bef8fc5149d822ef81b8ef2458e1d718c3a19c73532c5cef0f9bd8144574c7fad90ca89f13a08b44edf3a2656d
…and amounts are within bounds f5fb7fc psbt: check output index is within bounds before accessing (Andrew Chow) 1cf77a2 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Backport of bitcoin#17156, non-trivial due to crossing the refactor in bitcoin#17371 ACKs for top commit: laanwj: ACK f5fb7fc Tree-SHA512: 7aabf9a6b8a8e287a26dfbf73a437a3bc55177bef8fc5149d822ef81b8ef2458e1d718c3a19c73532c5cef0f9bd8144574c7fad90ca89f13a08b44edf3a2656d
…and amounts are within bounds f5fb7fc psbt: check output index is within bounds before accessing (Andrew Chow) 1cf77a2 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Backport of bitcoin#17156, non-trivial due to crossing the refactor in bitcoin#17371 ACKs for top commit: laanwj: ACK f5fb7fc Tree-SHA512: 7aabf9a6b8a8e287a26dfbf73a437a3bc55177bef8fc5149d822ef81b8ef2458e1d718c3a19c73532c5cef0f9bd8144574c7fad90ca89f13a08b44edf3a2656d
…and amounts are within bounds f5fb7fc psbt: check output index is within bounds before accessing (Andrew Chow) 1cf77a2 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Backport of bitcoin#17156, non-trivial due to crossing the refactor in bitcoin#17371 ACKs for top commit: laanwj: ACK f5fb7fc Tree-SHA512: 7aabf9a6b8a8e287a26dfbf73a437a3bc55177bef8fc5149d822ef81b8ef2458e1d718c3a19c73532c5cef0f9bd8144574c7fad90ca89f13a08b44edf3a2656d
Backport of #17156, non-trivial due to crossing the refactor in #17371