Skip to content

Commit

Permalink
Don't print both issuer and subject for a root certificate.
Browse files Browse the repository at this point in the history
Look at expiry date on authority certificates: flag ones which have expired, warn about ones close to expiry (30 days) and show ones within two years of expiry.
  • Loading branch information
iay committed Jun 11, 2008
1 parent 0575c63 commit de3bdfb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion build/check_authorities.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/perl -w
use File::Temp qw(tempfile);
use Date::Parse;

while (<>) {

Expand Down Expand Up @@ -54,7 +55,7 @@
}
if (/^\s*Subject:\s*(.*)$/) {
$subject = $1;
print " Subject: $subject\n";
print " Subject: $subject\n" unless $subject eq $issuer;
}
if (/RSA Public Key: \((\d+) bit\)/) {
$pubSize = $1;
Expand All @@ -63,6 +64,19 @@
print " *** PUBLIC KEY TOO SHORT ***\n";
}
}
if (/Not After : (.*)$/) {
$notAfter = $1;
$days = (str2time($notAfter)-time())/86400.0;
if ($days < 0) {
print " *** EXPIRED ***\n";
} elsif ($days < 30) {
$days = int($days);
print " *** expires in $days days\n";
} elsif ($days < (365*2)) {
$days = int($days);
print " expires in $days days\n";
}
}
}
close SSL;
#print " text lines: $#lines\n";
Expand Down

0 comments on commit de3bdfb

Please sign in to comment.