Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-ftp/pure-ftpd/, net-ftp/pure-ftpd/files/
Date: Thu, 31 Jan 2019 17:52:58
Message-Id: 1548957162.89b2b973f06a8be98a052a6e9ba17c5e1642874e.whissi@gentoo
commit:     89b2b973f06a8be98a052a6e9ba17c5e1642874e
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 31 17:52:42 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Jan 31 17:52:42 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89b2b973

net-ftp/pure-ftpd: add TLS 1.3 support

Package-Manager: Portage-2.3.58, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 .../pure-ftpd/files/pure-ftpd-1.0.47-TLSv1.3.patch | 46 ++++++++++++++++++++++
 ...1.0.47-r2.ebuild => pure-ftpd-1.0.47-r3.ebuild} |  3 +-
 2 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/net-ftp/pure-ftpd/files/pure-ftpd-1.0.47-TLSv1.3.patch b/net-ftp/pure-ftpd/files/pure-ftpd-1.0.47-TLSv1.3.patch
new file mode 100644
index 00000000000..65f19bf49da
--- /dev/null
+++ b/net-ftp/pure-ftpd/files/pure-ftpd-1.0.47-TLSv1.3.patch
@@ -0,0 +1,46 @@
+From 4a495c61ce22c893aed5ee57f6ce0b43c3be59ad Mon Sep 17 00:00:00 2001
+From: Frank Denis <github@××××××××.org>
+Date: Wed, 19 Sep 2018 23:53:45 +0200
+Subject: [PATCH] TLS1.3 compatibility
+
+Fixes #94
+---
+ src/tls.c | 17 +++++++++++++----
+ 1 file changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/src/tls.c b/src/tls.c
+index c693d3b..f383ed9 100644
+--- a/src/tls.c
++++ b/src/tls.c
+@@ -228,7 +228,16 @@ static void ssl_info_cb(const SSL *cnx, int where, int ret)
+     if ((where & SSL_CB_HANDSHAKE_START) != 0) {
+         if ((cnx == tls_cnx && tls_cnx_handshook != 0) ||
+             (cnx == tls_data_cnx && tls_data_cnx_handshook != 0)) {
+-            die(400, LOG_ERR, "TLS renegociation");
++            const SSL_CIPHER *cipher;
++            const char *cipher_version;
++            if ((cipher = SSL_get_current_cipher(cnx)) == NULL ||
++                (cipher_version = SSL_CIPHER_get_version(cipher)) == NULL) {
++                die(400, LOG_ERR, "No cipher");
++            }
++            if (strcmp(cipher_version, "TLSv1.3") != 0) {
++                die(400, LOG_ERR, "TLS renegociation");
++                return;
++            }
+         }
+         return;
+     }
+@@ -264,10 +273,10 @@ int tls_init_library(void)
+     OpenSSL_add_all_algorithms();
+ # else
+     OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS |
+-		     OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
++                     OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
+     OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS |
+-			OPENSSL_INIT_ADD_ALL_DIGESTS |
+-			OPENSSL_INIT_LOAD_CONFIG, NULL);
++                        OPENSSL_INIT_ADD_ALL_DIGESTS |
++                        OPENSSL_INIT_LOAD_CONFIG, NULL);
+ # endif
+     while (RAND_status() == 0) {
+         rnd = zrand();

diff --git a/net-ftp/pure-ftpd/pure-ftpd-1.0.47-r2.ebuild b/net-ftp/pure-ftpd/pure-ftpd-1.0.47-r3.ebuild
similarity index 98%
rename from net-ftp/pure-ftpd/pure-ftpd-1.0.47-r2.ebuild
rename to net-ftp/pure-ftpd/pure-ftpd-1.0.47-r3.ebuild
index 864c1ad8237..58e90f89ddc 100644
--- a/net-ftp/pure-ftpd/pure-ftpd-1.0.47-r2.ebuild
+++ b/net-ftp/pure-ftpd/pure-ftpd-1.0.47-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -43,6 +43,7 @@ RDEPEND="${DEPEND}
 PATCHES=(
 	"${FILESDIR}/${PN}-1.0.28-pam.patch"
 	"${FILESDIR}/${PN}-1.0.47-MAX_DATA_SIZE.patch"
+	"${FILESDIR}/${PN}-1.0.47-TLSv1.3.patch"
 )
 
 src_configure() {