psbt: Require ECDSA signatures to be validly encoded
Needed for later validation of sighash types.
This commit is contained in:
1 parent
53eb5593f0
commit
5a5d26d612
1 file changed
+5
@@ -520,6 +520,11 @@ struct PSBTInput
|
|||||||
std::vector<unsigned char> sig;
|
std::vector<unsigned char> sig;
|
||||||
s >> 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
|
// Add to list
|
||||||
partial_sigs.emplace(pubkey.GetID(), SigPair(pubkey, std::move(sig)));
|
partial_sigs.emplace(pubkey.GetID(), SigPair(pubkey, std::move(sig)));
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in new issue
Block a user