feat(core): Ensure input's script type and path match the scriptPubKey.

pull/2180/head
Andrew Kozlik 2 years ago committed by Andrew Kozlik
parent a38a0b6295
commit c9e6ca30c9

@ -0,0 +1 @@
Ensure input's script type and path match the scriptPubKey.

@ -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:
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:
await self.verify_external_input(i, txi, script_pubkey)

Loading…
Cancel
Save