diff options
author | Rob Austein <sra@hactrn.net> | 2006-08-22 22:28:43 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2006-08-22 22:28:43 +0000 |
commit | 23df5f10929f55dda14f948f27e726d68c16ecac (patch) | |
tree | 4ea91efdb2cd2c47cfc4e45829e1b96a1a9ee6cb | |
parent | ae410a8b815a014cbdd8af95cae6e6efe2d15ac8 (diff) |
# on 2006/08/10 06:49:35, sra did:
*** empty log message ***
svn path=/scripts/uri.pl; revision=197
-rw-r--r-- | scripts/uri.pl | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/scripts/uri.pl b/scripts/uri.pl index e91c4abe..10c4547e 100644 --- a/scripts/uri.pl +++ b/scripts/uri.pl @@ -3,20 +3,9 @@ eval 'exec perl -w -S $0 ${1+"$@"}' if 0; -use MIME::Base64; - -sub g { - my $x = shift; - $x =~ s{:}{}g; - $x = pack("H*", $x); - $x = encode_base64($x, ""); - $x =~ y{+/}{-_}; - $x =~ s{=+$}{}; - return $x; -} - while (@ARGV) { - my ($file, $aki, $ski, $a, $s) = shift(@ARGV); + my $file = shift(@ARGV); + my ($aia, $sia, $crl, $a, $s, $c) = qw(- - -); if ($file =~ /\.cer$/) { open(F, "-|", qw(openssl x509 -noout -inform DER -text -in), $file) or die("Couldn't run openssl x509 on $file: $!\n"); @@ -28,19 +17,20 @@ while (@ARGV) { } while (<F>) { chomp; - s/^\s*//; - s/^keyid://; + s{^.+URI:}{}; $a = $. + 1 - if (/X509v3 Authority Key Identifier:/); + if (/X509v3 Authority Information Access:/); $s = $. + 1 - if (/X509v3 Subject Key Identifier:/); - $aki = $_ + if (/X509v3 Subject Information Access:/); + $c = $. + 1 + if (/X509v3 CRL Distribution Points:/); + $aia = $_ if ($a && $. == $a); - $ski = $_ + $sia = $_ if ($s && $. == $s); + $crl = $_ + if ($c && $. == $c); } close(F); - my $gaki = $aki ? g($aki) : "=" x 27; - my $gski = $ski ? g($ski) : "=" x 27; - print("$gaki $gski $file\n"); + print("$aia $crl $sia $file\n"); } |