Repository navigation
reject malformed unordered PSBTs - #111
yuval-block wants to merge 1 commit into
Conversation
a0900ae to
568bc71
Compare
range-diff for force push a0900aeb14 → 568bc715d0
|
range-diff for force push a0900aeb14 → 568bc715d0
|
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
568bc71 to
4bf7243
Compare
4bf7243 to
eb00e80
Compare
49b7b30 to
bd05b74
Compare
range-diff for force push 49b7b304df → bd05b74787
|
range-diff for force push 49b7b304df → bd05b74787
|
bd05b74 to
a9581c5
Compare
range-diff for force push bd05b74787 → a9581c5710
|
| } | ||
| _ => {} | ||
| } | ||
| duplicate_sort_key(inputs.iter().filter_map(|input| input.sort_key())) |
There was a problem hiding this comment.
Parse checks don't hold for values built in code
The checks added here run only in try_from_psbt, so an UnorderedPsbt built in code can hold a state that into_psbt serializes and try_from_psbt then rejects: joining two PSBTs whose distinct inputs share a sort key (DuplicateSortKey, and the join is_ok()), a global left at Global::default() (NotUnordered), or set_sort_key_derivation(Explicit) with a seed set (UnexpectedSortSeed). @yuval-block, is validating only at parse intended, or should the type (and join) enforce these?
oak · automated · a9581c5
a9581c5 to
6a0b965
Compare
range-diff for force push a9581c5710 → 6a0b965918
|
range-diff for force push a9581c5710 → 6a0b965918
|
6a0b965 to
a271a32
Compare
range-diff for force push 6a0b965918 → a271a321e1
|
range-diff for force push 6a0b965918 → a271a321e1
|
range-diff for force push 14bdc5dc6e → 4b960b27d1
|
4b960b2 to
52c5c10
Compare
range-diff for force push 4b960b27d1 → 52c5c10828
|
52c5c10 to
d28748f
Compare
range-diff for force push 52c5c10828 → d28748fca8
|
d28748f to
a69dec9
Compare
range-diff for force push d28748fca8 → a69dec9481
|
a69dec9 to
496f7b9
Compare
range-diff for force push a69dec9481 → 496f7b9cd8
|
range-diff for force push a69dec9481 → 496f7b9cd8
|
496f7b9 to
f1e8135
Compare
range-diff for force push 496f7b9cd8 → f1e8135717
|
f1e8135 to
3898b66
Compare
range-diff for force push f1e8135717 → 3898b66476
|
3898b66 to
42aa094
Compare
range-diff for force push 3898b66476 → 42aa094bc9
|
42aa094 to
6f5ebba
Compare
range-diff for force push 42aa094bc9 → 6f5ebba138
|
Check the values of the unordered PSBT fields: PSBT_GLOBAL_TX_UNORDERED must be 0x03, PSBT_GLOBAL_SORT_DETERMINISTIC 0x00 or 0x01, the sort seed at least 16 bytes long, and sort keys at most 32 bytes long. Also reject PSBTs that break the modifiability invariants: a PSBT whose inputs or outputs are modifiable must be unordered, since its order would otherwise be lost, and an unordered PSBT must not have the SIGHASH_SINGLE bit set.
6f5ebba to
925002f
Compare
range-diff for force push 6f5ebba138 → 925002f20c
|
925002f to
86be9b9
Compare
range-diff for force push 925002f20c → 86be9b9b5f
|
Check the values of the unordered PSBT fields: PSBT_GLOBAL_TX_UNORDERED must be 0x03, PSBT_GLOBAL_SORT_DETERMINISTIC 0x00 or 0x01, the sort seed at least 16 bytes long, and sort keys at most 32 bytes long.
Also reject PSBTs that break the modifiability invariants: a PSBT whose inputs or outputs are modifiable must be unordered, since its order would otherwise be lost, and an unordered PSBT must not have the SIGHASH_SINGLE bit set.