[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Andy Polyakov appro at openssl.org
Tue Mar 27 18:17:57 UTC 2018


The branch OpenSSL_1_1_0-stable has been updated
       via  ae43c92a337db1756c42e4d9f53f0ab92b40c04f (commit)
      from  b1eaed1c996da382efcbd44611a8917a68188dbf (commit)


- Log -----------------------------------------------------------------
commit ae43c92a337db1756c42e4d9f53f0ab92b40c04f
Author: Miroslav Suk <miroslav.suk at eset.cz>
Date:   Thu Mar 22 09:20:43 2018 +0100

    o_time.c: use gmtime_s with MSVC
    ts/ts_rsp_sign.c: change to OPENSSL_gmtime.
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5720)
    
    (cherry picked from commit 98c03302fb7b855647aa14022f61f5fb272e514a)

-----------------------------------------------------------------------

Summary of changes:
 crypto/o_time.c         | 4 ++++
 crypto/ts/ts_rsp_sign.c | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/crypto/o_time.c b/crypto/o_time.c
index b2fb38a..30b8155 100644
--- a/crypto/o_time.c
+++ b/crypto/o_time.c
@@ -41,6 +41,10 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
     if (gmtime_r(timer, result) == NULL)
         return NULL;
     ts = result;
+#elif defined (OPENSSL_SYS_WINDOWS) && defined(_MSC_VER) && _MSC_VER >= 1400
+    if (gmtime_s(result, timer))
+        return NULL;
+    ts = result;
 #else
     ts = gmtime(timer);
     if (ts == NULL)
diff --git a/crypto/ts/ts_rsp_sign.c b/crypto/ts/ts_rsp_sign.c
index aea7b92..91c4a42 100644
--- a/crypto/ts/ts_rsp_sign.c
+++ b/crypto/ts/ts_rsp_sign.c
@@ -16,6 +16,7 @@
 #include <openssl/objects.h>
 #include <openssl/ts.h>
 #include <openssl/pkcs7.h>
+#include <openssl/crypto.h>
 #include "ts_lcl.h"
 
 static ASN1_INTEGER *def_serial_cb(struct TS_resp_ctx *, void *);
@@ -840,7 +841,7 @@ static ASN1_GENERALIZEDTIME
                                     long sec, long usec, unsigned precision)
 {
     time_t time_sec = (time_t)sec;
-    struct tm *tm = NULL;
+    struct tm *tm = NULL, tm_result;
     char genTime_str[17 + TS_MAX_CLOCK_PRECISION_DIGITS];
     char *p = genTime_str;
     char *p_end = genTime_str + sizeof(genTime_str);
@@ -848,7 +849,7 @@ static ASN1_GENERALIZEDTIME
     if (precision > TS_MAX_CLOCK_PRECISION_DIGITS)
         goto err;
 
-    if ((tm = gmtime(&time_sec)) == NULL)
+    if ((tm = OPENSSL_gmtime(&time_sec, &tm_result)) == NULL)
         goto err;
 
     /*


More information about the openssl-commits mailing list