mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 04:18:10 +00:00
feat(core): Ensure input's script type and path match the scriptPubKey.
This commit is contained in:
parent
a38a0b6295
commit
c9e6ca30c9
1
core/.changelog.d/1018.changed
Normal file
1
core/.changelog.d/1018.changed
Normal file
@ -0,0 +1 @@
|
|||||||
|
Ensure input's script type and path match the scriptPubKey.
|
1
core/.changelog.d/1018.incompatible
Normal file
1
core/.changelog.d/1018.incompatible
Normal file
@ -0,0 +1 @@
|
|||||||
|
Trezor will refuse to sign UTXOs that do not match the provided derivation path (e.g., transactions belonging to a different wallet, or synthetic transaction inputs).
|
@ -229,6 +229,9 @@ class Bitcoin:
|
|||||||
if prev_amount != txi.amount:
|
if prev_amount != txi.amount:
|
||||||
raise wire.DataError("Invalid amount specified")
|
raise wire.DataError("Invalid amount specified")
|
||||||
|
|
||||||
|
if script_pubkey != self.input_derive_script(txi):
|
||||||
|
raise wire.DataError("Input does not match scriptPubKey")
|
||||||
|
|
||||||
if i in self.external:
|
if i in self.external:
|
||||||
await self.verify_external_input(i, txi, script_pubkey)
|
await self.verify_external_input(i, txi, script_pubkey)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user