Fix build with recent LibreSSL, when including DANE. Bug 2386
[exim.git] / src / src / tlscert-openssl.c
index d3bb8f4670442f381d42ddb3bb9047a704f64d9d..3551045ce84dba8ab53d2fff1884bc9ba904f22d 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) Jeremy Harris 2014 - 2017 */
+/* Copyright (c) Jeremy Harris 2014 - 2019 */
 
 /* This module provides TLS (aka SSL) support for Exim using the OpenSSL
 library. It is #included into the tls.c file when that library is used.
@@ -17,8 +17,14 @@ library. It is #included into the tls.c file when that library is used.
 #include <openssl/rand.h>
 #include <openssl/x509v3.h>
 
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
-# define EXIM_HAVE_ASN1_MACROS
+#ifdef LIBRESSL_VERSION_NUMBER /* LibreSSL */
+# if LIBRESSL_VERSION_NUMBER >= 0x2090000fL
+#  define EXIM_HAVE_ASN1_MACROS
+# endif
+#else                          /* OpenSSL */
+# if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#  define EXIM_HAVE_ASN1_MACROS
+# endif
 #endif
 
 #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
@@ -156,7 +162,7 @@ else
 
     else
       {
-      if (!timestamps_utc)     /* decoded string in local TZ */
+      if (!f.timestamps_utc)   /* decoded string in local TZ */
        {                               /* shift to local TZ */
        restore_tz(tz);
        mod_tz = FALSE;