Skip to content

Commit

Permalink
Handle the new format OpenSSL 1.0.0c uses for public key size.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Feb 1, 2011
1 parent d3e0f5b commit 7f9d7c4
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions build/check_authorities.pl
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,27 @@
$subject = $1;
print " Subject: $subject\n" unless $subject eq $issuer;
}
if (/RSA Public Key: \((\d+) bit\)/) {

#
# Extract the public key size. This is displayed differently
# in different versions of OpenSSL.
#
if (/RSA Public Key: \((\d+) bit\)/) { # OpenSSL 0.9x
$pubSize = $1;
print " Public key size: $pubSize\n";
# print " Public key size: $pubSize\n";
if ($pubSize < 1024) {
print " *** PUBLIC KEY TOO SHORT ***\n";
error('PUBLIC KEY TOO SHORT');
}
next;
} elsif (/^\s*Public-Key: \((\d+) bit\)/) { # OpenSSL 1.0
$pubSize = $1;
# print " Public key size: $pubSize\n";
if ($pubSize < 1024) {
error('PUBLIC KEY TOO SHORT');
}
next;
}

if (/Not After : (.*)$/) {
$notAfter = $1;
$days = (str2time($notAfter)-time())/86400.0;
Expand Down

0 comments on commit 7f9d7c4

Please sign in to comment.