Skip to content

Commit

Permalink
Look at expiry date on embedded certificates: flag ones which have ex…
Browse files Browse the repository at this point in the history
…pired, warn about ones close to expiry (30 days) and show ones within 60 days of expiry.
  • Loading branch information
iay committed Jun 11, 2008
1 parent de3bdfb commit 66ed027
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build/check_embedded.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 @@ -78,6 +79,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 < 90) {
$days = int($days);
print " expires in $days days\n";
}
}
}
close SSL;
#print " text lines: $#lines\n";
Expand Down

0 comments on commit 66ed027

Please sign in to comment.