24 lines
796 B
Plaintext
24 lines
796 B
Plaintext
--source include/no_valgrind_without_big.inc
|
||
--source include/have_openssl.inc
|
||
|
||
--echo #
|
||
--echo # Bug#20923066 SSL AND RSA KEY MATERIAL EXPIRATION SHOULD BE EXTENDED
|
||
--echo #
|
||
|
||
let VALIDITY_START= `show status like 'Ssl_server_not_before'`;
|
||
let VALIDITY_END= `show status like 'Ssl_server_not_after'`;
|
||
|
||
perl;
|
||
my @start_date = $ENV{'VALIDITY_START'} =~ /(\d+:\d+:\d+) (\d+)/;
|
||
my @end_date = $ENV{'VALIDITY_END'} =~ /(\d+:\d+:\d+) (\d+)/;
|
||
my $cert_validity= $end_date[1] - $start_date[1];
|
||
|
||
# The default validity is 3650 days, which typically misses four leap days.
|
||
# Thus, if the day is Jan 1–5 (we add some extra padding), work around it.
|
||
if ($ENV{'VALIDITY_START'} =~ /Jan\s+[1-5]/ && $cert_validity == 9) {
|
||
++$cert_validity;
|
||
}
|
||
|
||
print "Validity of certificate: $cert_validity years\n";
|
||
EOF
|