## ## ca-bundle.pl -- Regenerate ca-bundle.crt from the Mozilla certdata.txt ## # configuration my $cvsroot = ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot'; my $certdata = 'mozilla/security/nss/lib/ckfw/builtins/certdata.txt'; my $date = `date`; $date =~ s/\n$//s; 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 "## Source: \"certdata.txt\" CVS revision $1\n##\n\n"; } } close(IN);