aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pluto/connections.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pluto/connections.c b/src/pluto/connections.c
index 2a3421961..9f277e135 100644
--- a/src/pluto/connections.c
+++ b/src/pluto/connections.c
@@ -874,7 +874,8 @@ static void load_end_certificate(char *filename, struct end *dst)
/* cache the certificate that was last retrieved from the smartcard */
if (dst->sc)
{
- if (!certificate->equals(certificate, dst->sc->last_cert->cert))
+ if (!dst->sc->last_cert ||
+ !certificate->equals(certificate, dst->sc->last_cert->cert))
{
lock_certs_and_keys("load_end_certificates");
cert_release(dst->sc->last_cert);