From 23df5f10929f55dda14f948f27e726d68c16ecac Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 22 Aug 2006 22:28:43 +0000 Subject: # on 2006/08/10 06:49:35, sra did: *** empty log message *** svn path=/scripts/uri.pl; revision=197 --- scripts/uri.pl | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'scripts/uri.pl') 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 () { 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"); } -- cgit v1.2.3