aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2006-08-22 22:29:29 +0000
committerRob Austein <sra@hactrn.net>2006-08-22 22:29:29 +0000
commite0d3a96f10a64d3efc1e54180642dbd58a38c27e (patch)
treeabea982ca1328e439e83ab500677143c689b7c84
parent01be99ccde06a1497e5947f5003188827ae48820 (diff)
# on 2006/08/11 08:39:33, sra did:
Initial revision svn path=/scripts/make-hashes.pl; revision=204
-rw-r--r--scripts/make-hashes.pl24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/make-hashes.pl b/scripts/make-hashes.pl
new file mode 100644
index 00000000..07de9142
--- /dev/null
+++ b/scripts/make-hashes.pl
@@ -0,0 +1,24 @@
+# -*- Perl -*-
+# $Id$
+
+my $openssl = "/u/sra/isc/route-pki/subvert-rpki.hactrn.net/openssl/trunk/apps/openssl";
+
+my $dir = "hashed";
+
+my %count;
+
+open(F, "-|", qw{find repository.apnic.net/APNIC -type f ( -name *.cer -o -name *.crl )})
+ or die("Couldn't run find: $!\n");
+my @files = <F>;
+close(F);
+chomp(@files);
+
+print("test -d $dir || mkdir $dir\n");
+
+for my $f (@files) {
+ my $prog = ($f =~ /\.cer$/) ? "x509" : "crl";
+ my $h = `$openssl $prog -inform DER -in $f -noout -hash`;
+ chomp($h);
+ my $n = 0 + $count{$h}++;
+ print("$openssl $prog -inform DER -outform PEM -out $dir/$h.$n -in $f\n");
+}