-
Notifications
You must be signed in to change notification settings - Fork 38.6k
check that a separator is found for psbt inputs, outputs, and global map #14377
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
|
Is this for 0.17.1 backport? |
| if (key.empty()) return; | ||
| if (key.empty()) { | ||
| found_sep = true; | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale for breaking here instead of throwing the error right away?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to throw the error if we don't get here.
| s >> key; | ||
|
|
||
| // the key is empty if that was actually a separator byte | ||
| // This is a special case for key lengths 0 as those are not allowed (except for separator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment may need updating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
|
|
||
| // the key is empty if that was actually a separator byte | ||
| // This is a special case for key lengths 0 as those are not allowed (except for separator) | ||
| if (key.empty()) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, comment may need updating?
|
|
||
| // the key is empty if that was actually a separator byte | ||
| // This is a special case for key lengths 0 as those are not allowed (except for separator) | ||
| if (key.empty()) break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment may need updating?
|
utACK 4fb3388. I think it should go into 0.17.1. |
|
|
utACK 4fb3388 |
…s, and global map 4fb3388 check that a separator is found for psbt inputs, outputs, and global map (Andrew Chow) Pull request description: Currently it doesn't make sure that a separator was found so PSBTs missing a trailing separator would still pass. This fixes that and adds a test case for it. It really only makes sense to check for the separator for the output maps as if an input or global map was missing a separator, the fields following it would be interpreted as belonging to the previous input or global map. However I have added the check for those two anyways to be consistent. Tree-SHA512: 50c0c08e201ba02494b369a4d36ddb73e6634eb5a4e4e201c4ef38fd2dbeea2c642b8a04d50c91615da61ecbfade37309e47431368f4b1064539c42015766b50
|
This will be backported in #14780. |
Github-Pull: bitcoin#14377 Rebased-From: 4fb3388
7bee414 Add test for conversion from non-witness to witness UTXO (Pieter Wuille) ff56bb9 Add regression test for PSBT signing bug #14473 (Glenn Willen) db445d4 Refactor PSBTInput signing to enforce invariant (Glenn Willen) ad94165 Simplify arguments to SignPSBTInput (Glenn Willen) 39ece4f Add bool PSBTInputSigned (Glenn Willen) 70ee1f8 New PartiallySignedTransaction constructor from CTransction (Glenn Willen) a9eab08 Remove redundant txConst parameter to FillPSBT (Glenn Willen) cfdd6b2 More concise conversion of CDataStream to string (Glenn Willen) a3fe125 check that a separator is found for psbt inputs, outputs, and global map (Andrew Chow) Pull request description: This is a backport of #14588, #14377, and #14197's test to 0.17. Tree-SHA512: 07535ec69a878a63b549e5e463345e233f34662dff805202614cf2ffc896c6d1981363e6d06d02db2e02d815075ad8ebdc5f93f637052cff8c8cbe6c8dfa096a
Summary: PR description: Currently it doesn't make sure that a separator was found so PSBTs missing a trailing separator would still pass. This fixes that and adds a test case for it. It really only makes sense to check for the separator for the output maps as if an input or global map was missing a separator, the fields following it would be interpreted as belonging to the previous input or global map. However I have added the check for those two anyways to be consistent. Backport of Core [[bitcoin/bitcoin#14377 | PR14377]] Test Plan: `ninja && test/functional/test_runner.py rpc_psbt` Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7753
… outputs, and global map 4fb3388 check that a separator is found for psbt inputs, outputs, and global map (Andrew Chow) Pull request description: Currently it doesn't make sure that a separator was found so PSBTs missing a trailing separator would still pass. This fixes that and adds a test case for it. It really only makes sense to check for the separator for the output maps as if an input or global map was missing a separator, the fields following it would be interpreted as belonging to the previous input or global map. However I have added the check for those two anyways to be consistent. Tree-SHA512: 50c0c08e201ba02494b369a4d36ddb73e6634eb5a4e4e201c4ef38fd2dbeea2c642b8a04d50c91615da61ecbfade37309e47431368f4b1064539c42015766b50
Currently it doesn't make sure that a separator was found so PSBTs missing a trailing separator would still pass. This fixes that and adds a test case for it.
It really only makes sense to check for the separator for the output maps as if an input or global map was missing a separator, the fields following it would be interpreted as belonging to the previous input or global map. However I have added the check for those two anyways to be consistent.