mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 05:34:57 +01:00
sign: don't assume we are parsing a sane Miniscript
The script provided for signature might be externally provided, for instance by way of 'finalizepsbt'. Therefore the script might be ill-crafted, so don't assume pubkeys are always 32 bytes. Thanks to Niklas for finding this.
This commit is contained in:
@@ -295,7 +295,7 @@ struct TapSatisfier: Satisfier<XOnlyPubKey> {
|
||||
//! Conversion from a raw xonly public key.
|
||||
template <typename I>
|
||||
std::optional<XOnlyPubKey> FromPKBytes(I first, I last) const {
|
||||
CHECK_NONFATAL(last - first == 32);
|
||||
if (last - first != 32) return {};
|
||||
XOnlyPubKey pubkey;
|
||||
std::copy(first, last, pubkey.begin());
|
||||
return pubkey;
|
||||
|
||||
Reference in New Issue
Block a user