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/
Date: Thu, 12 Sep 2019 13:40:48
Message-Id: 1568295627.fa8c16d6739c91f31c4be97cf2bb7e49e7564c70.whissi@gentoo
1 commit: fa8c16d6739c91f31c4be97cf2bb7e49e7564c70
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 12 13:21:58 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 12 13:40:27 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa8c16d6
7
8 dev-libs/openssl: bump to v1.0.2t
9
10 Package-Manager: Portage-2.3.75, Repoman-2.3.17
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 dev-libs/openssl/Manifest | 2 +
14 dev-libs/openssl/openssl-1.0.2t.ebuild | 309 +++++++++++++++++++++++++++++++++
15 2 files changed, 311 insertions(+)
16
17 diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest
18 index fd03dd1eb9b..d8247c8ece3 100644
19 --- a/dev-libs/openssl/Manifest
20 +++ b/dev-libs/openssl/Manifest
21 @@ -7,6 +7,8 @@ DIST openssl-1.0.2s.tar.gz 5349149 BLAKE2B 46c72dcceb5b473b129be0a895f3d6c25a24e
22 DIST openssl-1.0.2s_ec_curve.c 17254 BLAKE2B d40d8d6e770443f07abe70e2c4ddda6aec1cc8e37dc1f226a3fdd9ed5d228f09c6d372e8956b1948b55ee1d57d1429493e7288d0f54d9466a37fec805c85aacb SHA512 8e92fb100bcf4bd918c82b9a6cbd75a55abe1a2c08230a007e441c51577f974f8cc336e9ac8a672b32641480428ca8cead5380da1fe81bacb088145a1b754a15
23 DIST openssl-1.0.2s_ectest.c 30735 BLAKE2B 95333a27f1cf0a4305a3cee7f6d46b9d4673582ca9acfcf5ba2a0d9d317ab6219cd0d2ff0ba3a55a317c8f5819342f05cc17ba80ec2c92b2b4cab9a3552382e1 SHA512 f2e4d34327b490bc8371f0845c69df3f9fc51ea16f0ea0de0411a0c1fa9d49bb2b6fafc363eb3b3cd919dc7c24e4a0d075c6ff878c01d70dae918f2540874c19
24 DIST openssl-1.0.2s_hobble-openssl 1302 BLAKE2B 647caa6a0f4c53a2e77baa3b8e5961eaef3bb0ff38e7d5475eab8deef3439f7fe49028ec9ed0406f3453870b62cac67c496b3a048ee4c9ff4c6866d520235960 SHA512 3d757a4708e74a03dd5cb9b8114dfe442ed9520739a6eca693be4c4265771696f1449ea06d1c9bcfc6e94fc9b0dd0c10e153f1c3b0334831c0550b36cd63326e
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.1.0k-bindist-1.0.tar.xz 11716 BLAKE2B c491ba0899c44dbcc63f85b255548c439c965a20a04ac2a6324a4122c4691b7c95ec18e62be6d708a7ea62ea197d32e5091987cb5043969878f89e5bc26243d4 SHA512 1d5bc9d7b24cf55d32d996e2421d43a1218b605720293f00d07814afb481387856f0dc000ad3c3e4cba2361055668cfe79a945be44ab85a249555f37e683a909
28 DIST openssl-1.1.0k.tar.gz 5287321 BLAKE2B fce40a399f5a08d5fe183dfcaab11b211d982885fb9888b25fa41bdd9919ecd203fca6f573363cfb42c9a0776ae69ea50b0f144227a3f28ca0dbadf878d396bc SHA512 65f41a240a97d79504c0e1391fde8ac8692f0993437cdc35e4bc964ecc36e5ef75a62499c4c6cb4ce63f892135e06dba2d3594c8869d935554296fa3c6ccd822
29 DIST openssl-1.1.0l-bindist-1.0.tar.xz 13168 BLAKE2B 1fbd1f7bdba08f14e21485175232283c2309687021a526b4a132b676d7f9429577f8f14e180fb4f59ef24bc9c06873a6936e64559a901803a3f1d21453177b50 SHA512 f664a6876a2a9c7467bbc6a436593eb21cc6be51e08408657f34b67fa69cd6bece3cc65f60220d7e41f36b359b5299adf49a59ede7f8f738d6a31e29d2a49714
30
31 diff --git a/dev-libs/openssl/openssl-1.0.2t.ebuild b/dev-libs/openssl/openssl-1.0.2t.ebuild
32 new file mode 100644
33 index 00000000000..acd4d57924d
34 --- /dev/null
35 +++ b/dev-libs/openssl/openssl-1.0.2t.ebuild
36 @@ -0,0 +1,309 @@
37 +# Copyright 1999-2019 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI="7"
41 +
42 +inherit flag-o-matic toolchain-funcs multilib multilib-minimal
43 +
44 +# openssl-1.0.2-patches-1.6 contain additional CVE patches
45 +# which got fixed with this release.
46 +# Please use 1.7 version number when rolling a new tarball!
47 +PATCH_SET="openssl-1.0.2-patches-1.5"
48 +
49 +MY_P=${P/_/-}
50 +
51 +# This patch set is based on the following files from Fedora 25,
52 +# see https://src.fedoraproject.org/rpms/openssl/blob/25/f/openssl.spec
53 +# for more details:
54 +# - hobble-openssl (SOURCE1)
55 +# - ec_curve.c (SOURCE12) -- MODIFIED
56 +# - ectest.c (SOURCE13)
57 +# - openssl-1.1.1-ec-curves.patch (PATCH37) -- MODIFIED
58 +BINDIST_PATCH_SET="openssl-1.0.2t-bindist-1.0.tar.xz"
59 +
60 +DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
61 +HOMEPAGE="https://www.openssl.org/"
62 +SRC_URI="mirror://openssl/source/${MY_P}.tar.gz
63 + bindist? (
64 + mirror://gentoo/${BINDIST_PATCH_SET}
65 + https://dev.gentoo.org/~whissi/dist/openssl/${BINDIST_PATCH_SET}
66 + )
67 + !vanilla? (
68 + mirror://gentoo/${PATCH_SET}.tar.xz
69 + https://dev.gentoo.org/~chutzpah/dist/${PN}/${PATCH_SET}.tar.xz
70 + https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz
71 + https://dev.gentoo.org/~polynomial-c/dist/${PATCH_SET}.tar.xz
72 + )"
73 +
74 +LICENSE="openssl"
75 +SLOT="0"
76 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-linux"
77 +IUSE="+asm bindist gmp kerberos rfc3779 sctp cpu_flags_x86_sse2 sslv2 +sslv3 static-libs test +tls-heartbeat vanilla zlib"
78 +RESTRICT="!bindist? ( bindist )"
79 +
80 +RDEPEND=">=app-misc/c_rehash-1.7-r1
81 + gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
82 + kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )
83 + zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )"
84 +DEPEND="${RDEPEND}"
85 +BDEPEND="
86 + >=dev-lang/perl-5
87 + sctp? ( >=net-misc/lksctp-tools-1.0.12 )
88 + test? (
89 + sys-apps/diffutils
90 + sys-devel/bc
91 + )"
92 +PDEPEND="app-misc/ca-certificates"
93 +
94 +S="${WORKDIR}/${MY_P}"
95 +
96 +MULTILIB_WRAPPED_HEADERS=(
97 + usr/include/openssl/opensslconf.h
98 +)
99 +
100 +src_prepare() {
101 + if use bindist; then
102 + mv "${WORKDIR}"/bindist-patches/hobble-openssl "${WORKDIR}" || die
103 + bash "${WORKDIR}"/hobble-openssl || die
104 +
105 + cp -f "${WORKDIR}"/bindist-patches/ec_curve.c "${S}"/crypto/ec/ || die
106 + cp -f "${WORKDIR}"/bindist-patches/ectest.c "${S}"/crypto/ec/ || die
107 +
108 + eapply "${WORKDIR}"/bindist-patches/ec-curves.patch
109 +
110 + # Also see the configure parts below:
111 + # enable-ec \
112 + # $(use_ssl !bindist ec2m) \
113 + # $(use_ssl !bindist srp) \
114 + fi
115 +
116 + # keep this in sync with app-misc/c_rehash
117 + SSL_CNF_DIR="/etc/ssl"
118 +
119 + # Make sure we only ever touch Makefile.org and avoid patching a file
120 + # that gets blown away anyways by the Configure script in src_configure
121 + rm -f Makefile
122 +
123 + if ! use vanilla ; then
124 + if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]] ; then
125 + [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}"
126 + fi
127 + fi
128 +
129 + eapply_user
130 +
131 + # disable fips in the build
132 + # make sure the man pages are suffixed #302165
133 + # don't bother building man pages if they're disabled
134 + sed -i \
135 + -e '/DIRS/s: fips : :g' \
136 + -e '/^MANSUFFIX/s:=.*:=ssl:' \
137 + -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
138 + -e $(has noman FEATURES \
139 + && echo '/^install:/s:install_docs::' \
140 + || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
141 + Makefile.org \
142 + || die
143 + # show the actual commands in the log
144 + sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
145 +
146 + # since we're forcing $(CC) as makedep anyway, just fix
147 + # the conditional as always-on
148 + # helps clang (#417795), and versioned gcc (#499818)
149 + # this breaks build with 1.0.2p, not sure if it is needed anymore
150 + #sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die
151 +
152 + # quiet out unknown driver argument warnings since openssl
153 + # doesn't have well-split CFLAGS and we're making it even worse
154 + # and 'make depend' uses -Werror for added fun (#417795 again)
155 + [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
156 +
157 + # allow openssl to be cross-compiled
158 + cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
159 + chmod a+rx gentoo.config || die
160 +
161 + append-flags -fno-strict-aliasing
162 + append-flags $(test-flags-CC -Wa,--noexecstack)
163 + append-cppflags -DOPENSSL_NO_BUF_FREELISTS
164 +
165 + sed -i '1s,^:$,#!'${EPREFIX}'/usr/bin/perl,' Configure #141906
166 + # The config script does stupid stuff to prompt the user. Kill it.
167 + sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
168 + ./config --test-sanity || die "I AM NOT SANE"
169 +
170 + multilib_copy_sources
171 +}
172 +
173 +multilib_src_configure() {
174 + unset APPS #197996
175 + unset SCRIPTS #312551
176 + unset CROSS_COMPILE #311473
177 +
178 + tc-export CC AR RANLIB RC
179 +
180 + # Clean out patent-or-otherwise-encumbered code
181 + # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher)
182 + # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
183 + # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
184 + # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2
185 + # RC5: Expired https://en.wikipedia.org/wiki/RC5
186 +
187 + use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
188 + echoit() { echo "$@" ; "$@" ; }
189 +
190 + local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
191 +
192 + # See if our toolchain supports __uint128_t. If so, it's 64bit
193 + # friendly and can use the nicely optimized code paths. #460790
194 + local ec_nistp_64_gcc_128
195 + # Disable it for now though #469976
196 + #if ! use bindist ; then
197 + # echo "__uint128_t i;" > "${T}"/128.c
198 + # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
199 + # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
200 + # fi
201 + #fi
202 +
203 + # https://github.com/openssl/openssl/issues/2286
204 + if use ia64 ; then
205 + replace-flags -g3 -g2
206 + replace-flags -ggdb3 -ggdb2
207 + fi
208 +
209 + local sslout=$(./gentoo.config)
210 + einfo "Use configuration ${sslout:-(openssl knows best)}"
211 + local config="Configure"
212 + [[ -z ${sslout} ]] && config="config"
213 +
214 + # Fedora hobbled-EC needs 'no-ec2m', 'no-srp'
215 + # Make sure user flags don't get added *yet* to avoid duplicated
216 + # flags.
217 + CFLAGS= LDFLAGS= echoit \
218 + ./${config} \
219 + ${sslout} \
220 + $(use cpu_flags_x86_sse2 || echo "no-sse2") \
221 + enable-camellia \
222 + enable-ec \
223 + $(use_ssl !bindist ec2m) \
224 + $(use_ssl !bindist srp) \
225 + ${ec_nistp_64_gcc_128} \
226 + enable-idea \
227 + enable-mdc2 \
228 + enable-rc5 \
229 + enable-tlsext \
230 + $(use_ssl asm) \
231 + $(use_ssl gmp gmp -lgmp) \
232 + $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \
233 + $(use_ssl rfc3779) \
234 + $(use_ssl sctp) \
235 + $(use_ssl sslv2 ssl2) \
236 + $(use_ssl sslv3 ssl3) \
237 + $(use_ssl tls-heartbeat heartbeats) \
238 + $(use_ssl zlib) \
239 + --prefix="${EPREFIX}"/usr \
240 + --openssldir="${EPREFIX}"${SSL_CNF_DIR} \
241 + --libdir=$(get_libdir) \
242 + shared threads \
243 + || die
244 +
245 + # Clean out hardcoded flags that openssl uses
246 + local DEFAULT_CFLAGS=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
247 + -e 's:^CFLAG=::' \
248 + -e 's:\(^\| \)-fomit-frame-pointer::g' \
249 + -e 's:\(^\| \)-O[^ ]*::g' \
250 + -e 's:\(^\| \)-march=[^ ]*::g' \
251 + -e 's:\(^\| \)-mcpu=[^ ]*::g' \
252 + -e 's:\(^\| \)-m[^ ]*::g' \
253 + -e 's:^ *::' \
254 + -e 's: *$::' \
255 + -e 's: \+: :g' \
256 + -e 's:\\:\\\\:g'
257 + )
258 +
259 + # Now insert clean default flags with user flags
260 + sed -i \
261 + -e "/^CFLAG/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
262 + -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \
263 + Makefile || die
264 +}
265 +
266 +multilib_src_compile() {
267 + # depend is needed to use $confopts; it also doesn't matter
268 + # that it's -j1 as the code itself serializes subdirs
269 + emake -j1 V=1 depend
270 + emake all
271 + # rehash is needed to prep the certs/ dir; do this
272 + # separately to avoid parallel build issues.
273 + emake rehash
274 +}
275 +
276 +multilib_src_test() {
277 + emake -j1 test
278 +}
279 +
280 +multilib_src_install() {
281 + # We need to create $ED/usr on our own to avoid a race condition #665130
282 + if [[ ! -d "${ED}/usr" ]]; then
283 + # We can only create this directory once
284 + mkdir "${ED}"/usr || die
285 + fi
286 +
287 + emake INSTALL_PREFIX="${D}" install
288 +}
289 +
290 +multilib_src_install_all() {
291 + # openssl installs perl version of c_rehash by default, but
292 + # we provide a shell version via app-misc/c_rehash
293 + rm "${ED}"/usr/bin/c_rehash || die
294 +
295 + local -a DOCS=( CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el )
296 + einstalldocs
297 +
298 + use rfc3779 && dodoc engines/ccgost/README.gost
299 +
300 + # This is crappy in that the static archives are still built even
301 + # when USE=static-libs. But this is due to a failing in the openssl
302 + # build system: the static archives are built as PIC all the time.
303 + # Only way around this would be to manually configure+compile openssl
304 + # twice; once with shared lib support enabled and once without.
305 + use static-libs || rm -f "${ED}"/usr/lib*/lib*.a
306 +
307 + # create the certs directory
308 + dodir ${SSL_CNF_DIR}/certs
309 + cp -RP certs/* "${ED}"${SSL_CNF_DIR}/certs/ || die
310 + rm -r "${ED}"${SSL_CNF_DIR}/certs/{demo,expired}
311 +
312 + # Namespace openssl programs to prevent conflicts with other man pages
313 + cd "${ED}"/usr/share/man
314 + local m d s
315 + for m in $(find . -type f | xargs grep -L '#include') ; do
316 + d=${m%/*} ; d=${d#./} ; m=${m##*/}
317 + [[ ${m} == openssl.1* ]] && continue
318 + [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
319 + mv ${d}/{,ssl-}${m}
320 + # fix up references to renamed man pages
321 + sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
322 + ln -s ssl-${m} ${d}/openssl-${m}
323 + # locate any symlinks that point to this man page ... we assume
324 + # that any broken links are due to the above renaming
325 + for s in $(find -L ${d} -type l) ; do
326 + s=${s##*/}
327 + rm -f ${d}/${s}
328 + ln -s ssl-${m} ${d}/ssl-${s}
329 + ln -s ssl-${s} ${d}/openssl-${s}
330 + done
331 + done
332 + [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
333 +
334 + dodir /etc/sandbox.d #254521
335 + echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
336 +
337 + diropts -m0700
338 + keepdir ${SSL_CNF_DIR}/private
339 +}
340 +
341 +pkg_postinst() {
342 + ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
343 + c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null
344 + eend $?
345 +}