Skip to content

Commit af9839c

Browse files
committed
Provide a 1 day grace period for the 'notBefore' test on certificates.
1 parent df9b1a7 commit af9839c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cups/tls-gnutls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ cupsGetCredentialsTrust(
10051005
time_t curtime; // Current date/time
10061006

10071007
time(&curtime);
1008-
if (curtime < gnutls_x509_crt_get_activation_time(certs[0]) || curtime > gnutls_x509_crt_get_expiration_time(certs[0]))
1008+
if ((curtime + 86400) < gnutls_x509_crt_get_activation_time(certs[0]) || curtime > gnutls_x509_crt_get_expiration_time(certs[0]))
10091009
{
10101010
_cupsSetError(IPP_STATUS_ERROR_CUPS_PKI, _("Credentials have expired."), true);
10111011
trust = HTTP_TRUST_EXPIRED;

cups/tls-openssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ cupsGetCredentialsTrust(
10281028

10291029
DEBUG_printf("1cupsGetCredentialsTrust: curtime=%ld, notBefore=%ld, notAfter=%ld", (long)curtime, (long)openssl_get_date(cert, 0), (long)openssl_get_date(cert, 1));
10301030

1031-
if (curtime < openssl_get_date(cert, 0) || curtime > openssl_get_date(cert, 1))
1031+
if ((curtime + 86400) < openssl_get_date(cert, 0) || curtime > openssl_get_date(cert, 1))
10321032
{
10331033
_cupsSetError(IPP_STATUS_ERROR_CUPS_PKI, _("Credentials have expired."), true);
10341034
trust = HTTP_TRUST_EXPIRED;

0 commit comments

Comments
 (0)