CRL addition returns count of CRLs added
[exim.git] / src / src / tls-gnu.c
index 1953be1e460313c7a9dfce356ecfb3162581cc31..a9a82e88fc01f2833fd06126a356621e28303360 100644 (file)
@@ -728,15 +728,18 @@ if (cert_count < 0)
   }
 DEBUG(D_tls) debug_printf("Added %d certificate authorities.\n", cert_count);
 
-if (state->tls_crl && *state->tls_crl)
+if (state->tls_crl && *state->tls_crl &&
+    state->exp_tls_crl && *state->exp_tls_crl)
   {
-  if (state->exp_tls_crl && *state->exp_tls_crl)
+  DEBUG(D_tls) debug_printf("loading CRL file = %s\n", state->exp_tls_crl);
+  cert_count = gnutls_certificate_set_x509_crl_file(state->x509_cred,
+      CS state->exp_tls_crl, GNUTLS_X509_FMT_PEM);
+  if (cert_count < 0)
     {
-    DEBUG(D_tls) debug_printf("loading CRL file = %s\n", state->exp_tls_crl);
-    rc = gnutls_certificate_set_x509_crl_file(state->x509_cred,
-        CS state->exp_tls_crl, GNUTLS_X509_FMT_PEM);
+    rc = cert_count;
     exim_gnutls_err_check(US"gnutls_certificate_set_x509_crl_file");
     }
+  DEBUG(D_tls) debug_printf("Processed %d CRLs.\n", cert_count);
   }
 
 return OK;