Ravenports generated: 17 Jun 2020 17:57
[ravenports.git] / bucket_95 / nss
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               nss
4 VERSION=                3.53.1
5 KEYWORDS=               security
6 VARIANTS=               standard
7 SDESC[standard]=        Application security development libraries
8 HOMEPAGE=               http://www.mozilla.org/projects/security/pki/nss/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            MOZILLA/security/nss/releases/NSS_3_53_1_RTM/src
13 DISTFILE[1]=            nss-3.53.1.tar.gz:main
14 DF_INDEX=               1
15 SPKGS[standard]=        complete
16                         primary
17                         caroot
18
19 OPTIONS_AVAILABLE=      none
20 OPTIONS_STANDARD=       none
21
22 BUILD_DEPENDS=          libressl:single:static
23 BUILDRUN_DEPENDS=       nspr:single:standard
24
25 USES=                   cpe gmake perl:build sqlite zlib
26
27 DISTNAME=               nss-3.53.1/nss
28
29 LICENSE=                MPL:primary
30 LICENSE_FILE=           MPL:{{WRKSRC}}/COPYING
31 LICENSE_SCHEME=         solo
32
33 CPE_PRODUCT=            network_security_services
34 CPE_VENDOR=             mozilla
35 FPC_EQUIVALENT=         security/nss
36
37 MAKE_ENV=               LIBRARY_PATH="{{LOCALBASE}}/lib"
38                         SQLITE_INCLUDE_DIR="{{LOCALBASE}}/include"
39                         FREEBL_LOWHASH=1
40                         NSS_DISABLE_GTESTS=1
41                         NSS_USE_SYSTEM_SQLITE=1
42                         BUILD_OPT=1
43 SINGLE_JOB=             yes
44
45 PLIST_SUB=              CERTDIR=share/certs
46 SUB_FILES=              nss-config
47                         nss.pc
48                         pkg-message-caroot
49                         MAca-bundle.pl
50 SUB_LIST=               VERSION_NSS=3.53.1
51
52 CFLAGS=                 -I{{LOCALBASE}}/include/nspr
53 LDFLAGS=                -Wl,-rpath,{{PREFIX}}/lib/nss
54 VAR_OPSYS[sunos]=       MAKE_ENV=NS_USE_GCC=1
55                         MAKE_ENV=NO_MDUPDATE=1
56 VAR_OPSYS[linux]=       MAKE_ENV=RPATH=-Wl,-rpath,{{PREFIX}}/lib/nss
57 VAR_ARCH[x86_64]=       MAKE_ENV=USE_64=1
58
59 post-patch:
60         ${REINPLACE_CMD} '/NSS_DEFAULT_SYSTEM/s,/etc,${PREFIX}&,' \
61                 ${WRKSRC}/lib/sysinit/nsssysinit.c
62         (cd ${WRKSRC} && \
63                 ${FIND} . -name "*.c" -o -name "*.h" | \
64                 ${XARGS} ${GREP} -l -F '"nspr.h"' | \
65                 ${XARGS} ${REINPLACE_CMD} -e 's|"nspr.h"|<nspr.h>|')
66         ${FIND} ${WRKSRC}/tests -name '*.sh' | \
67                 ${XARGS} ${GREP} -l -F '/bin/bash' | \
68                 ${XARGS} ${REINPLACE_CMD} -e 's|#! */bin/bash|#!${SH}|'
69         ${REINPLACE_CMD} -e 's/@OS_RELEASE@/${OSREL}/' ${WRKSRC}/coreconf/arch.mk
70
71 post-build:
72         ${SETENV} ${MAKE_ENV} ${PERL} ${WRKDIR}/MAca-bundle.pl \
73                 < ${WRKSRC}/lib/ckfw/builtins/certdata.txt > ${WRKDIR}/ca-root-nss.crt
74
75 do-install:
76         @${MKDIR} ${STAGEDIR}${PREFIX}/include/nss/nss \
77                 ${STAGEDIR}${PREFIX}/lib/nss \
78                 ${STAGEDIR}${PREFIX}/share/certs
79         ${FIND} ${WRKDIR}/nss-3.53.1/dist/public/nss -type l \
80                 -exec ${INSTALL_DATA} {} ${STAGEDIR}${PREFIX}/include/nss/nss \;
81         ${INSTALL_LIB} ${WRKDIR}/nss-3.53.1/dist/${OPSYS}*_OPT.OBJ/lib/*.${LIBEXT} \
82                 ${STAGEDIR}${PREFIX}/lib/nss
83         ${INSTALL_DATA} ${WRKDIR}/nss-3.53.1/dist/${OPSYS}*_OPT.OBJ/lib/libcrmf.a \
84                 ${STAGEDIR}${PREFIX}/lib/nss
85 .for bin in certutil cmsutil crlutil derdump makepqg mangle modutil ocspclnt oidcalc p7content p7env p7sign p7verify pk12util rsaperf shlibsign signtool signver ssltap strsclnt symkeyutil vfychain vfyserv
86         ${INSTALL_PROGRAM} ${WRKDIR}/nss-3.53.1/dist/${OPSYS}*_OPT.OBJ/bin/${bin} \
87                 ${STAGEDIR}${PREFIX}/bin
88 .endfor
89         ${INSTALL_SCRIPT} ${WRKDIR}/nss-config ${STAGEDIR}${PREFIX}/bin
90         ${INSTALL_DATA} ${WRKDIR}/nss.pc ${STAGEDIR}${PREFIX}/lib/pkgconfig
91         # CA ROOT CERT
92 .for D in openssl openssl-devel libressl libressl-devel
93         ${MKDIR} ${STAGEDIR}${PREFIX}/etc/${D}
94         ${INSTALL_DATA} ${WRKDIR}/ca-root-nss.crt \
95                 ${STAGEDIR}${PREFIX}/etc/${D}/cert.pem.sample
96 .endfor
97         ${INSTALL_DATA} ${WRKDIR}/ca-root-nss.crt \
98                 ${STAGEDIR}${PREFIX}/share/certs
99
100 [FILE:301:descriptions/desc.primary]
101 Network Security Services (NSS) is a set of libraries designed to support
102 cross-platform development of security-enabled server applications.
103 Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5,
104 PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other
105 security standards.
106
107
108 [FILE:120:descriptions/desc.caroot]
109 Root certificates from certificate authorities included in the Mozilla
110 NSS library and thus in Firefox and Thunderbird.
111
112
113 [FILE:96:distinfo]
114 2dccde67079b25c4e95ac3121f11b2819c37cf8c48ca263a45d8f83f7a315316     81297900 nss-3.53.1.tar.gz
115
116
117 [FILE:1552:manifests/plist.primary]
118 %%ONLY-LINUX%%lib/nss/libnsssysinit.so
119 bin/
120  certutil
121  cmsutil
122  crlutil
123  derdump
124  makepqg
125  mangle
126  modutil
127  nss-config
128  ocspclnt
129  oidcalc
130  p7content
131  p7env
132  p7sign
133  p7verify
134  pk12util
135  rsaperf
136  shlibsign
137  signtool
138  signver
139  ssltap
140  strsclnt
141  symkeyutil
142  vfychain
143  vfyserv
144 include/nss/nss/
145  base64.h
146  blapit.h
147  cert.h
148  certdb.h
149  certt.h
150  ciferfam.h
151  cmmf.h
152  cmmft.h
153  cms.h
154  cmsreclist.h
155  cmst.h
156  crmf.h
157  crmft.h
158  cryptohi.h
159  cryptoht.h
160  eccutil.h
161  ecl-exp.h
162  hasht.h
163  jar-ds.h
164  jar.h
165  jarfile.h
166  key.h
167  keyhi.h
168  keyt.h
169  keythi.h
170  lowkeyi.h
171  lowkeyti.h
172  nss.h
173  nssb64.h
174  nssb64t.h
175  nssbase.h
176  nssbaset.h
177  nssck.api
178  nssckbi.h
179  nssckepv.h
180  nssckft.h
181  nssckfw.h
182  nssckfwc.h
183  nssckfwt.h
184  nssckg.h
185  nssckmdt.h
186  nssckt.h
187  nssilckt.h
188  nssilock.h
189  nsslocks.h
190  nsslowhash.h
191  nssrwlk.h
192  nssrwlkt.h
193  nssutil.h
194  ocsp.h
195  ocspt.h
196  p12.h
197  p12plcy.h
198  p12t.h
199  pk11func.h
200  pk11pqg.h
201  pk11priv.h
202  pk11pub.h
203  pk11sdr.h
204  pkcs11.h
205  pkcs11f.h
206  pkcs11n.h
207  pkcs11p.h
208  pkcs11t.h
209  pkcs11u.h
210  pkcs11uri.h
211  pkcs12.h
212  pkcs12t.h
213  pkcs1sig.h
214  pkcs7t.h
215  portreg.h
216  preenc.h
217  secasn1.h
218  secasn1t.h
219  seccomon.h
220  secder.h
221  secdert.h
222  secdig.h
223  secdigt.h
224  secerr.h
225  sechash.h
226  secitem.h
227  secmime.h
228  secmod.h
229  secmodt.h
230  secoid.h
231  secoidt.h
232  secpkcs5.h
233  secpkcs7.h
234  secport.h
235  shsign.h
236  smime.h
237  ssl.h
238  sslerr.h
239  sslexp.h
240  sslproto.h
241  sslt.h
242  utilmodt.h
243  utilpars.h
244  utilparst.h
245  utilrename.h
246 lib/nss/
247  libcrmf.a
248  libfreebl3.so
249  libfreeblpriv3.so
250  libnss3.so
251  libnssckbi-testlib.so
252  libnssckbi.so
253  libnssdbm3.so
254  libnssutil3.so
255  libsmime3.so
256  libsoftokn3.so
257  libssl3.so
258 lib/pkgconfig/nss.pc
259
260
261 [FILE:186:manifests/plist.caroot]
262 @sample etc/libressl-devel/cert.pem.sample
263 @sample etc/libressl/cert.pem.sample
264 @sample etc/openssl-devel/cert.pem.sample
265 @sample etc/openssl/cert.pem.sample
266 %%CERTDIR%%/ca-root-nss.crt
267
268
269 [FILE:449:patches/patch-bug301986]
270 --- lib/util/nssilckt.h.orig    2020-06-16 22:50:59 UTC
271 +++ lib/util/nssilckt.h
272 @@ -163,7 +163,7 @@ typedef enum {
273  ** Declare the trace record
274  */
275  struct pzTrace_s {
276 -    PRUint32 threadID;       /* PR_GetThreadID() */
277 +    pthread_t threadID;      /* PR_GetThreadID() */
278      nssILockOp op;           /* operation being performed */
279      nssILockType ltype;      /* lock type identifier */
280      PRIntervalTime callTime; /* time spent in function */
281
282
283 [FILE:2109:patches/patch-const]
284 --- cmd/modutil/modutil.h.orig  2020-06-16 22:50:59 UTC
285 +++ cmd/modutil/modutil.h
286 @@ -22,8 +22,8 @@
287  #include "error.h"
288  
289  Error LoadMechanismList(void);
290 -Error FipsMode(char *arg);
291 -Error ChkFipsMode(char *arg);
292 +Error FipsMode(const char *arg);
293 +Error ChkFipsMode(const char *arg);
294  Error AddModule(char *moduleName, char *libFile, char *ciphers,
295                  char *mechanisms, char *modparms);
296  Error DeleteModule(char *moduleName);
297 --- cmd/modutil/pk11.c.orig     2020-06-16 22:50:59 UTC
298 +++ cmd/modutil/pk11.c
299 @@ -16,7 +16,7 @@
300   * disable FIPS mode on the internal module.
301   */
302  Error
303 -FipsMode(char *arg)
304 +FipsMode(const char *arg)
305  {
306      char *internal_name;
307  
308 @@ -25,16 +25,18 @@ FipsMode(char *arg)
309              internal_name = PR_smprintf("%s",
310                                          SECMOD_GetInternalModule()->commonName);
311              if (SECMOD_DeleteInternalModule(internal_name) != SECSuccess) {
312 -                PR_fprintf(PR_STDERR, "%s\n", SECU_Strerror(PORT_GetError()));
313 +                PR_fprintf(PR_STDERR, "FipsMode(true): %s (%s)\n", SECU_Strerror(PORT_GetError()), internal_name);
314                  PR_smprintf_free(internal_name);
315                  PR_fprintf(PR_STDERR, errStrings[FIPS_SWITCH_FAILED_ERR]);
316                  return FIPS_SWITCH_FAILED_ERR;
317              }
318 -            PR_smprintf_free(internal_name);
319              if (!PK11_IsFIPS()) {
320 +                PR_fprintf(PR_STDERR, "FipsMode(true): in module %s", internal_name);
321 +                PR_smprintf_free(internal_name);
322                  PR_fprintf(PR_STDERR, errStrings[FIPS_SWITCH_FAILED_ERR]);
323                  return FIPS_SWITCH_FAILED_ERR;
324              }
325 +            PR_smprintf_free(internal_name);
326              PR_fprintf(PR_STDOUT, msgStrings[FIPS_ENABLED_MSG]);
327          } else {
328              PR_fprintf(PR_STDERR, errStrings[FIPS_ALREADY_ON_ERR]);
329 @@ -75,7 +77,7 @@ FipsMode(char *arg)
330   * If arg=="false", verify FIPS mode is disabled on the internal module.
331   */
332  Error
333 -ChkFipsMode(char *arg)
334 +ChkFipsMode(const char *arg)
335  {
336      if (!PORT_Strcasecmp(arg, "true")) {
337          if (PK11_IsFIPS()) {
338
339
340 [FILE:1383:patches/patch-coreconf_Darwin.mk]
341 --- coreconf/Darwin.mk.orig     2020-06-16 22:50:59 UTC
342 +++ coreconf/Darwin.mk
343 @@ -7,8 +7,8 @@ CC     ?= gcc
344  CCC    ?= g++
345  RANLIB ?= ranlib
346  
347 +NSS_ENABLE_WERROR = 0
348  include $(CORE_DEPTH)/coreconf/UNIX.mk
349 -include $(CORE_DEPTH)/coreconf/Werror.mk
350  
351  DEFAULT_COMPILER = gcc
352  
353 @@ -127,21 +127,4 @@ PROCESS_MAP_FILE = grep -v ';+' $< | gre
354  USE_SYSTEM_ZLIB = 1
355  ZLIB_LIBS      = -lz
356  
357 -# The system sqlite library in the latest version of Mac OS X often becomes
358 -# newer than the sqlite library in NSS. This may result in certain Mac OS X
359 -# system libraries having unresolved sqlite symbols during the shlibsign step
360 -# of the NSS build when we set DYLD_LIBRARY_PATH to the NSS lib directory and
361 -# the NSS libsqlite3.dylib is used instead of the system one. So just use the
362 -# system sqlite library on Mac, if it's sufficiently new.
363 -
364 -SYS_SQLITE3_VERSION_FULL := $(shell /usr/bin/sqlite3 -version | awk '{print $$1}')
365 -SYS_SQLITE3_VERSION_MAJOR := $(shell echo $(SYS_SQLITE3_VERSION_FULL) | awk -F. '{ print $$1 }')
366 -SYS_SQLITE3_VERSION_MINOR := $(shell echo $(SYS_SQLITE3_VERSION_FULL) | awk -F. '{ print $$2 }')
367 -
368 -ifeq (3,$(SYS_SQLITE3_VERSION_MAJOR))
369 -    ifeq (,$(filter-out 0 1 2 3 4,$(SYS_SQLITE3_VERSION_MINOR)))
370 -        # sqlite <= 3.4.x is too old, it doesn't provide sqlite3_file_control
371 -    else
372 -        NSS_USE_SYSTEM_SQLITE = 1
373 -    endif
374 -endif
375 +NSS_USE_SYSTEM_SQLITE = 1
376
377
378 [FILE:1313:patches/patch-coreconf_DragonFly.mk]
379 --- /dev/null   2020-06-17 17:51:18 UTC
380 +++ coreconf/DragonFly.mk
381 @@ -0,0 +1,54 @@
382 +#
383 +# This Source Code Form is subject to the terms of the Mozilla Public
384 +# License, v. 2.0. If a copy of the MPL was not distributed with this
385 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
386 +
387 +include $(CORE_DEPTH)/coreconf/UNIX.mk
388 +
389 +DEFAULT_COMPILER       = gcc
390 +CC                     = gcc
391 +CCC                    = g++
392 +RANLIB                 = ranlib
393 +
394 +CPU_ARCH               = $(OS_TEST)
395 +ifeq ($(CPU_ARCH),i386)
396 +CPU_ARCH               = x86
397 +endif
398 +ifeq ($(CPU_ARCH),amd64)
399 +CPU_ARCH               = x86_64
400 +endif
401 +
402 +ifneq (,$(filter %64, $(OS_TEST)))
403 +USE_64                 = 1
404 +endif
405 +
406 +OS_CFLAGS              = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
407 +
408 +DSO_CFLAGS             = -fPIC
409 +DSO_LDOPTS             = -shared -Wl,-soname -Wl,$(notdir $@)
410 +
411 +#
412 +# The default implementation strategy for FreeBSD is pthreads.
413 +#
414 +ifndef CLASSIC_NSPR
415 +USE_PTHREADS           = 1
416 +DEFINES                        += -D_THREAD_SAFE -D_REENTRANT
417 +OS_LIBS                        += -pthread
418 +DSO_LDOPTS             += -pthread
419 +endif
420 +
421 +ARCH                   = freebsd
422 +MOZ_OBJFORMAT          = elf
423 +DLL_SUFFIX             = so
424 +
425 +MKSHLIB                        = $(CC) $(DSO_LDOPTS)
426 +ifdef MAPFILE
427 +       MKSHLIB += -Wl,--version-script,$(MAPFILE)
428 +endif
429 +PROCESS_MAP_FILE = grep -v ';-' $< | \
430 +        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
431 +
432 +G++INCLUDES            = -I/usr/include/c++
433 +
434 +USE_SYSTEM_ZLIB                = 1
435 +ZLIB_LIBS              = -lz
436
437
438 [FILE:1125:patches/patch-coreconf_FreeBSD.mk]
439 --- coreconf/FreeBSD.mk.orig    2020-06-16 22:50:59 UTC
440 +++ coreconf/FreeBSD.mk
441 @@ -5,9 +5,9 @@
442  
443  include $(CORE_DEPTH)/coreconf/UNIX.mk
444  
445 -DEFAULT_COMPILER       = gcc
446 -CC                     = gcc
447 -CCC                    = g++
448 +DEFAULT_COMPILER       = $(CC)
449 +CC                     ?= gcc
450 +CCC                    = $(CXX)
451  RANLIB                 = ranlib
452  
453  CPU_ARCH               = $(OS_TEST)
454 @@ -20,6 +20,16 @@ endif
455  ifeq ($(CPU_ARCH),amd64)
456  CPU_ARCH               = x86_64
457  endif
458 +ifneq (,$(filter arm%, $(CPU_ARCH)))
459 +CPU_ARCH               = arm
460 +endif
461 +ifneq (,$(filter powerpc%, $(CPU_ARCH)))
462 +CPU_ARCH               = ppc
463 +endif
464 +
465 +ifneq (,$(filter %64, $(OS_TEST)))
466 +USE_64                 = 1
467 +endif
468  
469  OS_CFLAGS              = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
470  
471 @@ -46,7 +56,11 @@ else
472  DLL_SUFFIX             = so.1.0
473  endif
474  
475 -MKSHLIB                        = $(CC) $(DSO_LDOPTS)
476 +ifneq (,$(filter alpha ia64,$(OS_TEST)))
477 +MKSHLIB                        = $(CC) -Wl,-Bsymbolic -lc $(DSO_LDOPTS)
478 +else
479 +MKSHLIB                        = $(CC) -Wl,-Bsymbolic $(DSO_LDOPTS)
480 +endif
481  ifdef MAPFILE
482         MKSHLIB += -Wl,--version-script,$(MAPFILE)
483  endif
484 @@ -55,4 +69,5 @@ PROCESS_MAP_FILE = grep -v ';-' $< | \
485  
486  G++INCLUDES            = -I/usr/include/g++
487  
488 -INCLUDES               += -I/usr/X11R6/include
489 +USE_SYSTEM_ZLIB                = 1
490 +ZLIB_LIBS              = -lz
491
492
493 [FILE:2044:patches/patch-coreconf_SunOS5.mk]
494 --- coreconf/SunOS5.mk.orig     2020-06-16 22:50:59 UTC
495 +++ coreconf/SunOS5.mk
496 @@ -14,14 +14,14 @@ ifeq ($(USE_64), 1)
497    ifdef NS_USE_GCC
498        ARCHFLAG=-m64
499    else
500 -      ifeq ($(OS_TEST),i86pc)
501 +      ifeq ($(OS_TEST),x86_64)
502          ARCHFLAG=-xarch=amd64
503        else
504          ARCHFLAG=-xarch=v9
505        endif
506    endif
507  else
508 -  ifneq ($(OS_TEST),i86pc)
509 +  ifneq ($(OS_TEST),x86_64)
510      ifdef NS_USE_GCC
511        ARCHFLAG=-mcpu=v9
512      else
513 @@ -33,10 +33,10 @@ endif
514  DEFAULT_COMPILER = cc
515  
516  ifdef NS_USE_GCC
517 -       CC         = gcc
518 +       CC        ?= gcc
519         OS_CFLAGS += -Wall -Wno-format -Werror-implicit-function-declaration -Wno-switch
520         OS_CFLAGS += -D__EXTENSIONS__
521 -       CCC        = g++
522 +       CCC       ?= g++
523         CCC       += -Wall -Wno-format
524         ASFLAGS   += -x assembler-with-cpp
525         OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
526 @@ -65,7 +65,7 @@ RANLIB      = echo
527  CPU_ARCH    = sparc
528  OS_DEFINES += -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT
529  
530 -ifeq ($(OS_TEST),i86pc)
531 +ifeq ($(OS_TEST),x86_64)
532  ifeq ($(USE_64),1)
533      CPU_ARCH           = x86_64
534  else
535 @@ -107,15 +107,11 @@ endif
536         DSO_LDOPTS += -shared -h $(notdir $@)
537  else
538  ifeq ($(USE_64), 1)
539 -       ifeq ($(OS_TEST),i86pc)
540 -           DSO_LDOPTS +=-xarch=amd64
541 -       else
542 -           DSO_LDOPTS +=-xarch=v9
543 -       endif
544 +       DSO_LDOPTS += -m64
545  endif
546         DSO_LDOPTS += -G -h $(notdir $@)
547  endif
548 -DSO_LDOPTS += -z combreloc -z defs -z ignore
549 +# DSO_LDOPTS += -Wl,-z,origin
550  
551  # -KPIC generates position independent code for use in shared libraries.
552  # (Similarly for -fPIC in case of gcc.)
553 @@ -127,16 +123,5 @@ endif
554  
555  NOSUCHFILE   = /solaris-rm-f-sucks
556  
557 -ifeq ($(BUILD_SUN_PKG), 1)
558 -# The -R '$ORIGIN' linker option instructs this library to search for its
559 -# dependencies in the same directory where it resides.
560 -ifeq ($(USE_64), 1)
561 -RPATH = -R '$$ORIGIN:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
562 -else
563 -RPATH = -R '$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps'
564 -endif
565 -else
566 -RPATH = -R '$$ORIGIN'
567 -endif
568 -
569 -OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc
570 +OS_LIBS += -lrt
571 +RPATH = $(LDFLAGS) #-Wl,-rpath,$(PREFIX)/lib/nss
572
573
574 [FILE:286:patches/patch-coreconf_UNIX.mk]
575 --- coreconf/UNIX.mk.orig       2020-06-16 22:50:59 UTC
576 +++ coreconf/UNIX.mk
577 @@ -10,10 +10,8 @@ AR          = ar cr $@
578  LDOPTS     += -L$(SOURCE_LIB_DIR)
579  
580  ifdef BUILD_OPT
581 -       OPTIMIZER  += -O
582         DEFINES    += -UDEBUG -DNDEBUG
583  else
584 -       OPTIMIZER  += -g
585         DEFINES    += -DDEBUG -UNDEBUG
586  endif
587  
588
589
590 [FILE:611:patches/patch-coreconf_arch.mk]
591 --- coreconf/arch.mk.orig       2020-06-16 22:50:59 UTC
592 +++ coreconf/arch.mk
593 @@ -26,7 +26,7 @@ OS_ARCH := $(subst /,_,$(shell uname -s)
594  # Attempt to differentiate between sparc and x86 Solaris
595  #
596  
597 -OS_TEST := $(shell uname -m)
598 +OS_TEST := $(shell uname -p)
599  ifeq ($(OS_TEST),i86pc)
600      OS_RELEASE := $(shell uname -r)_$(OS_TEST)
601  else
602 @@ -118,6 +118,10 @@ ifeq ($(OS_ARCH),Linux)
603      KERNEL = Linux
604  endif
605  
606 +ifeq ($(OS_ARCH),DragonFly)
607 +OS_RELEASE := @OS_RELEASE@
608 +endif
609 +
610  # Since all uses of OS_ARCH that follow affect only userland, we can
611  # merge other Glibc systems with Linux here.
612  ifeq ($(OS_ARCH),GNU)
613
614
615 [FILE:496:patches/patch-coreconf_command.mk]
616 --- coreconf/command.mk.orig    2020-06-16 22:50:59 UTC
617 +++ coreconf/command.mk
618 @@ -12,7 +12,7 @@ AS            = $(CC)
619  ASFLAGS      += $(CFLAGS)
620  CCF           = $(CC) $(CFLAGS)
621  LINK_DLL      = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS) $(XLDFLAGS)
622 -CFLAGS        = $(OPTIMIZER) $(OS_CFLAGS) $(WARNING_CFLAGS) $(XP_DEFINE) \
623 +CFLAGS       += $(OPTIMIZER) $(OS_CFLAGS) $(WARNING_CFLAGS) $(XP_DEFINE) \
624                  $(DEFINES) $(INCLUDES) $(XCFLAGS)
625  CSTD          = -std=c99
626  CXXSTD        = -std=c++11
627
628
629 [FILE:465:patches/patch-coreconf_config.mk]
630 --- coreconf/config.mk.orig     2020-06-16 22:50:59 UTC
631 +++ coreconf/config.mk
632 @@ -31,7 +31,7 @@ endif
633  #######################################################################
634  
635  TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
636 -              AIX RISCOS WINNT WIN95 Linux Android
637 +              AIX RISCOS WINNT WIN95 Linux Android DragonFly
638  
639  ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
640  include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
641
642
643 [FILE:248:patches/patch-coreconf_location.mk]
644 --- coreconf/location.mk.orig   2020-06-16 22:50:59 UTC
645 +++ coreconf/location.mk
646 @@ -37,7 +37,7 @@ ifdef NSPR_INCLUDE_DIR
647  endif
648  
649  ifndef NSPR_LIB_DIR
650 -    NSPR_LIB_DIR = $(DIST)/lib
651 +    NSPR_LIB_DIR = $(PREFIX)/lib
652  endif
653  
654  ifdef NSS_INCLUDE_DIR
655
656
657 [FILE:308:patches/patch-coreconf_ruleset.mk]
658 --- coreconf/ruleset.mk.orig    2020-06-16 22:50:59 UTC
659 +++ coreconf/ruleset.mk
660 @@ -30,7 +30,7 @@
661  #
662  
663  ifndef COMPILER_TAG
664 -    ifneq ($(DEFAULT_COMPILER), $(notdir $(firstword $(CC))))
665 +    ifneq ($(DEFAULT_COMPILER), $(CC))
666  #
667  # Temporary define for the Client; to be removed when binary release is used
668  #
669
670
671 [FILE:720:patches/patch-lib_freebl_Makefile]
672 --- lib/freebl/Makefile.orig    2020-06-16 22:50:59 UTC
673 +++ lib/freebl/Makefile
674 @@ -238,7 +238,7 @@ ifeq ($(CPU_ARCH),x86)
675  endif
676  endif # Darwin
677  
678 -ifeq ($(OS_TARGET),Linux)
679 +ifeq (,$(filter-out Linux DragonFly FreeBSD, $(OS_TARGET)))
680  ifeq ($(CPU_ARCH),x86_64)
681      ASFILES  = arcfour-amd64-gas.s mpi_amd64_gas.s
682      ASFLAGS += -fPIC -Wa,--noexecstack
683 @@ -323,7 +323,7 @@ endif
684  # to bind the blapi function references in FREEBLVector vector
685  # (ldvector.c) to the blapi functions defined in the freebl
686  # shared libraries.
687 -ifeq (,$(filter-out BSD_OS FreeBSD Linux NetBSD OpenBSD, $(OS_TARGET)))
688 +ifeq (,$(filter-out BSD_OS DragonFly FreeBSD Linux NetBSD OpenBSD, $(OS_TARGET)))
689      MKSHLIB += -Wl,-Bsymbolic
690  endif
691  
692
693
694 [FILE:1041:patches/patch-lib_freebl_mpi_mpcpucache.c]
695 --- lib/freebl/mpi/mpcpucache.c.orig    2020-06-16 22:50:59 UTC
696 +++ lib/freebl/mpi/mpcpucache.c
697 @@ -706,6 +706,32 @@ s_mpi_getProcessorLineSize()
698  #endif
699  
700  #if defined(__ppc64__)
701 +
702 +#if defined(__FreeBSD__)
703 +#include <sys/stddef.h>
704 +#include <sys/sysctl.h>
705 +
706 +#include <machine/cpu.h>
707 +#include <machine/md_var.h>
708 +
709 +unsigned long
710 +s_mpi_getProcessorLineSize()
711 +{
712 +       static int cacheline_size = 0;
713 +       static int cachemib[] = { CTL_MACHDEP, CPU_CACHELINE };
714 +       int clen;
715 +       
716 +       if (cacheline_size > 0)
717 +               return cacheline_size;
718 +
719 +       clen = sizeof(cacheline_size);
720 +       if (sysctl(cachemib, sizeof(cachemib) / sizeof(cachemib[0]),
721 +           &cacheline_size, &clen, NULL, 0) < 0 || !cacheline_size)
722 +               return 128; /* guess */
723 +
724 +       return cacheline_size;
725 +}
726 +#else
727  /*
728   *  Sigh, The PPC has some really nice features to help us determine cache
729   *  size, since it had lots of direct control functions to do so. The POWER
730 @@ -759,6 +785,7 @@ s_mpi_getProcessorLineSize()
731      }
732      return 0;
733  }
734 +#endif
735  
736  #define MPI_GET_PROCESSOR_LINE_SIZE_DEFINED 1
737  #endif
738
739
740 [FILE:600:patches/patch-lib_softoken_pkcs11.c]
741 --- lib/softoken/pkcs11.c.orig  2020-06-16 22:50:59 UTC
742 +++ lib/softoken/pkcs11.c
743 @@ -3345,8 +3345,8 @@ nsc_CommonInitialize(CK_VOID_PTR pReserv
744          char buf[200];
745          int major = 0, minor = 0;
746  
747 -        long rv = sysinfo(SI_RELEASE, buf, sizeof(buf));
748 -        if (rv > 0 && rv < sizeof(buf)) {
749 +        long sunrv = sysinfo(SI_RELEASE, buf, sizeof(buf));
750 +        if (sunrv > 0 && sunrv < sizeof(buf)) {
751              if (2 == sscanf(buf, "%d.%d", &major, &minor)) {
752                  /* Are we on Solaris 10 or greater ? */
753                  if (major > 5 || (5 == major && minor >= 10)) {
754
755
756 [FILE:1013:patches/patch-lib_softoken_pkcs11c.c]
757 --- lib/softoken/pkcs11c.c.orig 2020-06-16 22:50:59 UTC
758 +++ lib/softoken/pkcs11c.c
759 @@ -6113,9 +6113,6 @@ sftk_unwrapPrivateKey(SFTKObject *key, S
760              break;
761          case NSSLOWKEYDSAKey:
762              keyType = CKK_DSA;
763 -            crv = (sftk_hasAttribute(key, CKA_NSS_DB)) ? CKR_OK : CKR_KEY_TYPE_INCONSISTENT;
764 -            if (crv != CKR_OK)
765 -                break;
766              crv = sftk_AddAttributeType(key, CKA_KEY_TYPE, &keyType,
767                                          sizeof(keyType));
768              if (crv != CKR_OK)
769 @@ -6155,9 +6152,6 @@ sftk_unwrapPrivateKey(SFTKObject *key, S
770          /* what about fortezza??? */
771          case NSSLOWKEYECKey:
772              keyType = CKK_EC;
773 -            crv = (sftk_hasAttribute(key, CKA_NSS_DB)) ? CKR_OK : CKR_KEY_TYPE_INCONSISTENT;
774 -            if (crv != CKR_OK)
775 -                break;
776              crv = sftk_AddAttributeType(key, CKA_KEY_TYPE, &keyType,
777                                          sizeof(keyType));
778              if (crv != CKR_OK)
779
780
781 [FILE:6041:files/MAca-bundle.pl.in]
782 ##
783 ##  MAca-bundle.pl -- Regenerate ca-root-nss.crt from the Mozilla certdata.txt
784 ##
785 ##  Rewritten in September 2011 by Matthias Andree to heed untrust
786 ##
787
788 ##  Copyright (c) 2011, 2013 Matthias Andree <mandree@FreeBSD.org>
789 ##  All rights reserved.
790 ##
791 ##  Redistribution and use in source and binary forms, with or without
792 ##  modification, are permitted provided that the following conditions are
793 ##  met:
794 ##
795 ##  * Redistributions of source code must retain the above copyright
796 ##  notice, this list of conditions and the following disclaimer.
797 ##
798 ##  * Redistributions in binary form must reproduce the above copyright
799 ##  notice, this list of conditions and the following disclaimer in the
800 ##  documentation and/or other materials provided with the distribution.
801 ##
802 ##  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
803 ##  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
804 ##  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
805 ##  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
806 ##  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
807 ##  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
808 ##  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
809 ##  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
810 ##  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
811 ##  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
812 ##  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
813 ##  POSSIBILITY OF SUCH DAMAGE.
814
815 use strict;
816 use Carp;
817 use MIME::Base64;
818
819 my $VERSION = '$FreeBSD: head/security/ca_root_nss/files/MAca-bundle.pl.in 325572 2013-08-29 08:10:09Z mandree $';
820
821 #   configuration
822 print <<EOH;
823 ##
824 ##  ca-root-nss.crt -- Bundle of CA Root Certificates
825 ##
826 ##  This is a bundle of X.509 certificates of public Certificate
827 ##  Authorities (CA). These were automatically extracted from Mozilla's
828 ##  root CA list (the file `certdata.txt').
829 ##
830 ##  Extracted from nss-%%VERSION_NSS%%
831 ##  with $VERSION
832 ##
833 EOH
834 my $debug = 0;
835 $debug++
836     if defined $ENV{'WITH_DEBUG'}
837         and $ENV{'WITH_DEBUG'} !~ m/(?i)^(no|0|false|)$/;
838
839 my %certs;
840 my %trusts;
841
842 sub printcert_plain($$)
843 {
844     my ($label, $certdata) = @_;
845     print "=== $label ===\n" if $label;
846     print
847         "-----BEGIN CERTIFICATE-----\n",
848         MIME::Base64::encode_base64($certdata),
849         "-----END CERTIFICATE-----\n\n";
850 }
851
852 sub printcert_info($$)
853 {
854     my (undef, $certdata) = @_;
855     return unless $certdata;
856     open(OUT, "|openssl x509 -text -inform DER -fingerprint")
857             || die "could not pipe to openssl x509";
858     print OUT $certdata;
859     close(OUT) or die "openssl x509 failed with exit code $?";
860 }
861
862 sub printcert($$) {
863     my ($a, $b) = @_;
864     printcert_info($a, $b);
865 }
866
867 sub graboct()
868 {
869     my $data;
870
871     while (<>) {
872         last if /^END/;
873         my (undef,@oct) = split /\\/;
874         my @bin = map(chr(oct), @oct);
875         $data .= join('', @bin);
876     }
877
878     return $data;
879 }
880
881
882 sub grabcert()
883 {
884     my $certdata;
885     my $cka_label;
886     my $serial;
887
888     while (<>) {
889         chomp;
890         last if ($_ eq '');
891
892         if (/^CKA_LABEL UTF8 "([^"]+)"/) {
893             $cka_label = $1;
894         }
895
896         if (/^CKA_VALUE MULTILINE_OCTAL/) {
897             $certdata = graboct();
898         }
899
900         if (/^CKA_SERIAL_NUMBER MULTILINE_OCTAL/) {
901             $serial = graboct();
902         }
903     }
904     return ($serial, $cka_label, $certdata);
905 }
906
907 sub grabtrust() {
908     my $cka_label;
909     my $serial;
910     my $maytrust = 0;
911     my $distrust = 0;
912
913     while (<>) {
914         chomp;
915         last if ($_ eq '');
916
917         if (/^CKA_LABEL UTF8 "([^"]+)"/) {
918             $cka_label = $1;
919         }
920
921         if (/^CKA_SERIAL_NUMBER MULTILINE_OCTAL/) {
922             $serial = graboct();
923         }
924
925         if (/^CKA_TRUST_(SERVER_AUTH|EMAIL_PROTECTION|CODE_SIGNING) CK_TRUST (\S+)$/)
926         {
927             if ($2 eq      'CKT_NSS_NOT_TRUSTED') {
928                 $distrust = 1;
929             } elsif ($2 eq 'CKT_NSS_TRUSTED_DELEGATOR') {
930                 $maytrust = 1;
931             } elsif ($2 ne 'CKT_NSS_MUST_VERIFY_TRUST') {
932                 confess "Unknown trust setting on line $.:\n"
933                 . "$_\n"
934                 . "Script must be updated:";
935             }
936         }
937     }
938
939     if (!$maytrust && !$distrust && $debug) {
940         print STDERR "line $.: no explicit trust/distrust found for $cka_label\n";
941     }
942
943     my $trust = ($maytrust and not $distrust);
944     return ($serial, $cka_label, $trust);
945 }
946
947 while (<>) {
948     if (/^CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE/) {
949         my ($serial, $label, $certdata) = grabcert();
950         if (defined $certs{$label."\0".$serial}) {
951             warn "Certificate $label duplicated!\n";
952         }
953         $certs{$label."\0".$serial} = $certdata;
954     } elsif (/^CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST/) {
955         my ($serial, $label, $trust) = grabtrust();
956         if (defined $trusts{$label."\0".$serial}) {
957             warn "Trust for $label duplicated!\n";
958         }
959         $trusts{$label."\0".$serial} = $trust;
960     } elsif (/^CVS_ID.*Revision: ([^ ]*).*/) {
961         print "##  Source: \"certdata.txt\" CVS revision $1\n##\n\n";
962     }
963 }
964
965 sub printlabel(@) {
966     my @res = @_;
967     map { s/\0.*//; s/[^[:print:]]/_/g; $_ = "\"$_\""; } @res;
968     return wantarray ? @res : $res[0];
969 }
970
971 # weed out untrusted certificates
972 my $untrusted = 0;
973 foreach my $it (keys %trusts) {
974     if (!$trusts{$it}) {
975         if (!exists($certs{$it})) {
976             warn "Found trust for nonexistent certificate ".printlabel($it)."\n" if $debug;
977         } else {
978             delete $certs{$it};
979             warn "Skipping untrusted ".printlabel($it)."\n" if $debug;
980             $untrusted++;
981         }
982     }
983 }
984
985 print           "##  Untrusted certificates omitted from this bundle: $untrusted\n\n";
986 print STDERR    "##  Untrusted certificates omitted from this bundle: $untrusted\n";
987
988 my $certcount = 0;
989 foreach my $it (sort {uc($a) cmp uc($b)} keys %certs) {
990     if (!exists($trusts{$it})) {
991         die "Found certificate without trust block,\naborting";
992     }
993     printcert("", $certs{$it});
994     print "\n\n\n";
995     $certcount++;
996     print STDERR "Trusting $certcount: ".printlabel($it)."\n" if $debug;
997 }
998
999 if ($certcount < 25) {
1000     die "Certificate count of $certcount is implausibly low.\nAbort";
1001 }
1002
1003 print           "##  Number of certificates: $certcount\n";
1004 print STDERR    "##  Number of certificates: $certcount\n";
1005 print "##  End of file.\n";
1006
1007
1008 [FILE:2352:files/nss-config.in]
1009 #!/bin/sh
1010
1011 prefix=%%PREFIX%%
1012 version=%%VERSION_NSS%%
1013
1014 usage()
1015 {
1016         cat <<EOF
1017 Usage: nss-config [OPTIONS] [LIBRARIES]
1018 Options:
1019         [--prefix[=DIR]]
1020         [--exec-prefix[=DIR]]
1021         [--includedir[=DIR]]
1022         [--libdir[=DIR]]
1023         [--version]
1024         [--libs]
1025         [--cflags]
1026 Dynamic Libraries:
1027         nss
1028         nssutil
1029         ssl
1030         smime
1031 EOF
1032         exit $1
1033 }
1034
1035 if test $# -eq 0; then
1036         usage 1 1>&2
1037 fi
1038
1039 lib_ssl=yes
1040 lib_smime=yes
1041 lib_nss=yes
1042 lib_nssutil=yes
1043
1044 while test $# -gt 0; do
1045   case "$1" in
1046   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
1047   *) optarg= ;;
1048   esac
1049
1050   case $1 in
1051     --prefix=*)
1052       prefix=$optarg
1053       ;;
1054     --prefix)
1055       echo_prefix=yes
1056       ;;
1057     --exec-prefix=*)
1058       exec_prefix=$optarg
1059       ;;
1060     --exec-prefix)
1061       echo_exec_prefix=yes
1062       ;;
1063     --includedir=*)
1064       includedir=$optarg
1065       ;;
1066     --includedir)
1067       echo_includedir=yes
1068       ;;
1069     --libdir=*)
1070       libdir=$optarg
1071       ;;
1072     --libdir)
1073       echo_libdir=yes
1074       ;;
1075     --version)
1076       case $version in
1077       *.*.*) echo $version ;;
1078       *.*) echo $version.0 ;;
1079       *) echo $version.0.0 ;;
1080       esac
1081       ;;
1082     --cflags)
1083       echo_cflags=yes
1084       ;;
1085     --libs)
1086       echo_libs=yes
1087       ;;
1088     ssl)
1089       lib_ssl=yes
1090       ;;
1091     smime)
1092       lib_smime=yes
1093       ;;
1094     nss)
1095       lib_nss=yes
1096       ;;
1097     nssutil)
1098       lib_nssutil=yes
1099       ;;
1100     *)
1101       usage 1 1>&2
1102       ;;
1103   esac
1104   shift
1105 done
1106
1107 # Set variables that may be dependent upon other variables
1108 if test -z "$exec_prefix"; then
1109     exec_prefix=$prefix
1110 fi
1111 if test -z "$includedir"; then
1112     includedir=$prefix/include/nss
1113 fi
1114 if test -z "$libdir"; then
1115     libdir=$prefix/lib/nss
1116 fi
1117
1118 if test "$echo_prefix" = "yes"; then
1119     echo $prefix
1120 fi
1121
1122 if test "$echo_exec_prefix" = "yes"; then
1123     echo $exec_prefix
1124 fi
1125
1126 if test "$echo_includedir" = "yes"; then
1127     echo $includedir
1128 fi
1129
1130 if test "$echo_libdir" = "yes"; then
1131     echo $libdir
1132 fi
1133
1134 if test "$echo_cflags" = "yes"; then
1135     echo -I$includedir -I$includedir/nss
1136 fi
1137
1138 if test "$echo_libs" = "yes"; then
1139       libdirs="-Wl,-R${libdir} -L$libdir"
1140       if test -n "$lib_ssl"; then
1141         libdirs="$libdirs -lssl3"
1142       fi
1143       if test -n "$lib_smime"; then
1144         libdirs="$libdirs -lsmime3"
1145       fi
1146       if test -n "$lib_nss"; then
1147         libdirs="$libdirs -lnss3"
1148       fi
1149       if test -n "$lib_nssutil"; then
1150         libdirs="$libdirs -lnssutil3"
1151       fi
1152       echo $libdirs
1153 fi      
1154
1155
1156 [FILE:315:files/nss.pc.in]
1157 prefix=%%PREFIX%%
1158 exec_prefix=%%PREFIX%%
1159 libdir=%%PREFIX%%/lib/nss
1160 includedir=%%PREFIX%%/include
1161
1162 Name: NSS
1163 Description: Mozilla Network Security Services
1164 Version: %%VERSION_NSS%%
1165 Requires: nspr
1166 Libs: -Wl,-R${libdir} -L${libdir} -lnss3 -lsmime3 -lssl3 -lnssutil3
1167 Cflags: -I${includedir}/nss -I${includedir}/nss/nss
1168
1169
1170 [FILE:948:files/pkg-message-caroot.in]
1171 ********************************* WARNING *********************************
1172
1173 Ravenports do not, and can not warrant that the certification authorities
1174 whose certificates are included in this package have in any way been
1175 audited for trustworthiness or RFC 3647 compliance.
1176
1177 Assessment and verification of trust is the complete responsibility of the
1178 system administrator.
1179
1180 *********************************** NOTE **********************************
1181
1182 This package installs symlinks to support root certificates discovery by
1183 default for software that uses OpenSSL.
1184
1185 This enables SSL Certificate Verification by client software without manual
1186 intervention.
1187
1188 If you prefer to do this manually, replace the following symlinks with
1189 either an empty file or your site-local certificate bundle.
1190
1191   * /etc/ssl/cert.pem
1192   * %%PREFIX%%/etc/ssl/cert.pem
1193   * %%PREFIX%%/openssl/cert.pem
1194
1195 ***************************************************************************
1196