From: Dr. Stephen Henson Date: Sun, 5 Dec 2004 18:26:48 +0000 (+0000) Subject: Use X509_cmp_time() in -checkend option, to support GeneralizedTime. X-Git-Tag: BEN_FIPS_TEST_6~18 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b0ab906524081a75283b5c7a5e75e5fb35b93dc8;p=oweals%2Fopenssl.git Use X509_cmp_time() in -checkend option, to support GeneralizedTime. --- diff --git a/apps/x509.c b/apps/x509.c index 167b94f85f..7a998523c7 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -974,9 +974,9 @@ bad: if (checkend) { - time_t tnow=time(NULL); + time_t tcheck=time(NULL) + checkoffset; - if (ASN1_UTCTIME_cmp_time_t(X509_get_notAfter(x), tnow+checkoffset) == -1) + if (X509_cmp_time(X509_get_notAfter(x), &tcheck) < 0) { BIO_printf(out,"Certificate will expire\n"); ret=1;