diff options
| author | John L. Jegutanis <[email protected]> | 2019-09-06 20:54:00 +0200 |
|---|---|---|
| committer | John L. Jegutanis <[email protected]> | 2019-10-08 01:45:36 +0300 |
| commit | 9743432034586385cfef87df4b377c255ed0cba8 (patch) | |
| tree | 27482fb0a24712803f5243868bcac20b1ab84d30 /src/net_processing.cpp | |
| parent | Merge #17069: tests: Pass fuzzing inputs as constant references (diff) | |
| download | discoin-9743432034586385cfef87df4b377c255ed0cba8.tar.xz discoin-9743432034586385cfef87df4b377c255ed0cba8.zip | |
Fix bug where duplicate PSBT keys are accepted
As per the BIP 174 spec a PSBT key cannot be duplicated,
however the current code accepts key duplication.
The PSBT key/value entries can be duplicated when the value
is `empty()` or `IsNull()` for `CScript` or `CTxOut` respectively
and if those key/value entries are serialized before the non-empty ones.
For example, the following PSBT, included in the test vectors,
contains a duplicate field:
```
// magic
70736274ff
// global tx
//// key
0100
//// value
2a02000000000140420f000000000017a9146e91b72d5593e7d4391e2ff44e91e985c31641f08700000000
//// separator
00
// no inputs
// outputs
//// key PSBT_OUT_WITNESSSCRIPT
0101
//// value (empty script)
00
//// key PSBT_OUT_WITNESSSCRIPT (same as the above)
0101
//// value (an OP_RETURN script)
016a
//// separator
00
```
Diffstat (limited to 'src/net_processing.cpp')
0 files changed, 0 insertions, 0 deletions