Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/elinks/, www-client/elinks/files/
Date: Sun, 22 Oct 2017 16:55:37
Message-Id: 1508691309.9f93ee632f0a851deddaa347bc933278a48f7f8d.monsieurp@gentoo
1 commit: 9f93ee632f0a851deddaa347bc933278a48f7f8d
2 Author: Felix Janda <felix.janda <AT> posteo <DOT> de>
3 AuthorDate: Sat Oct 14 13:43:32 2017 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 22 16:55:09 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f93ee63
7
8 www-client/elinks-0.12_pre6-r2: fix compilation with libressl.
9
10 Closes: https://bugs.gentoo.org/584766
11 Closes: https://bugs.gentoo.org/609006
12
13 www-client/elinks/elinks-0.12_pre6-r2.ebuild | 2 ++
14 .../elinks/files/elinks-0.12_pre5-libressl.patch | 29 ++++++++++++++++++++++
15 .../elinks/files/elinks-0.12_pre5-rand-egd.patch | 20 +++++++++++++++
16 3 files changed, 51 insertions(+)
17
18 diff --git a/www-client/elinks/elinks-0.12_pre6-r2.ebuild b/www-client/elinks/elinks-0.12_pre6-r2.ebuild
19 index ed3f69831bd..e9e8625888a 100644
20 --- a/www-client/elinks/elinks-0.12_pre6-r2.ebuild
21 +++ b/www-client/elinks/elinks-0.12_pre6-r2.ebuild
22 @@ -56,6 +56,8 @@ src_prepare() {
23
24 epatch "${FILESDIR}"/${PN}-9999-parallel-make.patch
25 epatch "${FILESDIR}"/${PN}-0.12_pre5-compilation-fix.patch
26 + epatch "${FILESDIR}"/${PN}-0.12_pre5-libressl.patch
27 + epatch "${FILESDIR}"/${PN}-0.12_pre5-rand-egd.patch
28
29 if use javascript ; then
30 if has_version ">=dev-lang/spidermonkey-1.8"; then
31
32 diff --git a/www-client/elinks/files/elinks-0.12_pre5-libressl.patch b/www-client/elinks/files/elinks-0.12_pre5-libressl.patch
33 new file mode 100644
34 index 00000000000..d41ab689e9f
35 --- /dev/null
36 +++ b/www-client/elinks/files/elinks-0.12_pre5-libressl.patch
37 @@ -0,0 +1,29 @@
38 +Adapted from upstream
39 +commit 54ebe365b752f8969a67279d0d29552ab638e025
40 +Author: Witold Filipczyk <witekfl@×××××××××××.pl>
41 +Date: Mon Mar 6 17:39:36 2017 +0100
42 +
43 + Compilation fix for OpenSSL-1.1
44 +
45 +--- a/src/network/ssl/socket.c
46 ++++ b/src/network/ssl/socket.c
47 +@@ -67,7 +67,9 @@
48 + ssl_set_no_tls(struct socket *socket)
49 + {
50 + #ifdef CONFIG_OPENSSL
51 +- ((ssl_t *) socket->ssl)->options |= SSL_OP_NO_TLSv1;
52 ++#ifdef SSL_OP_NO_TLSv1
53 ++ SSL_set_options((ssl_t *)socket->ssl, SSL_OP_NO_TLSv1);
54 ++#endif
55 + #elif defined(CONFIG_GNUTLS)
56 + {
57 + /* GnuTLS does not support SSLv2 because it is "insecure".
58 +@@ -145,7 +147,7 @@
59 + }
60 +
61 + if (client_cert) {
62 +- SSL_CTX *ctx = ((SSL *) socket->ssl)->ctx;
63 ++ SSL_CTX *ctx = SSL_get_SSL_CTX((SSL *) socket->ssl);
64 +
65 + SSL_CTX_use_certificate_chain_file(ctx, client_cert);
66 + SSL_CTX_use_PrivateKey_file(ctx, client_cert,
67
68 diff --git a/www-client/elinks/files/elinks-0.12_pre5-rand-egd.patch b/www-client/elinks/files/elinks-0.12_pre5-rand-egd.patch
69 new file mode 100644
70 index 00000000000..6c5679a95bb
71 --- /dev/null
72 +++ b/www-client/elinks/files/elinks-0.12_pre5-rand-egd.patch
73 @@ -0,0 +1,20 @@
74 +--- a/src/network/ssl/ssl.c
75 ++++ b/src/network/ssl/ssl.c
76 +@@ -84,11 +84,16 @@ init_openssl(struct module *module)
77 + * cannot initialize the PRNG and so every attempt to use SSL fails.
78 + * It's actually an OpenSSL FAQ, and according to them, it's up to the
79 + * application coders to seed the RNG. -- William Yodlowsky */
80 +- if (RAND_egd(RAND_file_name(f_randfile, sizeof(f_randfile))) < 0) {
81 ++ RAND_file_name(f_randfile, sizeof(f_randfile));
82 ++#ifdef HAVE_RAND_EGD
83 ++ if (RAND_egd(f_randfile) < 0) {
84 + /* Not an EGD, so read and write to it */
85 ++#endif
86 + if (RAND_load_file(f_randfile, -1))
87 + RAND_write_file(f_randfile);
88 ++#ifdef HAVE_RAND_EGD
89 + }
90 ++#endif
91 +
92 + SSLeay_add_ssl_algorithms();
93 + context = SSL_CTX_new(SSLv23_client_method());