aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_x509revoked.c
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-06-01 16:33:56 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-06-01 16:33:56 +0900
commitdc2222fd8323d0c8cb74e25dad819ecdbdd99e2a (patch)
tree7a1aee21a017cfd9c51fbaee44193e7257044412 /ext/openssl/ossl_x509revoked.c
parent17b3f3ed11660fd3adaf74ca7e13fdf83689a241 (diff)
downloadruby-topic/openssl-get-rid-of-time_t.tar.gz
openssl: fix the Year 2038 issuetopic/openssl-get-rid-of-time_t
The fix in r55219 was wrong. It fixed the issue only when long is 32bit and also time_t is 64bit. But time_t may be 32bit. OpenSSL 1.0.0 introduced ASN1_TIME_adj() and X509_time_adj_ex() which takes offset days. So make use of it.
Diffstat (limited to 'ext/openssl/ossl_x509revoked.c')
-rw-r--r--ext/openssl/ossl_x509revoked.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ext/openssl/ossl_x509revoked.c b/ext/openssl/ossl_x509revoked.c
index 46250e1225..fc1a7d1337 100644
--- a/ext/openssl/ossl_x509revoked.c
+++ b/ext/openssl/ossl_x509revoked.c
@@ -144,13 +144,10 @@ static VALUE
ossl_x509revoked_set_time(VALUE self, VALUE time)
{
X509_REVOKED *rev;
- time_t sec;
- sec = time_to_time_t(time);
GetX509Rev(self, rev);
- if (!X509_time_adj(rev->revocationDate, 0, &sec)) {
+ if (!ossl_x509_time_adjust(rev->revocationDate, time))
ossl_raise(eX509RevError, NULL);
- }
return time;
}