aboutsummaryrefslogtreecommitdiff
path: root/src/ecwrapper.cpp
diff options
context:
space:
mode:
authorCory Fields <[email protected]>2015-01-09 22:06:08 -0500
committerCory Fields <[email protected]>2015-01-09 22:06:55 -0500
commit8dccba6a45db0466370726ed462b9da2eae43bce (patch)
tree44083128b139ad0171401972140430fd99cb4d32 /src/ecwrapper.cpp
parentdepends: bump openssl to 1.0.1k (diff)
downloaddiscoin-8dccba6a45db0466370726ed462b9da2eae43bce.tar.xz
discoin-8dccba6a45db0466370726ed462b9da2eae43bce.zip
fail immediately on an empty signature
Diffstat (limited to 'src/ecwrapper.cpp')
-rw-r--r--src/ecwrapper.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ecwrapper.cpp b/src/ecwrapper.cpp
index 33dd9a9a2..0236e90c1 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();