Browse code

openssl update

Hanno Böck authored on 19/03/2015 15:19:22
Showing 2 changed files
... ...
@@ -14,8 +14,10 @@ DIST openssl-1.0.1i.tar.gz 4422117 SHA256 3c179f46ca77069a6a0bac70212a9b3b838b2f
14 14
 DIST openssl-1.0.1j.tar.gz 4432964 SHA256 1b60ca8789ba6f03e8ef20da2293b8dc131c39d83814e775069f02d26354edf3 SHA512 a786bb99b68d88c1de79d3c5372767f091ebeefb5abc1d4883253fd3ab5a86af53389f5ff36fdd8faa27c5fb78be8bbff406392c373358697da80d250eadebb8 WHIRLPOOL 467aa3b02d04837e3281670401985e492d15b561c03b97246e3c8e61b0d3b1927332e3a226de4ed5bd02265a04fb31ce84c3501f4af9685633d00a9b43c56978
15 15
 DIST openssl-1.0.1k.tar.gz 4434910 SHA256 8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fcebe7a41c SHA512 8b000fbd1bf919d9913a314f99aedd48a69f6caa4ccf43237889e73e08cbe0d82bfc27e9c7c4cade09fc459f91d6c4a831a9b3fc8bca0344fb864eadd7d1e8e8 WHIRLPOOL 5236a966d610c971e473cfc30e5412a72eef116fd259ada9c50da08bcd4ca967f80bb19babf530b4e5b9f1f24e9275e00391eb2e12a26d4544f593e2b4ba20b8
16 16
 DIST openssl-1.0.2.tar.gz 5265809 SHA256 8c48baf3babe0d505d16cfc0cf272589c66d3624264098213db0fb00034728e9 SHA512 dea46225a5445edc4986b02b99fbc90153819374b9a9bfdd892b60cd18ac7fefaf21a7e9d2bb05d0e3bfa4d2704e0ee24b06cc8e7081a542d7598cc9e73c67c5 WHIRLPOOL fe628a38125390deb75728b31427c308efbf65637a569fd1f139f6313fea533514ef05bf3d01bbdc793f77eb259400c95c53074a294d32d73576939d16f22e25
17
+DIST openssl-1.0.2a.tar.gz 5262089 SHA256 15b6393c20030aab02c8e2fe0243cb1d1d18062f6c095d67bca91871dc7f324a SHA512 02d228578824add52b73433d64697706e6503c2334933fe8dd6b477f59c430977012c3c34da207096229a425e1dcb6f3ae806043894b5ac98c27bbcddb794dd4 WHIRLPOOL a590c71794f5d29b80afa28b18621b7535e96b714b3690d793c1422a90b09a89cbcb912841d400c5982a8197bb02c13051190e96ba0e4d530509b48b43067cd7
17 18
 DIST openssl-c_rehash.sh.1.7 4167 SHA256 4999ee79892f52bd6a4a7baba9fac62262454d573bbffd72685d3aae9e48cee0 SHA512 55e8c2e827750a4f375cb83c86bfe2d166c01ffa5d7e9b16657b72b38b747c8985dd2c98f854c911dfbbee2ff3e92aff39fdf089d979b2e3534b7685ee8b80da WHIRLPOOL c88f06a3b8651f76b6289552cccceb64e13f6697c5f0ce3ff114c781ce1c218912b8ee308af9d087cd76a9600fdacda1953175bff07d7d3eb21b0c0b7f4f1ce1
18 19
 EBUILD openssl-1.0.1i.ebuild 8776 SHA256 99e7d64748e9448cd1f3d8738e1a97b5daab3c56b3e5f0168186f6644d83bbd8 SHA512 e1b922da0678ac59ed09f4cffd714b45ba8e028aa844e089a4385391fcb4e02b7fc731f855e2537acf10e817710e06aa61fac91233db78a053416212e83a9bf2 WHIRLPOOL 3537527dde49f7fd39c73c7a4053c5bf44fdf3e2544fd7148019729abd01120c7f3fe85e83a38b89630ff0bb38b7d044e42234cfaf4cf68612b630900e5b209a
19 20
 EBUILD openssl-1.0.1j.ebuild 8848 SHA256 823be5d97748b5b7e6f134746f13850b5a97cbf4ad0639c7238367d741386cb6 SHA512 f426b8bcd82113fc27eb001491e2c5ff03f276fd449f3ab763b58e1e5366f75d77eb5bb26648130ed1775e418181cc9d4cc744e507185cb12855b117bd86096c WHIRLPOOL 690246218ae96ec269249c23b65f6ec5f59e3e19388cb2bcd2f1e125fc75ba43124e9f63dc5ea4b0af62fd8aee024a9cff5fddf9ddd123e6fe9dc3a164860c48
20 21
 EBUILD openssl-1.0.1k.ebuild 8848 SHA256 654fb54cb45c343adea6b81d0850a2f9a62c43bd663c3f2d9a402ab90af0f05f SHA512 4372499d07a14131a05f9f62ef99eab1a86b50ab12356d58037e5d7d3754450a6c35947811282ad990c4d1897bc9ce6a4e16bf60ce6926d532e308ad80d28264 WHIRLPOOL 8f4c9224f9637cccb1362a343cfd17cd6b322eb96b15f18f34e2e26c8688d4eb0278a48618eee61e771c65c0d22e11e19a5e81e1fefdca3c9faaca75d74d7930
21 22
 EBUILD openssl-1.0.2-r1.ebuild 8829 SHA256 b07881d45227d608973c699e146081b2d3d164b741cc127995d2537cc8bb5c95 SHA512 0dbaae39454349726633993ffb71596344b0898cfe420fcc315b07fa0d314e780e9b61a978881b2c091b113523fd0ab37410a771c831b58f8bcd2c67e5c84234 WHIRLPOOL 1b167afb27753e66aa474e23ca2df504e8e3d70d67428af8179e88b238350e988014d8d33f5fe683d4fb345c847b0d954a558b5b69d22836b154c4bc6c15738a
23
+EBUILD openssl-1.0.2a.ebuild 8937 SHA256 9c7fb1f83273b492cf63ade7dab998c606222ca0aa2bad5c42f1fdb30964c93d SHA512 956a6640f3ffa41afcaf9a54967a63ce8b23216d5c54949c460ca780ed536961f918e0c6ce34e9bee5b0011de9400eba150ffe1e6c87a053eeae8efb35048c44 WHIRLPOOL 99003d7ad1bc559998e6c8d625c24ef776b96fc715b842bef2e9fb302508049480dc65c5f29b49ce8779d00f939abc3c25558b625c41634ccd154c76098ee3df
22 24
new file mode 100644
... ...
@@ -0,0 +1,264 @@
1
+# Copyright 1999-2015 Gentoo Foundation
2
+# Distributed under the terms of the GNU General Public License v2
3
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-1.0.2-r2.ebuild,v 1.2 2015/03/04 16:41:25 vapier Exp $
4
+
5
+EAPI="4"
6
+
7
+inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
8
+
9
+REV="1.7"
10
+MY_P=${P/_/-}
11
+DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
12
+HOMEPAGE="http://www.openssl.org/"
13
+SRC_URI="mirror://openssl/source/${MY_P}.tar.gz
14
+	http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/${PN}/${PN}-c_rehash.sh?rev=${REV} -> ${PN}-c_rehash.sh.${REV}"
15
+
16
+LICENSE="openssl"
17
+SLOT="0"
18
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
19
+IUSE="bindist gmp kerberos rfc3779 sctp cpu_flags_x86_sse2 static-libs test +tls-heartbeat vanilla zlib insecure-ssl2 insecure-ssl3"
20
+
21
+# The blocks are temporary just to make sure people upgrade to a
22
+# version that lack runtime version checking.  We'll drop them in
23
+# the future.
24
+RDEPEND="gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
25
+	zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
26
+	kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )
27
+	abi_x86_32? (
28
+		!<=app-emulation/emul-linux-x86-baselibs-20140508
29
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
30
+	)
31
+	!<net-misc/openssh-5.9_p1-r4
32
+	!<net-libs/neon-0.29.6-r1"
33
+DEPEND="${RDEPEND}
34
+	sys-apps/diffutils
35
+	>=dev-lang/perl-5
36
+	sctp? ( >=net-misc/lksctp-tools-1.0.12 )
37
+	test? ( sys-devel/bc )"
38
+PDEPEND="app-misc/ca-certificates"
39
+
40
+S="${WORKDIR}/${MY_P}"
41
+
42
+MULTILIB_WRAPPED_HEADERS=(
43
+	usr/include/openssl/opensslconf.h
44
+)
45
+
46
+src_prepare() {
47
+	SSL_CNF_DIR="/etc/ssl"
48
+	sed \
49
+		-e "/^DIR=/s:=.*:=${EPREFIX}${SSL_CNF_DIR}:" \
50
+		-e "s:SSL_CMD=/usr:SSL_CMD=${EPREFIX}/usr:" \
51
+		"${DISTDIR}"/${PN}-c_rehash.sh.${REV} \
52
+		> "${WORKDIR}"/c_rehash || die #416717
53
+
54
+	# Make sure we only ever touch Makefile.org and avoid patching a file
55
+	# that gets blown away anyways by the Configure script in src_configure
56
+	rm -f Makefile
57
+
58
+	#epatch "${FILESDIR}"/${P}-CVE-2015-0209.patch #541502
59
+	#epatch "${FILESDIR}"/${P}-CVE-2015-0288.patch #542038
60
+	if ! use vanilla ; then
61
+		epatch "${FILESDIR}"/${PN}-1.0.0a-ldflags.patch #327421
62
+		epatch "${FILESDIR}"/${PN}-1.0.0d-windres.patch #373743
63
+		epatch "${FILESDIR}"/${PN}-1.0.2-parallel-build.patch
64
+		epatch "${FILESDIR}"/${PN}-1.0.2-ipv6.patch
65
+		epatch "${FILESDIR}"/${PN}-1.0.2-s_client-verify.patch #472584
66
+
67
+		epatch_user #332661
68
+	fi
69
+
70
+	# disable fips in the build
71
+	# make sure the man pages are suffixed #302165
72
+	# don't bother building man pages if they're disabled
73
+	sed -i \
74
+		-e '/DIRS/s: fips : :g' \
75
+		-e '/^MANSUFFIX/s:=.*:=ssl:' \
76
+		-e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
77
+		-e $(has noman FEATURES \
78
+			&& echo '/^install:/s:install_docs::' \
79
+			|| echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
80
+		Makefile.org \
81
+		|| die
82
+	# show the actual commands in the log
83
+	sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
84
+
85
+	# since we're forcing $(CC) as makedep anyway, just fix
86
+	# the conditional as always-on
87
+	# helps clang (#417795), and versioned gcc (#499818)
88
+	sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die
89
+
90
+	# quiet out unknown driver argument warnings since openssl
91
+	# doesn't have well-split CFLAGS and we're making it even worse
92
+	# and 'make depend' uses -Werror for added fun (#417795 again)
93
+	[[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
94
+
95
+	# allow openssl to be cross-compiled
96
+	cp "${FILESDIR}"/gentoo.config-1.0.1 gentoo.config || die
97
+	chmod a+rx gentoo.config
98
+
99
+	append-flags -fno-strict-aliasing
100
+	append-flags $(test-flags-CC -Wa,--noexecstack)
101
+	append-cppflags -DOPENSSL_NO_BUF_FREELISTS
102
+
103
+	sed -i '1s,^:$,#!'${EPREFIX}'/usr/bin/perl,' Configure #141906
104
+	# The config script does stupid stuff to prompt the user.  Kill it.
105
+	sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
106
+	./config --test-sanity || die "I AM NOT SANE"
107
+
108
+	multilib_copy_sources
109
+}
110
+
111
+multilib_src_configure() {
112
+	unset APPS #197996
113
+	unset SCRIPTS #312551
114
+	unset CROSS_COMPILE #311473
115
+
116
+	tc-export CC AR RANLIB RC
117
+
118
+	# Clean out patent-or-otherwise-encumbered code
119
+	# Camellia: Royalty Free            http://en.wikipedia.org/wiki/Camellia_(cipher)
120
+	# IDEA:     Expired                 http://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
121
+	# EC:       ????????? ??/??/2015    http://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
122
+	# MDC2:     Expired                 http://en.wikipedia.org/wiki/MDC-2
123
+	# RC5:      Expirted                http://en.wikipedia.org/wiki/RC5
124
+
125
+	use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
126
+	echoit() { echo "$@" ; "$@" ; }
127
+
128
+	local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
129
+
130
+	# See if our toolchain supports __uint128_t.  If so, it's 64bit
131
+	# friendly and can use the nicely optimized code paths. #460790
132
+	local ec_nistp_64_gcc_128
133
+	# Disable it for now though #469976
134
+	#if ! use bindist ; then
135
+	#	echo "__uint128_t i;" > "${T}"/128.c
136
+	#	if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
137
+	#		ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
138
+	#	fi
139
+	#fi
140
+
141
+	local sslout=$(./gentoo.config)
142
+	einfo "Use configuration ${sslout:-(openssl knows best)}"
143
+	local config="Configure"
144
+	[[ -z ${sslout} ]] && config="config"
145
+
146
+	echoit \
147
+	./${config} \
148
+		${sslout} \
149
+		$(use sctp && echo "sctp") \
150
+		$(use cpu_flags_x86_sse2 || echo "no-sse2") \
151
+		enable-camellia \
152
+ 		$(use_ssl insecure-ssl2 ssl2) \
153
+ 		$(use_ssl insecure-ssl3 ssl3) \
154
+
155
+		$(use_ssl !bindist ec) \
156
+		${ec_nistp_64_gcc_128} \
157
+		enable-idea \
158
+		enable-mdc2 \
159
+		enable-rc5 \
160
+		enable-tlsext \
161
+		$(use_ssl gmp gmp -lgmp) \
162
+		$(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \
163
+		$(use_ssl rfc3779) \
164
+		$(use_ssl tls-heartbeat heartbeats) \
165
+		$(use_ssl zlib) \
166
+		--prefix="${EPREFIX}"/usr \
167
+		--openssldir="${EPREFIX}"${SSL_CNF_DIR} \
168
+		--libdir=$(get_libdir) \
169
+		shared threads \
170
+		|| die
171
+
172
+	# Clean out hardcoded flags that openssl uses
173
+	local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
174
+		-e 's:^CFLAG=::' \
175
+		-e 's:-fomit-frame-pointer ::g' \
176
+		-e 's:-O[0-9] ::g' \
177
+		-e 's:-march=[-a-z0-9]* ::g' \
178
+		-e 's:-mcpu=[-a-z0-9]* ::g' \
179
+		-e 's:-m[a-z0-9]* ::g' \
180
+	)
181
+	sed -i \
182
+		-e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
183
+		-e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
184
+		Makefile || die
185
+}
186
+
187
+multilib_src_compile() {
188
+	# depend is needed to use $confopts; it also doesn't matter
189
+	# that it's -j1 as the code itself serializes subdirs
190
+	emake -j1 depend
191
+	emake all
192
+	# rehash is needed to prep the certs/ dir; do this
193
+	# separately to avoid parallel build issues.
194
+	emake rehash
195
+}
196
+
197
+multilib_src_test() {
198
+	emake -j1 test
199
+}
200
+
201
+multilib_src_install() {
202
+	emake INSTALL_PREFIX="${D}" install
203
+}
204
+
205
+multilib_src_install_all() {
206
+	dobin "${WORKDIR}"/c_rehash #333117
207
+	dodoc CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el
208
+	dohtml -r doc/*
209
+	use rfc3779 && dodoc engines/ccgost/README.gost
210
+
211
+	# This is crappy in that the static archives are still built even
212
+	# when USE=static-libs.  But this is due to a failing in the openssl
213
+	# build system: the static archives are built as PIC all the time.
214
+	# Only way around this would be to manually configure+compile openssl
215
+	# twice; once with shared lib support enabled and once without.
216
+	use static-libs || rm -f "${ED}"/usr/lib*/lib*.a
217
+
218
+	# create the certs directory
219
+	dodir ${SSL_CNF_DIR}/certs
220
+	cp -RP certs/* "${ED}"${SSL_CNF_DIR}/certs/ || die
221
+	rm -r "${ED}"${SSL_CNF_DIR}/certs/{demo,expired}
222
+
223
+	# Namespace openssl programs to prevent conflicts with other man pages
224
+	cd "${ED}"/usr/share/man
225
+	local m d s
226
+	for m in $(find . -type f | xargs grep -L '#include') ; do
227
+		d=${m%/*} ; d=${d#./} ; m=${m##*/}
228
+		[[ ${m} == openssl.1* ]] && continue
229
+		[[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
230
+		mv ${d}/{,ssl-}${m}
231
+		# fix up references to renamed man pages
232
+		sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
233
+		ln -s ssl-${m} ${d}/openssl-${m}
234
+		# locate any symlinks that point to this man page ... we assume
235
+		# that any broken links are due to the above renaming
236
+		for s in $(find -L ${d} -type l) ; do
237
+			s=${s##*/}
238
+			rm -f ${d}/${s}
239
+			ln -s ssl-${m} ${d}/ssl-${s}
240
+			ln -s ssl-${s} ${d}/openssl-${s}
241
+		done
242
+	done
243
+	[[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
244
+
245
+	dodir /etc/sandbox.d #254521
246
+	echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
247
+
248
+	diropts -m0700
249
+	keepdir ${SSL_CNF_DIR}/private
250
+}
251
+
252
+pkg_preinst() {
253
+	has_version ${CATEGORY}/${PN}:0.9.8 && return 0
254
+	preserve_old_lib /usr/$(get_libdir)/lib{crypto,ssl}.so.0.9.8
255
+}
256
+
257
+pkg_postinst() {
258
+	ebegin "Running 'c_rehash ${EROOT%/}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
259
+	c_rehash "${EROOT%/}${SSL_CNF_DIR}/certs" >/dev/null
260
+	eend $?
261
+
262
+	has_version ${CATEGORY}/${PN}:0.9.8 && return 0
263
+	preserve_old_lib_notify /usr/$(get_libdir)/lib{crypto,ssl}.so.0.9.8
264
+}