diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-01-26 12:08:11 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-01-26 12:09:11 +0100 |
| commit | b01a435c34f0669affece2b3d90f92c347588d69 (patch) | |
| tree | c552af9882211c9805a3d258e7f494560b3ab225 /src/script/interpreter.cpp | |
| parent | Merge pull request #5599 (diff) | |
| parent | Make empty byte arrays pass CheckSignatureEncoding() (diff) | |
| download | discoin-b01a435c34f0669affece2b3d90f92c347588d69.tar.xz discoin-b01a435c34f0669affece2b3d90f92c347588d69.zip | |
Merge pull request #5627
2fa9a8e Make empty byte arrays pass CheckSignatureEncoding() (Peter Todd)
Diffstat (limited to 'src/script/interpreter.cpp')
| -rw-r--r-- | src/script/interpreter.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index d0f75ab67..8a06f3d11 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -189,6 +189,11 @@ bool static IsDefinedHashtypeSignature(const valtype &vchSig) { } bool static CheckSignatureEncoding(const valtype &vchSig, unsigned int flags, ScriptError* serror) { + // Empty signature. Not strictly DER encoded, but allowed to provide a + // compact way to provide an invalid signature for use with CHECK(MULTI)SIG + if (vchSig.size() == 0) { + return true; + } if ((flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC)) != 0 && !IsDERSignature(vchSig)) { return set_error(serror, SCRIPT_ERR_SIG_DER); } else if ((flags & SCRIPT_VERIFY_LOW_S) != 0 && !IsLowDERSignature(vchSig, serror)) { |