Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-voip/telepathy-salut/files/, net-voip/telepathy-salut/
Date: Sun, 02 Dec 2018 20:41:15
Message-Id: 1543783250.b87bd835aaa06a7d303fd513de972bf8660ca0f0.asturm@gentoo
1 commit: b87bd835aaa06a7d303fd513de972bf8660ca0f0
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 2 20:32:18 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 2 20:40:50 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b87bd835
7
8 net-voip/telepathy-salut: Fix build with openssl-1.1
9
10 Closes: https://bugs.gentoo.org/663994
11 Package-Manager: Portage-2.3.52, Repoman-2.3.12
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 .../files/telepathy-salut-0.8.1-openssl-1.1.patch | 188 +++++++++++++++++++++
15 .../telepathy-salut-0.8.1-r2.ebuild | 81 +++++++++
16 2 files changed, 269 insertions(+)
17
18 diff --git a/net-voip/telepathy-salut/files/telepathy-salut-0.8.1-openssl-1.1.patch b/net-voip/telepathy-salut/files/telepathy-salut-0.8.1-openssl-1.1.patch
19 new file mode 100644
20 index 00000000000..2f4c74e2420
21 --- /dev/null
22 +++ b/net-voip/telepathy-salut/files/telepathy-salut-0.8.1-openssl-1.1.patch
23 @@ -0,0 +1,188 @@
24 +From 68e7fb2f17dd9348e586ef676d8138c4b849a1ce Mon Sep 17 00:00:00 2001
25 +From: Roel Aaij <roel.aaij@××××××.nl>
26 +Date: Fri, 26 Oct 2018 15:01:37 +0200
27 +Subject: [PATCH] openssl: fix build with openssl >= 1.1.0
28 +
29 +---
30 + wocky/wocky-openssl-dh1024.c | 10 ++++++++++
31 + wocky/wocky-openssl-dh2048.c | 10 ++++++++++
32 + wocky/wocky-openssl-dh4096.c | 10 ++++++++++
33 + wocky/wocky-openssl-dh512.c | 10 ++++++++++
34 + wocky/wocky-openssl.c | 38 ++++++++++++++++++++++++++++++++----
35 + 5 files changed, 74 insertions(+), 4 deletions(-)
36 +
37 +diff --git a/lib/ext/wocky/wocky/wocky-openssl-dh1024.c b/lib/ext/wocky/wocky/wocky-openssl-dh1024.c
38 +index b77fb4c..bb50523 100644
39 +--- a/lib/ext/wocky/wocky/wocky-openssl-dh1024.c
40 ++++ b/lib/ext/wocky/wocky/wocky-openssl-dh1024.c
41 +@@ -25,11 +25,21 @@ DH *get_dh1024(void)
42 + 0x02,
43 + };
44 + DH *dh;
45 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
46 ++ int r = 0;
47 ++#endif
48 +
49 + if ((dh=DH_new()) == NULL) return(NULL);
50 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
51 ++ r = DH_set0_pqg(dh, BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL),
52 ++ NULL, BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL));
53 ++ if (!r)
54 ++ { DH_free(dh); return(NULL); }
55 ++#else
56 + dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL);
57 + dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL);
58 + if ((dh->p == NULL) || (dh->g == NULL))
59 + { DH_free(dh); return(NULL); }
60 ++#endif
61 + return(dh);
62 + }
63 +diff --git a/lib/ext/wocky/wocky/wocky-openssl-dh2048.c b/lib/ext/wocky/wocky/wocky-openssl-dh2048.c
64 +index c16deb7..d53ceda 100644
65 +--- a/lib/ext/wocky/wocky/wocky-openssl-dh2048.c
66 ++++ b/lib/ext/wocky/wocky/wocky-openssl-dh2048.c
67 +@@ -36,11 +36,21 @@ DH *get_dh2048(void)
68 + 0x02,
69 + };
70 + DH *dh;
71 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
72 ++ int r = 0;
73 ++#endif
74 +
75 + if ((dh=DH_new()) == NULL) return(NULL);
76 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
77 ++ r = DH_set0_pqg(dh, BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL),
78 ++ NULL, BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL));
79 ++ if (!r)
80 ++ { DH_free(dh); return(NULL); }
81 ++#else
82 + dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL);
83 + dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL);
84 + if ((dh->p == NULL) || (dh->g == NULL))
85 + { DH_free(dh); return(NULL); }
86 ++#endif
87 + return(dh);
88 + }
89 +diff --git a/lib/ext/wocky/wocky/wocky-openssl-dh4096.c b/lib/ext/wocky/wocky/wocky-openssl-dh4096.c
90 +index 2854385..93fa7e5 100644
91 +--- a/lib/ext/wocky/wocky/wocky-openssl-dh4096.c
92 ++++ b/lib/ext/wocky/wocky/wocky-openssl-dh4096.c
93 +@@ -57,11 +57,21 @@ DH *get_dh4096(void)
94 + 0x02,
95 + };
96 + DH *dh;
97 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
98 ++ int r = 0;
99 ++#endif
100 +
101 + if ((dh=DH_new()) == NULL) return(NULL);
102 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
103 ++ r = DH_set0_pqg(dh, BN_bin2bn(dh4096_p,sizeof(dh4096_p),NULL),
104 ++ NULL, BN_bin2bn(dh4096_g,sizeof(dh4096_g),NULL));
105 ++ if (!r)
106 ++ { DH_free(dh); return(NULL); }
107 ++#else
108 + dh->p=BN_bin2bn(dh4096_p,sizeof(dh4096_p),NULL);
109 + dh->g=BN_bin2bn(dh4096_g,sizeof(dh4096_g),NULL);
110 + if ((dh->p == NULL) || (dh->g == NULL))
111 + { DH_free(dh); return(NULL); }
112 ++#endif
113 + return(dh);
114 + }
115 +diff --git a/lib/ext/wocky/wocky/wocky-openssl-dh512.c b/lib/ext/wocky/wocky/wocky-openssl-dh512.c
116 +index 8e7a278..c2891cd 100644
117 +--- a/lib/ext/wocky/wocky/wocky-openssl-dh512.c
118 ++++ b/lib/ext/wocky/wocky/wocky-openssl-dh512.c
119 +@@ -20,11 +20,21 @@ DH *get_dh512(void)
120 + 0x02,
121 + };
122 + DH *dh;
123 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
124 ++ int r = 0;
125 ++#endif
126 +
127 + if ((dh=DH_new()) == NULL) return(NULL);
128 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
129 ++ r = DH_set0_pqg(dh, BN_bin2bn(dh512_p,sizeof(dh512_p),NULL),
130 ++ NULL, BN_bin2bn(dh512_g,sizeof(dh512_g),NULL));
131 ++ if (!r)
132 ++ { DH_free(dh); return(NULL); }
133 ++#else
134 + dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
135 + dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
136 + if ((dh->p == NULL) || (dh->g == NULL))
137 + { DH_free(dh); return(NULL); }
138 ++#endif
139 + return(dh);
140 + }
141 +diff --git a/lib/ext/wocky/wocky/wocky-openssl.c b/lib/ext/wocky/wocky/wocky-openssl.c
142 +index 2201213..18f9981 100644
143 +--- a/lib/ext/wocky/wocky/wocky-openssl.c
144 ++++ b/lib/ext/wocky/wocky/wocky-openssl.c
145 +@@ -885,7 +885,11 @@ check_peer_name (const char *target, X509 *cert)
146 + int i;
147 + gboolean rval = FALSE;
148 + X509_NAME *subject = X509_get_subject_name (cert);
149 +- X509_CINF *ci = cert->cert_info;
150 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
151 ++ const STACK_OF(X509_EXTENSION)* extensions = X509_get0_extensions(cert);
152 ++#else
153 ++ const STACK_OF(X509_EXTENSION)* extensions = cert->cert_info->extensions;
154 ++#endif
155 + static const long nid[] = { NID_commonName, NID_subject_alt_name, NID_undef };
156 +
157 + /* first, see if the x509 name contains the info we want: */
158 +@@ -906,16 +910,21 @@ check_peer_name (const char *target, X509 *cert)
159 + * and extract the subject_alt_name from the x509 v3 extensions: if that *
160 + * extension is present, and a string, use that. If it is present, and *
161 + * a multi-value stack, trawl it for the "DNS" entry and use that */
162 +- if (!rval && (ci->extensions != NULL))
163 +- for (i = 0; i < sk_X509_EXTENSION_num(ci->extensions) && !rval; i++)
164 ++ if (!rval && (extensions != NULL))
165 ++ for (i = 0; i < sk_X509_EXTENSION_num(extensions) && !rval; i++)
166 + {
167 +- X509_EXTENSION *ext = sk_X509_EXTENSION_value (ci->extensions, i);
168 ++ X509_EXTENSION *ext = sk_X509_EXTENSION_value (extensions, i);
169 + ASN1_OBJECT *obj = X509_EXTENSION_get_object (ext);
170 + X509V3_EXT_METHOD *convert = NULL;
171 + long ni = OBJ_obj2nid (obj);
172 + const guchar *p;
173 + char *value = NULL;
174 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
175 ++ const ASN1_OCTET_STRING* ext_value = X509_EXTENSION_get_data(ext);
176 ++ int len = ASN1_STRING_length(ext_value);
177 ++#else
178 + int len = ext->value->length;
179 ++#endif
180 + void *ext_str = NULL;
181 +
182 + if (ni != NID_subject_alt_name)
183 +@@ -927,7 +936,11 @@ check_peer_name (const char *target, X509 *cert)
184 + if ((convert = (X509V3_EXT_METHOD *) X509V3_EXT_get (ext)) == NULL)
185 + continue;
186 +
187 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
188 ++ p = ASN1_STRING_get0_data(ext_value);
189 ++#else
190 + p = ext->value->data;
191 ++#endif
192 + ext_str = ((convert->it != NULL) ?
193 + ASN1_item_d2i (NULL, &p, len, ASN1_ITEM_ptr(convert->it)) :
194 + convert->d2i (NULL, &p, len) );
195 +@@ -1675,12 +1701,16 @@ wocky_tls_session_init (WockyTLSSession *session)
196 +
197 + if G_UNLIKELY (g_once_init_enter (&initialised))
198 + {
199 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
200 ++ DEBUG ("initialising SSL library and error strings");
201 ++#else
202 + gint malloc_init_succeeded;
203 +
204 + DEBUG ("initialising SSL library and error strings");
205 +
206 + malloc_init_succeeded = CRYPTO_malloc_init ();
207 + g_warn_if_fail (malloc_init_succeeded);
208 ++#endif
209 +
210 + SSL_library_init ();
211 + SSL_load_error_strings ();
212
213 diff --git a/net-voip/telepathy-salut/telepathy-salut-0.8.1-r2.ebuild b/net-voip/telepathy-salut/telepathy-salut-0.8.1-r2.ebuild
214 new file mode 100644
215 index 00000000000..21535ca1b82
216 --- /dev/null
217 +++ b/net-voip/telepathy-salut/telepathy-salut-0.8.1-r2.ebuild
218 @@ -0,0 +1,81 @@
219 +# Copyright 1999-2018 Gentoo Authors
220 +# Distributed under the terms of the GNU General Public License v2
221 +
222 +EAPI=6
223 +
224 +PYTHON_COMPAT=( python2_7 )
225 +inherit python-any-r1
226 +
227 +DESCRIPTION="A link-local XMPP connection manager for Telepathy"
228 +HOMEPAGE="https://telepathy.freedesktop.org/"
229 +SRC_URI="https://telepathy.freedesktop.org/releases/${PN}/${P}.tar.gz"
230 +
231 +LICENSE="LGPL-2.1"
232 +SLOT="0"
233 +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-linux"
234 +IUSE="gnutls test"
235 +
236 +RDEPEND="
237 + >=dev-libs/dbus-glib-0.61
238 + dev-libs/libxml2
239 + >=dev-libs/glib-2.28:2
240 + >=sys-apps/dbus-1.1.0
241 + >=net-libs/telepathy-glib-0.17.1
242 + >=net-dns/avahi-0.6.22[dbus]
243 + net-libs/libsoup:2.4
244 + sys-apps/util-linux
245 + dev-db/sqlite:3
246 + gnutls? ( >=net-libs/gnutls-2.10.2 )
247 + !gnutls? ( >=dev-libs/openssl-0.9.8g:0[-bindist] )
248 +"
249 +DEPEND="${RDEPEND}
250 + ${PYTHON_DEPS}
251 + dev-libs/libxslt
252 + virtual/pkgconfig
253 + test? (
254 + >=dev-libs/check-0.9.4
255 + net-libs/libgsasl
256 + || (
257 + $(python_gen_any_dep 'dev-python/twisted[${PYTHON_USEDEP}]')
258 + $(python_gen_any_dep 'dev-python/twisted-words[${PYTHON_USEDEP}]')
259 + )
260 + )
261 +"
262 +# FIXME: needs xmppstream python module
263 +# >=net-dns/avahi-0.6.22[python]
264 +
265 +PATCHES=(
266 + "${FILESDIR}"/${PN}-0.5.0-uninitialized.patch # upstream bug #37701
267 + "${FILESDIR}"/${P}-openssl-1.1.patch # bug #663994
268 +)
269 +
270 +python_check_deps() {
271 + if use test ; then
272 + has_version "dev-python/twisted[${PYTHON_USEDEP}]" \
273 + || has_version "dev-python/twisted-words[${PYTHON_USEDEP}]"
274 + fi
275 +}
276 +
277 +pkg_setup() {
278 + python-any-r1_pkg_setup
279 +}
280 +
281 +src_configure() {
282 + econf \
283 + --disable-coding-style-checks \
284 + --disable-plugins \
285 + --disable-Werror \
286 + --disable-static \
287 + --disable-avahi-tests \
288 + --docdir=/usr/share/doc/${PF} \
289 + --with-tls=$(usex gnutls gnutls openssl)
290 + #$(use_enable test avahi-tests)
291 +
292 + # false positives according to bug #413581:
293 + # unrecognized options: --disable-plugins, --disable-avahi-tests
294 +}
295 +
296 +src_install() {
297 + MAKEOPTS+=" -j1" default # bug 413581
298 + find "${D}" -name '*.la' -delete || die
299 +}