summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Thode <prometheanfire@gentoo.org>2017-12-03 17:16:30 -0600
committerMatthew Thode <prometheanfire@gentoo.org>2017-12-03 17:16:58 -0600
commitbb2668b25a60043cebec65fdcfa9c1082495d7b7 (patch)
treecfdf947f89cb9764c501e57e9fb9a34180ca2eb3 /net-misc/wget/files
parentkde-frameworks/kdelibs: Drop USE=opengl (diff)
downloadgentoo-bb2668b25a60043cebec65fdcfa9c1082495d7b7.tar.gz
gentoo-bb2668b25a60043cebec65fdcfa9c1082495d7b7.tar.bz2
gentoo-bb2668b25a60043cebec65fdcfa9c1082495d7b7.zip
net-misc/wget: fix build on openssl 1.1
Package-Manager: Portage-2.3.14, Repoman-2.3.6
Diffstat (limited to 'net-misc/wget/files')
-rw-r--r--net-misc/wget/files/wget-1.92.2-openssl-1.1.0-r1.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/net-misc/wget/files/wget-1.92.2-openssl-1.1.0-r1.patch b/net-misc/wget/files/wget-1.92.2-openssl-1.1.0-r1.patch
new file mode 100644
index 000000000000..79f33b157599
--- /dev/null
+++ b/net-misc/wget/files/wget-1.92.2-openssl-1.1.0-r1.patch
@@ -0,0 +1,80 @@
+--- a/src/openssl.c
++++ b/src/openssl.c
+@@ -174,11 +174,16 @@ ssl_init (void)
+ {
+ SSL_METHOD const *meth;
+ long ssl_options = 0;
++#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100000L)
++ int ssl_proto_version = 0;
++#endif
+
+ #if OPENSSL_VERSION_NUMBER >= 0x00907000
+ if (ssl_true_initialized == 0)
+ {
++#if OPENSSL_API_COMPAT < 0x10100000L
+ OPENSSL_config (NULL);
++#endif
+ ssl_true_initialized = 1;
+ }
+ #endif
+@@ -202,8 +207,12 @@ ssl_init (void)
+ CONF_modules_load_file(NULL, NULL,
+ CONF_MFLAGS_DEFAULT_SECTION|CONF_MFLAGS_IGNORE_MISSING_FILE);
+ #endif
++#if OPENSSL_API_COMPAT >= 0x10100000L
++ OPENSSL_init_ssl(0, NULL);
++#else
+ SSL_library_init ();
+ SSL_load_error_strings ();
++#endif
+ #if OPENSSL_VERSION_NUMBER < 0x10100000L
+ SSLeay_add_all_algorithms ();
+ SSLeay_add_ssl_algorithms ();
+@@ -229,16 +238,31 @@ ssl_init (void)
+ ssl_options |= SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3;
+ break;
+ case secure_protocol_tlsv1:
++#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100000L)
++ meth = TLS_client_method();
++ ssl_proto_version = TLS1_VERSION;
++#else
+ meth = TLSv1_client_method ();
++#endif
+ break;
+
+ #if OPENSSL_VERSION_NUMBER >= 0x10001000
+ case secure_protocol_tlsv1_1:
++#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100000L)
++ meth = TLS_client_method();
++ ssl_proto_version = TLS1_1_VERSION;
++#else
+ meth = TLSv1_1_client_method ();
++#endif
+ break;
+
+ case secure_protocol_tlsv1_2:
++#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100000L)
++ meth = TLS_client_method();
++ ssl_proto_version = TLS1_2_VERSION;
++#else
+ meth = TLSv1_2_client_method ();
++#endif
+ break;
+ #else
+ case secure_protocol_tlsv1_1:
+@@ -262,8 +286,15 @@ ssl_init (void)
+ if (!ssl_ctx)
+ goto error;
+
++#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+ if (ssl_options)
+ SSL_CTX_set_options (ssl_ctx, ssl_options);
++#endif
++
++#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >=0x10100000L)
++ if (ssl_proto_version)
++ SSL_CTX_set_min_proto_version(ssl_ctx, ssl_proto_version);
++#endif
+
+ /* OpenSSL ciphers: https://www.openssl.org/docs/apps/ciphers.html
+ * Since we want a good protection, we also use HIGH (that excludes MD4 ciphers and some more)