summaryrefslogtreecommitdiffstats
path: root/crypto/ts
diff options
context:
space:
mode:
authorJonathan Scalise <scalisejonathan@gmail.com>2017-06-02 16:47:03 -0400
committerRichard Levitte <levitte@openssl.org>2018-01-24 16:23:20 +0100
commit8552d91856895960d00343972613ce5c296864b7 (patch)
tree13e48ba1eb7cb104fd8fdba6b7e2c9417ff4d3bf /crypto/ts
parent874893375c023c2b394887cfb54d52837a29f7c5 (diff)
Changed OPENSSL_gmtime so macOS uses threadsafe gmtime_r instead of gmtime.
Updated uses of gmtime to now call OPENSSL_gmtime instead. Used similar preprocessor logic to make sure localtime_r is called instead of localtime when applicable. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3609)
Diffstat (limited to 'crypto/ts')
-rw-r--r--crypto/ts/ts_rsp_sign.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/ts/ts_rsp_sign.c b/crypto/ts/ts_rsp_sign.c
index db6ce3241f..721ee25287 100644
--- a/crypto/ts/ts_rsp_sign.c
+++ b/crypto/ts/ts_rsp_sign.c
@@ -58,6 +58,7 @@
*/
#include "cryptlib.h"
+#include "o_time.h"
#if defined(OPENSSL_SYS_UNIX)
# include <sys/time.h>
@@ -948,6 +949,7 @@ static ASN1_GENERALIZEDTIME
{
time_t time_sec = (time_t)sec;
struct tm *tm = NULL;
+ struct tm result = {0};
char genTime_str[17 + TS_MAX_CLOCK_PRECISION_DIGITS];
char *p = genTime_str;
char *p_end = genTime_str + sizeof(genTime_str);
@@ -955,7 +957,7 @@ static ASN1_GENERALIZEDTIME
if (precision > TS_MAX_CLOCK_PRECISION_DIGITS)
goto err;
- if (!(tm = gmtime(&time_sec)))
+ if (!(tm = OPENSSL_gmtime(&time_sec, &result)))
goto err;
/*