aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2015-01-09 22:06:08 -0500
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-10 08:10:38 +0100
commit76ce5c8de3b97c9843e23c9b30f1049045c4b293 (patch)
treea980709f4e005c14cad6a61f8d77f1b7ade22e33
parent2d375fe97b34b16c11868dca8c5dde5667026914 (diff)
downloadbitcoin-76ce5c8de3b97c9843e23c9b30f1049045c4b293.tar.xz
fail immediately on an empty signature
Github-Pull: #5634 Rebased-From: 8dccba6a45db0466370726ed462b9da2eae43bce
-rw-r--r--src/ecwrapper.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ecwrapper.cpp b/src/ecwrapper.cpp
index be33913d0d..79f70d1f47 100644
--- a/src/ecwrapper.cpp
+++ b/src/ecwrapper.cpp
@@ -117,6 +117,9 @@ bool CECKey::SetPubKey(const unsigned char* pubkey, size_t size) {
}
bool CECKey::Verify(const uint256 &hash, const std::vector<unsigned char>& vchSig) {
+ if (vchSig.empty())
+ return false;
+
// New versions of OpenSSL will reject non-canonical DER signatures. de/re-serialize first.
unsigned char *norm_der = NULL;
ECDSA_SIG *norm_sig = ECDSA_SIG_new();