1 |
commit: 273422f6cae129a4a97402641e81b13db9461ec4 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 1 21:24:50 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 1 21:25:12 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=273422f6 |
7 |
|
8 |
dev-libs/openssl-compat: security cleanup (#702176) |
9 |
|
10 |
Bug: https://bugs.gentoo.org/702176 |
11 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
12 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
13 |
|
14 |
dev-libs/openssl-compat/Manifest | 1 - |
15 |
.../openssl-compat/openssl-compat-1.0.2t-r1.ebuild | 246 --------------------- |
16 |
2 files changed, 247 deletions(-) |
17 |
|
18 |
diff --git a/dev-libs/openssl-compat/Manifest b/dev-libs/openssl-compat/Manifest |
19 |
index f6ca6a00831..f8e304a6376 100644 |
20 |
--- a/dev-libs/openssl-compat/Manifest |
21 |
+++ b/dev-libs/openssl-compat/Manifest |
22 |
@@ -1,5 +1,4 @@ |
23 |
DIST openssl-0.9.8zh.tar.gz 3818524 BLAKE2B 610bb4858900983cf4519fa8b63f1e03b3845e39e68884fd8bebd738cd5cd6c2c75513643af49bf9e2294adc446a6516480fe9b62de55d9b6379bf9e7c5cd364 SHA512 b97fa2468211f86c0719c68ad1781eff84f772c479ed5193d6da14bac086b4ca706e7d851209d9df3f0962943b5e5333ab0def00110fb2e517caa73c0c6674c6 |
24 |
DIST openssl-1.0.2-patches-1.5.tar.xz 12404 BLAKE2B 6c1b8c28f339f539b2ab8643379502a24cf62bffde00041dce54d5dd9e8d2620b181362ee5464b0ab32ba4948e209697bfabadbea2944a409a1009100d298f24 SHA512 5725e2d9d1ee8cc074bcef3bed61c71bdab2ff1c114362110c3fb8da11ad5bc8f2ff28e90a293f5f3a5cf96ecda54dffdb7ab3fb3f8b23ef6472250dc3037659 |
25 |
DIST openssl-1.0.2t-bindist-1.0.tar.xz 13872 BLAKE2B b2aade96a6e0ca6209a39e205b1c838de945903fcf959c62cc29ddcd1a0cb360fc5db234df86860a6a4c096f5ecc237611e4c2946b986a5500c24ba93c208ef4 SHA512 a48a7efb9b973b865bcc5009d450b428ed6b4b95e4cefe70c51056e47392c8a7bec58215168d8b07712419dc74646c2bd2fd23bcfbba2031376e292249a6b1b6 |
26 |
-DIST openssl-1.0.2t.tar.gz 5355422 BLAKE2B dcbc883151ff6c5b60f5849d8789c2e76a384cb3d5eb5f08a6109776d0edf134580dc33fa8b946ae2344542560f04ecef17f218406952dd8d31e4200c4882022 SHA512 0b88868933f42fab87e8b22449435a1091cc6e75f986aad6c173e01ad123161fcae8c226759073701bc65c9f2f0b6ce6a63a61203008ed873cfb6e484f32bc71 |
27 |
DIST openssl-1.0.2u.tar.gz 5355412 BLAKE2B b2ff2a10e5851af5aca4093422a9a072c794e87b997263826c1c35910c040f695fac63decac5856cb49399ed03d410f97701d9fd4e1ebfbcacd8f3a74ce8bf57 SHA512 c455bb309e20e2c2d47fdc5619c734d107d5c8c38c1409903ce979acc120b0d5fa0312917c0aa0d630e402d092a703d4249643f36078e8528a3cafc9dac6ab32 |
28 |
|
29 |
diff --git a/dev-libs/openssl-compat/openssl-compat-1.0.2t-r1.ebuild b/dev-libs/openssl-compat/openssl-compat-1.0.2t-r1.ebuild |
30 |
deleted file mode 100644 |
31 |
index b157a2495fc..00000000000 |
32 |
--- a/dev-libs/openssl-compat/openssl-compat-1.0.2t-r1.ebuild |
33 |
+++ /dev/null |
34 |
@@ -1,246 +0,0 @@ |
35 |
-# Copyright 1999-2019 Gentoo Authors |
36 |
-# Distributed under the terms of the GNU General Public License v2 |
37 |
- |
38 |
-EAPI="7" |
39 |
- |
40 |
-inherit flag-o-matic toolchain-funcs multilib multilib-minimal |
41 |
- |
42 |
-# openssl-1.0.2-patches-1.6 contain additional CVE patches |
43 |
-# which got fixed with this release. |
44 |
-# Please use 1.7 version number when rolling a new tarball! |
45 |
-PATCH_SET="openssl-1.0.2-patches-1.5" |
46 |
- |
47 |
-MY_P=openssl-${PV/_/-} |
48 |
- |
49 |
-# This patch set is based on the following files from Fedora 25, |
50 |
-# see https://src.fedoraproject.org/rpms/openssl/blob/25/f/openssl.spec |
51 |
-# for more details: |
52 |
-# - hobble-openssl (SOURCE1) |
53 |
-# - ec_curve.c (SOURCE12) -- MODIFIED |
54 |
-# - ectest.c (SOURCE13) |
55 |
-# - openssl-1.1.1-ec-curves.patch (PATCH37) -- MODIFIED |
56 |
-BINDIST_PATCH_SET="openssl-1.0.2t-bindist-1.0.tar.xz" |
57 |
- |
58 |
-DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)" |
59 |
-HOMEPAGE="https://www.openssl.org/" |
60 |
-SRC_URI="mirror://openssl/source/${MY_P}.tar.gz |
61 |
- bindist? ( |
62 |
- mirror://gentoo/${BINDIST_PATCH_SET} |
63 |
- https://dev.gentoo.org/~whissi/dist/openssl/${BINDIST_PATCH_SET} |
64 |
- ) |
65 |
- !vanilla? ( |
66 |
- mirror://gentoo/${PATCH_SET}.tar.xz |
67 |
- https://dev.gentoo.org/~chutzpah/dist/openssl/${PATCH_SET}.tar.xz |
68 |
- https://dev.gentoo.org/~whissi/dist/openssl/${PATCH_SET}.tar.xz |
69 |
- https://dev.gentoo.org/~polynomial-c/dist/${PATCH_SET}.tar.xz |
70 |
- )" |
71 |
- |
72 |
-LICENSE="openssl" |
73 |
-SLOT="1.0.0" |
74 |
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc x86 ~x86-linux" |
75 |
-IUSE="+asm bindist gmp kerberos rfc3779 sctp cpu_flags_x86_sse2 sslv2 +sslv3 static-libs test +tls-heartbeat vanilla zlib" |
76 |
- |
77 |
-RESTRICT="!bindist? ( bindist ) |
78 |
- test" |
79 |
- |
80 |
-RDEPEND="gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] ) |
81 |
- kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] ) |
82 |
- zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] ) |
83 |
- !=dev-libs/openssl-1.0.2*:0 |
84 |
- !dev-libs/openssl:1.0.0" |
85 |
-DEPEND="${RDEPEND}" |
86 |
-BDEPEND=" |
87 |
- >=dev-lang/perl-5 |
88 |
- sctp? ( >=net-misc/lksctp-tools-1.0.12 ) |
89 |
- test? ( |
90 |
- sys-apps/diffutils |
91 |
- sys-devel/bc |
92 |
- )" |
93 |
- |
94 |
-# Do not install any docs |
95 |
-DOCS=() |
96 |
- |
97 |
-S="${WORKDIR}/${MY_P}" |
98 |
- |
99 |
-MULTILIB_WRAPPED_HEADERS=( |
100 |
- usr/include/openssl/opensslconf.h |
101 |
-) |
102 |
- |
103 |
-src_prepare() { |
104 |
- if use bindist; then |
105 |
- mv "${WORKDIR}"/bindist-patches/hobble-openssl "${WORKDIR}" || die |
106 |
- bash "${WORKDIR}"/hobble-openssl || die |
107 |
- |
108 |
- cp -f "${WORKDIR}"/bindist-patches/ec_curve.c "${S}"/crypto/ec/ || die |
109 |
- cp -f "${WORKDIR}"/bindist-patches/ectest.c "${S}"/crypto/ec/ || die |
110 |
- |
111 |
- eapply "${WORKDIR}"/bindist-patches/ec-curves.patch |
112 |
- |
113 |
- # Also see the configure parts below: |
114 |
- # enable-ec \ |
115 |
- # $(use_ssl !bindist ec2m) \ |
116 |
- # $(use_ssl !bindist srp) \ |
117 |
- fi |
118 |
- |
119 |
- # keep this in sync with app-misc/c_rehash |
120 |
- SSL_CNF_DIR="/etc/ssl" |
121 |
- |
122 |
- # Make sure we only ever touch Makefile.org and avoid patching a file |
123 |
- # that gets blown away anyways by the Configure script in src_configure |
124 |
- rm -f Makefile |
125 |
- |
126 |
- if ! use vanilla ; then |
127 |
- eapply "${WORKDIR}"/patch/*.patch |
128 |
- fi |
129 |
- |
130 |
- eapply_user |
131 |
- |
132 |
- # disable fips in the build |
133 |
- # make sure the man pages are suffixed #302165 |
134 |
- # don't bother building man pages if they're disabled |
135 |
- sed -i \ |
136 |
- -e '/DIRS/s: fips : :g' \ |
137 |
- -e '/^MANSUFFIX/s:=.*:=ssl:' \ |
138 |
- -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \ |
139 |
- -e $(has noman FEATURES \ |
140 |
- && echo '/^install:/s:install_docs::' \ |
141 |
- || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ |
142 |
- Makefile.org \ |
143 |
- || die |
144 |
- # show the actual commands in the log |
145 |
- sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared |
146 |
- |
147 |
- # since we're forcing $(CC) as makedep anyway, just fix |
148 |
- # the conditional as always-on |
149 |
- # helps clang (#417795), and versioned gcc (#499818) |
150 |
- # this breaks build with 1.0.2p, not sure if it is needed anymore |
151 |
- #sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die |
152 |
- |
153 |
- # quiet out unknown driver argument warnings since openssl |
154 |
- # doesn't have well-split CFLAGS and we're making it even worse |
155 |
- # and 'make depend' uses -Werror for added fun (#417795 again) |
156 |
- [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments |
157 |
- |
158 |
- # allow openssl to be cross-compiled |
159 |
- cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die |
160 |
- chmod a+rx gentoo.config || die |
161 |
- |
162 |
- append-flags -fno-strict-aliasing |
163 |
- append-flags $(test-flags-CC -Wa,--noexecstack) |
164 |
- append-cppflags -DOPENSSL_NO_BUF_FREELISTS |
165 |
- |
166 |
- sed -i '1s,^:$,#!'${EPREFIX}'/usr/bin/perl,' Configure #141906 |
167 |
- # The config script does stupid stuff to prompt the user. Kill it. |
168 |
- sed -i '/stty -icanon min 0 time 50; read waste/d' config || die |
169 |
- ./config --test-sanity || die "I AM NOT SANE" |
170 |
- |
171 |
- multilib_copy_sources |
172 |
-} |
173 |
- |
174 |
-multilib_src_configure() { |
175 |
- unset APPS #197996 |
176 |
- unset SCRIPTS #312551 |
177 |
- unset CROSS_COMPILE #311473 |
178 |
- |
179 |
- tc-export CC AR RANLIB RC |
180 |
- |
181 |
- # Clean out patent-or-otherwise-encumbered code |
182 |
- # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher) |
183 |
- # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm |
184 |
- # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography |
185 |
- # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2 |
186 |
- # RC5: Expired https://en.wikipedia.org/wiki/RC5 |
187 |
- |
188 |
- use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; } |
189 |
- echoit() { echo "$@" ; "$@" ; } |
190 |
- |
191 |
- local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal") |
192 |
- |
193 |
- # See if our toolchain supports __uint128_t. If so, it's 64bit |
194 |
- # friendly and can use the nicely optimized code paths. #460790 |
195 |
- local ec_nistp_64_gcc_128 |
196 |
- # Disable it for now though #469976 |
197 |
- #if ! use bindist ; then |
198 |
- # echo "__uint128_t i;" > "${T}"/128.c |
199 |
- # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then |
200 |
- # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128" |
201 |
- # fi |
202 |
- #fi |
203 |
- |
204 |
- # https://github.com/openssl/openssl/issues/2286 |
205 |
- if use ia64 ; then |
206 |
- replace-flags -g3 -g2 |
207 |
- replace-flags -ggdb3 -ggdb2 |
208 |
- fi |
209 |
- |
210 |
- local sslout=$(./gentoo.config) |
211 |
- einfo "Use configuration ${sslout:-(openssl knows best)}" |
212 |
- local config="Configure" |
213 |
- [[ -z ${sslout} ]] && config="config" |
214 |
- |
215 |
- # Fedora hobbled-EC needs 'no-ec2m', 'no-srp' |
216 |
- # Make sure user flags don't get added *yet* to avoid duplicated |
217 |
- # flags. |
218 |
- CFLAGS= LDFLAGS= echoit \ |
219 |
- ./${config} \ |
220 |
- ${sslout} \ |
221 |
- $(use cpu_flags_x86_sse2 || echo "no-sse2") \ |
222 |
- enable-camellia \ |
223 |
- enable-ec \ |
224 |
- $(use_ssl !bindist ec2m) \ |
225 |
- $(use_ssl !bindist srp) \ |
226 |
- ${ec_nistp_64_gcc_128} \ |
227 |
- enable-idea \ |
228 |
- enable-mdc2 \ |
229 |
- enable-rc5 \ |
230 |
- enable-tlsext \ |
231 |
- $(use_ssl asm) \ |
232 |
- $(use_ssl gmp gmp -lgmp) \ |
233 |
- $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \ |
234 |
- $(use_ssl rfc3779) \ |
235 |
- $(use_ssl sctp) \ |
236 |
- $(use_ssl sslv2 ssl2) \ |
237 |
- $(use_ssl sslv3 ssl3) \ |
238 |
- $(use_ssl tls-heartbeat heartbeats) \ |
239 |
- $(use_ssl zlib) \ |
240 |
- --prefix="${EPREFIX}"/usr \ |
241 |
- --openssldir="${EPREFIX}"${SSL_CNF_DIR} \ |
242 |
- --libdir=$(get_libdir) \ |
243 |
- shared threads \ |
244 |
- || die |
245 |
- |
246 |
- # Clean out hardcoded flags that openssl uses |
247 |
- local DEFAULT_CFLAGS=$(grep ^CFLAG= Makefile | LC_ALL=C sed \ |
248 |
- -e 's:^CFLAG=::' \ |
249 |
- -e 's:\(^\| \)-fomit-frame-pointer::g' \ |
250 |
- -e 's:\(^\| \)-O[^ ]*::g' \ |
251 |
- -e 's:\(^\| \)-march=[^ ]*::g' \ |
252 |
- -e 's:\(^\| \)-mcpu=[^ ]*::g' \ |
253 |
- -e 's:\(^\| \)-m[^ ]*::g' \ |
254 |
- -e 's:^ *::' \ |
255 |
- -e 's: *$::' \ |
256 |
- -e 's: \+: :g' \ |
257 |
- -e 's:\\:\\\\:g' |
258 |
- ) |
259 |
- |
260 |
- # Now insert clean default flags with user flags |
261 |
- sed -i \ |
262 |
- -e "/^CFLAG/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \ |
263 |
- -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \ |
264 |
- Makefile || die |
265 |
-} |
266 |
- |
267 |
-multilib_src_compile() { |
268 |
- # depend is needed to use $confopts; it also doesn't matter |
269 |
- # that it's -j1 as the code itself serializes subdirs |
270 |
- emake -j1 V=1 depend |
271 |
- emake build_libs |
272 |
-} |
273 |
- |
274 |
-multilib_src_test() { |
275 |
- emake -j1 test |
276 |
-} |
277 |
- |
278 |
-multilib_src_install() { |
279 |
- dolib.so lib{crypto,ssl}.so.${SLOT} |
280 |
-} |