X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbin%2Fmkcabundle;fp=cirros-testvm%2Fsrc-cirros%2Fbin%2Fmkcabundle;h=f2cf0373f20960ea89d517ef3f60aa488fd7dd21;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/bin/mkcabundle b/cirros-testvm/src-cirros/bin/mkcabundle new file mode 100755 index 0000000..f2cf037 --- /dev/null +++ b/cirros-testvm/src-cirros/bin/mkcabundle @@ -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"; + } +}