* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/files/, net-misc/stunnel/
@ 2016-05-11 14:23 Anthony G. Basile
0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2016-05-11 14:23 UTC (permalink / raw
To: gentoo-commits
commit: 59e2b59bdca8190353478c9432a44c04d9d485b5
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed May 11 14:21:12 2016 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed May 11 14:24:05 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59e2b59b
net-misc/stunnel: add libressl compat patch, bug #582050
Package-Manager: portage-2.2.26
.../stunnel/files/stunnel-compat-libressl.patch | 32 ++++++++++++++++++++++
net-misc/stunnel/stunnel-5.30.ebuild | 3 ++
net-misc/stunnel/stunnel-5.31.ebuild | 3 ++
net-misc/stunnel/stunnel-5.32.ebuild | 3 ++
4 files changed, 41 insertions(+)
diff --git a/net-misc/stunnel/files/stunnel-compat-libressl.patch b/net-misc/stunnel/files/stunnel-compat-libressl.patch
new file mode 100644
index 0000000..5d92cab
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-compat-libressl.patch
@@ -0,0 +1,32 @@
+Author: 80x24 <80x24@momoka.net>
+
+diff -ru stunnel-5.24/src/verify.c stunnel-5.24.new/src/verify.c
+--- stunnel-5.24/src/verify.c 2015-09-23 18:00:08.000000000 +0800
++++ stunnel-5.24.new/src/verify.c 2015-11-18 13:16:06.321540501 +0800
+@@ -51,7 +51,7 @@
+ NOEXPORT int verify_callback(int, X509_STORE_CTX *);
+ NOEXPORT int verify_checks(CLI *, int, X509_STORE_CTX *);
+ NOEXPORT int cert_check(CLI *, X509_STORE_CTX *, int);
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cert_check_subject(CLI *, X509_STORE_CTX *);
+ #endif /* OPENSSL_VERSION_NUMBER>=0x10002000L */
+ NOEXPORT int cert_check_local(X509_STORE_CTX *);
+@@ -280,7 +280,7 @@
+ }
+
+ if(depth==0) { /* additional peer certificate checks */
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ if(!cert_check_subject(c, callback_ctx))
+ return 0; /* reject */
+ #endif /* OPENSSL_VERSION_NUMBER>=0x10002000L */
+@@ -291,7 +291,7 @@
+ return 1; /* accept */
+ }
+
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cert_check_subject(CLI *c, X509_STORE_CTX *callback_ctx) {
+ X509 *cert=X509_STORE_CTX_get_current_cert(callback_ctx);
+ NAME_LIST *ptr;
diff --git a/net-misc/stunnel/stunnel-5.30.ebuild b/net-misc/stunnel/stunnel-5.30.ebuild
index 5acb98e..a5e0fda 100644
--- a/net-misc/stunnel/stunnel-5.30.ebuild
+++ b/net-misc/stunnel/stunnel-5.30.ebuild
@@ -40,6 +40,9 @@ src_prepare() {
sed -i -e "s/^install-data-local:/do-not-run-this:/" \
tools/Makefile.in || die "sed failed"
+ # libressl compat
+ epatch "${FILESDIR}"/stunnel-compat-libressl.patch
+
echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
}
diff --git a/net-misc/stunnel/stunnel-5.31.ebuild b/net-misc/stunnel/stunnel-5.31.ebuild
index 4eac53e..6fb712f 100644
--- a/net-misc/stunnel/stunnel-5.31.ebuild
+++ b/net-misc/stunnel/stunnel-5.31.ebuild
@@ -40,6 +40,9 @@ src_prepare() {
sed -i -e "s/^install-data-local:/do-not-run-this:/" \
tools/Makefile.in || die "sed failed"
+ # libressl compat
+ epatch "${FILESDIR}"/stunnel-compat-libressl.patch
+
echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
}
diff --git a/net-misc/stunnel/stunnel-5.32.ebuild b/net-misc/stunnel/stunnel-5.32.ebuild
index 4eac53e..6fb712f 100644
--- a/net-misc/stunnel/stunnel-5.32.ebuild
+++ b/net-misc/stunnel/stunnel-5.32.ebuild
@@ -40,6 +40,9 @@ src_prepare() {
sed -i -e "s/^install-data-local:/do-not-run-this:/" \
tools/Makefile.in || die "sed failed"
+ # libressl compat
+ epatch "${FILESDIR}"/stunnel-compat-libressl.patch
+
echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/files/, net-misc/stunnel/
@ 2017-01-28 13:23 Anthony G. Basile
0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2017-01-28 13:23 UTC (permalink / raw
To: gentoo-commits
commit: ed175c5284d66d77c891808de3239f187ee636f4
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 28 13:22:36 2017 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Jan 28 13:22:36 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed175c52
net-misc/stunnel: fix build on libressl, bug #584298
Package-Manager: portage-2.3.3
.../files/stunnel-5.39-compat-libressl.patch | 132 +++++++++++++++++++++
net-misc/stunnel/stunnel-5.39.ebuild | 2 +-
2 files changed, 133 insertions(+), 1 deletion(-)
diff --git a/net-misc/stunnel/files/stunnel-5.39-compat-libressl.patch b/net-misc/stunnel/files/stunnel-5.39-compat-libressl.patch
new file mode 100644
index 00000000..7c4f743
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-5.39-compat-libressl.patch
@@ -0,0 +1,132 @@
+diff -Naur stunnel-5.30.orig/src/ctx.c stunnel-5.30/src/ctx.c
+--- stunnel-5.30.orig/src/ctx.c 2016-01-15 16:45:23.000000000 +0000
++++ stunnel-5.30/src/ctx.c 2016-05-14 15:16:47.392859450 +0000
+@@ -359,7 +359,7 @@
+ /**************************************** initialize OpenSSL CONF */
+
+ NOEXPORT int conf_init(SERVICE_OPTIONS *section) {
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CONF_CTX *cctx;
+ NAME_LIST *curr;
+ char *cmd, *param;
+diff -Naur stunnel-5.30.orig/src/verify.c stunnel-5.30/src/verify.c
+--- stunnel-5.30.orig/src/verify.c 2016-01-15 16:45:23.000000000 +0000
++++ stunnel-5.30/src/verify.c 2016-05-14 15:16:10.369860180 +0000
+@@ -51,7 +51,7 @@
+ NOEXPORT int verify_callback(int, X509_STORE_CTX *);
+ NOEXPORT int verify_checks(CLI *, int, X509_STORE_CTX *);
+ NOEXPORT int cert_check(CLI *, X509_STORE_CTX *, int);
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cert_check_subject(CLI *, X509_STORE_CTX *);
+ #endif /* OPENSSL_VERSION_NUMBER>=0x10002000L */
+ NOEXPORT int cert_check_local(X509_STORE_CTX *);
+@@ -280,7 +280,7 @@
+ }
+
+ if(depth==0) { /* additional peer certificate checks */
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ if(!cert_check_subject(c, callback_ctx))
+ return 0; /* reject */
+ #endif /* OPENSSL_VERSION_NUMBER>=0x10002000L */
+@@ -291,7 +291,7 @@
+ return 1; /* accept */
+ }
+
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cert_check_subject(CLI *c, X509_STORE_CTX *callback_ctx) {
+ X509 *cert=X509_STORE_CTX_get_current_cert(callback_ctx);
+ NAME_LIST *ptr;
+diff --git a/src/common.h b/src/common.h
+index 93f165e..491d9de 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -448,7 +448,7 @@ extern char *sys_errlist[];
+ #define OPENSSL_NO_TLS1_2
+ #endif /* OpenSSL older than 1.0.1 || defined(OPENSSL_NO_TLS1) */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ #ifndef OPENSSL_NO_SSL2
+ #define OPENSSL_NO_SSL2
+ #endif /* !defined(OPENSSL_NO_SSL2) */
+@@ -474,7 +474,7 @@ extern char *sys_errlist[];
+ #include <openssl/des.h>
+ #ifndef OPENSSL_NO_DH
+ #include <openssl/dh.h>
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
+ #endif /* OpenSSL older than 1.1.0 */
+ #endif /* !defined(OPENSSL_NO_DH) */
+diff --git a/src/prototypes.h b/src/prototypes.h
+index 303ff77..ae22598 100644
+--- a/src/prototypes.h
++++ b/src/prototypes.h
+@@ -664,13 +664,13 @@ typedef enum {
+ #endif /* OPENSSL_NO_DH */
+ STUNNEL_LOCKS /* number of locks */
+ } LOCK_TYPE;
+-#if OPENSSL_VERSION_NUMBER < 0x10100004L
++#if OPENSSL_VERSION_NUMBER < 0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+ typedef int STUNNEL_RWLOCK;
+ #else
+ typedef CRYPTO_RWLOCK *STUNNEL_RWLOCK;
+ #endif
+ extern STUNNEL_RWLOCK stunnel_locks[STUNNEL_LOCKS];
+-#if OPENSSL_VERSION_NUMBER>=0x10100004L
++#if OPENSSL_VERSION_NUMBER>=0x10100004L && !defined(LIBRESSL_VERSION_NUMBER)
+ #define CRYPTO_THREAD_read_unlock(type) CRYPTO_THREAD_unlock(type)
+ #define CRYPTO_THREAD_write_unlock(type) CRYPTO_THREAD_unlock(type)
+ #else
+diff --git a/src/ssl.c b/src/ssl.c
+index a7af7e6..1483734 100644
+--- a/src/ssl.c
++++ b/src/ssl.c
+@@ -50,7 +50,7 @@ NOEXPORT int add_rand_file(GLOBAL_OPTIONS *, const char *);
+ int index_cli, index_opt, index_redirect, index_addr;
+
+ int ssl_init(void) { /* init TLS before parsing configuration file */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS |
+ OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
+ #else
+@@ -83,7 +83,7 @@ int ssl_init(void) { /* init TLS before parsing configuration file */
+ }
+
+ #ifndef OPENSSL_NO_DH
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ /* this is needed for dhparam.c generated with OpenSSL >= 1.1.0
+ * to be linked against the older versions */
+ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) {
+diff --git a/src/sthreads.c b/src/sthreads.c
+index 59c24a2..04fb256 100644
+--- a/src/sthreads.c
++++ b/src/sthreads.c
+@@ -47,7 +47,7 @@
+ STUNNEL_RWLOCK stunnel_locks[STUNNEL_LOCKS];
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+ #define CRYPTO_THREAD_lock_new() CRYPTO_get_new_dynlockid()
+ #endif
+
+diff --git a/src/verify.c b/src/verify.c
+index ac1c3ee..3e3bda4 100644
+--- a/src/verify.c
++++ b/src/verify.c
+@@ -348,7 +348,7 @@ NOEXPORT int cert_check_local(X509_STORE_CTX *callback_ctx) {
+ cert=X509_STORE_CTX_get_current_cert(callback_ctx);
+ subject=X509_get_subject_name(cert);
+
+-#if OPENSSL_VERSION_NUMBER>=0x10000000L
++#if OPENSSL_VERSION_NUMBER>=0x10000000L && !defined(LIBRESSL_VERSION_NUMBER)
+ #if OPENSSL_VERSION_NUMBER<0x10100006L
+ #define X509_STORE_CTX_get1_certs X509_STORE_get1_certs
+ #endif
diff --git a/net-misc/stunnel/stunnel-5.39.ebuild b/net-misc/stunnel/stunnel-5.39.ebuild
index 4275ec9..b1e4715 100644
--- a/net-misc/stunnel/stunnel-5.39.ebuild
+++ b/net-misc/stunnel/stunnel-5.39.ebuild
@@ -41,7 +41,7 @@ src_prepare() {
tools/Makefile.in || die "sed failed"
# libressl compat
- eapply "${FILESDIR}"/stunnel-compat-libressl.patch
+ eapply "${FILESDIR}"/${P}-compat-libressl.patch
echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/files/, net-misc/stunnel/
@ 2018-07-09 2:35 Anthony G. Basile
0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2018-07-09 2:35 UTC (permalink / raw
To: gentoo-commits
commit: cac284e81e305e12e81f5ee9db058111b53a6af3
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 9 02:35:04 2018 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Jul 9 02:35:41 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cac284e8
net-misc/stunnel: version bump to 5.48
Package-Manager: Portage-2.3.40, Repoman-2.3.9
net-misc/stunnel/Manifest | 1 +
.../files/stunnel-5.48-compat-libressl.patch | 114 +++++++++++++++++++++
net-misc/stunnel/stunnel-5.48.ebuild | 95 +++++++++++++++++
3 files changed, 210 insertions(+)
diff --git a/net-misc/stunnel/Manifest b/net-misc/stunnel/Manifest
index 4cac857a20d..4369e08ff02 100644
--- a/net-misc/stunnel/Manifest
+++ b/net-misc/stunnel/Manifest
@@ -4,3 +4,4 @@ DIST stunnel-5.43.tar.gz 698715 BLAKE2B 21ac7014e571e1c22b1b21b6dc5c4f22ec91197c
DIST stunnel-5.44.tar.gz 699117 BLAKE2B 956c7ce8987f79efab3baaa5071263466ec01f0475bd7e66dff41e8de66811a10be3a5f14bd6430e26159682bd3c2abe93a0d5824a854ae0243e6bbfae14a664 SHA512 a1aa4f234926208bf1b2c9acc0bf83dc0f2c8f575bc57f5ce89b32b4e3fde0412ea0ef7c2edb364fbe0b52fdd89773fab4df53950c58797c11b7668f3e4e7638
DIST stunnel-5.45.tar.gz 706423 BLAKE2B 81c5355419de3b0bc88d59ea8c98d1a4523d7a1ae6a3d12464f7ab6a1df1f5dd798d2f50ec7adce7515e68a650149321f13e34791781620ad071824246502dce SHA512 653fea6e5002983bb9231a542ab1bab078428821910b8e257adbeea88e583e84d080615f232d5d3086e8d6069c43ddbdfc7923c4b50071ab0c0be547e76d8983
DIST stunnel-5.46.tar.gz 706499 BLAKE2B 6ece93015b2a59ec17fa60505bccb5e4444879d44fa0cea6e838aa56d178f61f26b8b9b469d8bf2991d4c094fd824eaed2b5214184f6a15e0c415c53b6f7d136 SHA512 2000e36d4d011a83e47afcaf19473e083da010d7b3909cb831c51975512257888615b5d64f4a4d78f48529d68c6740ea2be7f7935b0ab86de4535e290f78cc97
+DIST stunnel-5.48.tar.gz 708356 BLAKE2B 6f4538c5fe6bc00eb0f45edfbf83f1de6cfcd23257aa368dc0ba788dd17af7033ba20f1ab7c3f5bf48a5e2ff3d4048eb1a344d1ea4cebebe69e6e2277aaf19ba SHA512 5e6669ecd6e9b49aa6ef82b9a4dc6a2193c975eef85262aba70c7f264ef1b4d15dc287a2baa94b71be063deddcd07a20a5347ed5280f044fc6f68c61429a24fa
diff --git a/net-misc/stunnel/files/stunnel-5.48-compat-libressl.patch b/net-misc/stunnel/files/stunnel-5.48-compat-libressl.patch
new file mode 100644
index 00000000000..3161b1581b1
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-5.48-compat-libressl.patch
@@ -0,0 +1,114 @@
+diff -Naur stunnel-5.48.orig/src/common.h stunnel-5.48/src/common.h
+--- stunnel-5.48.orig/src/common.h 2018-06-08 13:30:15.000000000 -0400
++++ stunnel-5.48/src/common.h 2018-07-08 22:23:00.527131463 -0400
+@@ -446,7 +446,7 @@
+ #define OPENSSL_NO_TLS1_2
+ #endif /* OpenSSL older than 1.0.1 || defined(OPENSSL_NO_TLS1) */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ #ifndef OPENSSL_NO_SSL2
+ #define OPENSSL_NO_SSL2
+ #endif /* !defined(OPENSSL_NO_SSL2) */
+@@ -473,7 +473,7 @@
+ #include <openssl/des.h>
+ #ifndef OPENSSL_NO_DH
+ #include <openssl/dh.h>
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
+ #endif /* OpenSSL older than 1.1.0 */
+ #endif /* !defined(OPENSSL_NO_DH) */
+diff -Naur stunnel-5.48.orig/src/ctx.c stunnel-5.48/src/ctx.c
+--- stunnel-5.48.orig/src/ctx.c 2018-07-02 17:30:10.000000000 -0400
++++ stunnel-5.48/src/ctx.c 2018-07-08 22:23:00.527131463 -0400
+@@ -311,7 +311,7 @@
+
+ #ifndef OPENSSL_NO_DH
+
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx) {
+ return ctx->cipher_list;
+ }
+@@ -414,7 +414,7 @@
+ /**************************************** initialize OpenSSL CONF */
+
+ NOEXPORT int conf_init(SERVICE_OPTIONS *section) {
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CONF_CTX *cctx;
+ NAME_LIST *curr;
+ char *cmd, *param;
+diff -Naur stunnel-5.48.orig/src/options.c stunnel-5.48/src/options.c
+--- stunnel-5.48.orig/src/options.c 2018-07-02 17:30:26.000000000 -0400
++++ stunnel-5.48/src/options.c 2018-07-08 22:23:00.527131463 -0400
+@@ -4215,7 +4215,7 @@
+ }
+ #endif
+ /* engines can add new algorithms */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS|
+ OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
+ #else
+diff -Naur stunnel-5.48.orig/src/ssl.c stunnel-5.48/src/ssl.c
+--- stunnel-5.48.orig/src/ssl.c 2018-04-06 10:25:10.000000000 -0400
++++ stunnel-5.48/src/ssl.c 2018-07-08 22:23:00.527131463 -0400
+@@ -52,7 +52,7 @@
+ int index_session_authenticated, index_session_connect_address;
+
+ int ssl_init(void) { /* init TLS before parsing configuration file */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS |
+ OPENSSL_INIT_LOAD_CRYPTO_STRINGS | OPENSSL_INIT_LOAD_CONFIG, NULL);
+ #else
+@@ -88,7 +88,7 @@
+ }
+
+ #ifndef OPENSSL_NO_DH
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ /* this is needed for dhparam.c generated with OpenSSL >= 1.1.0
+ * to be linked against the older versions */
+ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) {
+diff -Naur stunnel-5.48.orig/src/verify.c stunnel-5.48/src/verify.c
+--- stunnel-5.48.orig/src/verify.c 2018-07-02 17:30:10.000000000 -0400
++++ stunnel-5.48/src/verify.c 2018-07-08 22:23:00.531131344 -0400
+@@ -51,7 +51,7 @@
+ NOEXPORT int verify_callback(int, X509_STORE_CTX *);
+ NOEXPORT int verify_checks(CLI *, int, X509_STORE_CTX *);
+ NOEXPORT int cert_check(CLI *, X509_STORE_CTX *, int);
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cert_check_subject(CLI *, X509_STORE_CTX *);
+ #endif /* OPENSSL_VERSION_NUMBER>=0x10002000L */
+ NOEXPORT int cert_check_local(X509_STORE_CTX *);
+@@ -285,7 +285,7 @@
+ }
+
+ if(depth==0) { /* additional peer certificate checks */
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ if(!cert_check_subject(c, callback_ctx))
+ return 0; /* reject */
+ #endif /* OPENSSL_VERSION_NUMBER>=0x10002000L */
+@@ -296,7 +296,7 @@
+ return 1; /* accept */
+ }
+
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cert_check_subject(CLI *c, X509_STORE_CTX *callback_ctx) {
+ X509 *cert=X509_STORE_CTX_get_current_cert(callback_ctx);
+ NAME_LIST *ptr;
+@@ -346,7 +346,7 @@
+ cert=X509_STORE_CTX_get_current_cert(callback_ctx);
+ subject=X509_get_subject_name(cert);
+
+-#if OPENSSL_VERSION_NUMBER<0x10100006L
++#if OPENSSL_VERSION_NUMBER<0x10100006L || defined(LIBRESSL_VERSION_NUMBER)
+ #define X509_STORE_CTX_get1_certs X509_STORE_get1_certs
+ #endif
+ /* modern API allows retrieving multiple matching certificates */
diff --git a/net-misc/stunnel/stunnel-5.48.ebuild b/net-misc/stunnel/stunnel-5.48.ebuild
new file mode 100644
index 00000000000..d7898dbcca0
--- /dev/null
+++ b/net-misc/stunnel/stunnel-5.48.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit ssl-cert multilib systemd user
+
+DESCRIPTION="TLS/SSL - Port Wrapper"
+HOMEPAGE="http://www.stunnel.org/index.html"
+SRC_URI="ftp://ftp.stunnel.org/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://www.usenix.org.uk/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://ftp.nluug.nl/pub/networking/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://www.namesdir.com/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://stunnel.cybermirror.org/archive/${PV%%.*}.x/${P}.tar.gz
+ http://mirrors.zerg.biz/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ ftp://mirrors.go-parts.com/stunnel/archive/${PV%%.*}.x/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="ipv6 libressl selinux stunnel3 tcpd"
+
+DEPEND="tcpd? ( sys-apps/tcp-wrappers )
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )"
+RDEPEND="${DEPEND}
+ stunnel3? ( dev-lang/perl )
+ selinux? ( sec-policy/selinux-stunnel )"
+
+RESTRICT="test"
+
+pkg_setup() {
+ enewgroup stunnel
+ enewuser stunnel -1 -1 -1 stunnel
+}
+
+src_prepare() {
+ # Hack away generation of certificate
+ sed -i -e "s/^install-data-local:/do-not-run-this:/" \
+ tools/Makefile.in || die "sed failed"
+
+ # libressl compat
+ eapply "${FILESDIR}"/${PN}-5.48-compat-libressl.patch
+
+ echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
+
+ eapply_user
+}
+
+src_configure() {
+ econf \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ $(use_enable ipv6) \
+ $(use_enable tcpd libwrap) \
+ --with-ssl="${EPREFIX}"/usr \
+ --disable-fips
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ rm -rf "${ED}"/usr/share/doc/${PN}
+ rm -f "${ED}"/etc/stunnel/stunnel.conf-sample \
+ "${ED}"/usr/share/man/man8/stunnel.{fr,pl}.8
+ use stunnel3 || rm -f "${ED}"/usr/bin/stunnel3
+
+ # The binary was moved to /usr/bin with 4.21,
+ # symlink for backwards compatibility
+ dosym ../bin/stunnel /usr/sbin/stunnel
+
+ dodoc AUTHORS BUGS CREDITS PORTS README TODO ChangeLog
+ docinto html
+ dodoc doc/stunnel.html doc/en/VNC_StunnelHOWTO.html tools/ca.html \
+ tools/importCA.html
+
+ insinto /etc/stunnel
+ doins "${FILESDIR}"/stunnel.conf
+ newinitd "${FILESDIR}"/stunnel-r1 stunnel
+
+ doenvd "${T}"/20stunnel
+
+ systemd_dounit "${S}/tools/stunnel.service"
+ systemd_newtmpfilesd "${FILESDIR}"/stunnel.tmpfiles.conf stunnel.conf
+}
+
+pkg_postinst() {
+ if [ ! -f "${EROOT}"/etc/stunnel/stunnel.key ]; then
+ install_cert /etc/stunnel/stunnel
+ chown stunnel:stunnel "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ chmod 0640 "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ fi
+
+ einfo "If you want to run multiple instances of stunnel, create a new config"
+ einfo "file ending with .conf in /etc/stunnel/. **Make sure** you change "
+ einfo "\'pid= \' with a unique filename."
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/files/, net-misc/stunnel/
@ 2019-04-24 4:56 Aaron Bauman
0 siblings, 0 replies; 6+ messages in thread
From: Aaron Bauman @ 2019-04-24 4:56 UTC (permalink / raw
To: gentoo-commits
commit: 5a85fb190b37206caed168691ad569c5c63932f7
Author: Stefan Strogin <stefan.strogin <AT> gmail <DOT> com>
AuthorDate: Wed Apr 24 04:42:13 2019 +0000
Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Wed Apr 24 04:56:31 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a85fb19
net-misc/stunnel: update LibreSSL patch for 5.51
Closes: https://bugs.gentoo.org/682894
Package-Manager: Portage-2.3.64, Repoman-2.3.12
Signed-off-by: Stefan Strogin <stefan.strogin <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/11807
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
net-misc/stunnel/files/stunnel-5.51-libressl.patch | 268 +++++++++++++++++++++
...{stunnel-5.51.ebuild => stunnel-5.51-r1.ebuild} | 4 +-
2 files changed, 270 insertions(+), 2 deletions(-)
diff --git a/net-misc/stunnel/files/stunnel-5.51-libressl.patch b/net-misc/stunnel/files/stunnel-5.51-libressl.patch
new file mode 100644
index 00000000000..7ca8ace454d
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-5.51-libressl.patch
@@ -0,0 +1,268 @@
+diff --git a/src/client.c b/src/client.c
+index b67544a..6676529 100644
+--- a/src/client.c
++++ b/src/client.c
+@@ -680,7 +680,7 @@ NOEXPORT void transfer(CLI *c) {
+ }
+
+ /****************************** wait for an event */
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ pending=SSL_pending(c->ssl) || SSL_has_pending(c->ssl);
+ #else
+ pending=SSL_pending(c->ssl);
+diff --git a/src/ctx.c b/src/ctx.c
+index b3dc684..0186968 100644
+--- a/src/ctx.c
++++ b/src/ctx.c
+@@ -91,7 +91,7 @@ NOEXPORT void set_prompt(const char *);
+ NOEXPORT int ui_retry();
+
+ /* session tickets */
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int generate_session_ticket_cb(SSL *, void *);
+ NOEXPORT int decrypt_session_ticket_cb(SSL *, SSL_SESSION *,
+ const unsigned char *, size_t, SSL_TICKET_STATUS, void *);
+@@ -125,7 +125,7 @@ NOEXPORT void sslerror_log(unsigned long, const char *, int, char *);
+
+ /**************************************** initialize section->ctx */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ typedef long unsigned SSL_OPTIONS_TYPE;
+ #else
+ typedef long SSL_OPTIONS_TYPE;
+@@ -133,7 +133,7 @@ typedef long SSL_OPTIONS_TYPE;
+
+ int context_init(SERVICE_OPTIONS *section) { /* init TLS context */
+ /* create TLS context */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ if(section->option.client)
+ section->ctx=SSL_CTX_new(TLS_client_method());
+ else /* server mode */
+@@ -229,7 +229,7 @@ int context_init(SERVICE_OPTIONS *section) { /* init TLS context */
+ #endif
+
+ /* setup session tickets */
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CTX_set_session_ticket_cb(section->ctx, generate_session_ticket_cb,
+ decrypt_session_ticket_cb, NULL);
+ #endif /* OpenSSL 1.1.1 or later */
+@@ -483,7 +483,7 @@ NOEXPORT int ecdh_init(SERVICE_OPTIONS *section) {
+ /**************************************** initialize OpenSSL CONF */
+
+ NOEXPORT int conf_init(SERVICE_OPTIONS *section) {
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CONF_CTX *cctx;
+ NAME_LIST *curr;
+ char *cmd, *param;
+@@ -969,7 +969,7 @@ NOEXPORT int ui_retry() {
+
+ /**************************************** session tickets */
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+
+ typedef struct {
+ void *session_authenticated;
+@@ -1412,7 +1412,7 @@ NOEXPORT void info_callback(const SSL *ssl, int where, int ret) {
+
+ c=SSL_get_ex_data((SSL *)ssl, index_ssl_cli);
+ if(c) {
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ OSSL_HANDSHAKE_STATE state=SSL_get_state(ssl);
+ #else
+ int state=SSL_get_state((SSL *)ssl);
+diff --git a/src/options.c b/src/options.c
+index c7bd5c5..5441b80 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -81,7 +81,7 @@ NOEXPORT char *sni_init(SERVICE_OPTIONS *);
+ NOEXPORT void sni_free(SERVICE_OPTIONS *);
+ #endif /* !defined(OPENSSL_NO_TLSEXT) */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int str_to_proto_version(const char *);
+ #else /* OPENSSL_VERSION_NUMBER<0x10100000L */
+ NOEXPORT char *tls_methods_set(SERVICE_OPTIONS *, const char *);
+@@ -3098,7 +3098,7 @@ NOEXPORT char *parse_service_option(CMD cmd, SERVICE_OPTIONS **section_ptr,
+ break;
+ }
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+
+ /* sslVersion */
+ switch(cmd) {
+@@ -3671,7 +3671,7 @@ NOEXPORT void sni_free(SERVICE_OPTIONS *section) {
+
+ /**************************************** modern TLS version handling */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+
+ NOEXPORT int str_to_proto_version(const char *name) {
+ if(!strcasecmp(name, "all"))
+diff --git a/src/prototypes.h b/src/prototypes.h
+index 4a5d9af..057d3b9 100644
+--- a/src/prototypes.h
++++ b/src/prototypes.h
+@@ -226,7 +226,7 @@ typedef struct service_options_struct {
+ #if OPENSSL_VERSION_NUMBER>=0x009080dfL
+ long unsigned ssl_options_clear;
+ #endif /* OpenSSL 0.9.8m or later */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ int min_proto_version, max_proto_version;
+ #else /* OPENSSL_VERSION_NUMBER<0x10100000L */
+ SSL_METHOD *client_method, *server_method;
+@@ -666,7 +666,7 @@ int getnameinfo(const struct sockaddr *, socklen_t,
+ #define USE_OS_THREADS
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #ifdef USE_OS_THREADS
+
+@@ -714,7 +714,7 @@ typedef enum {
+
+ extern CRYPTO_RWLOCK *stunnel_locks[STUNNEL_LOCKS];
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+ /* Emulate the OpenSSL 1.1 locking API for older OpenSSL versions */
+ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void);
+ int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *);
+diff --git a/src/ssl.c b/src/ssl.c
+index 60e31c1..10b0658 100644
+--- a/src/ssl.c
++++ b/src/ssl.c
+@@ -39,7 +39,7 @@
+ #include "prototypes.h"
+
+ /* global OpenSSL initialization: compression, engine, entropy */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cb_dup_addr(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
+ void *from_d, int idx, long argl, void *argp);
+ #else
+@@ -114,7 +114,7 @@ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) {
+ #endif
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cb_dup_addr(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
+ void *from_d, int idx, long argl, void *argp) {
+ #else
+@@ -177,7 +177,7 @@ int ssl_configure(GLOBAL_OPTIONS *global) { /* configure global TLS settings */
+
+ #ifndef OPENSSL_NO_COMP
+
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ NOEXPORT int COMP_get_type(const COMP_METHOD *meth) {
+ return meth->type;
+diff --git a/src/sthreads.c b/src/sthreads.c
+index 37a1398..750e312 100644
+--- a/src/sthreads.c
++++ b/src/sthreads.c
+@@ -97,14 +97,16 @@ unsigned long stunnel_thread_id(void) {
+
+ #endif /* USE_WIN32 */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100004L
++#if (OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100004L) || \
++ defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT void threadid_func(CRYPTO_THREADID *tid) {
+ CRYPTO_THREADID_set_numeric(tid, stunnel_thread_id());
+ }
+ #endif
+
+ void thread_id_init(void) {
+-#if OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100000L
++#if (OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100000L) || \
++ defined(LIBRESSL_VERSION_NUMBER)
+ CRYPTO_THREADID_set_callback(threadid_func);
+ #endif
+ #if OPENSSL_VERSION_NUMBER<0x10000000L || !defined(OPENSSL_NO_DEPRECATED)
+@@ -115,7 +117,7 @@ void thread_id_init(void) {
+ /**************************************** locking */
+
+ /* we only need to initialize locking with OpenSSL older than 1.1.0 */
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #ifdef USE_PTHREAD
+
+@@ -224,7 +226,7 @@ NOEXPORT int s_atomic_add(int *val, int amount, CRYPTO_RWLOCK *lock) {
+
+ CRYPTO_RWLOCK *stunnel_locks[STUNNEL_LOCKS];
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #ifdef USE_OS_THREADS
+
+@@ -334,7 +336,8 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock) {
+
+ void locking_init(void) {
+ size_t i;
+-#if defined(USE_OS_THREADS) && OPENSSL_VERSION_NUMBER<0x10100004L
++#if defined(USE_OS_THREADS) && \
++ (OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER))
+ size_t num;
+
+ /* initialize the OpenSSL static locking */
+diff --git a/src/tls.c b/src/tls.c
+index 6c92b96..5e60a95 100644
+--- a/src/tls.c
++++ b/src/tls.c
+@@ -41,7 +41,7 @@
+ volatile int tls_initialized=0;
+
+ NOEXPORT void tls_platform_init();
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT void free_function(void *);
+ #endif
+
+@@ -52,7 +52,7 @@ void tls_init() {
+ tls_platform_init();
+ tls_initialized=1;
+ ui_tls=tls_alloc(NULL, NULL, "ui");
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ CRYPTO_set_mem_functions(str_alloc_detached_debug,
+ str_realloc_detached_debug, str_free_debug);
+ #else
+@@ -184,7 +184,7 @@ TLS_DATA *tls_get() {
+
+ /**************************************** OpenSSL allocator hook */
+
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT void free_function(void *ptr) {
+ /* CRYPTO_set_mem_ex_functions() needs a function rather than a macro */
+ /* unfortunately, OpenSSL provides no file:line information here */
+diff --git a/src/verify.c b/src/verify.c
+index acdfb5b..d7b7655 100644
+--- a/src/verify.c
++++ b/src/verify.c
+@@ -346,7 +346,7 @@ NOEXPORT int cert_check_local(X509_STORE_CTX *callback_ctx) {
+ cert=X509_STORE_CTX_get_current_cert(callback_ctx);
+ subject=X509_get_subject_name(cert);
+
+-#if OPENSSL_VERSION_NUMBER<0x10100006L
++#if OPENSSL_VERSION_NUMBER<0x10100006L || defined(LIBRESSL_VERSION_NUMBER)
+ #define X509_STORE_CTX_get1_certs X509_STORE_get1_certs
+ #endif
+ /* modern API allows retrieving multiple matching certificates */
diff --git a/net-misc/stunnel/stunnel-5.51.ebuild b/net-misc/stunnel/stunnel-5.51-r1.ebuild
similarity index 97%
rename from net-misc/stunnel/stunnel-5.51.ebuild
rename to net-misc/stunnel/stunnel-5.51-r1.ebuild
index e3b397589b4..0c9f131d637 100644
--- a/net-misc/stunnel/stunnel-5.51.ebuild
+++ b/net-misc/stunnel/stunnel-5.51-r1.ebuild
@@ -39,8 +39,8 @@ src_prepare() {
sed -i -e "s/^install-data-local:/do-not-run-this:/" \
tools/Makefile.in || die "sed failed"
- # bug 656420
- eapply "${FILESDIR}"/${PN}-5.50-libressl.patch
+ # bugs 656420, 682894
+ eapply "${FILESDIR}"/${P}-libressl.patch
echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/files/, net-misc/stunnel/
@ 2019-05-22 5:49 Stefan Strogin
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Strogin @ 2019-05-22 5:49 UTC (permalink / raw
To: gentoo-commits
commit: 6d65515da00c16636e1d6f10f0482b29afe4cf9b
Author: Stefan Strogin <steils <AT> gentoo <DOT> org>
AuthorDate: Wed May 22 05:43:50 2019 +0000
Commit: Stefan Strogin <steils <AT> gentoo <DOT> org>
CommitDate: Wed May 22 05:44:53 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d65515d
net-misc/stunnel: restore LibreSSL support; add patch for 5.54
Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Stefan Strogin <steils <AT> gentoo.org>
net-misc/stunnel/files/stunnel-5.54-libressl.patch | 313 +++++++++++++++++++++
net-misc/stunnel/stunnel-5.54.ebuild | 11 +-
2 files changed, 320 insertions(+), 4 deletions(-)
diff --git a/net-misc/stunnel/files/stunnel-5.54-libressl.patch b/net-misc/stunnel/files/stunnel-5.54-libressl.patch
new file mode 100644
index 00000000000..1965f47bca2
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-5.54-libressl.patch
@@ -0,0 +1,313 @@
+diff --git a/src/client.c b/src/client.c
+index 21fa273..e500d62 100644
+--- a/src/client.c
++++ b/src/client.c
+@@ -657,7 +657,7 @@ NOEXPORT void print_cipher(CLI *c) { /* print negotiated cipher */
+ NOEXPORT void transfer(CLI *c) {
+ int timeout; /* s_poll_wait timeout in seconds */
+ int pending; /* either processed on unprocessed TLS data */
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ int has_pending=0, prev_has_pending;
+ #endif
+ int watchdog=0; /* a counter to detect an infinite loop */
+@@ -705,7 +705,7 @@ NOEXPORT void transfer(CLI *c) {
+
+ /****************************** wait for an event */
+ pending=SSL_pending(c->ssl);
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ /* only attempt to process SSL_has_pending() data once */
+ prev_has_pending=has_pending;
+ has_pending=SSL_has_pending(c->ssl);
+@@ -1109,7 +1109,7 @@ NOEXPORT void transfer(CLI *c) {
+ s_log(LOG_ERR,
+ "please report the problem to Michal.Trojnara@stunnel.org");
+ stunnel_info(LOG_ERR);
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ s_log(LOG_ERR, "protocol=%s, SSL_pending=%d, SSL_has_pending=%d",
+ SSL_get_version(c->ssl),
+ SSL_pending(c->ssl), SSL_has_pending(c->ssl));
+diff --git a/src/ctx.c b/src/ctx.c
+index 01119f3..b73fdcb 100644
+--- a/src/ctx.c
++++ b/src/ctx.c
+@@ -91,7 +91,7 @@ NOEXPORT void set_prompt(const char *);
+ NOEXPORT int ui_retry();
+
+ /* session tickets */
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int generate_session_ticket_cb(SSL *, void *);
+ NOEXPORT int decrypt_session_ticket_cb(SSL *, SSL_SESSION *,
+ const unsigned char *, size_t, SSL_TICKET_STATUS, void *);
+@@ -130,7 +130,7 @@ NOEXPORT void sslerror_log(unsigned long, const char *, int, char *);
+
+ /**************************************** initialize section->ctx */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ typedef long unsigned SSL_OPTIONS_TYPE;
+ #else
+ typedef long SSL_OPTIONS_TYPE;
+@@ -138,7 +138,7 @@ typedef long SSL_OPTIONS_TYPE;
+
+ int context_init(SERVICE_OPTIONS *section) { /* init TLS context */
+ /* create TLS context */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ if(section->option.client)
+ section->ctx=SSL_CTX_new(TLS_client_method());
+ else /* server mode */
+@@ -234,7 +234,7 @@ int context_init(SERVICE_OPTIONS *section) { /* init TLS context */
+ #endif
+
+ /* setup session tickets */
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CTX_set_session_ticket_cb(section->ctx, generate_session_ticket_cb,
+ decrypt_session_ticket_cb, NULL);
+ #endif /* OpenSSL 1.1.1 or later */
+@@ -493,7 +493,7 @@ NOEXPORT int ecdh_init(SERVICE_OPTIONS *section) {
+ /**************************************** initialize OpenSSL CONF */
+
+ NOEXPORT int conf_init(SERVICE_OPTIONS *section) {
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CONF_CTX *cctx;
+ NAME_LIST *curr;
+ char *cmd, *param;
+@@ -979,7 +979,7 @@ NOEXPORT int ui_retry() {
+
+ /**************************************** session tickets */
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+
+ typedef struct {
+ void *session_authenticated;
+@@ -1470,7 +1470,7 @@ NOEXPORT void info_callback(const SSL *ssl, int where, int ret) {
+
+ c=SSL_get_ex_data((SSL *)ssl, index_ssl_cli);
+ if(c) {
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ OSSL_HANDSHAKE_STATE state=SSL_get_state(ssl);
+ #else
+ int state=SSL_get_state((SSL *)ssl);
+diff --git a/src/options.c b/src/options.c
+index 670adbe..a10cecd 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -81,7 +81,7 @@ NOEXPORT char *sni_init(SERVICE_OPTIONS *);
+ NOEXPORT void sni_free(SERVICE_OPTIONS *);
+ #endif /* !defined(OPENSSL_NO_TLSEXT) */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int str_to_proto_version(const char *);
+ #else /* OPENSSL_VERSION_NUMBER<0x10100000L */
+ NOEXPORT char *tls_methods_set(SERVICE_OPTIONS *, const char *);
+@@ -96,7 +96,7 @@ NOEXPORT PSK_KEYS *psk_dup(PSK_KEYS *);
+ NOEXPORT void psk_free(PSK_KEYS *);
+ #endif /* !defined(OPENSSL_NO_PSK) */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10000000L
++#if OPENSSL_VERSION_NUMBER>=0x10000000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT TICKET_KEY *key_read(char *, char *);
+ NOEXPORT TICKET_KEY *key_dup(TICKET_KEY *);
+ NOEXPORT void key_free(TICKET_KEY *);
+@@ -3104,7 +3104,7 @@ NOEXPORT char *parse_service_option(CMD cmd, SERVICE_OPTIONS **section_ptr,
+ break;
+ }
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+
+ /* sslVersion */
+ switch(cmd) {
+@@ -3273,7 +3273,7 @@ NOEXPORT char *parse_service_option(CMD cmd, SERVICE_OPTIONS **section_ptr,
+ }
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER>=0x10000000L
++#if OPENSSL_VERSION_NUMBER>=0x10000000L && !defined(LIBRESSL_VERSION_NUMBER)
+
+ /* ticketKeySecret */
+ switch(cmd) {
+@@ -3755,7 +3755,7 @@ NOEXPORT void sni_free(SERVICE_OPTIONS *section) {
+
+ /**************************************** modern TLS version handling */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+
+ NOEXPORT int str_to_proto_version(const char *name) {
+ if(!strcasecmp(name, "all"))
+@@ -4079,7 +4079,7 @@ NOEXPORT void psk_free(PSK_KEYS *head) {
+
+ /**************************************** read ticket key */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10000000L
++#if OPENSSL_VERSION_NUMBER>=0x10000000L && !defined(LIBRESSL_VERSION_NUMBER)
+
+ NOEXPORT TICKET_KEY *key_read(char *arg, char *option) {
+ char *key_str;
+diff --git a/src/prototypes.h b/src/prototypes.h
+index ebd413c..edd4341 100644
+--- a/src/prototypes.h
++++ b/src/prototypes.h
+@@ -244,7 +244,7 @@ typedef struct service_options_struct {
+ #if OPENSSL_VERSION_NUMBER>=0x009080dfL
+ long unsigned ssl_options_clear;
+ #endif /* OpenSSL 0.9.8m or later */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ int min_proto_version, max_proto_version;
+ #else /* OPENSSL_VERSION_NUMBER<0x10100000L */
+ SSL_METHOD *client_method, *server_method;
+@@ -706,7 +706,7 @@ int getnameinfo(const struct sockaddr *, socklen_t,
+ extern CLI *thread_head;
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #ifdef USE_OS_THREADS
+
+@@ -755,7 +755,7 @@ typedef enum {
+
+ extern CRYPTO_RWLOCK *stunnel_locks[STUNNEL_LOCKS];
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+ /* Emulate the OpenSSL 1.1 locking API for older OpenSSL versions */
+ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void);
+ int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *);
+diff --git a/src/ssl.c b/src/ssl.c
+index 60e31c1..10b0658 100644
+--- a/src/ssl.c
++++ b/src/ssl.c
+@@ -39,7 +39,7 @@
+ #include "prototypes.h"
+
+ /* global OpenSSL initialization: compression, engine, entropy */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cb_dup_addr(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
+ void *from_d, int idx, long argl, void *argp);
+ #else
+@@ -114,7 +114,7 @@ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) {
+ #endif
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cb_dup_addr(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
+ void *from_d, int idx, long argl, void *argp) {
+ #else
+@@ -177,7 +177,7 @@ int ssl_configure(GLOBAL_OPTIONS *global) { /* configure global TLS settings */
+
+ #ifndef OPENSSL_NO_COMP
+
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ NOEXPORT int COMP_get_type(const COMP_METHOD *meth) {
+ return meth->type;
+diff --git a/src/sthreads.c b/src/sthreads.c
+index dc2cd43..7a01f2e 100644
+--- a/src/sthreads.c
++++ b/src/sthreads.c
+@@ -102,14 +102,16 @@ unsigned long stunnel_thread_id(void) {
+
+ #endif /* USE_WIN32 */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100004L
++#if (OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100004L) || \
++ defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT void threadid_func(CRYPTO_THREADID *tid) {
+ CRYPTO_THREADID_set_numeric(tid, stunnel_thread_id());
+ }
+ #endif
+
+ void thread_id_init(void) {
+-#if OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100000L
++#if (OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100000L) || \
++ defined(LIBRESSL_VERSION_NUMBER)
+ CRYPTO_THREADID_set_callback(threadid_func);
+ #endif
+ #if OPENSSL_VERSION_NUMBER<0x10000000L || !defined(OPENSSL_NO_DEPRECATED)
+@@ -120,7 +122,7 @@ void thread_id_init(void) {
+ /**************************************** locking */
+
+ /* we only need to initialize locking with OpenSSL older than 1.1.0 */
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #ifdef USE_PTHREAD
+
+@@ -229,7 +231,7 @@ NOEXPORT int s_atomic_add(int *val, int amount, CRYPTO_RWLOCK *lock) {
+
+ CRYPTO_RWLOCK *stunnel_locks[STUNNEL_LOCKS];
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #ifdef USE_OS_THREADS
+
+@@ -339,7 +341,8 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock) {
+
+ void locking_init(void) {
+ size_t i;
+-#if defined(USE_OS_THREADS) && OPENSSL_VERSION_NUMBER<0x10100004L
++#if defined(USE_OS_THREADS) && \
++ (OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER))
+ size_t num;
+
+ /* initialize the OpenSSL static locking */
+diff --git a/src/tls.c b/src/tls.c
+index 6c92b96..5e60a95 100644
+--- a/src/tls.c
++++ b/src/tls.c
+@@ -41,7 +41,7 @@
+ volatile int tls_initialized=0;
+
+ NOEXPORT void tls_platform_init();
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT void free_function(void *);
+ #endif
+
+@@ -52,7 +52,7 @@ void tls_init() {
+ tls_platform_init();
+ tls_initialized=1;
+ ui_tls=tls_alloc(NULL, NULL, "ui");
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ CRYPTO_set_mem_functions(str_alloc_detached_debug,
+ str_realloc_detached_debug, str_free_debug);
+ #else
+@@ -184,7 +184,7 @@ TLS_DATA *tls_get() {
+
+ /**************************************** OpenSSL allocator hook */
+
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT void free_function(void *ptr) {
+ /* CRYPTO_set_mem_ex_functions() needs a function rather than a macro */
+ /* unfortunately, OpenSSL provides no file:line information here */
+diff --git a/src/verify.c b/src/verify.c
+index 1d1eccb..dfd9bff 100644
+--- a/src/verify.c
++++ b/src/verify.c
+@@ -346,7 +346,7 @@ NOEXPORT int cert_check_local(X509_STORE_CTX *callback_ctx) {
+ cert=X509_STORE_CTX_get_current_cert(callback_ctx);
+ subject=X509_get_subject_name(cert);
+
+-#if OPENSSL_VERSION_NUMBER<0x10100006L
++#if OPENSSL_VERSION_NUMBER<0x10100006L || defined(LIBRESSL_VERSION_NUMBER)
+ #define X509_STORE_CTX_get1_certs X509_STORE_get1_certs
+ #endif
+ /* modern API allows retrieving multiple matching certificates */
diff --git a/net-misc/stunnel/stunnel-5.54.ebuild b/net-misc/stunnel/stunnel-5.54.ebuild
index 8e7f7da16ba..a36f2872e78 100644
--- a/net-misc/stunnel/stunnel-5.54.ebuild
+++ b/net-misc/stunnel/stunnel-5.54.ebuild
@@ -18,11 +18,11 @@ SRC_URI="ftp://ftp.stunnel.org/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
-IUSE="ipv6 selinux stunnel3 tcpd"
+IUSE="ipv6 libressl selinux stunnel3 tcpd"
-DEPEND="
- tcpd? ( sys-apps/tcp-wrappers )
- dev-libs/openssl:0="
+DEPEND="!libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ tcpd? ( sys-apps/tcp-wrappers )"
RDEPEND="${DEPEND}
stunnel3? ( dev-lang/perl )
selinux? ( sec-policy/selinux-stunnel )"
@@ -39,6 +39,9 @@ src_prepare() {
sed -i -e "s/^install-data-local:/do-not-run-this:/" \
tools/Makefile.in || die "sed failed"
+ # bugs 656420, 682894
+ eapply "${FILESDIR}"/${P}-libressl.patch
+
echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
eapply_user
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/files/, net-misc/stunnel/
@ 2023-10-04 15:57 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2023-10-04 15:57 UTC (permalink / raw
To: gentoo-commits
commit: 8e88a75c402954c9c81d2a471be272cfd1523583
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 4 15:54:16 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 4 15:54:16 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e88a75c
net-misc/stunnel: add 5.71
Closes: https://bugs.gentoo.org/892992
Signed-off-by: Sam James <sam <AT> gentoo.org>
net-misc/stunnel/Manifest | 1 +
.../stunnel-5.71-dont-clobber-fortify-source.patch | 15 +++
.../stunnel-5.71-respect-EPYTHON-for-tests.patch | 12 ++
net-misc/stunnel/stunnel-5.71.ebuild | 123 +++++++++++++++++++++
4 files changed, 151 insertions(+)
diff --git a/net-misc/stunnel/Manifest b/net-misc/stunnel/Manifest
index 1f9de1099a83..de88c8164e0d 100644
--- a/net-misc/stunnel/Manifest
+++ b/net-misc/stunnel/Manifest
@@ -1,3 +1,4 @@
DIST stunnel-5.64.tar.gz 869088 BLAKE2B c6be054b825e57c1ac44adf28d4546ab78250cf9d7b17bc9e039d2715ca2316fef674a3ed2c4419a5a7ad6fa85b56809f736d0dca0bc672521347d5f51d2ed23 SHA512 85ed22664420db3c97b871f1afeb6483e547f421f0419fed1ccb4f3563ea154b6aeb6ae7221f001557c786a3406ada4c7b0d44b208dcf98f16209229aee4e0aa
DIST stunnel-5.65.tar.gz 872293 BLAKE2B 45cc4dd0ec91cb9a99c10d26910b05325af29ec2609c0b86d5aceb07fbd495ff6fe39b0fe2c5895358596ee34ed822870c6eb1a538e30557f4485d042f5ae781 SHA512 96ca0535a07d5ea050a5d985c0ab6299bb92e551715120f536869a7b408b795fdc251782aaa7a4a282749d3146726d71c8b3c25430969aa55745a863abe5728a
DIST stunnel-5.68.tar.gz 884989 BLAKE2B e2551b2052db0719203b24dcf16a2ef74c078dccd1200d25502defcef1301456e755a71a1a2b6ab7b43fc9ddc04cd031fca83ffb760528133a0e22ae22e64d40 SHA512 cdc3b8ab4cd35ba722b5248c005ae58a39d79a80600447417b1d0d01fd3aa9e8b22f8568c3177423be99d7395bb15a8754e975fb953556cd80a9cc11e185e9fb
+DIST stunnel-5.71.tar.gz 895646 BLAKE2B d323363c7bfdd6c0b7931b84a6069cf9a8337e967c31e14d15976d7932f0c0d6f40f7a1cbf5abbdff0e9edc52176cdcead4f848653088193b2debf4e77443b42 SHA512 c7004f48b93b3415305eec1193d51b7bf51a3bdd2cdc9f6ae588f563b32408b1ecde83b9f3f5b658f945ab5bcc5124390c38235394aad4471bf5b666081af2a2
diff --git a/net-misc/stunnel/files/stunnel-5.71-dont-clobber-fortify-source.patch b/net-misc/stunnel/files/stunnel-5.71-dont-clobber-fortify-source.patch
new file mode 100644
index 000000000000..723b9c5e43f2
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-5.71-dont-clobber-fortify-source.patch
@@ -0,0 +1,15 @@
+Don't clobber toolchain defaults.
+
+https://bugs.gentoo.org/892992
+--- a/configure.ac
++++ b/configure.ac
+@@ -109,7 +109,8 @@ if test "${GCC}" = yes; then
+ AX_APPEND_LINK_FLAGS([-Wl,-z,now])
+ AX_APPEND_LINK_FLAGS([-Wl,-z,noexecstack])
+ fi
+-AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2])
++
++AX_ADD_FORTIFY_SOURCE
+
+ AC_MSG_NOTICE([**************************************** libtool])
+ LT_INIT([disable-static])
diff --git a/net-misc/stunnel/files/stunnel-5.71-respect-EPYTHON-for-tests.patch b/net-misc/stunnel/files/stunnel-5.71-respect-EPYTHON-for-tests.patch
new file mode 100644
index 000000000000..3c421da91484
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-5.71-respect-EPYTHON-for-tests.patch
@@ -0,0 +1,12 @@
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -7,8 +7,7 @@ EXTRA_DIST = maketest.py plugin_collection.py reader.py error.py plugins
+
+ # try to find a supported python version (>= 3.7) that works
+ check-local:
+- for v in $$(seq 20 -1 7); do command -v python3.$$v && break; done || ( echo "Python 3.7 or later not found" && false )
+- for v in $$(seq 20 -1 7); do command -v python3.$$v && python3.$$v $(srcdir)/maketest.py --debug=10 --libs=$(SSLDIR)/lib64:$(SSLDIR)/lib && break; done
++ ${EPYTHON} $(srcdir)/maketest.py --debug=10 --libs=$(SSLDIR)/lib64:$(SSLDIR)/lib
+
+ dist-hook:
+ rm -rf $(distdir)/__pycache__ $(distdir)/plugins/__pycache__
diff --git a/net-misc/stunnel/stunnel-5.71.ebuild b/net-misc/stunnel/stunnel-5.71.ebuild
new file mode 100644
index 000000000000..0a61d4a431b5
--- /dev/null
+++ b/net-misc/stunnel/stunnel-5.71.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit autotools python-any-r1 ssl-cert systemd tmpfiles
+
+DESCRIPTION="TLS/SSL - Port Wrapper"
+HOMEPAGE="https://www.stunnel.org/index.html"
+SRC_URI="
+ https://www.stunnel.org/downloads/${P}.tar.gz
+ ftp://ftp.stunnel.org/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://www.usenix.org.uk/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://ftp.nluug.nl/pub/networking/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://www.namesdir.com/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://stunnel.cybermirror.org/archive/${PV%%.*}.x/${P}.tar.gz
+ http://mirrors.zerg.biz/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ ftp://mirrors.go-parts.com/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="selinux stunnel3 systemd tcpd test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ dev-libs/openssl:=
+ tcpd? ( sys-apps/tcp-wrappers )
+ systemd? ( sys-apps/systemd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ acct-user/stunnel
+ acct-group/stunnel
+ selinux? ( sec-policy/selinux-stunnel )
+ stunnel3? ( dev-lang/perl )
+"
+BDEPEND="
+ test? ( ${PYTHON_DEPS} )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.71-dont-clobber-fortify-source.patch
+ "${FILESDIR}"/${PN}-5.71-respect-EPYTHON-for-tests.patch
+)
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # Hack away generation of certificate
+ sed -i -e "s/^install-data-local:/do-not-run-this:/" \
+ tools/Makefile.am || die "sed failed"
+
+ echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel || die
+
+ # We pass --disable-fips to configure, so avoid spurious test failures
+ rm tests/plugins/p10_fips.py tests/plugins/p11_fips_cipher.py || die
+
+ # Needed for FORTIFY_SOURCE patch
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --libdir="${EPREFIX}/usr/$(get_libdir)"
+ --with-ssl="${EPREFIX}"/usr
+ --disable-fips
+ $(use_enable tcpd libwrap)
+ $(use_enable systemd)
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ rm -rf "${ED}"/usr/share/doc/${PN} || die
+ rm -f "${ED}"/etc/stunnel/stunnel.conf-sample \
+ "${ED}"/usr/share/man/man8/stunnel.{fr,pl}.8 || die
+
+ if ! use stunnel3 ; then
+ rm -f "${ED}"/usr/bin/stunnel3 || die
+ fi
+
+ dodoc AUTHORS.md BUGS.md CREDITS.md PORTS.md README.md TODO.md
+ docinto html
+ dodoc doc/stunnel.html doc/en/VNC_StunnelHOWTO.html tools/ca.html \
+ tools/importCA.html
+
+ insinto /etc/stunnel
+ doins "${FILESDIR}"/stunnel.conf
+ newinitd "${FILESDIR}"/stunnel-r2 stunnel
+
+ doenvd "${T}"/20stunnel
+
+ systemd_dounit "${S}/tools/stunnel.service"
+ newtmpfiles "${FILESDIR}"/stunnel.tmpfiles.conf stunnel.conf
+
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ if [[ ! -f "${EROOT}"/etc/stunnel/stunnel.key ]]; then
+ install_cert /etc/stunnel/stunnel
+ chown stunnel:stunnel "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ chmod 0640 "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ fi
+
+ tmpfiles_process stunnel.conf
+
+ einfo "If you want to run multiple instances of stunnel, create a new config"
+ einfo "file ending with .conf in /etc/stunnel/. **Make sure** you change "
+ einfo "\'pid= \' with a unique filename. For openrc make a symlink from the"
+ einfo "stunnel init script to \'stunnel.name\' and use that to start|stop"
+ einfo "your custom instance"
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-10-04 15:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-22 5:49 [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/files/, net-misc/stunnel/ Stefan Strogin
-- strict thread matches above, loose matches on Subject: below --
2023-10-04 15:57 Sam James
2019-04-24 4:56 Aaron Bauman
2018-07-09 2:35 Anthony G. Basile
2017-01-28 13:23 Anthony G. Basile
2016-05-11 14:23 Anthony G. Basile
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox