diff options
author | Eric Sandall | 2019-08-09 08:38:40 +0000 |
---|---|---|
committer | Eric Sandall | 2019-08-09 08:38:40 +0000 |
commit | fc254645f79c836a344f9febc8de59064b76ae62 (patch) | |
tree | 21d2d388a0994347df499298c3b02a3cb5889b01 /http | |
parent | f7273edcebeb2b67e23a9750123601be28ac0803 (diff) |
elinks: Apply openssl-1.1.patch and rand-egd.patch
* openssl-1.1.patch: Fix compilation with newer OpenSSL and LibreSSL (no TLSv1)
From https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/elinks/files/elinks-0.12_pre5-libressl.patch
* rand-edg.patch: Fix undefined reference to RAND_egd
From https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/elinks/files/elinks-0.12_pre5-rand-egd.patch
Diffstat (limited to 'http')
-rw-r--r-- | http/elinks/HISTORY | 17 | ||||
-rwxr-xr-x | http/elinks/PRE_BUILD | 8 | ||||
-rw-r--r-- | http/elinks/openssl-1.1.patch | 31 | ||||
-rw-r--r-- | http/elinks/rand-egd.patch | 22 |
4 files changed, 73 insertions, 5 deletions
diff --git a/http/elinks/HISTORY b/http/elinks/HISTORY index 2f42d6c809..0eb7b37961 100644 --- a/http/elinks/HISTORY +++ b/http/elinks/HISTORY @@ -1,8 +1,15 @@ -2014-08-24 Treeve Jelbert <treeve@sourcemage.org> - * DEPENDS: fix bad with-SSL usage - -2014-08-19 Treeve Jelbert <treeve@sourcemage.org> - * DEPENDS: openssl => SSL +2019-08-09 Eric Sandall <sandalle@sourcemage.org> + * PRE_BUILD: Apply openssl-1.1.patch and rand-egd.patch + * openssl-1.1.patch: Fix compilation with newer OpenSSL and LibreSSL (no TLSv1) + From https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/elinks/files/elinks-0.12_pre5-libressl.patch + * rand-edg.patch: Fix undefined reference to RAND_egd + From https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/elinks/files/elinks-0.12_pre5-rand-egd.patch + +2014-08-24 Treeve Jelbert <treeve@sourcemage.org> + * DEPENDS: fix bad with-SSL usage + +2014-08-19 Treeve Jelbert <treeve@sourcemage.org> + * DEPENDS: openssl => SSL 2014-07-03 Ismael Luceno <ismael@sourcemage.org> * DETAILS: Use get_scm_version diff --git a/http/elinks/PRE_BUILD b/http/elinks/PRE_BUILD index 40be4f50e6..01a5e4f9ea 100755 --- a/http/elinks/PRE_BUILD +++ b/http/elinks/PRE_BUILD @@ -1,6 +1,14 @@ default_pre_build && cd "$SOURCE_DIRECTORY" && +message "${MESSAGE_COLOR}Patching undefined reference to RAND_egd...${DEFAULT_COLOR}" && +patch -p1 < "${SPELL_DIRECTORY}"/rand-egd.patch && + +if is_depends_enabled ${SPELL} $(get_spell_provider ${SPELL} SSL); then + message "${MESSAGE_COLOR}Patching for OpenSSL 1.1+...${DEFAULT_COLOR}" && + patch -p1 < "${SPELL_DIRECTORY}"/openssl-1.1.patch +fi && + if is_depends_enabled $SPELL lua && [[ $ELINKS_VCS != y ]]; then patch -p0 < "$SPELL_DIRECTORY/lua51.patch" fi diff --git a/http/elinks/openssl-1.1.patch b/http/elinks/openssl-1.1.patch new file mode 100644 index 0000000000..f0e5d2c13b --- /dev/null +++ b/http/elinks/openssl-1.1.patch @@ -0,0 +1,31 @@ +# From https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/elinks/files/elinks-0.12_pre5-libressl.patch +Adapted from upstream +commit 54ebe365b752f8969a67279d0d29552ab638e025 +Author: Witold Filipczyk <witekfl@poczta.onet.pl> +Date: Mon Mar 6 17:39:36 2017 +0100 + + Compilation fix for OpenSSL-1.1 + +--- a/src/network/ssl/socket.c ++++ b/src/network/ssl/socket.c +@@ -67,7 +67,9 @@ + ssl_set_no_tls(struct socket *socket) + { + #ifdef CONFIG_OPENSSL +- ((ssl_t *) socket->ssl)->options |= SSL_OP_NO_TLSv1; ++#ifdef SSL_OP_NO_TLSv1 ++ SSL_set_options((ssl_t *)socket->ssl, SSL_OP_NO_TLSv1); ++#endif + #elif defined(CONFIG_GNUTLS) + { + /* GnuTLS does not support SSLv2 because it is "insecure". +@@ -145,7 +147,7 @@ + } + + if (client_cert) { +- SSL_CTX *ctx = ((SSL *) socket->ssl)->ctx; ++ SSL_CTX *ctx = SSL_get_SSL_CTX((SSL *) socket->ssl); + + SSL_CTX_use_certificate_chain_file(ctx, client_cert); + SSL_CTX_use_PrivateKey_file(ctx, client_cert, + diff --git a/http/elinks/rand-egd.patch b/http/elinks/rand-egd.patch new file mode 100644 index 0000000000..2146191f50 --- /dev/null +++ b/http/elinks/rand-egd.patch @@ -0,0 +1,22 @@ +# From https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/elinks/files/elinks-0.12_pre5-rand-egd.patch +--- a/src/network/ssl/ssl.c ++++ b/src/network/ssl/ssl.c +@@ -84,11 +84,16 @@ init_openssl(struct module *module) + * cannot initialize the PRNG and so every attempt to use SSL fails. + * It's actually an OpenSSL FAQ, and according to them, it's up to the + * application coders to seed the RNG. -- William Yodlowsky */ +- if (RAND_egd(RAND_file_name(f_randfile, sizeof(f_randfile))) < 0) { ++ RAND_file_name(f_randfile, sizeof(f_randfile)); ++#ifdef HAVE_RAND_EGD ++ if (RAND_egd(f_randfile) < 0) { + /* Not an EGD, so read and write to it */ ++#endif + if (RAND_load_file(f_randfile, -1)) + RAND_write_file(f_randfile); ++#ifdef HAVE_RAND_EGD + } ++#endif + + SSLeay_add_ssl_algorithms(); + context = SSL_CTX_new(SSLv23_client_method()); + |