aboutsummaryrefslogtreecommitdiff
path: root/scripts/make-hashes.pl
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2006-08-22 22:30:32 +0000
committerRob Austein <sra@hactrn.net>2006-08-22 22:30:32 +0000
commitce6c39cb4737a44dfadc8a3494a94a4eec8a9a60 (patch)
tree825ca683d03a650703da1540e6efa12755753162 /scripts/make-hashes.pl
parent78d8fa13bb630408b49e7f3e1a2dfc0cd253f6f5 (diff)
# on 2006/08/12 17:08:24, sra did:
whoops, need per directory hash buckets svn path=/scripts/make-hashes.pl; revision=213
Diffstat (limited to 'scripts/make-hashes.pl')
-rw-r--r--scripts/make-hashes.pl15
1 files changed, 7 insertions, 8 deletions
diff --git a/scripts/make-hashes.pl b/scripts/make-hashes.pl
index 96953ccc..6676992e 100644
--- a/scripts/make-hashes.pl
+++ b/scripts/make-hashes.pl
@@ -6,9 +6,8 @@ use strict;
my $openssl = "/u/sra/isc/route-pki/subvert-rpki.hactrn.net/openssl/trunk/apps/openssl";
my $dir = "hashed";
-my %dirs;
my @cmds;
-my %count;
+my %hashes;
exit unless (@ARGV);
@@ -21,21 +20,21 @@ while (<F>) {
chomp;
my $f = $_;
my $type = /\.cer$/ ? "x509" : "crl";
+ $_ = "$dir/$f";
+ s=/[^/]+$==;
+ my $d = $_;
my $h = `$openssl $type -inform DER -in $f -noout -hash`;
chomp($h);
$h .= ".";
$h .= "r" if ($type eq "crl");
- my $n = 0 + $count{$h}++;
- $_ = "$dir/$f";
- s=/[^/]+$==;
- $dirs{$_} = 1;
- push(@cmds, "$openssl $type -inform DER -outform PEM -out $_/$h$n -in $f\n");
+ $h .= 0 + $hashes{$d}{$h}++;
+ push(@cmds, "$openssl $type -inform DER -outform PEM -out $d/$h -in $f\n");
}
close(F);
print("test -d $_ || mkdir -p $_\n")
- foreach (sort(keys(%dirs)));
+ foreach (sort(keys(%hashes)));
print($_)
foreach (@cmds);