From f0c6d1184282bb4f953834644e950841091ac2ee Mon Sep 17 00:00:00 2001 From: Ian Young Date: Wed, 28 Nov 2012 11:54:26 +0000 Subject: [PATCH] Support OpenSSL 1.0, as found on CentOS 6.x. --- build/check_locs_list.pl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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;