diff -r e3665a058d13 -r d4b4127cd2bb ca-certificates/mkcabundle.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ca-certificates/mkcabundle.pl Fri Mar 11 21:41:16 2011 +0100 @@ -0,0 +1,41 @@ +#!/usr/bin/perl -w +# +# Used to regenerate ca-bundle.crt from the Mozilla certdata.txt. +# Run as ./mkcabundle.pl > ca-bundle.crt +# + +my $cvsroot = ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot'; +my $certdata = 'mozilla/security/nss/lib/ckfw/builtins/certdata.txt'; + +open(IN, "cvs -d $cvsroot co -p $certdata|") + || die "could not check out certdata.txt"; + +my $incert = 0; + +print<) { + if (/^CKA_VALUE MULTILINE_OCTAL/) { + $incert = 1; + open(OUT, "|openssl x509 -text -inform DER -fingerprint") + || die "could not pipe to openssl x509"; + } elsif (/^END/ && $incert) { + close(OUT); + $incert = 0; + print "\n\n"; + } elsif ($incert) { + my @bs = split(/\\/); + foreach my $b (@bs) { + chomp $b; + printf(OUT "%c", oct($b)) unless $b eq ''; + } + } elsif (/^CVS_ID.*Revision: ([^ ]*).*/) { + print "# Generated from certdata.txt RCS revision $1\n#\n"; + } +}