aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tortls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 2a2a5d7fd1..1057cf40f0 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -891,9 +891,12 @@ tor_tls_cert_is_valid(int severity,
{
check_no_tls_errors();
EVP_PKEY *cert_key;
- EVP_PKEY *signing_key = X509_get_pubkey(signing_cert->cert);
int r, key_ok = 0;
+ if (!signing_cert)
+ goto bad;
+
+ EVP_PKEY *signing_key = X509_get_pubkey(signing_cert->cert);
if (!signing_key)
goto bad;
r = X509_verify(cert->cert, signing_key);