mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
Merge pull request #3843
787ee0cCheck redeemScript size does not exceed 520 byte limit (Peter Todd)4d79098Increase IsStandard() scriptSig length (Peter Todd)f80cffaDo not trigger a DoS ban if SCRIPT_VERIFY_NULLDUMMY fails (Peter Todd)6380180Add rejection of non-null CHECKMULTISIG dummy values (Peter Todd)29c1749Let tx (in)valid tests use any SCRIPT_VERIFY flag (Peter Todd)68f7d1dCreate (MANDATORY|STANDARD)_SCRIPT_VERIFY_FLAGS constants (Peter Todd)
This commit is contained in:
@@ -923,8 +923,22 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
|
||||
fSuccess = false;
|
||||
}
|
||||
|
||||
while (i-- > 0)
|
||||
// Clean up stack of actual arguments
|
||||
while (i-- > 1)
|
||||
popstack(stack);
|
||||
|
||||
// A bug causes CHECKMULTISIG to consume one extra argument
|
||||
// whose contents were not checked in any way.
|
||||
//
|
||||
// Unfortunately this is a potential source of mutability,
|
||||
// so optionally verify it is exactly equal to zero prior
|
||||
// to removing it from the stack.
|
||||
if (stack.size() < 1)
|
||||
return false;
|
||||
if ((flags & SCRIPT_VERIFY_NULLDUMMY) && stacktop(-1).size())
|
||||
return error("CHECKMULTISIG dummy argument not null");
|
||||
popstack(stack);
|
||||
|
||||
stack.push_back(fSuccess ? vchTrue : vchFalse);
|
||||
|
||||
if (opcode == OP_CHECKMULTISIGVERIFY)
|
||||
@@ -1659,7 +1673,7 @@ bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CTransa
|
||||
}
|
||||
|
||||
// Test solution
|
||||
return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, 0);
|
||||
return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, STANDARD_SCRIPT_VERIFY_FLAGS, 0);
|
||||
}
|
||||
|
||||
bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType)
|
||||
|
||||
Reference in New Issue
Block a user