Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/openssl/
Date: Wed, 29 May 2019 12:04:31
Message-Id: 1559131461.004c15696dd6004b9cf8dd4238a05d5569ef8dde.polynomial-c@gentoo
1 commit: 004c15696dd6004b9cf8dd4238a05d5569ef8dde
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 29 11:59:09 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Wed May 29 12:04:21 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=004c1569
7
8 dev-libs/openssl: Bump to versions 1.0.2s, 1.1.0k and 1.1.1c
9
10 Package-Manager: Portage-2.3.67, Repoman-2.3.13
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 dev-libs/openssl/Manifest | 12 ++
14 dev-libs/openssl/openssl-1.0.2s-r200.ebuild | 248 ++++++++++++++++++++++
15 dev-libs/openssl/openssl-1.0.2s.ebuild | 309 ++++++++++++++++++++++++++++
16 dev-libs/openssl/openssl-1.1.0k.ebuild | 298 +++++++++++++++++++++++++++
17 dev-libs/openssl/openssl-1.1.1c.ebuild | 298 +++++++++++++++++++++++++++
18 5 files changed, 1165 insertions(+)
19
20 diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest
21 index 2d49947a80c..26e97789fde 100644
22 --- a/dev-libs/openssl/Manifest
23 +++ b/dev-libs/openssl/Manifest
24 @@ -4,14 +4,26 @@ DIST openssl-1.0.2r.tar.gz 5348369 BLAKE2B 9f9c2d2fe6eaf9acacab29b394a318f30c38e
25 DIST openssl-1.0.2r_ec_curve.c 17254 BLAKE2B d40d8d6e770443f07abe70e2c4ddda6aec1cc8e37dc1f226a3fdd9ed5d228f09c6d372e8956b1948b55ee1d57d1429493e7288d0f54d9466a37fec805c85aacb SHA512 8e92fb100bcf4bd918c82b9a6cbd75a55abe1a2c08230a007e441c51577f974f8cc336e9ac8a672b32641480428ca8cead5380da1fe81bacb088145a1b754a15
26 DIST openssl-1.0.2r_ectest.c 30735 BLAKE2B 95333a27f1cf0a4305a3cee7f6d46b9d4673582ca9acfcf5ba2a0d9d317ab6219cd0d2ff0ba3a55a317c8f5819342f05cc17ba80ec2c92b2b4cab9a3552382e1 SHA512 f2e4d34327b490bc8371f0845c69df3f9fc51ea16f0ea0de0411a0c1fa9d49bb2b6fafc363eb3b3cd919dc7c24e4a0d075c6ff878c01d70dae918f2540874c19
27 DIST openssl-1.0.2r_hobble-openssl 1302 BLAKE2B 647caa6a0f4c53a2e77baa3b8e5961eaef3bb0ff38e7d5475eab8deef3439f7fe49028ec9ed0406f3453870b62cac67c496b3a048ee4c9ff4c6866d520235960 SHA512 3d757a4708e74a03dd5cb9b8114dfe442ed9520739a6eca693be4c4265771696f1449ea06d1c9bcfc6e94fc9b0dd0c10e153f1c3b0334831c0550b36cd63326e
28 +DIST openssl-1.0.2s.tar.gz 5349149 BLAKE2B 46c72dcceb5b473b129be0a895f3d6c25a24ee852a31dc369ccf0e44319259d8694d3571b8cb698efb8bce89dbe31f4fc9f82753cacb24cbd3d50fa2ab9b6e83 SHA512 9f745452c4f777df694158e95003cde78a2cf8199bc481a563ec36644664c3c1415a774779b9791dd18f2aeb57fa1721cb52b3db12d025955e970071d5b66d2a
29 +DIST openssl-1.0.2s_ec_curve.c 17254 BLAKE2B d40d8d6e770443f07abe70e2c4ddda6aec1cc8e37dc1f226a3fdd9ed5d228f09c6d372e8956b1948b55ee1d57d1429493e7288d0f54d9466a37fec805c85aacb SHA512 8e92fb100bcf4bd918c82b9a6cbd75a55abe1a2c08230a007e441c51577f974f8cc336e9ac8a672b32641480428ca8cead5380da1fe81bacb088145a1b754a15
30 +DIST openssl-1.0.2s_ectest.c 30735 BLAKE2B 95333a27f1cf0a4305a3cee7f6d46b9d4673582ca9acfcf5ba2a0d9d317ab6219cd0d2ff0ba3a55a317c8f5819342f05cc17ba80ec2c92b2b4cab9a3552382e1 SHA512 f2e4d34327b490bc8371f0845c69df3f9fc51ea16f0ea0de0411a0c1fa9d49bb2b6fafc363eb3b3cd919dc7c24e4a0d075c6ff878c01d70dae918f2540874c19
31 +DIST openssl-1.0.2s_hobble-openssl 1302 BLAKE2B 647caa6a0f4c53a2e77baa3b8e5961eaef3bb0ff38e7d5475eab8deef3439f7fe49028ec9ed0406f3453870b62cac67c496b3a048ee4c9ff4c6866d520235960 SHA512 3d757a4708e74a03dd5cb9b8114dfe442ed9520739a6eca693be4c4265771696f1449ea06d1c9bcfc6e94fc9b0dd0c10e153f1c3b0334831c0550b36cd63326e
32 DIST openssl-1.1.0-build_d2ede125556ac99aa0faa7744c703af3f559094e.patch 3001 BLAKE2B 8f0ac4be6409b4ec50bec171697da2aebe2688e8ae06bd0dfac8b0c74661d38ebeb0a12bde0ef941b213eee9b85965262213b140636060285dcfb02a3bd14961 SHA512 ec6710e9669ac19e4c6f1286c89a383e7d276a773a2740037f98a8f2dbf18305614e7d30d9ed530923a0e7d10a3776fea2ca77229adc25df13ecad55589a3673
33 DIST openssl-1.1.0-ec-curves_d2ede125556ac99aa0faa7744c703af3f559094e.patch 5311 BLAKE2B e9ec985adf6f13eb04412158a05da7cbe10be7d64bce73b899152ea379336ece7b7069089ef46993ac301ef850fd46fd0352898e249b2ea9fff5baf20896e5b5 SHA512 c38c4b05195f2b323a07efd8d17335ba2a168a16a59d7941da36568081f1c043da8d2216b7084b0617963635ded9bafeee736ecddbfa251cf0a02e4cba64cdc8
34 DIST openssl-1.1.0j.tar.gz 5411919 BLAKE2B 0fbd936f38d30b64bea717a67cd59704c5ce44ee19f377a820f89ba66b9e0a7509cf39e0fb00c104ae6440a6bd811e388239b458ffe685d8601235bab2afb2f1 SHA512 e7d30951ebb3cbcb6d59e3eb40f64f5a84634b7f5c380a588d378973f1c415395e3ab71a9aaff6478a89ec6efcc88f17f1882c99c25dcd18165f1435a51e5768
35 DIST openssl-1.1.0j_d2ede125556ac99aa0faa7744c703af3f559094e_ec_curve.c 18401 BLAKE2B f969071ac1b5d0e43b50d54e50b5c4d9201fc8b94458902e9849f14841b5505a2e43ed57a8c13255f042a211af9ee904776c155c36da838a8ad22e1052b02bc1 SHA512 a1c2bb3c3e3d342bddc8c952985e87fc4bad2e8142d5d760b18f346c44c20f00db61c4856f3dcf879b2098e0c036330762915f65d80a1a2cba717d2caeb95457
36 DIST openssl-1.1.0j_d2ede125556ac99aa0faa7744c703af3f559094e_ectest.c 30688 BLAKE2B 6673ef0fd139af82d830794179b19b9e06be25fac4a13b8bdfa5fd5dad25f594ce8eab118aab9ec2aab25001e1de127c03f8e1a04f4f3ef4c464b7fb1811ed4a SHA512 240fc72916caf4a8b0af774ce307abfe9a93a762eba6fae760cec79d619fe3db0d6919fc92a8951cb031f73958237700b45f590aa7f9f2890762cccda1f1e74b
37 DIST openssl-1.1.0j_d2ede125556ac99aa0faa7744c703af3f559094e_hobble-openssl 1117 BLAKE2B c3a1477e63331e83cf1cbe58e9ef131ec500a311e22d3da55034800ca353c387b2e202575acf3badb00b236ff91d4bac1bb131a33930939646d26bec27be6e04 SHA512 fa9cc70afa11a7a292548b4bddbba8159824a364ce5c279b483768e6ae2aa4b5491d9bf2cc734819f30a11c8ee0d91bcb991c4a7ab357296aeb4c04feac74826
38 +DIST openssl-1.1.0k.tar.gz 5287321 BLAKE2B fce40a399f5a08d5fe183dfcaab11b211d982885fb9888b25fa41bdd9919ecd203fca6f573363cfb42c9a0776ae69ea50b0f144227a3f28ca0dbadf878d396bc SHA512 65f41a240a97d79504c0e1391fde8ac8692f0993437cdc35e4bc964ecc36e5ef75a62499c4c6cb4ce63f892135e06dba2d3594c8869d935554296fa3c6ccd822
39 +DIST openssl-1.1.0k_d2ede125556ac99aa0faa7744c703af3f559094e_ec_curve.c 18401 BLAKE2B f969071ac1b5d0e43b50d54e50b5c4d9201fc8b94458902e9849f14841b5505a2e43ed57a8c13255f042a211af9ee904776c155c36da838a8ad22e1052b02bc1 SHA512 a1c2bb3c3e3d342bddc8c952985e87fc4bad2e8142d5d760b18f346c44c20f00db61c4856f3dcf879b2098e0c036330762915f65d80a1a2cba717d2caeb95457
40 +DIST openssl-1.1.0k_d2ede125556ac99aa0faa7744c703af3f559094e_ectest.c 30688 BLAKE2B 6673ef0fd139af82d830794179b19b9e06be25fac4a13b8bdfa5fd5dad25f594ce8eab118aab9ec2aab25001e1de127c03f8e1a04f4f3ef4c464b7fb1811ed4a SHA512 240fc72916caf4a8b0af774ce307abfe9a93a762eba6fae760cec79d619fe3db0d6919fc92a8951cb031f73958237700b45f590aa7f9f2890762cccda1f1e74b
41 +DIST openssl-1.1.0k_d2ede125556ac99aa0faa7744c703af3f559094e_hobble-openssl 1117 BLAKE2B c3a1477e63331e83cf1cbe58e9ef131ec500a311e22d3da55034800ca353c387b2e202575acf3badb00b236ff91d4bac1bb131a33930939646d26bec27be6e04 SHA512 fa9cc70afa11a7a292548b4bddbba8159824a364ce5c279b483768e6ae2aa4b5491d9bf2cc734819f30a11c8ee0d91bcb991c4a7ab357296aeb4c04feac74826
42 DIST openssl-1.1.1-ec-curves.patch 7265 BLAKE2B 04725d226c430132cf54afbfaa30a82f8f8bbfd3608823d1d0cd42c3c13f417e90762759da3134d7b0c4373e531925db337b681340f2f284cb2f16a4caef22e3 SHA512 de4d0f1635740c57217836a476c420141c0d34a5f90cbf7957aed7a80e7ac9ca036de2d8448e6bf4c122999e308730575899f61cea6e51ab6825dd04890d75a1
43 DIST openssl-1.1.1b.tar.gz 8213737 BLAKE2B 7ad9da9548052e2a033a684038f97c420cfffd57994604bcb3fa12640796c8c0aea3d24fb05648ee4940fbec40b81462e81c353da5a41a2575c0585d9718eae8 SHA512 b54025fbb4fe264466f3b0d762aad4be45bd23cd48bdb26d901d4c41a40bfd776177e02230995ab181a695435039dbad313f4b9a563239a70807a2e19ecf045d
44 DIST openssl-1.1.1b_ec_curve.c 17938 BLAKE2B d5cbde40dcd8608087aed6ffa9feb040ffadecf0c46b7f3978cc468a9503f0a5ad0a426ea6f8db56f49a64474a508bebdf946e01ebf09adc727675f3b180bcdc SHA512 ec470f6514cb9a4f680b8cbbe02e2bbe71639b288f3429d976726047901d9c50377dfb2737f32429da2fb0e52fd67878a86debb54520e307ee196d97b5c66415
45 DIST openssl-1.1.1b_ectest.c 35091 BLAKE2B a9602255ab529751c2af2419206ce113f03f93b7b776691ea2ec550f26ddbecd241844bb81dc86988fdbb1c0a587318f82ce4faecba1a6142a19cf08d40fb2c5 SHA512 7813d9b6b7ab62119a7f2dd5431c17c5839f4c320ac7071b0714c9b8528bda5fda779dbb263328dca6ee8446e9fa09c663da659c9a82832a65cf53d1cd8a4cef
46 DIST openssl-1.1.1b_hobble-openssl 1117 BLAKE2B c3a1477e63331e83cf1cbe58e9ef131ec500a311e22d3da55034800ca353c387b2e202575acf3badb00b236ff91d4bac1bb131a33930939646d26bec27be6e04 SHA512 fa9cc70afa11a7a292548b4bddbba8159824a364ce5c279b483768e6ae2aa4b5491d9bf2cc734819f30a11c8ee0d91bcb991c4a7ab357296aeb4c04feac74826
47 +DIST openssl-1.1.1c.tar.gz 8864262 BLAKE2B bd157b244bedcefb8e646a743732945119b267236789ac69c38856570318aca09299bdaaea3f20294863b633e6fd4dfe124820597185b3b7461cfdf094daadb0 SHA512 8e2c5cc11c120efbb7d7850980cb6eaa782d29b4996b3f3378d37613c1679f852d7cc08a90d62e78fcec3439f06bdbee70064579a8c2adaffd91532a97f646ff
48 +DIST openssl-1.1.1c_ec_curve.c 17938 BLAKE2B d5cbde40dcd8608087aed6ffa9feb040ffadecf0c46b7f3978cc468a9503f0a5ad0a426ea6f8db56f49a64474a508bebdf946e01ebf09adc727675f3b180bcdc SHA512 ec470f6514cb9a4f680b8cbbe02e2bbe71639b288f3429d976726047901d9c50377dfb2737f32429da2fb0e52fd67878a86debb54520e307ee196d97b5c66415
49 +DIST openssl-1.1.1c_ectest.c 35091 BLAKE2B a9602255ab529751c2af2419206ce113f03f93b7b776691ea2ec550f26ddbecd241844bb81dc86988fdbb1c0a587318f82ce4faecba1a6142a19cf08d40fb2c5 SHA512 7813d9b6b7ab62119a7f2dd5431c17c5839f4c320ac7071b0714c9b8528bda5fda779dbb263328dca6ee8446e9fa09c663da659c9a82832a65cf53d1cd8a4cef
50 +DIST openssl-1.1.1c_hobble-openssl 1117 BLAKE2B c3a1477e63331e83cf1cbe58e9ef131ec500a311e22d3da55034800ca353c387b2e202575acf3badb00b236ff91d4bac1bb131a33930939646d26bec27be6e04 SHA512 fa9cc70afa11a7a292548b4bddbba8159824a364ce5c279b483768e6ae2aa4b5491d9bf2cc734819f30a11c8ee0d91bcb991c4a7ab357296aeb4c04feac74826
51
52 diff --git a/dev-libs/openssl/openssl-1.0.2s-r200.ebuild b/dev-libs/openssl/openssl-1.0.2s-r200.ebuild
53 new file mode 100644
54 index 00000000000..44b9547d141
55 --- /dev/null
56 +++ b/dev-libs/openssl/openssl-1.0.2s-r200.ebuild
57 @@ -0,0 +1,248 @@
58 +# Copyright 1999-2019 Gentoo Authors
59 +# Distributed under the terms of the GNU General Public License v2
60 +
61 +EAPI="6"
62 +
63 +inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
64 +
65 +# openssl-1.0.2-patches-1.6 contain additional CVE patches
66 +# which got fixed with this release.
67 +# Please use 1.7 version number when rolling a new tarball!
68 +PATCH_SET="openssl-1.0.2-patches-1.5"
69 +MY_P=${P/_/-}
70 +DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
71 +HOMEPAGE="https://www.openssl.org/"
72 +SRC_URI="mirror://openssl/source/${MY_P}.tar.gz
73 + !vanilla? (
74 + mirror://gentoo/${PATCH_SET}.tar.xz
75 + https://dev.gentoo.org/~chutzpah/dist/${PN}/${PATCH_SET}.tar.xz
76 + https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz
77 + https://dev.gentoo.org/~polynomial-c/dist/${PATCH_SET}.tar.xz
78 + )"
79 +
80 +LICENSE="openssl"
81 +SLOT="1.0.0"
82 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-linux"
83 +IUSE="+asm bindist gmp kerberos rfc3779 sctp cpu_flags_x86_sse2 sslv2 +sslv3 static-libs test +tls-heartbeat vanilla zlib"
84 +RESTRICT="!bindist? ( bindist )"
85 +
86 +RDEPEND=">=app-misc/c_rehash-1.7-r1
87 + gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
88 + zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
89 + kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )
90 + !=dev-libs/openssl-1.0.2*:0"
91 +DEPEND="${RDEPEND}
92 + >=dev-lang/perl-5
93 + sctp? ( >=net-misc/lksctp-tools-1.0.12 )
94 + test? (
95 + sys-apps/diffutils
96 + sys-devel/bc
97 + )"
98 +
99 +RESTRICT="test"
100 +
101 +# Do not install any docs
102 +DOCS=()
103 +
104 +# This does not copy the entire Fedora patchset, but JUST the parts that
105 +# are needed to make it safe to use EC with RESTRICT=bindist.
106 +# See openssl.spec for the matching numbering of SourceNNN, PatchNNN
107 +SOURCE1=hobble-openssl
108 +SOURCE12=ec_curve.c
109 +SOURCE13=ectest.c
110 +# These are ported instead
111 +#PATCH1=openssl-1.1.0-build.patch # Fixes EVP testcase for EC
112 +#PATCH37=openssl-1.1.0-ec-curves.patch
113 +FEDORA_GIT_BASE='https://src.fedoraproject.org/cgit/rpms/openssl.git/plain/'
114 +FEDORA_GIT_BRANCH='f25'
115 +FEDORA_SRC_URI=()
116 +FEDORA_SOURCE=( $SOURCE1 $SOURCE12 $SOURCE13 )
117 +FEDORA_PATCH=( $PATCH1 $PATCH37 )
118 +for i in "${FEDORA_SOURCE[@]}" ; do
119 + FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${P}_${i}" )
120 +done
121 +for i in "${FEDORA_PATCH[@]}" ; do # Already have a version prefix
122 + FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${i}" )
123 +done
124 +SRC_URI+=" bindist? ( ${FEDORA_SRC_URI[@]} )"
125 +
126 +S="${WORKDIR}/${MY_P}"
127 +
128 +MULTILIB_WRAPPED_HEADERS=(
129 + usr/include/openssl/opensslconf.h
130 +)
131 +
132 +src_prepare() {
133 + if use bindist; then
134 + # This just removes the prefix, and puts it into WORKDIR like the RPM.
135 + for i in "${FEDORA_SOURCE[@]}" ; do
136 + cp -f "${DISTDIR}"/"${P}_${i}" "${WORKDIR}"/"${i}" || die
137 + done
138 + # .spec %prep
139 + bash "${WORKDIR}"/"${SOURCE1}" || die
140 + cp -f "${WORKDIR}"/"${SOURCE12}" "${S}"/crypto/ec/ || die
141 + cp -f "${WORKDIR}"/"${SOURCE13}" "${S}"/crypto/ec/ || die # Moves to test/ in OpenSSL-1.1
142 + for i in "${FEDORA_PATCH[@]}" ; do
143 + eapply "${DISTDIR}"/"${i}"
144 + done
145 + eapply "${FILESDIR}"/openssl-1.0.2p-hobble-ecc.patch
146 + # Also see the configure parts below:
147 + # enable-ec \
148 + # $(use_ssl !bindist ec2m) \
149 + # $(use_ssl !bindist srp) \
150 + fi
151 +
152 + # keep this in sync with app-misc/c_rehash
153 + SSL_CNF_DIR="/etc/ssl"
154 +
155 + # Make sure we only ever touch Makefile.org and avoid patching a file
156 + # that gets blown away anyways by the Configure script in src_configure
157 + rm -f Makefile
158 +
159 + if ! use vanilla ; then
160 + eapply "${WORKDIR}"/patch/*.patch
161 + fi
162 +
163 + eapply_user
164 +
165 + # disable fips in the build
166 + # make sure the man pages are suffixed #302165
167 + # don't bother building man pages if they're disabled
168 + sed -i \
169 + -e '/DIRS/s: fips : :g' \
170 + -e '/^MANSUFFIX/s:=.*:=ssl:' \
171 + -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
172 + -e $(has noman FEATURES \
173 + && echo '/^install:/s:install_docs::' \
174 + || echo '/^MANDIR=/s:=.*:='${EPREFIX%/}'/usr/share/man:') \
175 + Makefile.org \
176 + || die
177 + # show the actual commands in the log
178 + sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
179 +
180 + # since we're forcing $(CC) as makedep anyway, just fix
181 + # the conditional as always-on
182 + # helps clang (#417795), and versioned gcc (#499818)
183 + # this breaks build with 1.0.2p, not sure if it is needed anymore
184 + #sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die
185 +
186 + # quiet out unknown driver argument warnings since openssl
187 + # doesn't have well-split CFLAGS and we're making it even worse
188 + # and 'make depend' uses -Werror for added fun (#417795 again)
189 + [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
190 +
191 + # allow openssl to be cross-compiled
192 + cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
193 + chmod a+rx gentoo.config || die
194 +
195 + append-flags -fno-strict-aliasing
196 + append-flags $(test-flags-CC -Wa,--noexecstack)
197 + append-cppflags -DOPENSSL_NO_BUF_FREELISTS
198 +
199 + sed -i '1s,^:$,#!'${EPREFIX%/}'/usr/bin/perl,' Configure #141906
200 + # The config script does stupid stuff to prompt the user. Kill it.
201 + sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
202 + ./config --test-sanity || die "I AM NOT SANE"
203 +
204 + multilib_copy_sources
205 +}
206 +
207 +multilib_src_configure() {
208 + unset APPS #197996
209 + unset SCRIPTS #312551
210 + unset CROSS_COMPILE #311473
211 +
212 + tc-export CC AR RANLIB RC
213 +
214 + # Clean out patent-or-otherwise-encumbered code
215 + # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher)
216 + # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
217 + # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
218 + # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2
219 + # RC5: Expired https://en.wikipedia.org/wiki/RC5
220 +
221 + use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
222 + echoit() { echo "$@" ; "$@" ; }
223 +
224 + local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
225 +
226 + # See if our toolchain supports __uint128_t. If so, it's 64bit
227 + # friendly and can use the nicely optimized code paths. #460790
228 + local ec_nistp_64_gcc_128
229 + # Disable it for now though #469976
230 + #if ! use bindist ; then
231 + # echo "__uint128_t i;" > "${T}"/128.c
232 + # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
233 + # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
234 + # fi
235 + #fi
236 +
237 + # https://github.com/openssl/openssl/issues/2286
238 + if use ia64 ; then
239 + replace-flags -g3 -g2
240 + replace-flags -ggdb3 -ggdb2
241 + fi
242 +
243 + local sslout=$(./gentoo.config)
244 + einfo "Use configuration ${sslout:-(openssl knows best)}"
245 + local config="Configure"
246 + [[ -z ${sslout} ]] && config="config"
247 +
248 + # Fedora hobbled-EC needs 'no-ec2m', 'no-srp'
249 + echoit \
250 + ./${config} \
251 + ${sslout} \
252 + $(use cpu_flags_x86_sse2 || echo "no-sse2") \
253 + enable-camellia \
254 + enable-ec \
255 + $(use_ssl !bindist ec2m) \
256 + $(use_ssl !bindist srp) \
257 + ${ec_nistp_64_gcc_128} \
258 + enable-idea \
259 + enable-mdc2 \
260 + enable-rc5 \
261 + enable-tlsext \
262 + $(use_ssl asm) \
263 + $(use_ssl gmp gmp -lgmp) \
264 + $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \
265 + $(use_ssl rfc3779) \
266 + $(use_ssl sctp) \
267 + $(use_ssl sslv2 ssl2) \
268 + $(use_ssl sslv3 ssl3) \
269 + $(use_ssl tls-heartbeat heartbeats) \
270 + $(use_ssl zlib) \
271 + --prefix="${EPREFIX%/}"/usr \
272 + --openssldir="${EPREFIX%/}"${SSL_CNF_DIR} \
273 + --libdir=$(get_libdir) \
274 + shared threads \
275 + || die
276 +
277 + # Clean out hardcoded flags that openssl uses
278 + local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
279 + -e 's:^CFLAG=::' \
280 + -e 's:-fomit-frame-pointer ::g' \
281 + -e 's:-O[0-9] ::g' \
282 + -e 's:-march=[-a-z0-9]* ::g' \
283 + -e 's:-mcpu=[-a-z0-9]* ::g' \
284 + -e 's:-m[a-z0-9]* ::g' \
285 + )
286 + sed -i \
287 + -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
288 + -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
289 + Makefile || die
290 +}
291 +
292 +multilib_src_compile() {
293 + # depend is needed to use $confopts; it also doesn't matter
294 + # that it's -j1 as the code itself serializes subdirs
295 + emake -j1 V=1 depend
296 + emake build_libs
297 +}
298 +
299 +multilib_src_test() {
300 + emake -j1 test
301 +}
302 +
303 +multilib_src_install() {
304 + dolib.so lib{crypto,ssl}.so.${SLOT}
305 +}
306
307 diff --git a/dev-libs/openssl/openssl-1.0.2s.ebuild b/dev-libs/openssl/openssl-1.0.2s.ebuild
308 new file mode 100644
309 index 00000000000..57280189ad1
310 --- /dev/null
311 +++ b/dev-libs/openssl/openssl-1.0.2s.ebuild
312 @@ -0,0 +1,309 @@
313 +# Copyright 1999-2019 Gentoo Authors
314 +# Distributed under the terms of the GNU General Public License v2
315 +
316 +EAPI="6"
317 +
318 +inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
319 +
320 +# openssl-1.0.2-patches-1.6 contain additional CVE patches
321 +# which got fixed with this release.
322 +# Please use 1.7 version number when rolling a new tarball!
323 +PATCH_SET="openssl-1.0.2-patches-1.5"
324 +MY_P=${P/_/-}
325 +DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
326 +HOMEPAGE="https://www.openssl.org/"
327 +SRC_URI="mirror://openssl/source/${MY_P}.tar.gz
328 + !vanilla? (
329 + mirror://gentoo/${PATCH_SET}.tar.xz
330 + https://dev.gentoo.org/~chutzpah/dist/${PN}/${PATCH_SET}.tar.xz
331 + https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz
332 + https://dev.gentoo.org/~polynomial-c/dist/${PATCH_SET}.tar.xz
333 + )"
334 +
335 +LICENSE="openssl"
336 +SLOT="0"
337 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-linux"
338 +IUSE="+asm bindist gmp kerberos rfc3779 sctp cpu_flags_x86_sse2 sslv2 +sslv3 static-libs test +tls-heartbeat vanilla zlib"
339 +RESTRICT="!bindist? ( bindist )"
340 +
341 +RDEPEND=">=app-misc/c_rehash-1.7-r1
342 + gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
343 + zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
344 + kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )"
345 +DEPEND="${RDEPEND}
346 + >=dev-lang/perl-5
347 + sctp? ( >=net-misc/lksctp-tools-1.0.12 )
348 + test? (
349 + sys-apps/diffutils
350 + sys-devel/bc
351 + )"
352 +PDEPEND="app-misc/ca-certificates"
353 +
354 +# This does not copy the entire Fedora patchset, but JUST the parts that
355 +# are needed to make it safe to use EC with RESTRICT=bindist.
356 +# See openssl.spec for the matching numbering of SourceNNN, PatchNNN
357 +SOURCE1=hobble-openssl
358 +SOURCE12=ec_curve.c
359 +SOURCE13=ectest.c
360 +# These are ported instead
361 +#PATCH1=openssl-1.1.0-build.patch # Fixes EVP testcase for EC
362 +#PATCH37=openssl-1.1.0-ec-curves.patch
363 +FEDORA_GIT_BASE='https://src.fedoraproject.org/cgit/rpms/openssl.git/plain/'
364 +FEDORA_GIT_BRANCH='f25'
365 +FEDORA_SRC_URI=()
366 +FEDORA_SOURCE=( $SOURCE1 $SOURCE12 $SOURCE13 )
367 +FEDORA_PATCH=( $PATCH1 $PATCH37 )
368 +for i in "${FEDORA_SOURCE[@]}" ; do
369 + FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${P}_${i}" )
370 +done
371 +for i in "${FEDORA_PATCH[@]}" ; do # Already have a version prefix
372 + FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${i}" )
373 +done
374 +SRC_URI+=" bindist? ( ${FEDORA_SRC_URI[@]} )"
375 +
376 +S="${WORKDIR}/${MY_P}"
377 +
378 +MULTILIB_WRAPPED_HEADERS=(
379 + usr/include/openssl/opensslconf.h
380 +)
381 +
382 +src_prepare() {
383 + if use bindist; then
384 + # This just removes the prefix, and puts it into WORKDIR like the RPM.
385 + for i in "${FEDORA_SOURCE[@]}" ; do
386 + cp -f "${DISTDIR}"/"${P}_${i}" "${WORKDIR}"/"${i}" || die
387 + done
388 + # .spec %prep
389 + bash "${WORKDIR}"/"${SOURCE1}" || die
390 + cp -f "${WORKDIR}"/"${SOURCE12}" "${S}"/crypto/ec/ || die
391 + cp -f "${WORKDIR}"/"${SOURCE13}" "${S}"/crypto/ec/ || die # Moves to test/ in OpenSSL-1.1
392 + for i in "${FEDORA_PATCH[@]}" ; do
393 + eapply "${DISTDIR}"/"${i}"
394 + done
395 + eapply "${FILESDIR}"/openssl-1.0.2p-hobble-ecc.patch
396 + # Also see the configure parts below:
397 + # enable-ec \
398 + # $(use_ssl !bindist ec2m) \
399 + # $(use_ssl !bindist srp) \
400 + fi
401 +
402 + # keep this in sync with app-misc/c_rehash
403 + SSL_CNF_DIR="/etc/ssl"
404 +
405 + # Make sure we only ever touch Makefile.org and avoid patching a file
406 + # that gets blown away anyways by the Configure script in src_configure
407 + rm -f Makefile
408 +
409 + if ! use vanilla ; then
410 + eapply "${WORKDIR}"/patch/*.patch
411 + fi
412 +
413 + eapply_user
414 +
415 + # disable fips in the build
416 + # make sure the man pages are suffixed #302165
417 + # don't bother building man pages if they're disabled
418 + sed -i \
419 + -e '/DIRS/s: fips : :g' \
420 + -e '/^MANSUFFIX/s:=.*:=ssl:' \
421 + -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
422 + -e $(has noman FEATURES \
423 + && echo '/^install:/s:install_docs::' \
424 + || echo '/^MANDIR=/s:=.*:='${EPREFIX%/}'/usr/share/man:') \
425 + Makefile.org \
426 + || die
427 + # show the actual commands in the log
428 + sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
429 +
430 + # since we're forcing $(CC) as makedep anyway, just fix
431 + # the conditional as always-on
432 + # helps clang (#417795), and versioned gcc (#499818)
433 + # this breaks build with 1.0.2p, not sure if it is needed anymore
434 + #sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die
435 +
436 + # quiet out unknown driver argument warnings since openssl
437 + # doesn't have well-split CFLAGS and we're making it even worse
438 + # and 'make depend' uses -Werror for added fun (#417795 again)
439 + [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
440 +
441 + # allow openssl to be cross-compiled
442 + cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
443 + chmod a+rx gentoo.config || die
444 +
445 + append-flags -fno-strict-aliasing
446 + append-flags $(test-flags-CC -Wa,--noexecstack)
447 + append-cppflags -DOPENSSL_NO_BUF_FREELISTS
448 +
449 + sed -i '1s,^:$,#!'${EPREFIX%/}'/usr/bin/perl,' Configure #141906
450 + # The config script does stupid stuff to prompt the user. Kill it.
451 + sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
452 + ./config --test-sanity || die "I AM NOT SANE"
453 +
454 + multilib_copy_sources
455 +}
456 +
457 +multilib_src_configure() {
458 + unset APPS #197996
459 + unset SCRIPTS #312551
460 + unset CROSS_COMPILE #311473
461 +
462 + tc-export CC AR RANLIB RC
463 +
464 + # Clean out patent-or-otherwise-encumbered code
465 + # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher)
466 + # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
467 + # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
468 + # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2
469 + # RC5: Expired https://en.wikipedia.org/wiki/RC5
470 +
471 + use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
472 + echoit() { echo "$@" ; "$@" ; }
473 +
474 + local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
475 +
476 + # See if our toolchain supports __uint128_t. If so, it's 64bit
477 + # friendly and can use the nicely optimized code paths. #460790
478 + local ec_nistp_64_gcc_128
479 + # Disable it for now though #469976
480 + #if ! use bindist ; then
481 + # echo "__uint128_t i;" > "${T}"/128.c
482 + # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
483 + # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
484 + # fi
485 + #fi
486 +
487 + # https://github.com/openssl/openssl/issues/2286
488 + if use ia64 ; then
489 + replace-flags -g3 -g2
490 + replace-flags -ggdb3 -ggdb2
491 + fi
492 +
493 + local sslout=$(./gentoo.config)
494 + einfo "Use configuration ${sslout:-(openssl knows best)}"
495 + local config="Configure"
496 + [[ -z ${sslout} ]] && config="config"
497 +
498 + # Fedora hobbled-EC needs 'no-ec2m', 'no-srp'
499 + echoit \
500 + ./${config} \
501 + ${sslout} \
502 + $(use cpu_flags_x86_sse2 || echo "no-sse2") \
503 + enable-camellia \
504 + enable-ec \
505 + $(use_ssl !bindist ec2m) \
506 + $(use_ssl !bindist srp) \
507 + ${ec_nistp_64_gcc_128} \
508 + enable-idea \
509 + enable-mdc2 \
510 + enable-rc5 \
511 + enable-tlsext \
512 + $(use_ssl asm) \
513 + $(use_ssl gmp gmp -lgmp) \
514 + $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \
515 + $(use_ssl rfc3779) \
516 + $(use_ssl sctp) \
517 + $(use_ssl sslv2 ssl2) \
518 + $(use_ssl sslv3 ssl3) \
519 + $(use_ssl tls-heartbeat heartbeats) \
520 + $(use_ssl zlib) \
521 + --prefix="${EPREFIX%/}"/usr \
522 + --openssldir="${EPREFIX%/}"${SSL_CNF_DIR} \
523 + --libdir=$(get_libdir) \
524 + shared threads \
525 + || die
526 +
527 + # Clean out hardcoded flags that openssl uses
528 + local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
529 + -e 's:^CFLAG=::' \
530 + -e 's:-fomit-frame-pointer ::g' \
531 + -e 's:-O[0-9] ::g' \
532 + -e 's:-march=[-a-z0-9]* ::g' \
533 + -e 's:-mcpu=[-a-z0-9]* ::g' \
534 + -e 's:-m[a-z0-9]* ::g' \
535 + )
536 + sed -i \
537 + -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
538 + -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
539 + Makefile || die
540 +}
541 +
542 +multilib_src_compile() {
543 + # depend is needed to use $confopts; it also doesn't matter
544 + # that it's -j1 as the code itself serializes subdirs
545 + emake -j1 V=1 depend
546 + emake all
547 + # rehash is needed to prep the certs/ dir; do this
548 + # separately to avoid parallel build issues.
549 + emake rehash
550 +}
551 +
552 +multilib_src_test() {
553 + emake -j1 test
554 +}
555 +
556 +multilib_src_install() {
557 + # We need to create $ED/usr on our own to avoid a race condition #665130
558 + if [[ ! -d "${ED%/}/usr" ]]; then
559 + # We can only create this directory once
560 + mkdir "${ED%/}"/usr || die
561 + fi
562 +
563 + emake INSTALL_PREFIX="${D%/}" install
564 +}
565 +
566 +multilib_src_install_all() {
567 + # openssl installs perl version of c_rehash by default, but
568 + # we provide a shell version via app-misc/c_rehash
569 + rm "${ED%/}"/usr/bin/c_rehash || die
570 +
571 + local -a DOCS=( CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el )
572 + einstalldocs
573 +
574 + use rfc3779 && dodoc engines/ccgost/README.gost
575 +
576 + # This is crappy in that the static archives are still built even
577 + # when USE=static-libs. But this is due to a failing in the openssl
578 + # build system: the static archives are built as PIC all the time.
579 + # Only way around this would be to manually configure+compile openssl
580 + # twice; once with shared lib support enabled and once without.
581 + use static-libs || rm -f "${ED}"/usr/lib*/lib*.a
582 +
583 + # create the certs directory
584 + dodir ${SSL_CNF_DIR}/certs
585 + cp -RP certs/* "${ED}"${SSL_CNF_DIR}/certs/ || die
586 + rm -r "${ED}"${SSL_CNF_DIR}/certs/{demo,expired}
587 +
588 + # Namespace openssl programs to prevent conflicts with other man pages
589 + cd "${ED}"/usr/share/man
590 + local m d s
591 + for m in $(find . -type f | xargs grep -L '#include') ; do
592 + d=${m%/*} ; d=${d#./} ; m=${m##*/}
593 + [[ ${m} == openssl.1* ]] && continue
594 + [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
595 + mv ${d}/{,ssl-}${m}
596 + # fix up references to renamed man pages
597 + sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
598 + ln -s ssl-${m} ${d}/openssl-${m}
599 + # locate any symlinks that point to this man page ... we assume
600 + # that any broken links are due to the above renaming
601 + for s in $(find -L ${d} -type l) ; do
602 + s=${s##*/}
603 + rm -f ${d}/${s}
604 + ln -s ssl-${m} ${d}/ssl-${s}
605 + ln -s ssl-${s} ${d}/openssl-${s}
606 + done
607 + done
608 + [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
609 +
610 + dodir /etc/sandbox.d #254521
611 + echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
612 +
613 + diropts -m0700
614 + keepdir ${SSL_CNF_DIR}/private
615 +}
616 +
617 +pkg_postinst() {
618 + ebegin "Running 'c_rehash ${EROOT%/}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
619 + c_rehash "${EROOT%/}${SSL_CNF_DIR}/certs" >/dev/null
620 + eend $?
621 +}
622
623 diff --git a/dev-libs/openssl/openssl-1.1.0k.ebuild b/dev-libs/openssl/openssl-1.1.0k.ebuild
624 new file mode 100644
625 index 00000000000..f5af55a9879
626 --- /dev/null
627 +++ b/dev-libs/openssl/openssl-1.1.0k.ebuild
628 @@ -0,0 +1,298 @@
629 +# Copyright 1999-2019 Gentoo Authors
630 +# Distributed under the terms of the GNU General Public License v2
631 +
632 +EAPI="6"
633 +
634 +inherit flag-o-matic toolchain-funcs multilib multilib-minimal
635 +
636 +MY_P=${P/_/-}
637 +DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
638 +HOMEPAGE="https://www.openssl.org/"
639 +SRC_URI="mirror://openssl/source/${MY_P}.tar.gz"
640 +
641 +LICENSE="openssl"
642 +SLOT="0/1.1" # .so version of libssl/libcrypto
643 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-linux"
644 +IUSE="+asm bindist elibc_musl rfc3779 sctp cpu_flags_x86_sse2 static-libs test tls-heartbeat vanilla zlib"
645 +RESTRICT="!bindist? ( bindist )"
646 +
647 +RDEPEND=">=app-misc/c_rehash-1.7-r1
648 + zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )"
649 +DEPEND="${RDEPEND}
650 + >=dev-lang/perl-5
651 + sctp? ( >=net-misc/lksctp-tools-1.0.12 )
652 + test? (
653 + sys-apps/diffutils
654 + sys-devel/bc
655 + )"
656 +PDEPEND="app-misc/ca-certificates"
657 +
658 +# This does not copy the entire Fedora patchset, but JUST the parts that
659 +# are needed to make it safe to use EC with RESTRICT=bindist.
660 +# See openssl.spec for the matching numbering of SourceNNN, PatchNNN
661 +SOURCE1=hobble-openssl
662 +SOURCE12=ec_curve.c
663 +SOURCE13=ectest.c
664 +PATCH1=openssl-1.1.0-build.patch # Fixes EVP testcase for EC
665 +PATCH37=openssl-1.1.0-ec-curves.patch
666 +FEDORA_GIT_BASE='https://src.fedoraproject.org/cgit/rpms/openssl.git/plain/'
667 +FEDORA_GIT_BRANCH='f28'
668 +FEDORA_GIT_COMMIT="d2ede125556ac99aa0faa7744c703af3f559094e"
669 +FEDORA_SRC_URI=()
670 +FEDORA_SOURCE=( $SOURCE1 $SOURCE12 $SOURCE13 )
671 +FEDORA_PATCH=( $PATCH1 $PATCH37 )
672 +for i in "${FEDORA_SOURCE[@]}" ; do
673 + FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH}&id=${FEDORA_GIT_COMMIT} -> ${P}_${FEDORA_GIT_COMMIT}_${i}" )
674 +done
675 +for i in "${FEDORA_PATCH[@]}" ; do # Already have a version prefix
676 + FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH}&id=${FEDORA_GIT_COMMIT} -> ${i%.patch}_${FEDORA_GIT_COMMIT}.patch" )
677 +done
678 +SRC_URI+=" bindist? ( ${FEDORA_SRC_URI[@]} )"
679 +
680 +S="${WORKDIR}/${MY_P}"
681 +
682 +MULTILIB_WRAPPED_HEADERS=(
683 + usr/include/openssl/opensslconf.h
684 +)
685 +
686 +PATCHES=(
687 + "${FILESDIR}"/${PN}-1.0.2a-x32-asm.patch #542618
688 + "${FILESDIR}"/${PN}-1.1.0j-parallel_install_fix.patch #671602
689 +)
690 +
691 +src_prepare() {
692 + if use bindist; then
693 + # we need to patch the patch but we cannot patch in DISTDIR...
694 + mkdir "${WORKDIR}"/fedora_patches || die
695 + for i in "${FEDORA_PATCH[@]}" ; do
696 + cp "${DISTDIR}"/"${i%.patch}_${FEDORA_GIT_COMMIT}.patch" "${WORKDIR}"/fedora_patches || die
697 + done
698 +
699 + # now patch the path, due to OpenSSL change cb193560e0da17a41b40ce574a2349f1d4d59ed1
700 + sed -i -e 's#test/evptests.txt#test/recipes/30-test_evp_data/evppkey.txt#g' \
701 + "${WORKDIR}"/fedora_patches/openssl-1.1.0-build_d2ede125556ac99aa0faa7744c703af3f559094e.patch || \
702 + die
703 +
704 + # This just removes the prefix, and puts it into WORKDIR like the RPM.
705 + for i in "${FEDORA_SOURCE[@]}" ; do
706 + cp -f "${DISTDIR}"/"${P}_${FEDORA_GIT_COMMIT}_${i}" "${WORKDIR}"/"${i}" || die
707 + done
708 + # .spec %prep
709 + bash "${WORKDIR}"/"${SOURCE1}" || die
710 + cp -f "${WORKDIR}"/"${SOURCE12}" "${S}"/crypto/ec/ || die
711 + cp -f "${WORKDIR}"/"${SOURCE13}" "${S}"/test/ || die
712 + for i in "${FEDORA_PATCH[@]}" ; do
713 + #eapply "${DISTDIR}"/"${i%.patch}_${FEDORA_GIT_COMMIT}.patch"
714 + eapply "${WORKDIR}/fedora_patches/${i%.patch}_${FEDORA_GIT_COMMIT}.patch"
715 + done
716 + # Also see the configure parts below:
717 + # enable-ec \
718 + # $(use_ssl !bindist ec2m) \
719 +
720 + fi
721 + # keep this in sync with app-misc/c_rehash
722 + SSL_CNF_DIR="/etc/ssl"
723 +
724 + # Make sure we only ever touch Makefile.org and avoid patching a file
725 + # that gets blown away anyways by the Configure script in src_configure
726 + rm -f Makefile
727 +
728 + if ! use vanilla ; then
729 + eapply "${PATCHES[@]}"
730 + fi
731 +
732 + eapply_user #332661
733 +
734 + # make sure the man pages are suffixed #302165
735 + # don't bother building man pages if they're disabled
736 + # Make DOCDIR Gentoo compliant
737 + sed -i \
738 + -e '/^MANSUFFIX/s:=.*:=ssl:' \
739 + -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
740 + -e $(has noman FEATURES \
741 + && echo '/^install:/s:install_docs::' \
742 + || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
743 + -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \
744 + Configurations/unix-Makefile.tmpl \
745 + || die
746 +
747 + # show the actual commands in the log
748 + sed -i '/^SET_X/s@=.*@=set -x@' Makefile.shared || die
749 +
750 + # quiet out unknown driver argument warnings since openssl
751 + # doesn't have well-split CFLAGS and we're making it even worse
752 + # and 'make depend' uses -Werror for added fun (#417795 again)
753 + [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
754 +
755 + # allow openssl to be cross-compiled
756 + cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
757 + chmod a+rx gentoo.config || die
758 +
759 + append-flags -fno-strict-aliasing
760 + append-flags $(test-flags-CC -Wa,--noexecstack)
761 + append-cppflags -DOPENSSL_NO_BUF_FREELISTS
762 +
763 + # Prefixify Configure shebang (#141906)
764 + sed \
765 + -e "1s,/usr/bin/env,${EPREFIX}&," \
766 + -i Configure || die
767 + # Remove test target when FEATURES=test isn't set
768 + if ! use test ; then
769 + sed \
770 + -e '/^$config{dirs}/s@ "test",@@' \
771 + -i Configure || die
772 + fi
773 + # The config script does stupid stuff to prompt the user. Kill it.
774 + sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
775 + ./config --test-sanity || die "I AM NOT SANE"
776 +
777 + multilib_copy_sources
778 +}
779 +
780 +multilib_src_configure() {
781 + unset APPS #197996
782 + unset SCRIPTS #312551
783 + unset CROSS_COMPILE #311473
784 +
785 + tc-export CC AR RANLIB RC
786 +
787 + # Clean out patent-or-otherwise-encumbered code
788 + # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher)
789 + # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
790 + # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
791 + # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2
792 + # RC5: Expired https://en.wikipedia.org/wiki/RC5
793 +
794 + use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
795 + echoit() { echo "$@" ; "$@" ; }
796 +
797 + local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
798 +
799 + # See if our toolchain supports __uint128_t. If so, it's 64bit
800 + # friendly and can use the nicely optimized code paths. #460790
801 + local ec_nistp_64_gcc_128
802 + # Disable it for now though #469976
803 + #if ! use bindist ; then
804 + # echo "__uint128_t i;" > "${T}"/128.c
805 + # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
806 + # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
807 + # fi
808 + #fi
809 +
810 + local sslout=$(./gentoo.config)
811 + einfo "Use configuration ${sslout:-(openssl knows best)}"
812 + local config="Configure"
813 + [[ -z ${sslout} ]] && config="config"
814 +
815 + # Fedora hobbled-EC needs 'no-ec2m'
816 + # 'srp' was restricted until early 2017 as well.
817 + # "disable-deprecated" option breaks too many consumers.
818 + # Don't set it without thorough revdeps testing.
819 + echoit \
820 + ./${config} \
821 + ${sslout} \
822 + $(use cpu_flags_x86_sse2 || echo "no-sse2") \
823 + enable-camellia \
824 + enable-ec \
825 + $(use_ssl !bindist ec2m) \
826 + enable-srp \
827 + $(use elibc_musl && echo "no-async") \
828 + ${ec_nistp_64_gcc_128} \
829 + enable-idea \
830 + enable-mdc2 \
831 + enable-rc5 \
832 + $(use_ssl asm) \
833 + $(use_ssl rfc3779) \
834 + $(use_ssl sctp) \
835 + $(use_ssl tls-heartbeat heartbeats) \
836 + $(use_ssl zlib) \
837 + --prefix="${EPREFIX}"/usr \
838 + --openssldir="${EPREFIX}"${SSL_CNF_DIR} \
839 + --libdir=$(get_libdir) \
840 + shared threads \
841 + || die
842 +
843 + # Clean out hardcoded flags that openssl uses
844 + # Fix quoting for sed
845 + local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \
846 + -e 's:^CFLAGS=::' \
847 + -e 's:-fomit-frame-pointer ::g' \
848 + -e 's:-O[0-9] ::g' \
849 + -e 's:-march=[-a-z0-9]* ::g' \
850 + -e 's:-mcpu=[-a-z0-9]* ::g' \
851 + -e 's:-m[a-z0-9]* ::g' \
852 + -e 's:\\:\\\\:g' \
853 + )
854 + sed -i \
855 + -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
856 + -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \
857 + Makefile || die
858 +}
859 +
860 +multilib_src_compile() {
861 + # depend is needed to use $confopts; it also doesn't matter
862 + # that it's -j1 as the code itself serializes subdirs
863 + emake -j1 depend
864 + emake all
865 +}
866 +
867 +multilib_src_test() {
868 + emake -j1 test
869 +}
870 +
871 +multilib_src_install() {
872 + emake DESTDIR="${D}" install
873 +}
874 +
875 +multilib_src_install_all() {
876 + # openssl installs perl version of c_rehash by default, but
877 + # we provide a shell version via app-misc/c_rehash
878 + rm "${ED%/}"/usr/bin/c_rehash || die
879 +
880 + dodoc CHANGES* FAQ NEWS README doc/*.txt doc/${PN}-c-indent.el
881 +
882 + # This is crappy in that the static archives are still built even
883 + # when USE=static-libs. But this is due to a failing in the openssl
884 + # build system: the static archives are built as PIC all the time.
885 + # Only way around this would be to manually configure+compile openssl
886 + # twice; once with shared lib support enabled and once without.
887 + use static-libs || rm -f "${ED%/}"/usr/lib*/lib*.a
888 +
889 + # create the certs directory
890 + keepdir ${SSL_CNF_DIR}/certs
891 +
892 + # Namespace openssl programs to prevent conflicts with other man pages
893 + cd "${ED%/}"/usr/share/man || die
894 + local m d s
895 + for m in $(find . -type f | xargs grep -L '#include') ; do
896 + d=${m%/*} ; d=${d#./} ; m=${m##*/}
897 + [[ ${m} == openssl.1* ]] && continue
898 + [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
899 + mv ${d}/{,ssl-}${m}
900 + # fix up references to renamed man pages
901 + sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
902 + ln -s ssl-${m} ${d}/openssl-${m}
903 + # locate any symlinks that point to this man page ... we assume
904 + # that any broken links are due to the above renaming
905 + for s in $(find -L ${d} -type l) ; do
906 + s=${s##*/}
907 + rm -f ${d}/${s}
908 + # We don't want to "|| die" here
909 + ln -s ssl-${m} ${d}/ssl-${s}
910 + ln -s ssl-${s} ${d}/openssl-${s}
911 + done
912 + done
913 + [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
914 +
915 + dodir /etc/sandbox.d #254521
916 + echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED%/}"/etc/sandbox.d/10openssl
917 +
918 + diropts -m0700
919 + keepdir ${SSL_CNF_DIR}/private
920 +}
921 +
922 +pkg_postinst() {
923 + ebegin "Running 'c_rehash ${EROOT%/}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
924 + c_rehash "${EROOT%/}${SSL_CNF_DIR}/certs" >/dev/null
925 + eend $?
926 +}
927
928 diff --git a/dev-libs/openssl/openssl-1.1.1c.ebuild b/dev-libs/openssl/openssl-1.1.1c.ebuild
929 new file mode 100644
930 index 00000000000..f4e635b13b6
931 --- /dev/null
932 +++ b/dev-libs/openssl/openssl-1.1.1c.ebuild
933 @@ -0,0 +1,298 @@
934 +# Copyright 1999-2019 Gentoo Authors
935 +# Distributed under the terms of the GNU General Public License v2
936 +
937 +EAPI=7
938 +
939 +inherit flag-o-matic toolchain-funcs multilib multilib-minimal
940 +
941 +MY_P=${P/_/-}
942 +DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
943 +HOMEPAGE="https://www.openssl.org/"
944 +SRC_URI="mirror://openssl/source/${MY_P}.tar.gz"
945 +
946 +LICENSE="openssl"
947 +SLOT="0/1.1" # .so version of libssl/libcrypto
948 +[[ "${PV}" = *_pre* ]] || \
949 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-linux"
950 +IUSE="+asm bindist elibc_musl rfc3779 sctp cpu_flags_x86_sse2 sslv3 static-libs test tls-heartbeat vanilla zlib"
951 +RESTRICT="!bindist? ( bindist )"
952 +
953 +RDEPEND=">=app-misc/c_rehash-1.7-r1
954 + zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )"
955 +DEPEND="${RDEPEND}
956 + >=dev-lang/perl-5
957 + sctp? ( >=net-misc/lksctp-tools-1.0.12 )
958 + test? (
959 + sys-apps/diffutils
960 + sys-devel/bc
961 + )"
962 +PDEPEND="app-misc/ca-certificates"
963 +
964 +PATCHES=(
965 + "${FILESDIR}"/${PN}-1.1.0j-parallel_install_fix.patch #671602
966 +)
967 +
968 +# This does not copy the entire Fedora patchset, but JUST the parts that
969 +# are needed to make it safe to use EC with RESTRICT=bindist.
970 +# See openssl.spec for the matching numbering of SourceNNN, PatchNNN
971 +SOURCE1=hobble-openssl
972 +SOURCE12=ec_curve.c
973 +SOURCE13=ectest.c
974 +PATCH37=openssl-1.1.1-ec-curves.patch
975 +FEDORA_GIT_BASE='https://src.fedoraproject.org/cgit/rpms/openssl.git/plain/'
976 +FEDORA_GIT_BRANCH='f29'
977 +FEDORA_SRC_URI=()
978 +FEDORA_SOURCE=( ${SOURCE1} ${SOURCE12} ${SOURCE13} )
979 +FEDORA_PATCH=( ${PATCH37} )
980 +for i in "${FEDORA_SOURCE[@]}" ; do
981 + FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${P}_${i}" )
982 +done
983 +for i in "${FEDORA_PATCH[@]}" ; do # Already have a version prefix
984 + FEDORA_SRC_URI+=( "${FEDORA_GIT_BASE}/${i}?h=${FEDORA_GIT_BRANCH} -> ${i}" )
985 +done
986 +SRC_URI+=" bindist? ( ${FEDORA_SRC_URI[@]} )"
987 +
988 +S="${WORKDIR}/${MY_P}"
989 +
990 +MULTILIB_WRAPPED_HEADERS=(
991 + usr/include/openssl/opensslconf.h
992 +)
993 +
994 +src_prepare() {
995 + if use bindist; then
996 + # This just removes the prefix, and puts it into WORKDIR like the RPM.
997 + for i in "${FEDORA_SOURCE[@]}" ; do
998 + cp -f "${DISTDIR}"/"${P}_${i}" "${WORKDIR}"/"${i}" || die
999 + done
1000 +
1001 + # .spec %prep
1002 + bash "${WORKDIR}"/"${SOURCE1}" || die
1003 + cp -f "${WORKDIR}"/"${SOURCE12}" "${S}"/crypto/ec/ || die
1004 + cp -f "${WORKDIR}"/"${SOURCE13}" "${S}"/test/ || die
1005 + for i in "${FEDORA_PATCH[@]}" ; do
1006 + if [[ "${i}" == "${PATCH37}" ]] ; then
1007 + # apply our own for OpenSSL 1.1.1b adjusted version of this patch
1008 + eapply "${FILESDIR}"/openssl-1.1.1b-ec-curves-patch.patch
1009 + else
1010 + eapply "${DISTDIR}"/"${i}"
1011 + fi
1012 + done
1013 + # Also see the configure parts below:
1014 + # enable-ec \
1015 + # $(use_ssl !bindist ec2m) \
1016 +
1017 + fi
1018 +
1019 + # keep this in sync with app-misc/c_rehash
1020 + SSL_CNF_DIR="/etc/ssl"
1021 +
1022 + # Make sure we only ever touch Makefile.org and avoid patching a file
1023 + # that gets blown away anyways by the Configure script in src_configure
1024 + rm -f Makefile
1025 +
1026 + if ! use vanilla ; then
1027 + if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]] ; then
1028 + [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}"
1029 + fi
1030 + fi
1031 +
1032 + eapply_user #332661
1033 +
1034 + # make sure the man pages are suffixed #302165
1035 + # don't bother building man pages if they're disabled
1036 + # Make DOCDIR Gentoo compliant
1037 + sed -i \
1038 + -e '/^MANSUFFIX/s:=.*:=ssl:' \
1039 + -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
1040 + -e $(has noman FEATURES \
1041 + && echo '/^install:/s:install_docs::' \
1042 + || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
1043 + -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \
1044 + Configurations/unix-Makefile.tmpl \
1045 + || die
1046 +
1047 + # quiet out unknown driver argument warnings since openssl
1048 + # doesn't have well-split CFLAGS and we're making it even worse
1049 + # and 'make depend' uses -Werror for added fun (#417795 again)
1050 + [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
1051 +
1052 + # allow openssl to be cross-compiled
1053 + cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
1054 + chmod a+rx gentoo.config || die
1055 +
1056 + append-flags -fno-strict-aliasing
1057 + append-flags $(test-flags-CC -Wa,--noexecstack)
1058 + append-cppflags -DOPENSSL_NO_BUF_FREELISTS
1059 +
1060 + # Prefixify Configure shebang (#141906)
1061 + sed \
1062 + -e "1s,/usr/bin/env,${EPREFIX}&," \
1063 + -i Configure || die
1064 + # Remove test target when FEATURES=test isn't set
1065 + if ! use test ; then
1066 + sed \
1067 + -e '/^$config{dirs}/s@ "test",@@' \
1068 + -i Configure || die
1069 + fi
1070 + # The config script does stupid stuff to prompt the user. Kill it.
1071 + sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
1072 + ./config --test-sanity || die "I AM NOT SANE"
1073 +
1074 + multilib_copy_sources
1075 +}
1076 +
1077 +multilib_src_configure() {
1078 + unset APPS #197996
1079 + unset SCRIPTS #312551
1080 + unset CROSS_COMPILE #311473
1081 +
1082 + tc-export CC AR RANLIB RC
1083 +
1084 + # Clean out patent-or-otherwise-encumbered code
1085 + # Camellia: Royalty Free https://en.wikipedia.org/wiki/Camellia_(cipher)
1086 + # IDEA: Expired https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
1087 + # EC: ????????? ??/??/2015 https://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
1088 + # MDC2: Expired https://en.wikipedia.org/wiki/MDC-2
1089 + # RC5: Expired https://en.wikipedia.org/wiki/RC5
1090 +
1091 + use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
1092 + echoit() { echo "$@" ; "$@" ; }
1093 +
1094 + local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
1095 +
1096 + # See if our toolchain supports __uint128_t. If so, it's 64bit
1097 + # friendly and can use the nicely optimized code paths. #460790
1098 + local ec_nistp_64_gcc_128
1099 + # Disable it for now though #469976
1100 + #if ! use bindist ; then
1101 + # echo "__uint128_t i;" > "${T}"/128.c
1102 + # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
1103 + # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
1104 + # fi
1105 + #fi
1106 +
1107 + local sslout=$(./gentoo.config)
1108 + einfo "Use configuration ${sslout:-(openssl knows best)}"
1109 + local config="Configure"
1110 + [[ -z ${sslout} ]] && config="config"
1111 +
1112 + # Fedora hobbled-EC needs 'no-ec2m'
1113 + # 'srp' was restricted until early 2017 as well.
1114 + # "disable-deprecated" option breaks too many consumers.
1115 + # Don't set it without thorough revdeps testing.
1116 + echoit \
1117 + ./${config} \
1118 + ${sslout} \
1119 + $(use cpu_flags_x86_sse2 || echo "no-sse2") \
1120 + enable-camellia \
1121 + enable-ec \
1122 + $(use_ssl !bindist ec2m) \
1123 + enable-srp \
1124 + $(use elibc_musl && echo "no-async") \
1125 + ${ec_nistp_64_gcc_128} \
1126 + enable-idea \
1127 + enable-mdc2 \
1128 + enable-rc5 \
1129 + $(use_ssl sslv3 ssl3) \
1130 + $(use_ssl sslv3 ssl3-method) \
1131 + $(use_ssl asm) \
1132 + $(use_ssl rfc3779) \
1133 + $(use_ssl sctp) \
1134 + $(use_ssl tls-heartbeat heartbeats) \
1135 + $(use_ssl zlib) \
1136 + --prefix="${EPREFIX}"/usr \
1137 + --openssldir="${EPREFIX}"${SSL_CNF_DIR} \
1138 + --libdir=$(get_libdir) \
1139 + shared threads \
1140 + || die
1141 +
1142 + # Clean out hardcoded flags that openssl uses
1143 + # Fix quoting for sed
1144 + local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \
1145 + -e 's:^CFLAGS=::' \
1146 + -e 's:-fomit-frame-pointer ::g' \
1147 + -e 's:-O[0-9] ::g' \
1148 + -e 's:-march=[-a-z0-9]* ::g' \
1149 + -e 's:-mcpu=[-a-z0-9]* ::g' \
1150 + -e 's:-m[a-z0-9]* ::g' \
1151 + -e 's:\\:\\\\:g' \
1152 + )
1153 + sed -i \
1154 + -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
1155 + -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \
1156 + Makefile || die
1157 +}
1158 +
1159 +multilib_src_compile() {
1160 + # depend is needed to use $confopts; it also doesn't matter
1161 + # that it's -j1 as the code itself serializes subdirs
1162 + emake -j1 depend
1163 + emake all
1164 +}
1165 +
1166 +multilib_src_test() {
1167 + emake -j1 test
1168 +}
1169 +
1170 +multilib_src_install() {
1171 + # We need to create $ED/usr on our own to avoid a race condition #665130
1172 + if [[ ! -d "${ED}/usr" ]]; then
1173 + # We can only create this directory once
1174 + mkdir "${ED}"/usr || die
1175 + fi
1176 +
1177 + emake DESTDIR="${D}" install
1178 +}
1179 +
1180 +multilib_src_install_all() {
1181 + # openssl installs perl version of c_rehash by default, but
1182 + # we provide a shell version via app-misc/c_rehash
1183 + rm "${ED}"/usr/bin/c_rehash || die
1184 +
1185 + dodoc CHANGES* FAQ NEWS README doc/*.txt doc/${PN}-c-indent.el
1186 +
1187 + # This is crappy in that the static archives are still built even
1188 + # when USE=static-libs. But this is due to a failing in the openssl
1189 + # build system: the static archives are built as PIC all the time.
1190 + # Only way around this would be to manually configure+compile openssl
1191 + # twice; once with shared lib support enabled and once without.
1192 + use static-libs || rm -f "${ED}"/usr/lib*/lib*.a
1193 +
1194 + # create the certs directory
1195 + keepdir ${SSL_CNF_DIR}/certs
1196 +
1197 + # Namespace openssl programs to prevent conflicts with other man pages
1198 + cd "${ED}"/usr/share/man || die
1199 + local m d s
1200 + for m in $(find . -type f | xargs grep -L '#include') ; do
1201 + d=${m%/*} ; d=${d#./} ; m=${m##*/}
1202 + [[ ${m} == openssl.1* ]] && continue
1203 + [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
1204 + mv ${d}/{,ssl-}${m}
1205 + # fix up references to renamed man pages
1206 + sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
1207 + ln -s ssl-${m} ${d}/openssl-${m}
1208 + # locate any symlinks that point to this man page ... we assume
1209 + # that any broken links are due to the above renaming
1210 + for s in $(find -L ${d} -type l) ; do
1211 + s=${s##*/}
1212 + rm -f ${d}/${s}
1213 + # We don't want to "|| die" here
1214 + ln -s ssl-${m} ${d}/ssl-${s}
1215 + ln -s ssl-${s} ${d}/openssl-${s}
1216 + done
1217 + done
1218 + [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
1219 +
1220 + dodir /etc/sandbox.d #254521
1221 + echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
1222 +
1223 + diropts -m0700
1224 + keepdir ${SSL_CNF_DIR}/private
1225 +}
1226 +
1227 +pkg_postinst() {
1228 + ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
1229 + c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null
1230 + eend $?
1231 +}