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/nss/, dev-libs/nss/files/
Date: Fri, 16 Apr 2021 11:35:05
Message-Id: 1618572840.d81e6654725a8f93a3046cdd1c018612bffe7b2e.whissi@gentoo
1 commit: d81e6654725a8f93a3046cdd1c018612bffe7b2e
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 16 10:54:22 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 16 11:34:00 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d81e6654
7
8 dev-libs/nss: drop old
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.3
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 dev-libs/nss/Manifest | 2 -
14 .../nss/files/nss-3.53-fix-building-on-ppc.patch | 39 ---
15 ...8-always-tolerate-the-first-CCS-in-TLS1.3.patch | 200 ------------
16 dev-libs/nss/nss-3.58-r2.ebuild | 360 ---------------------
17 dev-libs/nss/nss-3.62.ebuild | 359 --------------------
18 5 files changed, 960 deletions(-)
19
20 diff --git a/dev-libs/nss/Manifest b/dev-libs/nss/Manifest
21 index c54a531abad..94f7cbcc143 100644
22 --- a/dev-libs/nss/Manifest
23 +++ b/dev-libs/nss/Manifest
24 @@ -1,4 +1,2 @@
25 -DIST nss-3.58.tar.gz 81846254 BLAKE2B f8e7d0b231916b197ad21706a057d055f8377059d76d4f09aff523cc4cd071a3184f02dc488259df22109b70be7b8a5d5fa7ea2273a830de825cc9a8c95dcca9 SHA512 03d2ab1517ac07620ea3f02dcf680cf019e0129006ff2559b2d0a047036340c20b98c9679b17a594e5502aa30e158caf309f046901b9ec7c7adeeaa13ec50b80
26 -DIST nss-3.62.tar.gz 82159506 BLAKE2B 9abd7504766fb57214a16608a7299f8cf6d25c9a4e285665eabd812bce536ba244b698de31fd53796148f3856e4bee6c8a03ce5b6c5234a9337d7af8f300f007 SHA512 7044008ea8e5d6f658da96e202a896e24a1ffa29d7ca862f32ed37cfa09adf8c2d5fbc371e3af6bc5151b2d1216c38207976b41888d5ad8efd4dc3049cb5831d
27 DIST nss-3.63.tar.gz 82167087 BLAKE2B 3db1aea3aea8373ba8e285a5a87e8b5e39107af8cc5977701fb2fe29b6e7657dba1b1ea3bf80aa0768b0d5f6d130cacc3e029eec69b071a0d87da0825860ffd9 SHA512 2f1f75dce7fd049453cbcf53263a3d9d4d9e62ad2cc2fef4dd0d5645fe14dad4ce47ed64aae507a09214d7fccbe83c142844121f55b44783e5a1bcfe24ea671c
28 DIST nss-cacert-class1-class3.patch 22950 BLAKE2B 9d5e60df5f161a3c27c41e5a9419440a54f888eda454e3cde5ebe626d4075b65cf9938b5144d0fb022377f4bd415bff5e5c67d104409860aa9391b3eb8872c68 SHA512 a5aa740bf110a3f0262e3f1ef2fc739ac2b44f042e220039d48aee8e97cd764d5c10718220364f4098aba955882bd02cadb5481512388971a8290312f88a7df0
29
30 diff --git a/dev-libs/nss/files/nss-3.53-fix-building-on-ppc.patch b/dev-libs/nss/files/nss-3.53-fix-building-on-ppc.patch
31 deleted file mode 100644
32 index 962b9cb1eed..00000000000
33 --- a/dev-libs/nss/files/nss-3.53-fix-building-on-ppc.patch
34 +++ /dev/null
35 @@ -1,39 +0,0 @@
36 -https://bugzilla.mozilla.org/show_bug.cgi?id=1642174
37 -
38 -From a7a862bab5e4aae4615ddae3cbe230345f92ed0d Mon Sep 17 00:00:00 2001
39 -From: Lauri Kasanen <cand@×××.com>
40 -Date: Mon, 1 Jun 2020 12:11:45 +0300
41 -Subject: [PATCH v3] Bug 1642174 /usr/bin/ld: OBJS/Linux_SINGLE_SHLIB/sha512-p8.o:
42 - ABI version 2 is not compatible with ABI version 1 output
43 -
44 -Don't try to build the SHA-2 accelerated asm on old-ABI ppc.
45 -
46 -Currently make only, I don't have enough gyp-fu to do that side.
47 -However, the reporters of 1642174 and 1635625 both used make, not gyp.
48 -
49 -Signed-off-by: Lauri Kasanen <cand@×××.com>
50 ----
51 - lib/freebl/Makefile | 5 ++++-
52 - 1 file changed, 4 insertions(+), 1 deletion(-)
53 -
54 -diff --git a/lib/freebl/Makefile b/lib/freebl/Makefile
55 -index 5f7384429..e0461c7d3 100644
56 ---- a/lib/freebl/Makefile
57 -+++ b/lib/freebl/Makefile
58 -@@ -267,9 +267,12 @@ ifeq ($(CPU_ARCH),arm)
59 - endif
60 - ifeq ($(CPU_ARCH),ppc)
61 - EXTRA_SRCS += gcm-ppc.c
62 -- ASFILES += sha512-p8.s
63 - ifdef USE_64
64 - DEFINES += -DNSS_NO_INIT_SUPPORT
65 -+ PPC_ABI := $(shell $(CC) -dM -E - < /dev/null | awk '$$2 == "_CALL_ELF" {print $$3}')
66 -+ ifeq ($(PPC_ABI),2)
67 -+ ASFILES += sha512-p8.s
68 -+ endif
69 - endif # USE_64
70 - endif # ppc
71 - endif # Linux
72 ---
73 -2.19.1
74 -
75
76 diff --git a/dev-libs/nss/files/nss-3.58-always-tolerate-the-first-CCS-in-TLS1.3.patch b/dev-libs/nss/files/nss-3.58-always-tolerate-the-first-CCS-in-TLS1.3.patch
77 deleted file mode 100644
78 index a92c0389936..00000000000
79 --- a/dev-libs/nss/files/nss-3.58-always-tolerate-the-first-CCS-in-TLS1.3.patch
80 +++ /dev/null
81 @@ -1,200 +0,0 @@
82 -
83 -# HG changeset patch
84 -# User Daiki Ueno <dueno@××××××.com>
85 -# Date 1603691171 -3600
86 -# Node ID b03a4fc5b902498414b02640dcb2717dfef9682f
87 -# Parent 6f79a76958129dc09c353c288f115fd9a51ab7d4
88 -Bug 1672703, always tolerate the first CCS in TLS 1.3, r=mt
89 -
90 -Summary:
91 -This flips the meaning of the flag for checking excessive CCS
92 -messages, so it only rejects multiple CCS messages while the first CCS
93 -message is always accepted.
94 -
95 -Reviewers: mt
96 -
97 -Reviewed By: mt
98 -
99 -Bug #: 1672703
100 -
101 -Differential Revision: https://phabricator.services.mozilla.com/D94603
102 -
103 ---- a/gtests/ssl_gtest/ssl_tls13compat_unittest.cc
104 -+++ b/gtests/ssl_gtest/ssl_tls13compat_unittest.cc
105 -@@ -343,29 +343,28 @@ TEST_F(TlsConnectStreamTls13, ChangeCiph
106 - // Client sends CCS before starting the handshake.
107 - client_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs)));
108 - client_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs)));
109 - ConnectExpectAlert(server_, kTlsAlertUnexpectedMessage);
110 - server_->CheckErrorCode(SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER);
111 - client_->CheckErrorCode(SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT);
112 - }
113 -
114 --// The server rejects a ChangeCipherSpec if the client advertises an
115 --// empty session ID.
116 -+// The server accepts a ChangeCipherSpec even if the client advertises
117 -+// an empty session ID.
118 - TEST_F(TlsConnectStreamTls13, ChangeCipherSpecAfterClientHelloEmptySid) {
119 - EnsureTlsSetup();
120 - ConfigureVersion(SSL_LIBRARY_VERSION_TLS_1_3);
121 -
122 - StartConnect();
123 - client_->Handshake(); // Send ClientHello
124 - client_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs))); // Send CCS
125 -
126 -- server_->ExpectSendAlert(kTlsAlertUnexpectedMessage);
127 -- server_->Handshake(); // Consume ClientHello and CCS
128 -- server_->CheckErrorCode(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
129 -+ Handshake();
130 -+ CheckConnected();
131 - }
132 -
133 - // The server rejects multiple ChangeCipherSpec even if the client
134 - // indicates compatibility mode with non-empty session ID.
135 - TEST_F(Tls13CompatTest, ChangeCipherSpecAfterClientHelloTwice) {
136 - EnsureTlsSetup();
137 - ConfigureVersion(SSL_LIBRARY_VERSION_TLS_1_3);
138 - EnableCompatMode();
139 -@@ -376,36 +375,37 @@ TEST_F(Tls13CompatTest, ChangeCipherSpec
140 - client_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs)));
141 - client_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs)));
142 -
143 - server_->ExpectSendAlert(kTlsAlertUnexpectedMessage);
144 - server_->Handshake(); // Consume ClientHello and CCS.
145 - server_->CheckErrorCode(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
146 - }
147 -
148 --// The client rejects a ChangeCipherSpec if it advertises an empty
149 -+// The client accepts a ChangeCipherSpec even if it advertises an empty
150 - // session ID.
151 - TEST_F(TlsConnectStreamTls13, ChangeCipherSpecAfterServerHelloEmptySid) {
152 - EnsureTlsSetup();
153 - ConfigureVersion(SSL_LIBRARY_VERSION_TLS_1_3);
154 -
155 - // To replace Finished with a CCS below
156 - auto filter = MakeTlsFilter<TlsHandshakeDropper>(server_);
157 - filter->SetHandshakeTypes({kTlsHandshakeFinished});
158 - filter->EnableDecryption();
159 -
160 - StartConnect();
161 - client_->Handshake(); // Send ClientHello
162 - server_->Handshake(); // Consume ClientHello, and
163 - // send ServerHello..CertificateVerify
164 - // Send CCS
165 - server_->SendDirect(DataBuffer(kCannedCcs, sizeof(kCannedCcs)));
166 -- client_->ExpectSendAlert(kTlsAlertUnexpectedMessage);
167 -- client_->Handshake(); // Consume ClientHello and CCS
168 -- client_->CheckErrorCode(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
169 -+
170 -+ // No alert is sent from the client. As Finished is dropped, we
171 -+ // can't use Handshake() and CheckConnected().
172 -+ client_->Handshake();
173 - }
174 -
175 - // The client rejects multiple ChangeCipherSpec in a row even if the
176 - // client indicates compatibility mode with non-empty session ID.
177 - TEST_F(Tls13CompatTest, ChangeCipherSpecAfterServerHelloTwice) {
178 - EnsureTlsSetup();
179 - ConfigureVersion(SSL_LIBRARY_VERSION_TLS_1_3);
180 - EnableCompatMode();
181 ---- a/lib/ssl/ssl3con.c
182 -+++ b/lib/ssl/ssl3con.c
183 -@@ -6640,21 +6640,17 @@ ssl_CheckServerSessionIdCorrectness(sslS
184 - if (sentFakeSid) {
185 - return !sidMatch;
186 - }
187 - return PR_TRUE;
188 - }
189 -
190 - /* TLS 1.3: We sent a session ID. The server's should match. */
191 - if (!IS_DTLS(ss) && (sentRealSid || sentFakeSid)) {
192 -- if (sidMatch) {
193 -- ss->ssl3.hs.allowCcs = PR_TRUE;
194 -- return PR_TRUE;
195 -- }
196 -- return PR_FALSE;
197 -+ return sidMatch;
198 - }
199 -
200 - /* TLS 1.3 (no SID)/DTLS 1.3: The server shouldn't send a session ID. */
201 - return sidBytes->len == 0;
202 - }
203 -
204 - static SECStatus
205 - ssl_CheckServerRandom(sslSocket *ss)
206 -@@ -8691,17 +8687,16 @@ ssl3_HandleClientHello(sslSocket *ss, PR
207 - if (sidBytes.len > 0 && !IS_DTLS(ss)) {
208 - SECITEM_FreeItem(&ss->ssl3.hs.fakeSid, PR_FALSE);
209 - rv = SECITEM_CopyItem(NULL, &ss->ssl3.hs.fakeSid, &sidBytes);
210 - if (rv != SECSuccess) {
211 - desc = internal_error;
212 - errCode = PORT_GetError();
213 - goto alert_loser;
214 - }
215 -- ss->ssl3.hs.allowCcs = PR_TRUE;
216 - }
217 -
218 - /* TLS 1.3 requires that compression include only null. */
219 - if (comps.len != 1 || comps.data[0] != ssl_compression_null) {
220 - goto alert_loser;
221 - }
222 -
223 - /* If there is a cookie, then this is a second ClientHello (TLS 1.3). */
224 -@@ -13061,25 +13056,24 @@ ssl3_HandleRecord(sslSocket *ss, SSL3Cip
225 - * will fail if the server fails to negotiate compatibility mode in a
226 - * 0-RTT session that is resumed from a session that did negotiate it.
227 - * We don't care about that corner case right now. */
228 - if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3 &&
229 - cText->hdr[0] == ssl_ct_change_cipher_spec &&
230 - ss->ssl3.hs.ws != idle_handshake &&
231 - cText->buf->len == 1 &&
232 - cText->buf->buf[0] == change_cipher_spec_choice) {
233 -- if (ss->ssl3.hs.allowCcs) {
234 -- /* Ignore the first CCS. */
235 -- ss->ssl3.hs.allowCcs = PR_FALSE;
236 -+ if (!ss->ssl3.hs.rejectCcs) {
237 -+ /* Allow only the first CCS. */
238 -+ ss->ssl3.hs.rejectCcs = PR_TRUE;
239 - return SECSuccess;
240 -- }
241 --
242 -- /* Compatibility mode is not negotiated. */
243 -- alert = unexpected_message;
244 -- PORT_SetError(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
245 -+ } else {
246 -+ alert = unexpected_message;
247 -+ PORT_SetError(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
248 -+ }
249 - }
250 -
251 - if ((IS_DTLS(ss) && !dtls13_AeadLimitReached(spec)) ||
252 - (!IS_DTLS(ss) && ss->sec.isServer &&
253 - ss->ssl3.hs.zeroRttIgnore == ssl_0rtt_ignore_trial)) {
254 - /* Silently drop the packet unless we sent a fatal alert. */
255 - if (ss->ssl3.fatalAlertSent) {
256 - return SECFailure;
257 ---- a/lib/ssl/sslimpl.h
258 -+++ b/lib/ssl/sslimpl.h
259 -@@ -705,20 +705,17 @@ typedef struct SSL3HandshakeStateStr {
260 - sslZeroRttIgnore zeroRttIgnore; /* Are we ignoring 0-RTT? */
261 - ssl3CipherSuite zeroRttSuite; /* The cipher suite we used for 0-RTT. */
262 - PRCList bufferedEarlyData; /* Buffered TLS 1.3 early data
263 - * on server.*/
264 - PRBool helloRetry; /* True if HelloRetryRequest has been sent
265 - * or received. */
266 - PRBool receivedCcs; /* A server received ChangeCipherSpec
267 - * before the handshake started. */
268 -- PRBool allowCcs; /* A server allows ChangeCipherSpec
269 -- * as the middlebox compatibility mode
270 -- * is explicitly indicarted by
271 -- * legacy_session_id in TLS 1.3 ClientHello. */
272 -+ PRBool rejectCcs; /* Excessive ChangeCipherSpecs are rejected. */
273 - PRBool clientCertRequested; /* True if CertificateRequest received. */
274 - PRBool endOfFlight; /* Processed a full flight (DTLS 1.3). */
275 - ssl3KEADef kea_def_mutable; /* Used to hold the writable kea_def
276 - * we use for TLS 1.3 */
277 - PRUint16 ticketNonce; /* A counter we use for tickets. */
278 - SECItem fakeSid; /* ... (server) the SID the client used. */
279 -
280 - /* rttEstimate is used to guess the round trip time between server and client.
281 -
282
283 diff --git a/dev-libs/nss/nss-3.58-r2.ebuild b/dev-libs/nss/nss-3.58-r2.ebuild
284 deleted file mode 100644
285 index 8ca8cd6f203..00000000000
286 --- a/dev-libs/nss/nss-3.58-r2.ebuild
287 +++ /dev/null
288 @@ -1,360 +0,0 @@
289 -# Copyright 1999-2021 Gentoo Authors
290 -# Distributed under the terms of the GNU General Public License v2
291 -
292 -EAPI=7
293 -
294 -inherit flag-o-matic multilib toolchain-funcs multilib-minimal
295 -
296 -NSPR_VER="4.29"
297 -RTM_NAME="NSS_${PV//./_}_RTM"
298 -
299 -DESCRIPTION="Mozilla's Network Security Services library that implements PKI support"
300 -HOMEPAGE="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS"
301 -SRC_URI="https://archive.mozilla.org/pub/security/nss/releases/${RTM_NAME}/src/${P}.tar.gz
302 - cacert? ( https://dev.gentoo.org/~axs/distfiles/${PN}-cacert-class1-class3.patch )"
303 -
304 -LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
305 -SLOT="0"
306 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
307 -IUSE="cacert utils"
308 -# pkg-config called by nss-config -> virtual/pkgconfig in RDEPEND
309 -RDEPEND="
310 - >=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}]
311 - >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}]
312 - >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
313 - virtual/pkgconfig
314 -"
315 -DEPEND="${RDEPEND}"
316 -
317 -RESTRICT="test"
318 -
319 -S="${WORKDIR}/${P}/${PN}"
320 -
321 -MULTILIB_CHOST_TOOLS=(
322 - /usr/bin/nss-config
323 -)
324 -
325 -PATCHES=(
326 - # Custom changes for gentoo
327 - "${FILESDIR}/${PN}-3.53-gentoo-fixups.patch"
328 - "${FILESDIR}/${PN}-3.21-gentoo-fixup-warnings.patch"
329 - "${FILESDIR}/${PN}-3.23-hppa-byte_order.patch"
330 - "${FILESDIR}/${PN}-3.53-fix-building-on-ppc.patch"
331 - "${FILESDIR}/${PN}-3.58-always-tolerate-the-first-CCS-in-TLS1.3.patch"
332 -)
333 -
334 -src_prepare() {
335 - if use cacert ; then #521462
336 - PATCHES+=(
337 - "${DISTDIR}/${PN}-cacert-class1-class3.patch"
338 - )
339 - fi
340 -
341 - default
342 -
343 - pushd coreconf >/dev/null || die
344 - # hack nspr paths
345 - echo 'INCLUDES += -I$(DIST)/include/dbm' \
346 - >> headers.mk || die "failed to append include"
347 -
348 - # modify install path
349 - sed -e '/CORE_DEPTH/s:SOURCE_PREFIX.*$:SOURCE_PREFIX = $(CORE_DEPTH)/dist:' \
350 - -i source.mk || die
351 -
352 - # Respect LDFLAGS
353 - sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' rules.mk
354 - popd >/dev/null || die
355 -
356 - # Fix pkgconfig file for Prefix
357 - sed -i -e "/^PREFIX =/s:= /usr:= ${EPREFIX}/usr:" \
358 - config/Makefile || die
359 -
360 - # use host shlibsign if need be #436216
361 - if tc-is-cross-compiler ; then
362 - sed -i \
363 - -e 's:"${2}"/shlibsign:shlibsign:' \
364 - cmd/shlibsign/sign.sh || die
365 - fi
366 -
367 - # dirty hack
368 - sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../freebl/\$(OBJDIR):" \
369 - lib/ssl/config.mk || die
370 - sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../../lib/freebl/\$(OBJDIR):" \
371 - cmd/platlibs.mk || die
372 -
373 - multilib_copy_sources
374 -
375 - strip-flags
376 -}
377 -
378 -multilib_src_configure() {
379 - # Ensure we stay multilib aware
380 - sed -i -e "/@libdir@/ s:lib64:$(get_libdir):" config/Makefile || die
381 -}
382 -
383 -nssarch() {
384 - # Most of the arches are the same as $ARCH
385 - local t=${1:-${CHOST}}
386 - case ${t} in
387 - aarch64*)echo "aarch64";;
388 - hppa*) echo "parisc";;
389 - i?86*) echo "i686";;
390 - x86_64*) echo "x86_64";;
391 - *) tc-arch ${t};;
392 - esac
393 -}
394 -
395 -nssbits() {
396 - local cc cppflags="${1}CPPFLAGS" cflags="${1}CFLAGS"
397 - if [[ ${1} == BUILD_ ]]; then
398 - cc=$(tc-getBUILD_CC)
399 - else
400 - cc=$(tc-getCC)
401 - fi
402 - echo > "${T}"/test.c || die
403 - ${cc} ${!cppflags} ${!cflags} -c "${T}"/test.c -o "${T}/${1}test.o" || die
404 - case $(file "${T}/${1}test.o") in
405 - *32-bit*x86-64*) echo USE_X32=1;;
406 - *64-bit*|*ppc64*|*x86_64*) echo USE_64=1;;
407 - *32-bit*|*ppc*|*i386*) ;;
408 - *) die "Failed to detect whether ${cc} builds 64bits or 32bits, disable distcc if you're using it, please";;
409 - esac
410 -}
411 -
412 -multilib_src_compile() {
413 - # use ABI to determine bit'ness, or fallback if unset
414 - local buildbits mybits
415 - case "${ABI}" in
416 - n32) mybits="USE_N32=1";;
417 - x32) mybits="USE_X32=1";;
418 - s390x|*64) mybits="USE_64=1";;
419 - ${DEFAULT_ABI})
420 - einfo "Running compilation test to determine bit'ness"
421 - mybits=$(nssbits)
422 - ;;
423 - esac
424 - # bitness of host may differ from target
425 - if tc-is-cross-compiler; then
426 - buildbits=$(nssbits BUILD_)
427 - fi
428 -
429 - local makeargs=(
430 - CC="$(tc-getCC)"
431 - CCC="$(tc-getCXX)"
432 - AR="$(tc-getAR) rc \$@"
433 - RANLIB="$(tc-getRANLIB)"
434 - OPTIMIZER=
435 - ${mybits}
436 - )
437 -
438 - # Take care of nspr settings #436216
439 - local myCPPFLAGS="${CPPFLAGS} $($(tc-getPKG_CONFIG) nspr --cflags)"
440 - unset NSPR_INCLUDE_DIR
441 -
442 - export NSS_ALLOW_SSLKEYLOGFILE=1
443 - export NSS_ENABLE_WERROR=0 #567158
444 - export BUILD_OPT=1
445 - export NSS_USE_SYSTEM_SQLITE=1
446 - export NSDISTMODE=copy
447 - export FREEBL_NO_DEPEND=1
448 - export FREEBL_LOWHASH=1
449 - export NSS_SEED_ONLY_DEV_URANDOM=1
450 - export USE_SYSTEM_ZLIB=1
451 - export ZLIB_LIBS=-lz
452 - export ASFLAGS=""
453 - # Fix build failure on arm64
454 - export NS_USE_GCC=1
455 - # Detect compiler type and set proper environment value
456 - if tc-is-gcc; then
457 - export CC_IS_GCC=1
458 - elif tc-is-clang; then
459 - export CC_IS_CLANG=1
460 - fi
461 -
462 - local d
463 -
464 - # Build the host tools first.
465 - LDFLAGS="${BUILD_LDFLAGS}" \
466 - XCFLAGS="${BUILD_CFLAGS}" \
467 - NSPR_LIB_DIR="${T}/fakedir" \
468 - emake -j1 -C coreconf \
469 - CC="$(tc-getBUILD_CC)" \
470 - ${buildbits-${mybits}}
471 - makeargs+=( NSINSTALL="${PWD}/$(find -type f -name nsinstall)" )
472 -
473 - # Then build the target tools.
474 - for d in . lib/dbm ; do
475 - CPPFLAGS="${myCPPFLAGS}" \
476 - XCFLAGS="${CFLAGS} ${CPPFLAGS}" \
477 - NSPR_LIB_DIR="${T}/fakedir" \
478 - emake -j1 "${makeargs[@]}" -C ${d} OS_TEST="$(nssarch)"
479 - done
480 -}
481 -
482 -# Altering these 3 libraries breaks the CHK verification.
483 -# All of the following cause it to break:
484 -# - stripping
485 -# - prelink
486 -# - ELF signing
487 -# http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html
488 -# Either we have to NOT strip them, or we have to forcibly resign after
489 -# stripping.
490 -#local_libdir="$(get_libdir)"
491 -#export STRIP_MASK="
492 -# */${local_libdir}/libfreebl3.so*
493 -# */${local_libdir}/libnssdbm3.so*
494 -# */${local_libdir}/libsoftokn3.so*"
495 -
496 -export NSS_CHK_SIGN_LIBS="freebl3 nssdbm3 softokn3"
497 -
498 -generate_chk() {
499 - local shlibsign="$1"
500 - local libdir="$2"
501 - einfo "Resigning core NSS libraries for FIPS validation"
502 - shift 2
503 - local i
504 - for i in ${NSS_CHK_SIGN_LIBS} ; do
505 - local libname=lib${i}.so
506 - local chkname=lib${i}.chk
507 - "${shlibsign}" \
508 - -i "${libdir}"/${libname} \
509 - -o "${libdir}"/${chkname}.tmp \
510 - && mv -f \
511 - "${libdir}"/${chkname}.tmp \
512 - "${libdir}"/${chkname} \
513 - || die "Failed to sign ${libname}"
514 - done
515 -}
516 -
517 -cleanup_chk() {
518 - local libdir="$1"
519 - shift 1
520 - local i
521 - for i in ${NSS_CHK_SIGN_LIBS} ; do
522 - local libfname="${libdir}/lib${i}.so"
523 - # If the major version has changed, then we have old chk files.
524 - [ ! -f "${libfname}" -a -f "${libfname}.chk" ] \
525 - && rm -f "${libfname}.chk"
526 - done
527 -}
528 -
529 -multilib_src_install() {
530 - pushd dist >/dev/null || die
531 -
532 - dodir /usr/$(get_libdir)
533 - cp -L */lib/*$(get_libname) "${ED}"/usr/$(get_libdir) || die "copying shared libs failed"
534 - local i
535 - for i in crmf freebl nssb nssckfw ; do
536 - cp -L */lib/lib${i}.a "${ED}"/usr/$(get_libdir) || die "copying libs failed"
537 - done
538 -
539 - # Install nss-config and pkgconfig file
540 - dodir /usr/bin
541 - cp -L */bin/nss-config "${ED}"/usr/bin || die
542 - dodir /usr/$(get_libdir)/pkgconfig
543 - cp -L */lib/pkgconfig/nss.pc "${ED}"/usr/$(get_libdir)/pkgconfig || die
544 -
545 - # create an nss-softokn.pc from nss.pc for libfreebl and some private headers
546 - # bug 517266
547 - sed -e 's#Libs:#Libs: -lfreebl#' \
548 - -e 's#Cflags:#Cflags: -I${includedir}/private#' \
549 - */lib/pkgconfig/nss.pc >"${ED}"/usr/$(get_libdir)/pkgconfig/nss-softokn.pc \
550 - || die "could not create nss-softokn.pc"
551 -
552 - # all the include files
553 - insinto /usr/include/nss
554 - doins public/nss/*.{h,api}
555 - insinto /usr/include/nss/private
556 - doins private/nss/{blapi,alghmac,cmac}.h
557 -
558 - popd >/dev/null || die
559 -
560 - local f nssutils
561 - # Always enabled because we need it for chk generation.
562 - nssutils=( shlibsign )
563 -
564 - if multilib_is_native_abi ; then
565 - if use utils; then
566 - # The tests we do not need to install.
567 - #nssutils_test="bltest crmftest dbtest dertimetest
568 - #fipstest remtest sdrtest"
569 - # checkcert utils has been removed in nss-3.22:
570 - # https://bugzilla.mozilla.org/show_bug.cgi?id=1187545
571 - # https://hg.mozilla.org/projects/nss/rev/df1729d37870
572 - # certcgi has been removed in nss-3.36:
573 - # https://bugzilla.mozilla.org/show_bug.cgi?id=1426602
574 - nssutils+=(
575 - addbuiltin
576 - atob
577 - baddbdir
578 - btoa
579 - certutil
580 - cmsutil
581 - conflict
582 - crlutil
583 - derdump
584 - digest
585 - makepqg
586 - mangle
587 - modutil
588 - multinit
589 - nonspr10
590 - ocspclnt
591 - oidcalc
592 - p7content
593 - p7env
594 - p7sign
595 - p7verify
596 - pk11mode
597 - pk12util
598 - pp
599 - rsaperf
600 - selfserv
601 - signtool
602 - signver
603 - ssltap
604 - strsclnt
605 - symkeyutil
606 - tstclnt
607 - vfychain
608 - vfyserv
609 - )
610 - # install man-pages for utils (bug #516810)
611 - doman doc/nroff/*.1
612 - fi
613 - pushd dist/*/bin >/dev/null || die
614 - for f in ${nssutils[@]}; do
615 - dobin ${f}
616 - done
617 - popd >/dev/null || die
618 - fi
619 -
620 - # Prelink breaks the CHK files. We don't have any reliable way to run
621 - # shlibsign after prelink.
622 - dodir /etc/prelink.conf.d
623 - printf -- "-b ${EPREFIX}/usr/$(get_libdir)/lib%s.so\n" ${NSS_CHK_SIGN_LIBS} \
624 - > "${ED}"/etc/prelink.conf.d/nss.conf
625 -}
626 -
627 -pkg_postinst() {
628 - multilib_pkg_postinst() {
629 - # We must re-sign the libraries AFTER they are stripped.
630 - local shlibsign="${EROOT}/usr/bin/shlibsign"
631 - # See if we can execute it (cross-compiling & such). #436216
632 - "${shlibsign}" -h >&/dev/null
633 - if [[ $? -gt 1 ]] ; then
634 - shlibsign="shlibsign"
635 - fi
636 - generate_chk "${shlibsign}" "${EROOT}"/usr/$(get_libdir)
637 - }
638 -
639 - multilib_foreach_abi multilib_pkg_postinst
640 -}
641 -
642 -pkg_postrm() {
643 - multilib_pkg_postrm() {
644 - cleanup_chk "${EROOT}"/usr/$(get_libdir)
645 - }
646 -
647 - multilib_foreach_abi multilib_pkg_postrm
648 -}
649
650 diff --git a/dev-libs/nss/nss-3.62.ebuild b/dev-libs/nss/nss-3.62.ebuild
651 deleted file mode 100644
652 index 5e3240e8db8..00000000000
653 --- a/dev-libs/nss/nss-3.62.ebuild
654 +++ /dev/null
655 @@ -1,359 +0,0 @@
656 -# Copyright 1999-2021 Gentoo Authors
657 -# Distributed under the terms of the GNU General Public License v2
658 -
659 -EAPI=7
660 -
661 -inherit flag-o-matic multilib toolchain-funcs multilib-minimal
662 -
663 -NSPR_VER="4.29"
664 -RTM_NAME="NSS_${PV//./_}_RTM"
665 -
666 -DESCRIPTION="Mozilla's Network Security Services library that implements PKI support"
667 -HOMEPAGE="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS"
668 -SRC_URI="https://archive.mozilla.org/pub/security/nss/releases/${RTM_NAME}/src/${P}.tar.gz
669 - cacert? ( https://dev.gentoo.org/~axs/distfiles/${PN}-cacert-class1-class3.patch )"
670 -
671 -LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
672 -SLOT="0"
673 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
674 -IUSE="cacert utils"
675 -# pkg-config called by nss-config -> virtual/pkgconfig in RDEPEND
676 -RDEPEND="
677 - >=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}]
678 - >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}]
679 - >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
680 - virtual/pkgconfig
681 -"
682 -DEPEND="${RDEPEND}"
683 -
684 -RESTRICT="test"
685 -
686 -S="${WORKDIR}/${P}/${PN}"
687 -
688 -MULTILIB_CHOST_TOOLS=(
689 - /usr/bin/nss-config
690 -)
691 -
692 -PATCHES=(
693 - # Custom changes for gentoo
694 - "${FILESDIR}/${PN}-3.53-gentoo-fixups.patch"
695 - "${FILESDIR}/${PN}-3.21-gentoo-fixup-warnings.patch"
696 - "${FILESDIR}/${PN}-3.23-hppa-byte_order.patch"
697 -)
698 -
699 -src_prepare() {
700 - if use cacert ; then #521462
701 - PATCHES+=(
702 - "${DISTDIR}/${PN}-cacert-class1-class3.patch"
703 - )
704 - fi
705 -
706 - default
707 -
708 - pushd coreconf >/dev/null || die
709 - # hack nspr paths
710 - echo 'INCLUDES += -I$(DIST)/include/dbm' \
711 - >> headers.mk || die "failed to append include"
712 -
713 - # modify install path
714 - sed -e '/CORE_DEPTH/s:SOURCE_PREFIX.*$:SOURCE_PREFIX = $(CORE_DEPTH)/dist:' \
715 - -i source.mk || die
716 -
717 - # Respect LDFLAGS
718 - sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' rules.mk
719 - popd >/dev/null || die
720 -
721 - # Fix pkgconfig file for Prefix
722 - sed -i -e "/^PREFIX =/s:= /usr:= ${EPREFIX}/usr:" \
723 - config/Makefile || die
724 -
725 - # use host shlibsign if need be #436216
726 - if tc-is-cross-compiler ; then
727 - sed -i \
728 - -e 's:"${2}"/shlibsign:shlibsign:' \
729 - cmd/shlibsign/sign.sh || die
730 - fi
731 -
732 - # dirty hack
733 - sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../freebl/\$(OBJDIR):" \
734 - lib/ssl/config.mk || die
735 - sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../../lib/freebl/\$(OBJDIR):" \
736 - cmd/platlibs.mk || die
737 -
738 - multilib_copy_sources
739 -
740 - strip-flags
741 -}
742 -
743 -multilib_src_configure() {
744 - # Ensure we stay multilib aware
745 - sed -i -e "/@libdir@/ s:lib64:$(get_libdir):" config/Makefile || die
746 -}
747 -
748 -nssarch() {
749 - # Most of the arches are the same as $ARCH
750 - local t=${1:-${CHOST}}
751 - case ${t} in
752 - *86*-pc-solaris2*) echo "i86pc" ;;
753 - aarch64*) echo "aarch64" ;;
754 - hppa*) echo "parisc" ;;
755 - i?86*) echo "i686" ;;
756 - x86_64*) echo "x86_64" ;;
757 - *) tc-arch ${t} ;;
758 - esac
759 -}
760 -
761 -nssbits() {
762 - local cc cppflags="${1}CPPFLAGS" cflags="${1}CFLAGS"
763 - if [[ ${1} == BUILD_ ]]; then
764 - cc=$(tc-getBUILD_CC)
765 - else
766 - cc=$(tc-getCC)
767 - fi
768 - echo > "${T}"/test.c || die
769 - ${cc} ${!cppflags} ${!cflags} -c "${T}"/test.c -o "${T}/${1}test.o" || die
770 - case $(file "${T}/${1}test.o") in
771 - *32-bit*x86-64*) echo USE_X32=1;;
772 - *64-bit*|*ppc64*|*x86_64*) echo USE_64=1;;
773 - *32-bit*|*ppc*|*i386*) ;;
774 - *) die "Failed to detect whether ${cc} builds 64bits or 32bits, disable distcc if you're using it, please";;
775 - esac
776 -}
777 -
778 -multilib_src_compile() {
779 - # use ABI to determine bit'ness, or fallback if unset
780 - local buildbits mybits
781 - case "${ABI}" in
782 - n32) mybits="USE_N32=1";;
783 - x32) mybits="USE_X32=1";;
784 - s390x|*64) mybits="USE_64=1";;
785 - ${DEFAULT_ABI})
786 - einfo "Running compilation test to determine bit'ness"
787 - mybits=$(nssbits)
788 - ;;
789 - esac
790 - # bitness of host may differ from target
791 - if tc-is-cross-compiler; then
792 - buildbits=$(nssbits BUILD_)
793 - fi
794 -
795 - local makeargs=(
796 - CC="$(tc-getCC)"
797 - CCC="$(tc-getCXX)"
798 - AR="$(tc-getAR) rc \$@"
799 - RANLIB="$(tc-getRANLIB)"
800 - OPTIMIZER=
801 - ${mybits}
802 - )
803 -
804 - # Take care of nspr settings #436216
805 - local myCPPFLAGS="${CPPFLAGS} $($(tc-getPKG_CONFIG) nspr --cflags)"
806 - unset NSPR_INCLUDE_DIR
807 -
808 - export NSS_ALLOW_SSLKEYLOGFILE=1
809 - export NSS_ENABLE_WERROR=0 #567158
810 - export BUILD_OPT=1
811 - export NSS_USE_SYSTEM_SQLITE=1
812 - export NSDISTMODE=copy
813 - export FREEBL_NO_DEPEND=1
814 - export FREEBL_LOWHASH=1
815 - export NSS_SEED_ONLY_DEV_URANDOM=1
816 - export USE_SYSTEM_ZLIB=1
817 - export ZLIB_LIBS=-lz
818 - export ASFLAGS=""
819 - # Fix build failure on arm64
820 - export NS_USE_GCC=1
821 - # Detect compiler type and set proper environment value
822 - if tc-is-gcc; then
823 - export CC_IS_GCC=1
824 - elif tc-is-clang; then
825 - export CC_IS_CLANG=1
826 - fi
827 -
828 - local d
829 -
830 - # Build the host tools first.
831 - LDFLAGS="${BUILD_LDFLAGS}" \
832 - XCFLAGS="${BUILD_CFLAGS}" \
833 - NSPR_LIB_DIR="${T}/fakedir" \
834 - emake -j1 -C coreconf \
835 - CC="$(tc-getBUILD_CC)" \
836 - ${buildbits-${mybits}}
837 - makeargs+=( NSINSTALL="${PWD}/$(find -type f -name nsinstall)" )
838 -
839 - # Then build the target tools.
840 - for d in . lib/dbm ; do
841 - CPPFLAGS="${myCPPFLAGS}" \
842 - XCFLAGS="${CFLAGS} ${CPPFLAGS}" \
843 - NSPR_LIB_DIR="${T}/fakedir" \
844 - emake -j1 "${makeargs[@]}" -C ${d} OS_TEST="$(nssarch)"
845 - done
846 -}
847 -
848 -# Altering these 3 libraries breaks the CHK verification.
849 -# All of the following cause it to break:
850 -# - stripping
851 -# - prelink
852 -# - ELF signing
853 -# http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html
854 -# Either we have to NOT strip them, or we have to forcibly resign after
855 -# stripping.
856 -#local_libdir="$(get_libdir)"
857 -#export STRIP_MASK="
858 -# */${local_libdir}/libfreebl3.so*
859 -# */${local_libdir}/libnssdbm3.so*
860 -# */${local_libdir}/libsoftokn3.so*"
861 -
862 -export NSS_CHK_SIGN_LIBS="freebl3 nssdbm3 softokn3"
863 -
864 -generate_chk() {
865 - local shlibsign="$1"
866 - local libdir="$2"
867 - einfo "Resigning core NSS libraries for FIPS validation"
868 - shift 2
869 - local i
870 - for i in ${NSS_CHK_SIGN_LIBS} ; do
871 - local libname=lib${i}.so
872 - local chkname=lib${i}.chk
873 - "${shlibsign}" \
874 - -i "${libdir}"/${libname} \
875 - -o "${libdir}"/${chkname}.tmp \
876 - && mv -f \
877 - "${libdir}"/${chkname}.tmp \
878 - "${libdir}"/${chkname} \
879 - || die "Failed to sign ${libname}"
880 - done
881 -}
882 -
883 -cleanup_chk() {
884 - local libdir="$1"
885 - shift 1
886 - local i
887 - for i in ${NSS_CHK_SIGN_LIBS} ; do
888 - local libfname="${libdir}/lib${i}.so"
889 - # If the major version has changed, then we have old chk files.
890 - [ ! -f "${libfname}" -a -f "${libfname}.chk" ] \
891 - && rm -f "${libfname}.chk"
892 - done
893 -}
894 -
895 -multilib_src_install() {
896 - pushd dist >/dev/null || die
897 -
898 - dodir /usr/$(get_libdir)
899 - cp -L */lib/*$(get_libname) "${ED}"/usr/$(get_libdir) || die "copying shared libs failed"
900 - local i
901 - for i in crmf freebl nssb nssckfw ; do
902 - cp -L */lib/lib${i}.a "${ED}"/usr/$(get_libdir) || die "copying libs failed"
903 - done
904 -
905 - # Install nss-config and pkgconfig file
906 - dodir /usr/bin
907 - cp -L */bin/nss-config "${ED}"/usr/bin || die
908 - dodir /usr/$(get_libdir)/pkgconfig
909 - cp -L */lib/pkgconfig/nss.pc "${ED}"/usr/$(get_libdir)/pkgconfig || die
910 -
911 - # create an nss-softokn.pc from nss.pc for libfreebl and some private headers
912 - # bug 517266
913 - sed -e 's#Libs:#Libs: -lfreebl#' \
914 - -e 's#Cflags:#Cflags: -I${includedir}/private#' \
915 - */lib/pkgconfig/nss.pc >"${ED}"/usr/$(get_libdir)/pkgconfig/nss-softokn.pc \
916 - || die "could not create nss-softokn.pc"
917 -
918 - # all the include files
919 - insinto /usr/include/nss
920 - doins public/nss/*.{h,api}
921 - insinto /usr/include/nss/private
922 - doins private/nss/{blapi,alghmac,cmac}.h
923 -
924 - popd >/dev/null || die
925 -
926 - local f nssutils
927 - # Always enabled because we need it for chk generation.
928 - nssutils=( shlibsign )
929 -
930 - if multilib_is_native_abi ; then
931 - if use utils; then
932 - # The tests we do not need to install.
933 - #nssutils_test="bltest crmftest dbtest dertimetest
934 - #fipstest remtest sdrtest"
935 - # checkcert utils has been removed in nss-3.22:
936 - # https://bugzilla.mozilla.org/show_bug.cgi?id=1187545
937 - # https://hg.mozilla.org/projects/nss/rev/df1729d37870
938 - # certcgi has been removed in nss-3.36:
939 - # https://bugzilla.mozilla.org/show_bug.cgi?id=1426602
940 - nssutils+=(
941 - addbuiltin
942 - atob
943 - baddbdir
944 - btoa
945 - certutil
946 - cmsutil
947 - conflict
948 - crlutil
949 - derdump
950 - digest
951 - makepqg
952 - mangle
953 - modutil
954 - multinit
955 - nonspr10
956 - ocspclnt
957 - oidcalc
958 - p7content
959 - p7env
960 - p7sign
961 - p7verify
962 - pk11mode
963 - pk12util
964 - pp
965 - rsaperf
966 - selfserv
967 - signtool
968 - signver
969 - ssltap
970 - strsclnt
971 - symkeyutil
972 - tstclnt
973 - vfychain
974 - vfyserv
975 - )
976 - # install man-pages for utils (bug #516810)
977 - doman doc/nroff/*.1
978 - fi
979 - pushd dist/*/bin >/dev/null || die
980 - for f in ${nssutils[@]}; do
981 - dobin ${f}
982 - done
983 - popd >/dev/null || die
984 - fi
985 -
986 - # Prelink breaks the CHK files. We don't have any reliable way to run
987 - # shlibsign after prelink.
988 - dodir /etc/prelink.conf.d
989 - printf -- "-b ${EPREFIX}/usr/$(get_libdir)/lib%s.so\n" ${NSS_CHK_SIGN_LIBS} \
990 - > "${ED}"/etc/prelink.conf.d/nss.conf
991 -}
992 -
993 -pkg_postinst() {
994 - multilib_pkg_postinst() {
995 - # We must re-sign the libraries AFTER they are stripped.
996 - local shlibsign="${EROOT}/usr/bin/shlibsign"
997 - # See if we can execute it (cross-compiling & such). #436216
998 - "${shlibsign}" -h >&/dev/null
999 - if [[ $? -gt 1 ]] ; then
1000 - shlibsign="shlibsign"
1001 - fi
1002 - generate_chk "${shlibsign}" "${EROOT}"/usr/$(get_libdir)
1003 - }
1004 -
1005 - multilib_foreach_abi multilib_pkg_postinst
1006 -}
1007 -
1008 -pkg_postrm() {
1009 - multilib_pkg_postrm() {
1010 - cleanup_chk "${EROOT}"/usr/$(get_libdir)
1011 - }
1012 -
1013 - multilib_foreach_abi multilib_pkg_postrm
1014 -}