ssl/ssl_asn1.c: resolve warnings in VC-WIN32 build, which allows to add /WX.
authorAndy Polyakov <appro@openssl.org>
Sat, 11 Nov 2017 21:21:10 +0000 (22:21 +0100)
committerAndy Polyakov <appro@openssl.org>
Mon, 13 Nov 2017 09:58:21 +0000 (10:58 +0100)
It's argued that /WX allows to keep better focus on new code, which
motivates its comeback...

[Keep this commit separate as reminder for time overhaul.]

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4721)

ssl/ssl_asn1.c

index 7258618d18f76bf618ff0444f39dad1a44d974c8..9327b339cae80a5f148bf85b584fc2930402642f 100644 (file)
@@ -296,12 +296,12 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
     ret->master_key_length = tmpl;
 
     if (as->time != 0)
-        ret->time = as->time;
+        ret->time = (long)as->time;
     else
-        ret->time = (unsigned long)time(NULL);
+        ret->time = (long)time(NULL);
 
     if (as->timeout != 0)
-        ret->timeout = as->timeout;
+        ret->timeout = (long)as->timeout;
     else
         ret->timeout = 3;
 
@@ -326,7 +326,7 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
         goto err;
 #endif
 
-    ret->ext.tick_lifetime_hint = as->tlsext_tick_lifetime_hint;
+    ret->ext.tick_lifetime_hint = (unsigned long)as->tlsext_tick_lifetime_hint;
     ret->ext.tick_age_add = as->tlsext_tick_age_add;
     if (as->tlsext_tick) {
         ret->ext.tick = as->tlsext_tick->data;
@@ -352,7 +352,7 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
         goto err;
 #endif                          /* OPENSSL_NO_SRP */
     /* Flags defaults to zero which is fine */
-    ret->flags = as->flags;
+    ret->flags = (int32_t)as->flags;
     ret->ext.max_early_data = as->max_early_data;
 
     if (as->alpn_selected != NULL) {