summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-06-18 10:44:29 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2023-06-18 22:41:23 +0200
commitafab7dc5673fbc5fd600182612626676ae36d1c0 (patch)
tree4c13a887b3840894c2be520aec51f933b0239563 /src
parente7d6aafd3c9353d9e6169ca775cf1dae618238cd (diff)
Fail validation of signature with missing key instead throwing exception
Diffstat (limited to 'src')
-rw-r--r--src/pubkey.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pubkey.cpp b/src/pubkey.cpp
index 6461c10..59b73f9 100644
--- a/src/pubkey.cpp
+++ b/src/pubkey.cpp
@@ -173,6 +173,9 @@ Ref Signature::store(const Storage & st) const
bool Signature::verify(const Ref & ref) const
{
+ if (!key->key)
+ return false;
+
unique_ptr<EVP_MD_CTX, void(*)(EVP_MD_CTX*)>
mdctx(EVP_MD_CTX_create(), &EVP_MD_CTX_free);
if (!mdctx)