diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-10-07 22:55:27 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-10-07 22:55:27 +0000 |
commit | 87d3a0cd9006f67fed0d3335d8b1c5ab94a26f8f (patch) | |
tree | 1e3f5000326191e669df486f0a0a471aed765df6 /apps | |
parent | 1e369b375eaae43e2ec186f067905a0fab4bd6f1 (diff) |
Experimental new date handling routines. These fix issues with X509_time_adj()
and should avoid any OS date limitations such as the year 2038 bug.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/ca.c | 4 | ||||
-rw-r--r-- | apps/req.c | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -1399,7 +1399,7 @@ bad: if (!tmptm) goto err; X509_gmtime_adj(tmptm,0); X509_CRL_set_lastUpdate(crl, tmptm); - X509_gmtime_adj(tmptm,(crldays*24+crlhours)*60*60 + crlsec); + X509_time_adj_ex(tmptm, crldays, crlhours*60*60 + crlsec, NULL); X509_CRL_set_nextUpdate(crl, tmptm); ASN1_TIME_free(tmptm); @@ -2006,7 +2006,7 @@ again2: else ASN1_UTCTIME_set_string(X509_get_notBefore(ret),startdate); if (enddate == NULL) - X509_gmtime_adj(X509_get_notAfter(ret),(long)60*60*24*days); + X509_time_adj_ex(X509_get_notAfter(ret),days, 0, NULL); else ASN1_UTCTIME_set_string(X509_get_notAfter(ret),enddate); if (!X509_set_subject_name(ret,subject)) goto err; diff --git a/apps/req.c b/apps/req.c index 75d87808f2..e728d5bf95 100644 --- a/apps/req.c +++ b/apps/req.c @@ -838,7 +838,7 @@ loop: if (!X509_set_issuer_name(x509ss, X509_REQ_get_subject_name(req))) goto end; if (!X509_gmtime_adj(X509_get_notBefore(x509ss),0)) goto end; - if (!X509_gmtime_adj(X509_get_notAfter(x509ss), (long)60*60*24*days)) goto end; + if (!X509_time_adj_ex(X509_get_notAfter(x509ss), days, 0, NULL)) goto end; if (!X509_set_subject_name(x509ss, X509_REQ_get_subject_name(req))) goto end; tmppkey = X509_REQ_get_pubkey(req); if (!tmppkey || !X509_set_pubkey(x509ss,tmppkey)) goto end; |