diff options
Diffstat (limited to 'crypto/asn1/a_time.c')
-rw-r--r-- | crypto/asn1/a_time.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index 266614d14f..27ddd30899 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -64,6 +64,7 @@ #include <stdio.h> #include <time.h> #include "cryptlib.h" +#include "o_time.h" #include <openssl/asn1t.h> IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME) @@ -100,14 +101,11 @@ int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp) ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) { struct tm *ts; -#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__) struct tm data; - gmtime_r(&t,&data); - ts=&data; /* should return &data, but doesn't on some systems, so we don't even look at the return value */ -#else - ts=gmtime(&t); -#endif + ts=OPENSSL_gmtime(&t,&data); + if (ts == NULL) + return NULL; if((ts->tm_year >= 50) && (ts->tm_year < 150)) return ASN1_UTCTIME_set(s, t); return ASN1_GENERALIZEDTIME_set(s,t); |