mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
psbt: Require ECDSA signatures to be validly encoded
Needed for later validation of sighash types.
This commit is contained in:
parent
51d76634fb
commit
bd6c81f084
1 changed files with 5 additions and 0 deletions
|
@ -520,6 +520,11 @@ struct PSBTInput
|
|||
std::vector<unsigned char> sig;
|
||||
s >> sig;
|
||||
|
||||
// Check that the signature is validly encoded
|
||||
if (sig.empty() || !CheckSignatureEncoding(sig, SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_STRICTENC, nullptr)) {
|
||||
throw std::ios_base::failure("Signature is not a valid encoding");
|
||||
}
|
||||
|
||||
// Add to list
|
||||
partial_sigs.emplace(pubkey.GetID(), SigPair(pubkey, std::move(sig)));
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue