aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2015-01-10 09:14:17 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-10 09:14:17 +0100
commit91e1332011ca647362f95f34ae6c530640bfef98 (patch)
tree417ada4d7eb58da3e6ac5a146e38336d3fb78315
parentf4134ee30100a3ba8a25e3f7ac6c4e0b39fb05a3 (diff)
fail immediately on an empty signature
Github-Pull: #5634 Rebased-From: 8dccba6a45db0466370726ed462b9da2eae43bce
-rw-r--r--src/key.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/key.cpp b/src/key.cpp
index 8a1bfef771..7fcb17d574 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -376,6 +376,9 @@ bool CKey::SetCompactSignature(uint256 hash, const std::vector<unsigned char>& v
bool CKey::Verify(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();