Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/openssl/files/, dev-libs/openssl/
Date: Thu, 04 Jun 2020 17:53:46
Message-Id: 1591293181.9bce053e42181beb3ae28cc8585516202954a248.whissi@gentoo
1 commit: 9bce053e42181beb3ae28cc8585516202954a248
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 4 17:53:01 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 4 17:53:01 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9bce053e
7
8 dev-libs/openssl: security cleanup
9
10 Bug: https://bugs.gentoo.org/717442
11 Package-Manager: Portage-2.3.100, Repoman-2.3.22
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 dev-libs/openssl/Manifest | 3 -
15 ...sl-1.1.1d-config-Drop-linux-alpha-gcc-bwx.patch | 42 ---
16 ...x-potential-memleaks-w-BN_to_ASN1_INTEGER.patch | 107 -------
17 .../openssl/files/openssl-1.1.1d-fix-zlib.patch | 52 ----
18 ...stitched-AES-CBC-HMAC-SHA-implementations.patch | 62 ----
19 dev-libs/openssl/openssl-1.1.1d-r3.ebuild | 328 ---------------------
20 dev-libs/openssl/openssl-1.1.1f.ebuild | 324 --------------------
21 7 files changed, 918 deletions(-)
22
23 diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest
24 index 2d626cc93bd..0153ae0ad1c 100644
25 --- a/dev-libs/openssl/Manifest
26 +++ b/dev-libs/openssl/Manifest
27 @@ -3,8 +3,5 @@ DIST openssl-1.0.2t-bindist-1.0.tar.xz 13872 BLAKE2B b2aade96a6e0ca6209a39e205b1
28 DIST openssl-1.0.2u.tar.gz 5355412 BLAKE2B b2ff2a10e5851af5aca4093422a9a072c794e87b997263826c1c35910c040f695fac63decac5856cb49399ed03d410f97701d9fd4e1ebfbcacd8f3a74ce8bf57 SHA512 c455bb309e20e2c2d47fdc5619c734d107d5c8c38c1409903ce979acc120b0d5fa0312917c0aa0d630e402d092a703d4249643f36078e8528a3cafc9dac6ab32
29 DIST openssl-1.1.0l-bindist-1.0.tar.xz 13184 BLAKE2B c09e023458faff17b10d6f20c28462c0851757a20d59b4b751220ab307324d5778252df112ad74fd319407cc75fdd1cd507d48058dd0234dc8c03020c882ed42 SHA512 39720ecee3ec6080c1416f2fb7c9246b89ee55b21be2baabad51eb6823dbe1559450b1ae92fa61ac1cf5ba04ac8c02438aa469bc65eae6905cf1ea486f270793
30 DIST openssl-1.1.0l.tar.gz 5294857 BLAKE2B 0e4f30f9e8a22414325bd780dc4e875e962487fbe72967f0392ace959955429192541881a98d097d7bb75ed7238b1817b0c3c2c4da04421512bd538f2b07cdd7 SHA512 81b74149f40ea7d9f7e235820a4f977844653ad1e2b302e65e712c12193f47542fe7e3385fd1e25e3dd074e4e6d04199836cbc492656f5a7692edab5e234f4ad
31 -DIST openssl-1.1.1d-bindist-1.0.tar.xz 13180 BLAKE2B 680bd7400d3dd3930067ee7efa9718b74b30afa9be2397ad80f88031920806b6603b6469beede02b6e7a742abf5f82ebdd7c9b8e69c1ffe223e4860dc9581128 SHA512 9e4296326852010d5cebc204d1a34a34198d8d65460bc91a2bd37c80be892a5ae519513e4b0109e6b51b6faab0e171ef6cdae868868c158711558d147083c06f
32 -DIST openssl-1.1.1d.tar.gz 8845861 BLAKE2B d3155f07b487ebd8dd4fe25396c874f9af18b5cfd7e622298d29c4f2c8ce14ad4534609d321314a4bcd0d44414e1306190340daaacd3c8fca061c04498446244 SHA512 2bc9f528c27fe644308eb7603c992bac8740e9f0c3601a130af30c9ffebbf7e0f5c28b76a00bbb478bad40fbe89b4223a58d604001e1713da71ff4b7fe6a08a7
33 DIST openssl-1.1.1e-bindist-1.0.tar.xz 16948 BLAKE2B 78e034f1d263cbf5e57c92393f72acd07e86e39a5511a8852bad151371430954e07d787fd82cca55b373d1579bb22b9d29c9d677104ed68291a9d2dffe3ffbbb SHA512 0dbfb378b8f2724db82915e17fd4e43977e3e45030db25cdb9241c0ab842e41ef3d597ef71c4db5103635752dc2059ea6022597511a440f55fb56a5a52d3ccea
34 -DIST openssl-1.1.1f.tar.gz 9792828 BLAKE2B eba30dd12772cd714666ed8e5371e068623d8bfd4ff45863d10e82c65551654508a27f22f7ef1edadb543ab56f3c4c40ac3bcad665c667eb06ee90c69b24782e SHA512 b00bd9b5ad5298fbceeec6bb19c1ab0c106ca5cfb31178497c58bf7e0e0cf30fcc19c20f84e23af31cc126bf2447d3e4f8461db97bafa7bd78f69561932f000c
35 DIST openssl-1.1.1g.tar.gz 9801502 BLAKE2B 5e3dd4725ff89b959a5436d64b521317c6ffeb377418cc24c6d1927fab923423cb5f5fce2f9c2cdee597041c7be156d09668a5fd13dc6ff06d235a83db94cf19 SHA512 01e3d0b1bceeed8fb066f542ef5480862001556e0f612e017442330bbd7e5faee228b2de3513d7fc347446b7f217e27de1003dc9d7214d5833b97593f3ec25ab
36
37 diff --git a/dev-libs/openssl/files/openssl-1.1.1d-config-Drop-linux-alpha-gcc-bwx.patch b/dev-libs/openssl/files/openssl-1.1.1d-config-Drop-linux-alpha-gcc-bwx.patch
38 deleted file mode 100644
39 index 3771684b251..00000000000
40 --- a/dev-libs/openssl/files/openssl-1.1.1d-config-Drop-linux-alpha-gcc-bwx.patch
41 +++ /dev/null
42 @@ -1,42 +0,0 @@
43 -From 19ded1a717b6c72c3db241f06787a353f1190755 Mon Sep 17 00:00:00 2001
44 -From: Matt Turner <mattst88@×××××.com>
45 -Date: Tue, 18 Feb 2020 10:08:27 -0800
46 -Subject: [PATCH] config: Drop linux-alpha-gcc+bwx
47 -
48 -Its entry in Configuration/10-main.conf was dropped in commit
49 -7ead0c89185c ("Configure: fold related configurations more aggressively
50 -and clean-up.") probably because all but one of its bn_ops were removed
51 -(RC4_CHAR remained). Benchmarks on an Alpha EV7 indicate that RC4_INT is
52 -better than RC4_CHAR so rather than restoring the configuation, remove
53 -it from config.
54 -
55 -CLA: trivial
56 -Bug: https://bugs.gentoo.org/697840
57 -
58 -Reviewed-by: Paul Dale <paul.dale@××××××.com>
59 -Reviewed-by: Matt Caswell <matt@×××××××.org>
60 -Reviewed-by: Richard Levitte <levitte@×××××××.org>
61 -(Merged from https://github.com/openssl/openssl/pull/11130)
62 ----
63 - config | 5 +----
64 - 1 file changed, 1 insertion(+), 4 deletions(-)
65 -
66 -diff --git a/config b/config
67 -index 2213969f90..e39481ca2a 100755
68 ---- a/config
69 -+++ b/config
70 -@@ -498,10 +498,7 @@ case "$GUESSOS" in
71 - OUT="ios64-cross" ;;
72 - alpha-*-linux2)
73 - ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
74 -- case ${ISA:-generic} in
75 -- *[678]) OUT="linux-alpha+bwx-$CC" ;;
76 -- *) OUT="linux-alpha-$CC" ;;
77 -- esac
78 -+ OUT="linux-alpha-$CC"
79 - if [ "$CC" = "gcc" ]; then
80 - case ${ISA:-generic} in
81 - EV5|EV45) __CNF_CFLAGS="$__CNF_CFLAGS -mcpu=ev5"
82 ---
83 -2.24.1
84 -
85
86 diff --git a/dev-libs/openssl/files/openssl-1.1.1d-fix-potential-memleaks-w-BN_to_ASN1_INTEGER.patch b/dev-libs/openssl/files/openssl-1.1.1d-fix-potential-memleaks-w-BN_to_ASN1_INTEGER.patch
87 deleted file mode 100644
88 index 1f195d0384c..00000000000
89 --- a/dev-libs/openssl/files/openssl-1.1.1d-fix-potential-memleaks-w-BN_to_ASN1_INTEGER.patch
90 +++ /dev/null
91 @@ -1,107 +0,0 @@
92 -From 515c728dbaa92211d2eafb0041ab9fcd258fdc41 Mon Sep 17 00:00:00 2001
93 -From: Bernd Edlinger <bernd.edlinger@×××××××.de>
94 -Date: Mon, 9 Sep 2019 19:12:25 +0200
95 -Subject: [PATCH] Fix potential memory leaks with BN_to_ASN1_INTEGER
96 -
97 -Reviewed-by: Paul Dale <paul.dale@××××××.com>
98 -Reviewed-by: Matt Caswell <matt@×××××××.org>
99 -(Merged from https://github.com/openssl/openssl/pull/9833)
100 -
101 -(cherry picked from commit f28bc7d386b25fb75625d0c62c6b2e6d21de0d09)
102 ----
103 - crypto/ec/ec_asn1.c | 7 +++++--
104 - crypto/x509v3/v3_asid.c | 26 ++++++++++++++++++++------
105 - 2 files changed, 25 insertions(+), 8 deletions(-)
106 -
107 -diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c
108 -index 1ce1181fc10..7cbf8de9813 100644
109 ---- a/crypto/ec/ec_asn1.c
110 -+++ b/crypto/ec/ec_asn1.c
111 -@@ -446,6 +446,7 @@ ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group,
112 - unsigned char *buffer = NULL;
113 - const EC_POINT *point = NULL;
114 - point_conversion_form_t form;
115 -+ ASN1_INTEGER *orig;
116 -
117 - if (params == NULL) {
118 - if ((ret = ECPARAMETERS_new()) == NULL) {
119 -@@ -496,8 +497,9 @@ ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group,
120 - ECerr(EC_F_EC_GROUP_GET_ECPARAMETERS, ERR_R_EC_LIB);
121 - goto err;
122 - }
123 -- ret->order = BN_to_ASN1_INTEGER(tmp, ret->order);
124 -+ ret->order = BN_to_ASN1_INTEGER(tmp, orig = ret->order);
125 - if (ret->order == NULL) {
126 -+ ret->order = orig;
127 - ECerr(EC_F_EC_GROUP_GET_ECPARAMETERS, ERR_R_ASN1_LIB);
128 - goto err;
129 - }
130 -@@ -505,8 +507,9 @@ ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group,
131 - /* set the cofactor (optional) */
132 - tmp = EC_GROUP_get0_cofactor(group);
133 - if (tmp != NULL) {
134 -- ret->cofactor = BN_to_ASN1_INTEGER(tmp, ret->cofactor);
135 -+ ret->cofactor = BN_to_ASN1_INTEGER(tmp, orig = ret->cofactor);
136 - if (ret->cofactor == NULL) {
137 -+ ret->cofactor = orig;
138 - ECerr(EC_F_EC_GROUP_GET_ECPARAMETERS, ERR_R_ASN1_LIB);
139 - goto err;
140 - }
141 -diff --git a/crypto/x509v3/v3_asid.c b/crypto/x509v3/v3_asid.c
142 -index 089f2ae29f0..ef2d64826fb 100644
143 ---- a/crypto/x509v3/v3_asid.c
144 -+++ b/crypto/x509v3/v3_asid.c
145 -@@ -256,6 +256,7 @@ static int extract_min_max(ASIdOrRange *aor,
146 - static int ASIdentifierChoice_is_canonical(ASIdentifierChoice *choice)
147 - {
148 - ASN1_INTEGER *a_max_plus_one = NULL;
149 -+ ASN1_INTEGER *orig;
150 - BIGNUM *bn = NULL;
151 - int i, ret = 0;
152 -
153 -@@ -298,9 +299,15 @@ static int ASIdentifierChoice_is_canonical(ASIdentifierChoice *choice)
154 - */
155 - if ((bn == NULL && (bn = BN_new()) == NULL) ||
156 - ASN1_INTEGER_to_BN(a_max, bn) == NULL ||
157 -- !BN_add_word(bn, 1) ||
158 -- (a_max_plus_one =
159 -- BN_to_ASN1_INTEGER(bn, a_max_plus_one)) == NULL) {
160 -+ !BN_add_word(bn, 1)) {
161 -+ X509V3err(X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL,
162 -+ ERR_R_MALLOC_FAILURE);
163 -+ goto done;
164 -+ }
165 -+
166 -+ if ((a_max_plus_one =
167 -+ BN_to_ASN1_INTEGER(bn, orig = a_max_plus_one)) == NULL) {
168 -+ a_max_plus_one = orig;
169 - X509V3err(X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL,
170 - ERR_R_MALLOC_FAILURE);
171 - goto done;
172 -@@ -351,6 +358,7 @@ int X509v3_asid_is_canonical(ASIdentifiers *asid)
173 - static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice)
174 - {
175 - ASN1_INTEGER *a_max_plus_one = NULL;
176 -+ ASN1_INTEGER *orig;
177 - BIGNUM *bn = NULL;
178 - int i, ret = 0;
179 -
180 -@@ -416,9 +424,15 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice)
181 - */
182 - if ((bn == NULL && (bn = BN_new()) == NULL) ||
183 - ASN1_INTEGER_to_BN(a_max, bn) == NULL ||
184 -- !BN_add_word(bn, 1) ||
185 -- (a_max_plus_one =
186 -- BN_to_ASN1_INTEGER(bn, a_max_plus_one)) == NULL) {
187 -+ !BN_add_word(bn, 1)) {
188 -+ X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE,
189 -+ ERR_R_MALLOC_FAILURE);
190 -+ goto done;
191 -+ }
192 -+
193 -+ if ((a_max_plus_one =
194 -+ BN_to_ASN1_INTEGER(bn, orig = a_max_plus_one)) == NULL) {
195 -+ a_max_plus_one = orig;
196 - X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE,
197 - ERR_R_MALLOC_FAILURE);
198 - goto done;
199
200 diff --git a/dev-libs/openssl/files/openssl-1.1.1d-fix-zlib.patch b/dev-libs/openssl/files/openssl-1.1.1d-fix-zlib.patch
201 deleted file mode 100644
202 index 5d2f923a487..00000000000
203 --- a/dev-libs/openssl/files/openssl-1.1.1d-fix-zlib.patch
204 +++ /dev/null
205 @@ -1,52 +0,0 @@
206 -From 86ed78676c660b553696cc10c682962522dfeb6c Mon Sep 17 00:00:00 2001
207 -From: Tomas Mraz <tmraz@×××××××××××××.org>
208 -Date: Thu, 12 Sep 2019 12:27:36 +0200
209 -Subject: [PATCH] BIO_f_zlib: Properly handle BIO_CTRL_PENDING and
210 - BIO_CTRL_WPENDING calls.
211 -
212 -There can be data to write in output buffer and data to read that were
213 -not yet read in the input stream.
214 -
215 -Fixes #9866
216 -
217 -Reviewed-by: Richard Levitte <levitte@×××××××.org>
218 -(Merged from https://github.com/openssl/openssl/pull/9877)
219 -
220 -(cherry picked from commit 6beb8b39ba8e4cb005c1fcd2586ba19e17f04b95)
221 ----
222 - crypto/comp/c_zlib.c | 22 ++++++++++++++++++++++
223 - 1 file changed, 22 insertions(+)
224 -
225 -diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c
226 -index d688deee5f2..7c1be358fd7 100644
227 ---- a/crypto/comp/c_zlib.c
228 -+++ b/crypto/comp/c_zlib.c
229 -@@ -598,6 +598,28 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr)
230 - BIO_copy_next_retry(b);
231 - break;
232 -
233 -+ case BIO_CTRL_WPENDING:
234 -+ if (ctx->obuf == NULL)
235 -+ return 0;
236 -+
237 -+ if (ctx->odone) {
238 -+ ret = ctx->ocount;
239 -+ } else {
240 -+ ret = ctx->ocount;
241 -+ if (ret == 0)
242 -+ /* Unknown amount pending but we are not finished */
243 -+ ret = 1;
244 -+ }
245 -+ if (ret == 0)
246 -+ ret = BIO_ctrl(next, cmd, num, ptr);
247 -+ break;
248 -+
249 -+ case BIO_CTRL_PENDING:
250 -+ ret = ctx->zin.avail_in;
251 -+ if (ret == 0)
252 -+ ret = BIO_ctrl(next, cmd, num, ptr);
253 -+ break;
254 -+
255 - default:
256 - ret = BIO_ctrl(next, cmd, num, ptr);
257 - break;
258
259 diff --git a/dev-libs/openssl/files/openssl-1.1.1d-reenable-the-stitched-AES-CBC-HMAC-SHA-implementations.patch b/dev-libs/openssl/files/openssl-1.1.1d-reenable-the-stitched-AES-CBC-HMAC-SHA-implementations.patch
260 deleted file mode 100644
261 index dc8fe7146b7..00000000000
262 --- a/dev-libs/openssl/files/openssl-1.1.1d-reenable-the-stitched-AES-CBC-HMAC-SHA-implementations.patch
263 +++ /dev/null
264 @@ -1,62 +0,0 @@
265 -From 61cc715240d2d3f9511ca88043a3e9797c11482f Mon Sep 17 00:00:00 2001
266 -From: Richard Levitte <levitte@×××××××.org>
267 -Date: Thu, 3 Oct 2019 08:28:31 +0200
268 -Subject: [PATCH] Define AESNI_ASM if AESNI assembler is included, and use it
269 -
270 -Because we have cases where basic assembler support isn't present, but
271 -AESNI asssembler support is, we need a separate macro that indicates
272 -that, and use it.
273 -
274 -Reviewed-by: Tomas Mraz <tmraz@×××××××××××××.org>
275 -Reviewed-by: Paul Dale <paul.dale@××××××.com>
276 -(Merged from https://github.com/openssl/openssl/pull/10080)
277 ----
278 - Configure | 1 +
279 - crypto/evp/e_aes_cbc_hmac_sha1.c | 2 +-
280 - crypto/evp/e_aes_cbc_hmac_sha256.c | 4 ++--
281 - 3 files changed, 4 insertions(+), 3 deletions(-)
282 -
283 -diff --git a/Configure b/Configure
284 -index 811bee81f54..f498ac2f81b 100755
285 ---- a/Configure
286 -+++ b/Configure
287 -@@ -1376,6 +1376,7 @@ unless ($disabled{asm}) {
288 - }
289 - if ($target{aes_asm_src}) {
290 - push @{$config{lib_defines}}, "AES_ASM" if ($target{aes_asm_src} =~ m/\baes-/);;
291 -+ push @{$config{lib_defines}}, "AESNI_ASM" if ($target{aes_asm_src} =~ m/\baesni-/);;
292 - # aes-ctr.fake is not a real file, only indication that assembler
293 - # module implements AES_ctr32_encrypt...
294 - push @{$config{lib_defines}}, "AES_CTR_ASM" if ($target{aes_asm_src} =~ s/\s*aes-ctr\.fake//);
295 -diff --git a/crypto/evp/e_aes_cbc_hmac_sha1.c b/crypto/evp/e_aes_cbc_hmac_sha1.c
296 -index c9f5969162c..27c36b46e7a 100644
297 ---- a/crypto/evp/e_aes_cbc_hmac_sha1.c
298 -+++ b/crypto/evp/e_aes_cbc_hmac_sha1.c
299 -@@ -33,7 +33,7 @@ typedef struct {
300 -
301 - #define NO_PAYLOAD_LENGTH ((size_t)-1)
302 -
303 --#if defined(AES_ASM) && ( \
304 -+#if defined(AESNI_ASM) && ( \
305 - defined(__x86_64) || defined(__x86_64__) || \
306 - defined(_M_AMD64) || defined(_M_X64) )
307 -
308 -diff --git a/crypto/evp/e_aes_cbc_hmac_sha256.c b/crypto/evp/e_aes_cbc_hmac_sha256.c
309 -index d5178313ae3..cc622b6faa8 100644
310 ---- a/crypto/evp/e_aes_cbc_hmac_sha256.c
311 -+++ b/crypto/evp/e_aes_cbc_hmac_sha256.c
312 -@@ -34,7 +34,7 @@ typedef struct {
313 -
314 - # define NO_PAYLOAD_LENGTH ((size_t)-1)
315 -
316 --#if defined(AES_ASM) && ( \
317 -+#if defined(AESNI_ASM) && ( \
318 - defined(__x86_64) || defined(__x86_64__) || \
319 - defined(_M_AMD64) || defined(_M_X64) )
320 -
321 -@@ -947,4 +947,4 @@ const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void)
322 - {
323 - return NULL;
324 - }
325 --#endif
326 -+#endif /* AESNI_ASM */
327
328 diff --git a/dev-libs/openssl/openssl-1.1.1d-r3.ebuild b/dev-libs/openssl/openssl-1.1.1d-r3.ebuild
329 deleted file mode 100644
330 index 7de6ff8b593..00000000000
331 --- a/dev-libs/openssl/openssl-1.1.1d-r3.ebuild
332 +++ /dev/null
333 @@ -1,328 +0,0 @@
334 -# Copyright 1999-2020 Gentoo Authors
335 -# Distributed under the terms of the GNU General Public License v2
336 -
337 -EAPI="7"
338 -
339 -inherit flag-o-matic toolchain-funcs multilib multilib-minimal
340 -
341 -MY_P=${P/_/-}
342 -
343 -# This patch set is based on the following files from Fedora 31,
344 -# see https://src.fedoraproject.org/rpms/openssl/blob/f31/f/openssl.spec
345 -# for more details:
346 -# - hobble-openssl (SOURCE1)
347 -# - ec_curve.c (SOURCE12) -- MODIFIED
348 -# - ectest.c (SOURCE13)
349 -# - openssl-1.1.1-ec-curves.patch (PATCH37) -- MODIFIED
350 -BINDIST_PATCH_SET="openssl-1.1.1d-bindist-1.0.tar.xz"
351 -
352 -DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
353 -HOMEPAGE="https://www.openssl.org/"
354 -SRC_URI="mirror://openssl/source/${MY_P}.tar.gz
355 - bindist? (
356 - mirror://gentoo/${BINDIST_PATCH_SET}
357 - https://dev.gentoo.org/~whissi/dist/openssl/${BINDIST_PATCH_SET}
358 - )"
359 -
360 -LICENSE="openssl"
361 -SLOT="0/1.1" # .so version of libssl/libcrypto
362 -[[ "${PV}" = *_pre* ]] || \
363 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x86-linux"
364 -IUSE="+asm bindist elibc_musl rfc3779 sctp cpu_flags_x86_sse2 sslv3 static-libs test tls-heartbeat vanilla zlib"
365 -RESTRICT="!bindist? ( bindist )
366 - !test? ( test )"
367 -
368 -RDEPEND=">=app-misc/c_rehash-1.7-r1
369 - zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )"
370 -DEPEND="${RDEPEND}"
371 -BDEPEND="
372 - >=dev-lang/perl-5
373 - sctp? ( >=net-misc/lksctp-tools-1.0.12 )
374 - test? (
375 - sys-apps/diffutils
376 - sys-devel/bc
377 - sys-process/procps
378 - )"
379 -PDEPEND="app-misc/ca-certificates"
380 -
381 -PATCHES=(
382 - "${FILESDIR}"/${PN}-1.1.0j-parallel_install_fix.patch #671602
383 - "${FILESDIR}"/${P}-fix-zlib.patch
384 - "${FILESDIR}"/${P}-fix-potential-memleaks-w-BN_to_ASN1_INTEGER.patch
385 - "${FILESDIR}"/${P}-reenable-the-stitched-AES-CBC-HMAC-SHA-implementations.patch
386 - "${FILESDIR}"/${P}-config-Drop-linux-alpha-gcc-bwx.patch
387 -)
388 -
389 -S="${WORKDIR}/${MY_P}"
390 -
391 -# force upgrade to prevent broken login, bug 696950
392 -RDEPEND+=" !<net-misc/openssh-8.0_p1-r3"
393 -
394 -MULTILIB_WRAPPED_HEADERS=(
395 - usr/include/openssl/opensslconf.h
396 -)
397 -
398 -pkg_setup() {
399 - [[ ${MERGE_TYPE} == binary ]] && return
400 -
401 - # must check in pkg_setup; sysctl don't work with userpriv!
402 - if has test ${FEATURES} && use sctp; then
403 - # test_ssl_new will fail with "Ensure SCTP AUTH chunks are enabled in kernel"
404 - # if sctp.auth_enable is not enabled.
405 - local sctp_auth_status=$(sysctl -n net.sctp.auth_enable 2>/dev/null)
406 - if [[ -z "${sctp_auth_status}" ]] || [[ ${sctp_auth_status} != 1 ]]; then
407 - die "FEATURES=test with USE=sctp requires net.sctp.auth_enable=1!"
408 - fi
409 - fi
410 -}
411 -
412 -src_prepare() {
413 - # allow openssl to be cross-compiled
414 - cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
415 - chmod a+rx gentoo.config || die
416 -
417 - if use bindist; then
418 - mv "${WORKDIR}"/bindist-patches/hobble-openssl "${WORKDIR}" || die
419 - bash "${WORKDIR}"/hobble-openssl || die
420 -
421 - cp -f "${WORKDIR}"/bindist-patches/ec_curve.c "${S}"/crypto/ec/ || die
422 - cp -f "${WORKDIR}"/bindist-patches/ectest.c "${S}"/test/ || die
423 -
424 - eapply "${WORKDIR}"/bindist-patches/ec-curves.patch
425 -
426 - local known_failing_test
427 - for known_failing_test in \
428 - 30-test_evp_extra.t \
429 - 80-test_ssl_new.t \
430 - ; do
431 - ebegin "Disabling test '${known_failing_test}' which is known to fail with USE=bindist"
432 - rm test/recipes/${known_failing_test} || die
433 - eend $?
434 - done
435 -
436 - # Also see the configure parts below:
437 - # enable-ec \
438 - # $(use_ssl !bindist ec2m) \
439 - fi
440 -
441 - # keep this in sync with app-misc/c_rehash
442 - SSL_CNF_DIR="/etc/ssl"
443 -
444 - # Make sure we only ever touch Makefile.org and avoid patching a file
445 - # that gets blown away anyways by the Configure script in src_configure
446 - rm -f Makefile
447 -
448 - if ! use vanilla ; then
449 - if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]] ; then
450 - [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}"
451 - fi
452 - fi
453 -
454 - eapply_user #332661
455 -
456 - if has test ${FEATURES} && use sctp && has network-sandbox ${FEATURES}; then
457 - ebegin "Disabling test '80-test_ssl_new.t' which is known to fail with FEATURES=network-sandbox"
458 - rm test/recipes/80-test_ssl_new.t || die
459 - eend $?
460 - fi
461 -
462 - # make sure the man pages are suffixed #302165
463 - # don't bother building man pages if they're disabled
464 - # Make DOCDIR Gentoo compliant
465 - sed -i \
466 - -e '/^MANSUFFIX/s:=.*:=ssl:' \
467 - -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
468 - -e $(has noman FEATURES \
469 - && echo '/^install:/s:install_docs::' \
470 - || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
471 - -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \
472 - Configurations/unix-Makefile.tmpl \
473 - || die
474 -
475 - # quiet out unknown driver argument warnings since openssl
476 - # doesn't have well-split CFLAGS and we're making it even worse
477 - # and 'make depend' uses -Werror for added fun (#417795 again)
478 - [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
479 -
480 - append-flags -fno-strict-aliasing
481 - append-flags $(test-flags-CC -Wa,--noexecstack)
482 - append-cppflags -DOPENSSL_NO_BUF_FREELISTS
483 -
484 - # Prefixify Configure shebang (#141906)
485 - sed \
486 - -e "1s,/usr/bin/env,${EPREFIX}&," \
487 - -i Configure || die
488 - # Remove test target when FEATURES=test isn't set
489 - if ! use test ; then
490 - sed \
491 - -e '/^$config{dirs}/s@ "test",@@' \
492 - -i Configure || die
493 - fi
494 - # The config script does stupid stuff to prompt the user. Kill it.
495 - sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
496 - ./config --test-sanity || die "I AM NOT SANE"
497 -
498 - multilib_copy_sources
499 -}
500 -
501 -multilib_src_configure() {
502 - unset APPS #197996
503 - unset SCRIPTS #312551
504 - unset CROSS_COMPILE #311473
505 -
506 - tc-export CC AR RANLIB RC
507 -
508 - # Clean out patent-or-otherwise-encumbered code
509 - # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher)
510 - # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
511 - # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
512 - # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2
513 - # RC5: Expired https://en.wikipedia.org/wiki/RC5
514 -
515 - use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
516 - echoit() { echo "$@" ; "$@" ; }
517 -
518 - local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
519 -
520 - # See if our toolchain supports __uint128_t. If so, it's 64bit
521 - # friendly and can use the nicely optimized code paths. #460790
522 - local ec_nistp_64_gcc_128
523 - # Disable it for now though #469976
524 - #if ! use bindist ; then
525 - # echo "__uint128_t i;" > "${T}"/128.c
526 - # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
527 - # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
528 - # fi
529 - #fi
530 -
531 - local sslout=$(./gentoo.config)
532 - einfo "Use configuration ${sslout:-(openssl knows best)}"
533 - local config="Configure"
534 - [[ -z ${sslout} ]] && config="config"
535 -
536 - # Fedora hobbled-EC needs 'no-ec2m'
537 - # 'srp' was restricted until early 2017 as well.
538 - # "disable-deprecated" option breaks too many consumers.
539 - # Don't set it without thorough revdeps testing.
540 - # Make sure user flags don't get added *yet* to avoid duplicated
541 - # flags.
542 - CFLAGS= LDFLAGS= echoit \
543 - ./${config} \
544 - ${sslout} \
545 - $(use cpu_flags_x86_sse2 || echo "no-sse2") \
546 - enable-camellia \
547 - enable-ec \
548 - $(use_ssl !bindist ec2m) \
549 - enable-srp \
550 - $(use elibc_musl && echo "no-async") \
551 - ${ec_nistp_64_gcc_128} \
552 - enable-idea \
553 - enable-mdc2 \
554 - enable-rc5 \
555 - $(use_ssl sslv3 ssl3) \
556 - $(use_ssl sslv3 ssl3-method) \
557 - $(use_ssl asm) \
558 - $(use_ssl rfc3779) \
559 - $(use_ssl sctp) \
560 - $(use_ssl tls-heartbeat heartbeats) \
561 - $(use_ssl zlib) \
562 - --prefix="${EPREFIX}"/usr \
563 - --openssldir="${EPREFIX}"${SSL_CNF_DIR} \
564 - --libdir=$(get_libdir) \
565 - shared threads \
566 - || die
567 -
568 - # Clean out hardcoded flags that openssl uses
569 - local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \
570 - -e 's:^CFLAGS=::' \
571 - -e 's:\(^\| \)-fomit-frame-pointer::g' \
572 - -e 's:\(^\| \)-O[^ ]*::g' \
573 - -e 's:\(^\| \)-march=[^ ]*::g' \
574 - -e 's:\(^\| \)-mcpu=[^ ]*::g' \
575 - -e 's:\(^\| \)-m[^ ]*::g' \
576 - -e 's:^ *::' \
577 - -e 's: *$::' \
578 - -e 's: \+: :g' \
579 - -e 's:\\:\\\\:g'
580 - )
581 -
582 - # Now insert clean default flags with user flags
583 - sed -i \
584 - -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
585 - -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \
586 - Makefile || die
587 -}
588 -
589 -multilib_src_compile() {
590 - # depend is needed to use $confopts; it also doesn't matter
591 - # that it's -j1 as the code itself serializes subdirs
592 - emake -j1 depend
593 - emake all
594 -}
595 -
596 -multilib_src_test() {
597 - emake -j1 test
598 -}
599 -
600 -multilib_src_install() {
601 - # We need to create $ED/usr on our own to avoid a race condition #665130
602 - if [[ ! -d "${ED}/usr" ]]; then
603 - # We can only create this directory once
604 - mkdir "${ED}"/usr || die
605 - fi
606 -
607 - emake DESTDIR="${D}" install
608 -}
609 -
610 -multilib_src_install_all() {
611 - # openssl installs perl version of c_rehash by default, but
612 - # we provide a shell version via app-misc/c_rehash
613 - rm "${ED}"/usr/bin/c_rehash || die
614 -
615 - dodoc CHANGES* FAQ NEWS README doc/*.txt doc/${PN}-c-indent.el
616 -
617 - # This is crappy in that the static archives are still built even
618 - # when USE=static-libs. But this is due to a failing in the openssl
619 - # build system: the static archives are built as PIC all the time.
620 - # Only way around this would be to manually configure+compile openssl
621 - # twice; once with shared lib support enabled and once without.
622 - use static-libs || rm -f "${ED}"/usr/lib*/lib*.a
623 -
624 - # create the certs directory
625 - keepdir ${SSL_CNF_DIR}/certs
626 -
627 - # Namespace openssl programs to prevent conflicts with other man pages
628 - cd "${ED}"/usr/share/man || die
629 - local m d s
630 - for m in $(find . -type f | xargs grep -L '#include') ; do
631 - d=${m%/*} ; d=${d#./} ; m=${m##*/}
632 - [[ ${m} == openssl.1* ]] && continue
633 - [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
634 - mv ${d}/{,ssl-}${m}
635 - # fix up references to renamed man pages
636 - sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
637 - ln -s ssl-${m} ${d}/openssl-${m}
638 - # locate any symlinks that point to this man page ... we assume
639 - # that any broken links are due to the above renaming
640 - for s in $(find -L ${d} -type l) ; do
641 - s=${s##*/}
642 - rm -f ${d}/${s}
643 - # We don't want to "|| die" here
644 - ln -s ssl-${m} ${d}/ssl-${s}
645 - ln -s ssl-${s} ${d}/openssl-${s}
646 - done
647 - done
648 - [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
649 -
650 - dodir /etc/sandbox.d #254521
651 - echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
652 -
653 - diropts -m0700
654 - keepdir ${SSL_CNF_DIR}/private
655 -}
656 -
657 -pkg_postinst() {
658 - ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
659 - c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null
660 - eend $?
661 -}
662
663 diff --git a/dev-libs/openssl/openssl-1.1.1f.ebuild b/dev-libs/openssl/openssl-1.1.1f.ebuild
664 deleted file mode 100644
665 index 150624048da..00000000000
666 --- a/dev-libs/openssl/openssl-1.1.1f.ebuild
667 +++ /dev/null
668 @@ -1,324 +0,0 @@
669 -# Copyright 1999-2020 Gentoo Authors
670 -# Distributed under the terms of the GNU General Public License v2
671 -
672 -EAPI="7"
673 -
674 -inherit flag-o-matic toolchain-funcs multilib multilib-minimal
675 -
676 -MY_P=${P/_/-}
677 -
678 -# This patch set is based on the following files from Fedora 31,
679 -# see https://src.fedoraproject.org/rpms/openssl/blob/f31/f/openssl.spec
680 -# for more details:
681 -# - hobble-openssl (SOURCE1)
682 -# - ec_curve.c (SOURCE12) -- MODIFIED
683 -# - ectest.c (SOURCE13)
684 -# - openssl-1.1.1-ec-curves.patch (PATCH37) -- MODIFIED
685 -BINDIST_PATCH_SET="openssl-1.1.1e-bindist-1.0.tar.xz"
686 -
687 -DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
688 -HOMEPAGE="https://www.openssl.org/"
689 -SRC_URI="mirror://openssl/source/${MY_P}.tar.gz
690 - bindist? (
691 - mirror://gentoo/${BINDIST_PATCH_SET}
692 - https://dev.gentoo.org/~whissi/dist/openssl/${BINDIST_PATCH_SET}
693 - )"
694 -
695 -LICENSE="openssl"
696 -SLOT="0/1.1" # .so version of libssl/libcrypto
697 -[[ "${PV}" = *_pre* ]] || \
698 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv s390 sparc ~x86 ~x86-linux"
699 -IUSE="+asm bindist elibc_musl rfc3779 sctp cpu_flags_x86_sse2 sslv3 static-libs test tls-heartbeat vanilla zlib"
700 -RESTRICT="!bindist? ( bindist )
701 - !test? ( test )"
702 -
703 -RDEPEND=">=app-misc/c_rehash-1.7-r1
704 - zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )"
705 -DEPEND="${RDEPEND}"
706 -BDEPEND="
707 - >=dev-lang/perl-5
708 - sctp? ( >=net-misc/lksctp-tools-1.0.12 )
709 - test? (
710 - sys-apps/diffutils
711 - sys-devel/bc
712 - sys-process/procps
713 - )"
714 -PDEPEND="app-misc/ca-certificates"
715 -
716 -PATCHES=(
717 - "${FILESDIR}"/${PN}-1.1.0j-parallel_install_fix.patch #671602
718 -)
719 -
720 -S="${WORKDIR}/${MY_P}"
721 -
722 -# force upgrade to prevent broken login, bug 696950
723 -RDEPEND+=" !<net-misc/openssh-8.0_p1-r3"
724 -
725 -MULTILIB_WRAPPED_HEADERS=(
726 - usr/include/openssl/opensslconf.h
727 -)
728 -
729 -pkg_setup() {
730 - [[ ${MERGE_TYPE} == binary ]] && return
731 -
732 - # must check in pkg_setup; sysctl don't work with userpriv!
733 - if has test ${FEATURES} && use sctp; then
734 - # test_ssl_new will fail with "Ensure SCTP AUTH chunks are enabled in kernel"
735 - # if sctp.auth_enable is not enabled.
736 - local sctp_auth_status=$(sysctl -n net.sctp.auth_enable 2>/dev/null)
737 - if [[ -z "${sctp_auth_status}" ]] || [[ ${sctp_auth_status} != 1 ]]; then
738 - die "FEATURES=test with USE=sctp requires net.sctp.auth_enable=1!"
739 - fi
740 - fi
741 -}
742 -
743 -src_prepare() {
744 - # allow openssl to be cross-compiled
745 - cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
746 - chmod a+rx gentoo.config || die
747 -
748 - if use bindist; then
749 - mv "${WORKDIR}"/bindist-patches/hobble-openssl "${WORKDIR}" || die
750 - bash "${WORKDIR}"/hobble-openssl || die
751 -
752 - cp -f "${WORKDIR}"/bindist-patches/ec_curve.c "${S}"/crypto/ec/ || die
753 - cp -f "${WORKDIR}"/bindist-patches/ectest.c "${S}"/test/ || die
754 -
755 - eapply "${WORKDIR}"/bindist-patches/ec-curves.patch
756 -
757 - local known_failing_test
758 - for known_failing_test in \
759 - 30-test_evp_extra.t \
760 - 80-test_ssl_new.t \
761 - ; do
762 - ebegin "Disabling test '${known_failing_test}' which is known to fail with USE=bindist"
763 - rm test/recipes/${known_failing_test} || die
764 - eend $?
765 - done
766 -
767 - # Also see the configure parts below:
768 - # enable-ec \
769 - # $(use_ssl !bindist ec2m) \
770 - fi
771 -
772 - # keep this in sync with app-misc/c_rehash
773 - SSL_CNF_DIR="/etc/ssl"
774 -
775 - # Make sure we only ever touch Makefile.org and avoid patching a file
776 - # that gets blown away anyways by the Configure script in src_configure
777 - rm -f Makefile
778 -
779 - if ! use vanilla ; then
780 - if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]] ; then
781 - [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}"
782 - fi
783 - fi
784 -
785 - eapply_user #332661
786 -
787 - if has test ${FEATURES} && use sctp && has network-sandbox ${FEATURES}; then
788 - ebegin "Disabling test '80-test_ssl_new.t' which is known to fail with FEATURES=network-sandbox"
789 - rm test/recipes/80-test_ssl_new.t || die
790 - eend $?
791 - fi
792 -
793 - # make sure the man pages are suffixed #302165
794 - # don't bother building man pages if they're disabled
795 - # Make DOCDIR Gentoo compliant
796 - sed -i \
797 - -e '/^MANSUFFIX/s:=.*:=ssl:' \
798 - -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
799 - -e $(has noman FEATURES \
800 - && echo '/^install:/s:install_docs::' \
801 - || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
802 - -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \
803 - Configurations/unix-Makefile.tmpl \
804 - || die
805 -
806 - # quiet out unknown driver argument warnings since openssl
807 - # doesn't have well-split CFLAGS and we're making it even worse
808 - # and 'make depend' uses -Werror for added fun (#417795 again)
809 - [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
810 -
811 - append-flags -fno-strict-aliasing
812 - append-flags $(test-flags-CC -Wa,--noexecstack)
813 - append-cppflags -DOPENSSL_NO_BUF_FREELISTS
814 -
815 - # Prefixify Configure shebang (#141906)
816 - sed \
817 - -e "1s,/usr/bin/env,${EPREFIX}&," \
818 - -i Configure || die
819 - # Remove test target when FEATURES=test isn't set
820 - if ! use test ; then
821 - sed \
822 - -e '/^$config{dirs}/s@ "test",@@' \
823 - -i Configure || die
824 - fi
825 - # The config script does stupid stuff to prompt the user. Kill it.
826 - sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
827 - ./config --test-sanity || die "I AM NOT SANE"
828 -
829 - multilib_copy_sources
830 -}
831 -
832 -multilib_src_configure() {
833 - unset APPS #197996
834 - unset SCRIPTS #312551
835 - unset CROSS_COMPILE #311473
836 -
837 - tc-export CC AR RANLIB RC
838 -
839 - # Clean out patent-or-otherwise-encumbered code
840 - # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher)
841 - # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
842 - # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
843 - # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2
844 - # RC5: Expired https://en.wikipedia.org/wiki/RC5
845 -
846 - use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
847 - echoit() { echo "$@" ; "$@" ; }
848 -
849 - local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
850 -
851 - # See if our toolchain supports __uint128_t. If so, it's 64bit
852 - # friendly and can use the nicely optimized code paths. #460790
853 - local ec_nistp_64_gcc_128
854 - # Disable it for now though #469976
855 - #if ! use bindist ; then
856 - # echo "__uint128_t i;" > "${T}"/128.c
857 - # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
858 - # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
859 - # fi
860 - #fi
861 -
862 - local sslout=$(./gentoo.config)
863 - einfo "Use configuration ${sslout:-(openssl knows best)}"
864 - local config="Configure"
865 - [[ -z ${sslout} ]] && config="config"
866 -
867 - # Fedora hobbled-EC needs 'no-ec2m'
868 - # 'srp' was restricted until early 2017 as well.
869 - # "disable-deprecated" option breaks too many consumers.
870 - # Don't set it without thorough revdeps testing.
871 - # Make sure user flags don't get added *yet* to avoid duplicated
872 - # flags.
873 - CFLAGS= LDFLAGS= echoit \
874 - ./${config} \
875 - ${sslout} \
876 - $(use cpu_flags_x86_sse2 || echo "no-sse2") \
877 - enable-camellia \
878 - enable-ec \
879 - $(use_ssl !bindist ec2m) \
880 - enable-srp \
881 - $(use elibc_musl && echo "no-async") \
882 - ${ec_nistp_64_gcc_128} \
883 - enable-idea \
884 - enable-mdc2 \
885 - enable-rc5 \
886 - $(use_ssl sslv3 ssl3) \
887 - $(use_ssl sslv3 ssl3-method) \
888 - $(use_ssl asm) \
889 - $(use_ssl rfc3779) \
890 - $(use_ssl sctp) \
891 - $(use_ssl tls-heartbeat heartbeats) \
892 - $(use_ssl zlib) \
893 - --prefix="${EPREFIX}"/usr \
894 - --openssldir="${EPREFIX}"${SSL_CNF_DIR} \
895 - --libdir=$(get_libdir) \
896 - shared threads \
897 - || die
898 -
899 - # Clean out hardcoded flags that openssl uses
900 - local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \
901 - -e 's:^CFLAGS=::' \
902 - -e 's:\(^\| \)-fomit-frame-pointer::g' \
903 - -e 's:\(^\| \)-O[^ ]*::g' \
904 - -e 's:\(^\| \)-march=[^ ]*::g' \
905 - -e 's:\(^\| \)-mcpu=[^ ]*::g' \
906 - -e 's:\(^\| \)-m[^ ]*::g' \
907 - -e 's:^ *::' \
908 - -e 's: *$::' \
909 - -e 's: \+: :g' \
910 - -e 's:\\:\\\\:g'
911 - )
912 -
913 - # Now insert clean default flags with user flags
914 - sed -i \
915 - -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
916 - -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \
917 - Makefile || die
918 -}
919 -
920 -multilib_src_compile() {
921 - # depend is needed to use $confopts; it also doesn't matter
922 - # that it's -j1 as the code itself serializes subdirs
923 - emake -j1 depend
924 - emake all
925 -}
926 -
927 -multilib_src_test() {
928 - emake -j1 test
929 -}
930 -
931 -multilib_src_install() {
932 - # We need to create $ED/usr on our own to avoid a race condition #665130
933 - if [[ ! -d "${ED}/usr" ]]; then
934 - # We can only create this directory once
935 - mkdir "${ED}"/usr || die
936 - fi
937 -
938 - emake DESTDIR="${D}" install
939 -}
940 -
941 -multilib_src_install_all() {
942 - # openssl installs perl version of c_rehash by default, but
943 - # we provide a shell version via app-misc/c_rehash
944 - rm "${ED}"/usr/bin/c_rehash || die
945 -
946 - dodoc CHANGES* FAQ NEWS README doc/*.txt doc/${PN}-c-indent.el
947 -
948 - # This is crappy in that the static archives are still built even
949 - # when USE=static-libs. But this is due to a failing in the openssl
950 - # build system: the static archives are built as PIC all the time.
951 - # Only way around this would be to manually configure+compile openssl
952 - # twice; once with shared lib support enabled and once without.
953 - use static-libs || rm -f "${ED}"/usr/lib*/lib*.a
954 -
955 - # create the certs directory
956 - keepdir ${SSL_CNF_DIR}/certs
957 -
958 - # Namespace openssl programs to prevent conflicts with other man pages
959 - cd "${ED}"/usr/share/man || die
960 - local m d s
961 - for m in $(find . -type f | xargs grep -L '#include') ; do
962 - d=${m%/*} ; d=${d#./} ; m=${m##*/}
963 - [[ ${m} == openssl.1* ]] && continue
964 - [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
965 - mv ${d}/{,ssl-}${m}
966 - # fix up references to renamed man pages
967 - sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
968 - ln -s ssl-${m} ${d}/openssl-${m}
969 - # locate any symlinks that point to this man page ... we assume
970 - # that any broken links are due to the above renaming
971 - for s in $(find -L ${d} -type l) ; do
972 - s=${s##*/}
973 - rm -f ${d}/${s}
974 - # We don't want to "|| die" here
975 - ln -s ssl-${m} ${d}/ssl-${s}
976 - ln -s ssl-${s} ${d}/openssl-${s}
977 - done
978 - done
979 - [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
980 -
981 - dodir /etc/sandbox.d #254521
982 - echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
983 -
984 - diropts -m0700
985 - keepdir ${SSL_CNF_DIR}/private
986 -}
987 -
988 -pkg_postinst() {
989 - ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
990 - c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null
991 - eend $?
992 -}