Fix build with recent LibreSSL, when including DANE. Bug 2386
authorJeremy Harris <jgh146exb@wizmail.org>
Fri, 5 Apr 2019 12:38:54 +0000 (13:38 +0100)
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
Mon, 2 Sep 2019 22:17:36 +0000 (00:17 +0200)
(cherry picked from commit c19ab167ac and 1fbf41cdf6
(cherry picked from commit 0d82437ff97668a34a67b4ba398d1294ec016d3a)
(cherry picked from commit 09cc73f04332f420e07f4bc8bb2e2466c2460067)

doc/doc-txt/ChangeLog
src/src/dane-openssl.c
src/src/tlscert-openssl.c

index f0704c7d9e44d2c8c45cc5bf8d22cc3b2b847d71..70fdc9510d5259112b827d7ff6ab02502e011a47 100644 (file)
@@ -52,6 +52,9 @@ JH/11 Harden plaintext authenticator against a badly misconfigured client-send
 JH/12 Bug 2384: fix "-bP smtp_receive_timeout".  Previously it returned no
       output.
 
+JH/13 Bug 2386: Fix builds with Dane under LibreSSL 2.9.0 onward.  Some old
+      API was removed, so update to use the newer ones.
+
 
 
 Exim version 4.92
index f7ccbd76531747666a414a5a5a561df8acccdf65..79f136eae5d61f7a634fab106f0bf1496295be61 100644 (file)
@@ -2,7 +2,7 @@
  *  Author: Viktor Dukhovni
  *  License: THIS CODE IS IN THE PUBLIC DOMAIN.
  *
- * Copyright (c) The Exim Maintainers 2014 - 2018
+ * Copyright (c) The Exim Maintainers 2014 - 2019
  */
 #include <stdio.h>
 #include <string.h>
 #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
 # define X509_up_ref(x) CRYPTO_add(&((x)->references), 1, CRYPTO_LOCK_X509)
 #endif
+
+/* LibreSSL 2.9.0 and later - 2.9.0 has removed a number of macros ... */
+#ifdef LIBRESSL_VERSION_NUMBER
+# if LIBRESSL_VERSION_NUMBER >= 0x2090000fL
+#  define EXIM_HAVE_ASN1_MACROS
+# endif
+#endif
+/* OpenSSL */
 #if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
 # define EXIM_HAVE_ASN1_MACROS
 # define EXIM_OPAQUE_X509
+/* Older OpenSSL and all LibreSSL */
 #else
 # define X509_STORE_CTX_get_verify(ctx)                (ctx)->verify
 # define X509_STORE_CTX_get_verify_cb(ctx)     (ctx)->verify_cb
index 7e0128ee42ccac0c5d79fd792b37f1b9a33decda..3551045ce84dba8ab53d2fff1884bc9ba904f22d 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) Jeremy Harris 2014 - 2018 */
+/* 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)