Skip to content

Commit

Permalink
Support OpenSSL 1.0, as found on CentOS 6.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Nov 28, 2012
1 parent 72e416b commit f0c6d11
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion build/check_locs_list.pl
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,27 @@
$subjectCN = $1;
# print "subjectCN = $subjectCN\n";
}
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";
if ($pubSize < 1024) {
print "*** $hostPort: PUBLIC KEY TOO SHORT ($pubSize bits)\n";
}
next;
} elsif (/^\s*Public-Key: \((\d+) bit\)/) { # OpenSSL 1.0
$pubSize = $1;
# print " Public key size: $pubSize\n";
if ($pubSize < 1024) {
print "*** $hostPort: PUBLIC KEY TOO SHORT ($pubSize bits)\n";
}
next;
}

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

0 comments on commit f0c6d11

Please sign in to comment.