diff --git a/build/check_locs_list.pl b/build/check_locs_list.pl index d48416d3..9d18c9c2 100755 --- a/build/check_locs_list.pl +++ b/build/check_locs_list.pl @@ -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;