Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Sep 2019 08:24:25 +0000 (UTC)
From:      Matthias Andree <mandree@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r511399 - in branches/2019Q3/security/openvpn: . files
Message-ID:  <201909070824.x878OPD1029365@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mandree
Date: Sat Sep  7 08:24:25 2019
New Revision: 511399
URL: https://svnweb.freebsd.org/changeset/ports/511399

Log:
  MFH: r511397
  
  security/openvpn: regression fix, support LibreSSL again.
  
  (I use a different patch than what was submitted by pizzamig@,
  and have sent our patch upstream.)
  
  Remove IGNORE_SSL.
  
  While here, remove USE_LDCONFIG to fix a portlint complaint,
  and fix a typo in a Makefile comment.
  
  PR:		238382
  Reported by:	pizzamig@
  
  Since this does not change the default build, but fixes a broken
  build in non-default configurations,
  DEFAULT_VERSIONS+=ssl=libressl[-devel], and also fixes a regression
  from OpenVPN 2.4.6, this should be good to crawl under the blanket.
  
  Approved by:	ports-secteam@ (blanket)

Modified:
  branches/2019Q3/security/openvpn/Makefile
  branches/2019Q3/security/openvpn/files/patch-libressl
Directory Properties:
  branches/2019Q3/   (props changed)

Modified: branches/2019Q3/security/openvpn/Makefile
==============================================================================
--- branches/2019Q3/security/openvpn/Makefile	Sat Sep  7 08:24:20 2019	(r511398)
+++ branches/2019Q3/security/openvpn/Makefile	Sat Sep  7 08:24:25 2019	(r511399)
@@ -23,7 +23,7 @@ SHEBANG_FILES=		sample/sample-scripts/verify-cn \
 			sample/sample-scripts/auth-pam.pl \
 			sample/sample-scripts/ucn.pl
 CONFIGURE_ARGS+=	--enable-strict
-# avoid picking up CMAKE, we don't have cmocka in the tarballs..
+# avoid picking up CMAKE, we don't have cmocka in the tarballs.
 CONFIGURE_ENV+=		ac_cv_prog_CMAKE= CMAKE=
 
 # let OpenVPN's configure script pick up the requisite libraries,
@@ -62,7 +62,6 @@ X509ALTUSERNAME_PREVENTS_MSG=	OpenVPN ${DISTVERSION} c
 
 OPENSSL_USES=		ssl
 OPENSSL_CONFIGURE_ON=	--with-crypto-library=openssl
-IGNORE_SSL=		libressl libressl-devel
 
 LZ4_CONFIGURE_OFF=	--disable-lz4
 
@@ -72,7 +71,6 @@ MBEDTLS_LIB_DEPENDS=	libmbedtls.so:security/mbedtls
 MBEDTLS_CONFIGURE_ON=	--with-crypto-library=mbedtls
 
 USE_RC_SUBR=		openvpn
-USE_LDCONFIG=		${PREFIX}/lib
 
 SUB_FILES=		pkg-message openvpn-client
 

Modified: branches/2019Q3/security/openvpn/files/patch-libressl
==============================================================================
--- branches/2019Q3/security/openvpn/files/patch-libressl	Sat Sep  7 08:24:20 2019	(r511398)
+++ branches/2019Q3/security/openvpn/files/patch-libressl	Sat Sep  7 08:24:25 2019	(r511399)
@@ -1,20 +1,66 @@
---- ./src/openvpn/openssl_compat.h	2018-03-01 07:22:19.000000000 +0000
-+++ ./src/openvpn/openssl_compat.h	2018-03-12 10:44:08.876010487 +0000
-@@ -711,7 +711,7 @@
- }
- #endif /* SSL_CTX_get_max_proto_version */
+commit 5bc848a02665f26e83e5dbe8f4ef95f55e5e19bd
+Author: Matthias Andree <matthias.andree@gmx.de>
+Date:   Mon Aug 12 23:37:52 2019 +0200
+
+    Fix regression, reinstate LibreSSL support.
+    
+    OpenVPN 2.4.6 could be compiled with LibreSSL, 2.4.7 cannot.  This was broken
+    since 9de7fe0a "Add support for tls-ciphersuites for TLS 1.3".
+    
+    This patch avoids using TLS 1.3 directly, be it that OpenSSL was compiled
+    without TLS 1.3 support, or LibreSSL was used.
+    
+    This patch was based on an OpenBSD patch by
+    Jeremie Courreges-Anglas <jca@openbsd.org>, see
+    https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/net/openvpn/patches/patch-src_openvpn_ssl_openssl_c
+    but was revised to be more obvious and check actual feature macros,
+    do not rely on current LibreSSL implementation details alone.
+    
+    Franco Fichtner reports that OPNsense has been a long-time user
+    of LibreSSL without reported breakage, see also:
+    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238382#c10
+    
+    Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
+
+diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c
+index a78dae99..293bb192 100644
+--- ./src/openvpn/ssl_openssl.c
++++ ./src/openvpn/ssl_openssl.c
+@@ -206,7 +206,7 @@ info_callback(INFO_CALLBACK_SSL_CONST SSL *s, int where, int ret)
+ int
+ tls_version_max(void)
+ {
+-#if defined(TLS1_3_VERSION)
++#if defined(TLS1_3_VERSION) && !defined(OPENSSL_NO_TLS1_3)
+     return TLS_VER_1_3;
+ #elif defined(TLS1_2_VERSION) || defined(SSL_OP_NO_TLSv1_2)
+     return TLS_VER_1_2;
+@@ -233,7 +233,7 @@ openssl_tls_version(int ver)
+     {
+         return TLS1_2_VERSION;
+     }
+-#if defined(TLS1_3_VERSION)
++#if defined(TLS1_3_VERSION) && !defined(OPENSSL_NO_TLS1_3)
+     else if (ver == TLS_VER_1_3)
+     {
+         return TLS1_3_VERSION;
+@@ -459,8 +459,8 @@ tls_ctx_restrict_ciphers_tls13(struct tls_root_ctx *ctx, const char *ciphers)
+         return;
+     }
  
--#ifndef SSL_CTX_set_min_proto_version
-+#if !defined(SSL_CTX_set_min_proto_version) && !defined(LIBRESSL_VERSION_NUMBER)
- /** Mimics SSL_CTX_set_min_proto_version for OpenSSL < 1.1 */
- static inline int
- SSL_CTX_set_min_proto_version(SSL_CTX *ctx, long tls_ver_min)
-@@ -740,7 +740,7 @@
- }
- #endif /* SSL_CTX_set_min_proto_version */
+-#if (OPENSSL_VERSION_NUMBER < 0x1010100fL)
+-        crypto_msg(M_WARN, "Not compiled with OpenSSL 1.1.1 or higher. "
++#if (OPENSSL_VERSION_NUMBER < 0x1010100fL) || !defined(TLS1_3_VERSION) || defined(OPENSSL_NO_TLS1_3)
++        crypto_msg(M_WARN, "Not compiled with OpenSSL 1.1.1 or higher, or without TLS 1.3 support. "
+                        "Ignoring TLS 1.3 only tls-ciphersuites '%s' setting.",
+                         ciphers);
+ #else
+@@ -1846,7 +1846,7 @@ show_available_tls_ciphers_list(const char *cipher_list,
+         crypto_msg(M_FATAL, "Cannot create SSL_CTX object");
+     }
  
--#ifndef SSL_CTX_set_max_proto_version
-+#if !defined(SSL_CTX_set_max_proto_version) && !defined(LIBRESSL_VERSION_NUMBER)
- /** Mimics SSL_CTX_set_max_proto_version for OpenSSL < 1.1 */
- static inline int
- SSL_CTX_set_max_proto_version(SSL_CTX *ctx, long tls_ver_max)
+-#if (OPENSSL_VERSION_NUMBER >= 0x1010100fL)
++#if (OPENSSL_VERSION_NUMBER >= 0x1010100fL) && defined(TLS1_3_VERSION) && !defined(OPENSSL_NO_TLS1_3)
+     if (tls13)
+     {
+         SSL_CTX_set_min_proto_version(tls_ctx.ctx, TLS1_3_VERSION);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909070824.x878OPD1029365>