TLS: move from SUPPORT_TLS to DISABLE_TLS macro for the build
[exim.git] / src / src / tls.c
index f79bc3193e1f30f785cecd0b89a2d9b28fd40c15..1fd10d52b374000a425166f90804a88482076aea 100644 (file)
@@ -19,9 +19,11 @@ functions from the OpenSSL or GNU TLS libraries. */
 #include "exim.h"
 #include "transports/smtp.h"
 
-#if defined(MACRO_PREDEF) && defined(SUPPORT_TLS)
-# ifndef USE_GNUTLS
-#  include "macro_predef.h"
+#if defined(MACRO_PREDEF) && !defined(DISABLE_TLS)
+# include "macro_predef.h"
+# ifdef USE_GNUTLS
+#  include "tls-gnu.c"
+# else
 #  include "tls-openssl.c"
 # endif
 #endif
@@ -35,7 +37,7 @@ reference itself to stop picky compilers complaining that it is unused, and put
 in a dummy argument to stop even pickier compilers complaining about infinite
 loops. */
 
-#ifndef SUPPORT_TLS
+#ifdef DISABLE_TLS
 static void dummy(int x) { dummy(x-1); }
 #else
 
@@ -215,7 +217,7 @@ return ssl_xfer_buffer_lwm < ssl_xfer_buffer_hwm;
 }
 
 
-#endif  /* SUPPORT_TLS */
+#endif  /*DISABLE_TLS*/
 
 void
 tls_modify_variables(tls_support * dest_tsp)
@@ -224,13 +226,13 @@ modify_variable(US"tls_bits",                 &dest_tsp->bits);
 modify_variable(US"tls_certificate_verified", &dest_tsp->certificate_verified);
 modify_variable(US"tls_cipher",               &dest_tsp->cipher);
 modify_variable(US"tls_peerdn",               &dest_tsp->peerdn);
-#if defined(SUPPORT_TLS) && !defined(USE_GNUTLS)
+#if !defined(DISABLE_TLS) && !defined(USE_GNUTLS)
 modify_variable(US"tls_sni",                  &dest_tsp->sni);
 #endif
 }
 
 
-#ifdef SUPPORT_TLS
+#ifndef DISABLE_TLS
 /************************************************
 *      TLS certificate name operations         *
 ************************************************/
@@ -244,8 +246,7 @@ inplace.
 static void
 dn_to_list(uschar * dn)
 {
-uschar * cp;
-for (cp = dn; *cp; cp++)
+for (uschar * cp = dn; *cp; cp++)
   if (cp[0] == '\\' && cp[1] == ',')
     *cp++ = ',';
 }
@@ -363,7 +364,7 @@ else if ((subjdn = tls_cert_subject(cert, NULL)))
   }
 return FALSE;
 }
-#endif /*SUPPORT_TLS*/
+#endif /*!DISABLE_TLS*/
 #endif /*!MACRO_PREDEF*/
 
 /* vi: aw ai sw=2