From afab7dc5673fbc5fd600182612626676ae36d1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 18 Jun 2023 10:44:29 +0200 Subject: Fail validation of signature with missing key instead throwing exception --- src/pubkey.cpp | 3 +++ 1 file changed, 3 insertions(+) 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 mdctx(EVP_MD_CTX_create(), &EVP_MD_CTX_free); if (!mdctx) -- cgit v1.2.3