From 76ce5c8de3b97c9843e23c9b30f1049045c4b293 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 9 Jan 2015 22:06:08 -0500 Subject: fail immediately on an empty signature Github-Pull: #5634 Rebased-From: 8dccba6a45db0466370726ed462b9da2eae43bce --- src/ecwrapper.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ecwrapper.cpp') 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& 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(); -- cgit v1.2.3