1 |
commit: 3f612dc6e8123864c4bdbf03440301918ff62a6c |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 22 23:08:07 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 22 23:08:19 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f612dc6 |
7 |
|
8 |
dev-libs/nss: security cleanup (bug #750254) |
9 |
|
10 |
Package-Manager: Portage-3.0.12, Repoman-3.0.2 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
dev-libs/nss/Manifest | 1 - |
14 |
dev-libs/nss/nss-3.56.ebuild | 359 ------------------------------------------- |
15 |
2 files changed, 360 deletions(-) |
16 |
|
17 |
diff --git a/dev-libs/nss/Manifest b/dev-libs/nss/Manifest |
18 |
index bcb4d937030..23a2d7aed51 100644 |
19 |
--- a/dev-libs/nss/Manifest |
20 |
+++ b/dev-libs/nss/Manifest |
21 |
@@ -1,4 +1,3 @@ |
22 |
-DIST nss-3.56.tar.gz 81706176 BLAKE2B 84c3b9fd649ce38ad843725b180982692dcac34e851734813b959734054f2e9ebfad66496de320f46e861381f6d5f52db0cc4c0953f7504b79f6b529b871f173 SHA512 f2eed8252c13b38a4d80a11203136d22a521205f814b6d954cc119ccf8921fcb8f689d919944bea4739d1575e9bda7e13cf2ad054ac91d51e049abe246efc845 |
23 |
DIST nss-3.58.tar.gz 81846254 BLAKE2B f8e7d0b231916b197ad21706a057d055f8377059d76d4f09aff523cc4cd071a3184f02dc488259df22109b70be7b8a5d5fa7ea2273a830de825cc9a8c95dcca9 SHA512 03d2ab1517ac07620ea3f02dcf680cf019e0129006ff2559b2d0a047036340c20b98c9679b17a594e5502aa30e158caf309f046901b9ec7c7adeeaa13ec50b80 |
24 |
DIST nss-3.59.tar.gz 82141516 BLAKE2B 74959b14ec42b4628dfc3365af00420cdbd41d202541e9379f6a4448c4496b76307af48c9ec405b370f8770327ce56742b4382f8cd49724b42732ce5cc5b0779 SHA512 8963e846f2ff7222457ae59f042672cf4e44f7752807226f46c215a772fd1cbd65d0ce634da4afb698eabd4eb1c1e78146cc2a089339ada11da03d259c609a38 |
25 |
DIST nss-3.60.tar.gz 82035831 BLAKE2B fffc0e26d58d4625be1b8b0123f248a0c7994b18868ece534ba4d60131dd4897d075d7b2dba672c31ccd333e0c18ea384e2aa2f495c23b5430d6d10b91922873 SHA512 6463b2da28b5d9f1f20d45f77a3179e2b93c874af5742c7fc51eb7c44cef93270acacf79174dc63905f227256cbcee23a36f98f1cfed10dd5c56ffc0a76e2695 |
26 |
|
27 |
diff --git a/dev-libs/nss/nss-3.56.ebuild b/dev-libs/nss/nss-3.56.ebuild |
28 |
deleted file mode 100644 |
29 |
index fd9f45030fa..00000000000 |
30 |
--- a/dev-libs/nss/nss-3.56.ebuild |
31 |
+++ /dev/null |
32 |
@@ -1,359 +0,0 @@ |
33 |
-# Copyright 1999-2020 Gentoo Authors |
34 |
-# Distributed under the terms of the GNU General Public License v2 |
35 |
- |
36 |
-EAPI=7 |
37 |
- |
38 |
-inherit eutils flag-o-matic multilib toolchain-funcs multilib-minimal |
39 |
- |
40 |
-NSPR_VER="4.28" |
41 |
-RTM_NAME="NSS_${PV//./_}_RTM" |
42 |
- |
43 |
-DESCRIPTION="Mozilla's Network Security Services library that implements PKI support" |
44 |
-HOMEPAGE="http://www.mozilla.org/projects/security/pki/nss/" |
45 |
-SRC_URI="https://archive.mozilla.org/pub/security/nss/releases/${RTM_NAME}/src/${P}.tar.gz |
46 |
- cacert? ( https://dev.gentoo.org/~axs/distfiles/${PN}-cacert-class1-class3.patch )" |
47 |
- |
48 |
-LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )" |
49 |
-SLOT="0" |
50 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
51 |
-IUSE="cacert utils" |
52 |
-# pkg-config called by nss-config -> virtual/pkgconfig in RDEPEND |
53 |
-RDEPEND=" |
54 |
- >=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}] |
55 |
- >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}] |
56 |
- >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] |
57 |
- virtual/pkgconfig |
58 |
-" |
59 |
-DEPEND="${RDEPEND}" |
60 |
- |
61 |
-RESTRICT="test" |
62 |
- |
63 |
-S="${WORKDIR}/${P}/${PN}" |
64 |
- |
65 |
-MULTILIB_CHOST_TOOLS=( |
66 |
- /usr/bin/nss-config |
67 |
-) |
68 |
- |
69 |
-PATCHES=( |
70 |
- # Custom changes for gentoo |
71 |
- "${FILESDIR}/${PN}-3.53-gentoo-fixups.patch" |
72 |
- "${FILESDIR}/${PN}-3.21-gentoo-fixup-warnings.patch" |
73 |
- "${FILESDIR}/${PN}-3.23-hppa-byte_order.patch" |
74 |
- "${FILESDIR}/${PN}-3.53-fix-building-on-ppc.patch" |
75 |
-) |
76 |
- |
77 |
-src_prepare() { |
78 |
- if use cacert ; then #521462 |
79 |
- PATCHES+=( |
80 |
- "${DISTDIR}/${PN}-cacert-class1-class3.patch" |
81 |
- ) |
82 |
- fi |
83 |
- |
84 |
- default |
85 |
- |
86 |
- pushd coreconf >/dev/null || die |
87 |
- # hack nspr paths |
88 |
- echo 'INCLUDES += -I$(DIST)/include/dbm' \ |
89 |
- >> headers.mk || die "failed to append include" |
90 |
- |
91 |
- # modify install path |
92 |
- sed -e '/CORE_DEPTH/s:SOURCE_PREFIX.*$:SOURCE_PREFIX = $(CORE_DEPTH)/dist:' \ |
93 |
- -i source.mk || die |
94 |
- |
95 |
- # Respect LDFLAGS |
96 |
- sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' rules.mk |
97 |
- popd >/dev/null || die |
98 |
- |
99 |
- # Fix pkgconfig file for Prefix |
100 |
- sed -i -e "/^PREFIX =/s:= /usr:= ${EPREFIX}/usr:" \ |
101 |
- config/Makefile || die |
102 |
- |
103 |
- # use host shlibsign if need be #436216 |
104 |
- if tc-is-cross-compiler ; then |
105 |
- sed -i \ |
106 |
- -e 's:"${2}"/shlibsign:shlibsign:' \ |
107 |
- cmd/shlibsign/sign.sh || die |
108 |
- fi |
109 |
- |
110 |
- # dirty hack |
111 |
- sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../freebl/\$(OBJDIR):" \ |
112 |
- lib/ssl/config.mk || die |
113 |
- sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../../lib/freebl/\$(OBJDIR):" \ |
114 |
- cmd/platlibs.mk || die |
115 |
- |
116 |
- multilib_copy_sources |
117 |
- |
118 |
- strip-flags |
119 |
-} |
120 |
- |
121 |
-multilib_src_configure() { |
122 |
- # Ensure we stay multilib aware |
123 |
- sed -i -e "/@libdir@/ s:lib64:$(get_libdir):" config/Makefile || die |
124 |
-} |
125 |
- |
126 |
-nssarch() { |
127 |
- # Most of the arches are the same as $ARCH |
128 |
- local t=${1:-${CHOST}} |
129 |
- case ${t} in |
130 |
- aarch64*)echo "aarch64";; |
131 |
- hppa*) echo "parisc";; |
132 |
- i?86*) echo "i686";; |
133 |
- x86_64*) echo "x86_64";; |
134 |
- *) tc-arch ${t};; |
135 |
- esac |
136 |
-} |
137 |
- |
138 |
-nssbits() { |
139 |
- local cc cppflags="${1}CPPFLAGS" cflags="${1}CFLAGS" |
140 |
- if [[ ${1} == BUILD_ ]]; then |
141 |
- cc=$(tc-getBUILD_CC) |
142 |
- else |
143 |
- cc=$(tc-getCC) |
144 |
- fi |
145 |
- echo > "${T}"/test.c || die |
146 |
- ${cc} ${!cppflags} ${!cflags} -c "${T}"/test.c -o "${T}/${1}test.o" || die |
147 |
- case $(file "${T}/${1}test.o") in |
148 |
- *32-bit*x86-64*) echo USE_X32=1;; |
149 |
- *64-bit*|*ppc64*|*x86_64*) echo USE_64=1;; |
150 |
- *32-bit*|*ppc*|*i386*) ;; |
151 |
- *) die "Failed to detect whether ${cc} builds 64bits or 32bits, disable distcc if you're using it, please";; |
152 |
- esac |
153 |
-} |
154 |
- |
155 |
-multilib_src_compile() { |
156 |
- # use ABI to determine bit'ness, or fallback if unset |
157 |
- local buildbits mybits |
158 |
- case "${ABI}" in |
159 |
- n32) mybits="USE_N32=1";; |
160 |
- x32) mybits="USE_X32=1";; |
161 |
- s390x|*64) mybits="USE_64=1";; |
162 |
- ${DEFAULT_ABI}) |
163 |
- einfo "Running compilation test to determine bit'ness" |
164 |
- mybits=$(nssbits) |
165 |
- ;; |
166 |
- esac |
167 |
- # bitness of host may differ from target |
168 |
- if tc-is-cross-compiler; then |
169 |
- buildbits=$(nssbits BUILD_) |
170 |
- fi |
171 |
- |
172 |
- local makeargs=( |
173 |
- CC="$(tc-getCC)" |
174 |
- CCC="$(tc-getCXX)" |
175 |
- AR="$(tc-getAR) rc \$@" |
176 |
- RANLIB="$(tc-getRANLIB)" |
177 |
- OPTIMIZER= |
178 |
- ${mybits} |
179 |
- ) |
180 |
- |
181 |
- # Take care of nspr settings #436216 |
182 |
- local myCPPFLAGS="${CPPFLAGS} $($(tc-getPKG_CONFIG) nspr --cflags)" |
183 |
- unset NSPR_INCLUDE_DIR |
184 |
- |
185 |
- export NSS_ALLOW_SSLKEYLOGFILE=1 |
186 |
- export NSS_ENABLE_WERROR=0 #567158 |
187 |
- export BUILD_OPT=1 |
188 |
- export NSS_USE_SYSTEM_SQLITE=1 |
189 |
- export NSDISTMODE=copy |
190 |
- export FREEBL_NO_DEPEND=1 |
191 |
- export FREEBL_LOWHASH=1 |
192 |
- export NSS_SEED_ONLY_DEV_URANDOM=1 |
193 |
- export USE_SYSTEM_ZLIB=1 |
194 |
- export ZLIB_LIBS=-lz |
195 |
- export ASFLAGS="" |
196 |
- # Fix build failure on arm64 |
197 |
- export NS_USE_GCC=1 |
198 |
- # Detect compiler type and set proper environment value |
199 |
- if tc-is-gcc; then |
200 |
- export CC_IS_GCC=1 |
201 |
- elif tc-is-clang; then |
202 |
- export CC_IS_CLANG=1 |
203 |
- fi |
204 |
- |
205 |
- local d |
206 |
- |
207 |
- # Build the host tools first. |
208 |
- LDFLAGS="${BUILD_LDFLAGS}" \ |
209 |
- XCFLAGS="${BUILD_CFLAGS}" \ |
210 |
- NSPR_LIB_DIR="${T}/fakedir" \ |
211 |
- emake -j1 -C coreconf \ |
212 |
- CC="$(tc-getBUILD_CC)" \ |
213 |
- ${buildbits-${mybits}} |
214 |
- makeargs+=( NSINSTALL="${PWD}/$(find -type f -name nsinstall)" ) |
215 |
- |
216 |
- # Then build the target tools. |
217 |
- for d in . lib/dbm ; do |
218 |
- CPPFLAGS="${myCPPFLAGS}" \ |
219 |
- XCFLAGS="${CFLAGS} ${CPPFLAGS}" \ |
220 |
- NSPR_LIB_DIR="${T}/fakedir" \ |
221 |
- emake -j1 "${makeargs[@]}" -C ${d} OS_TEST="$(nssarch)" |
222 |
- done |
223 |
-} |
224 |
- |
225 |
-# Altering these 3 libraries breaks the CHK verification. |
226 |
-# All of the following cause it to break: |
227 |
-# - stripping |
228 |
-# - prelink |
229 |
-# - ELF signing |
230 |
-# http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html |
231 |
-# Either we have to NOT strip them, or we have to forcibly resign after |
232 |
-# stripping. |
233 |
-#local_libdir="$(get_libdir)" |
234 |
-#export STRIP_MASK=" |
235 |
-# */${local_libdir}/libfreebl3.so* |
236 |
-# */${local_libdir}/libnssdbm3.so* |
237 |
-# */${local_libdir}/libsoftokn3.so*" |
238 |
- |
239 |
-export NSS_CHK_SIGN_LIBS="freebl3 nssdbm3 softokn3" |
240 |
- |
241 |
-generate_chk() { |
242 |
- local shlibsign="$1" |
243 |
- local libdir="$2" |
244 |
- einfo "Resigning core NSS libraries for FIPS validation" |
245 |
- shift 2 |
246 |
- local i |
247 |
- for i in ${NSS_CHK_SIGN_LIBS} ; do |
248 |
- local libname=lib${i}.so |
249 |
- local chkname=lib${i}.chk |
250 |
- "${shlibsign}" \ |
251 |
- -i "${libdir}"/${libname} \ |
252 |
- -o "${libdir}"/${chkname}.tmp \ |
253 |
- && mv -f \ |
254 |
- "${libdir}"/${chkname}.tmp \ |
255 |
- "${libdir}"/${chkname} \ |
256 |
- || die "Failed to sign ${libname}" |
257 |
- done |
258 |
-} |
259 |
- |
260 |
-cleanup_chk() { |
261 |
- local libdir="$1" |
262 |
- shift 1 |
263 |
- local i |
264 |
- for i in ${NSS_CHK_SIGN_LIBS} ; do |
265 |
- local libfname="${libdir}/lib${i}.so" |
266 |
- # If the major version has changed, then we have old chk files. |
267 |
- [ ! -f "${libfname}" -a -f "${libfname}.chk" ] \ |
268 |
- && rm -f "${libfname}.chk" |
269 |
- done |
270 |
-} |
271 |
- |
272 |
-multilib_src_install() { |
273 |
- pushd dist >/dev/null || die |
274 |
- |
275 |
- dodir /usr/$(get_libdir) |
276 |
- cp -L */lib/*$(get_libname) "${ED}"/usr/$(get_libdir) || die "copying shared libs failed" |
277 |
- local i |
278 |
- for i in crmf freebl nssb nssckfw ; do |
279 |
- cp -L */lib/lib${i}.a "${ED}"/usr/$(get_libdir) || die "copying libs failed" |
280 |
- done |
281 |
- |
282 |
- # Install nss-config and pkgconfig file |
283 |
- dodir /usr/bin |
284 |
- cp -L */bin/nss-config "${ED}"/usr/bin || die |
285 |
- dodir /usr/$(get_libdir)/pkgconfig |
286 |
- cp -L */lib/pkgconfig/nss.pc "${ED}"/usr/$(get_libdir)/pkgconfig || die |
287 |
- |
288 |
- # create an nss-softokn.pc from nss.pc for libfreebl and some private headers |
289 |
- # bug 517266 |
290 |
- sed -e 's#Libs:#Libs: -lfreebl#' \ |
291 |
- -e 's#Cflags:#Cflags: -I${includedir}/private#' \ |
292 |
- */lib/pkgconfig/nss.pc >"${ED}"/usr/$(get_libdir)/pkgconfig/nss-softokn.pc \ |
293 |
- || die "could not create nss-softokn.pc" |
294 |
- |
295 |
- # all the include files |
296 |
- insinto /usr/include/nss |
297 |
- doins public/nss/*.{h,api} |
298 |
- insinto /usr/include/nss/private |
299 |
- doins private/nss/{blapi,alghmac,cmac}.h |
300 |
- |
301 |
- popd >/dev/null || die |
302 |
- |
303 |
- local f nssutils |
304 |
- # Always enabled because we need it for chk generation. |
305 |
- nssutils=( shlibsign ) |
306 |
- |
307 |
- if multilib_is_native_abi ; then |
308 |
- if use utils; then |
309 |
- # The tests we do not need to install. |
310 |
- #nssutils_test="bltest crmftest dbtest dertimetest |
311 |
- #fipstest remtest sdrtest" |
312 |
- # checkcert utils has been removed in nss-3.22: |
313 |
- # https://bugzilla.mozilla.org/show_bug.cgi?id=1187545 |
314 |
- # https://hg.mozilla.org/projects/nss/rev/df1729d37870 |
315 |
- # certcgi has been removed in nss-3.36: |
316 |
- # https://bugzilla.mozilla.org/show_bug.cgi?id=1426602 |
317 |
- nssutils+=( |
318 |
- addbuiltin |
319 |
- atob |
320 |
- baddbdir |
321 |
- btoa |
322 |
- certutil |
323 |
- cmsutil |
324 |
- conflict |
325 |
- crlutil |
326 |
- derdump |
327 |
- digest |
328 |
- makepqg |
329 |
- mangle |
330 |
- modutil |
331 |
- multinit |
332 |
- nonspr10 |
333 |
- ocspclnt |
334 |
- oidcalc |
335 |
- p7content |
336 |
- p7env |
337 |
- p7sign |
338 |
- p7verify |
339 |
- pk11mode |
340 |
- pk12util |
341 |
- pp |
342 |
- rsaperf |
343 |
- selfserv |
344 |
- signtool |
345 |
- signver |
346 |
- ssltap |
347 |
- strsclnt |
348 |
- symkeyutil |
349 |
- tstclnt |
350 |
- vfychain |
351 |
- vfyserv |
352 |
- ) |
353 |
- # install man-pages for utils (bug #516810) |
354 |
- doman doc/nroff/*.1 |
355 |
- fi |
356 |
- pushd dist/*/bin >/dev/null || die |
357 |
- for f in ${nssutils[@]}; do |
358 |
- dobin ${f} |
359 |
- done |
360 |
- popd >/dev/null || die |
361 |
- fi |
362 |
- |
363 |
- # Prelink breaks the CHK files. We don't have any reliable way to run |
364 |
- # shlibsign after prelink. |
365 |
- dodir /etc/prelink.conf.d |
366 |
- printf -- "-b ${EPREFIX}/usr/$(get_libdir)/lib%s.so\n" ${NSS_CHK_SIGN_LIBS} \ |
367 |
- > "${ED}"/etc/prelink.conf.d/nss.conf |
368 |
-} |
369 |
- |
370 |
-pkg_postinst() { |
371 |
- multilib_pkg_postinst() { |
372 |
- # We must re-sign the libraries AFTER they are stripped. |
373 |
- local shlibsign="${EROOT}/usr/bin/shlibsign" |
374 |
- # See if we can execute it (cross-compiling & such). #436216 |
375 |
- "${shlibsign}" -h >&/dev/null |
376 |
- if [[ $? -gt 1 ]] ; then |
377 |
- shlibsign="shlibsign" |
378 |
- fi |
379 |
- generate_chk "${shlibsign}" "${EROOT}"/usr/$(get_libdir) |
380 |
- } |
381 |
- |
382 |
- multilib_foreach_abi multilib_pkg_postinst |
383 |
-} |
384 |
- |
385 |
-pkg_postrm() { |
386 |
- multilib_pkg_postrm() { |
387 |
- cleanup_chk "${EROOT}"/usr/$(get_libdir) |
388 |
- } |
389 |
- |
390 |
- multilib_foreach_abi multilib_pkg_postrm |
391 |
-} |