[openssl-commits] [openssl] master update

Andy Polyakov appro at openssl.org
Tue Oct 6 07:45:02 UTC 2015


The branch master has been updated
       via  f4bd5de54459cc5f873807c7ed1f1b04b6e8d7e3 (commit)
      from  52ee3ed3a11024ab6e11c5705da6c3ba17cf7d98 (commit)


- Log -----------------------------------------------------------------
commit f4bd5de54459cc5f873807c7ed1f1b04b6e8d7e3
Author: Andy Polyakov <appro at openssl.org>
Date:   Mon Oct 5 15:23:37 2015 +0200

    Address more Windows warnings illuminated by mingw.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 include/openssl/e_os2.h   |  8 ++++++--
 ssl/record/rec_layer_s3.c | 16 ++++++++--------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h
index 6ef1f39..23602a5 100644
--- a/include/openssl/e_os2.h
+++ b/include/openssl/e_os2.h
@@ -262,8 +262,12 @@ extern "C" {
 #  define OPENSSL_GLOBAL_REF(name) _shadow_##name
 # endif
 
-# ifdef OPENSSL_SYS_MSDOS
-#  define ossl_ssize_t long
+# ifdef _WIN32
+#  ifdef _WIN64
+#   define ossl_ssize_t __int64
+#  else
+#   define ossl_ssize_t int
+#  endif
 # endif
 
 # if defined(__ultrix) && !defined(ssize_t)
diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c
index 6beb8ce..f5dd27a 100644
--- a/ssl/record/rec_layer_s3.c
+++ b/ssl/record/rec_layer_s3.c
@@ -293,7 +293,7 @@ int ssl3_read_n(SSL *s, int n, int max, int extend)
      * s->packet_length bytes if extend == 1].)
      */
     int i, len, left;
-    long align = 0;
+    size_t align = 0;
     unsigned char *pkt;
     SSL3_BUFFER *rb;
 
@@ -307,8 +307,8 @@ int ssl3_read_n(SSL *s, int n, int max, int extend)
 
     left = rb->left;
 #if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD!=0
-    align = (long)rb->buf + SSL3_RT_HEADER_LENGTH;
-    align = (-align) & (SSL3_ALIGN_PAYLOAD - 1);
+    align = (size_t)rb->buf + SSL3_RT_HEADER_LENGTH;
+    align = (0-align) & (SSL3_ALIGN_PAYLOAD - 1);
 #endif
 
     if (!extend) {
@@ -673,7 +673,7 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
     int i, mac_size, clear = 0;
     int prefix_len = 0;
     int eivlen;
-    long align = 0;
+    size_t align = 0;
     SSL3_RECORD *wr;
     SSL3_BUFFER *wb = &s->rlayer.wbuf;
     SSL_SESSION *sess;
@@ -753,8 +753,8 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
          * multiple of SSL3_ALIGN_PAYLOAD, so if we want to align the real
          * payload, then we can just pretent we simply have two headers.
          */
-        align = (long)SSL3_BUFFER_get_buf(wb) + 2 * SSL3_RT_HEADER_LENGTH;
-        align = (-align) & (SSL3_ALIGN_PAYLOAD - 1);
+        align = (size_t)SSL3_BUFFER_get_buf(wb) + 2 * SSL3_RT_HEADER_LENGTH;
+        align = (0-align) & (SSL3_ALIGN_PAYLOAD - 1);
 #endif
         p = SSL3_BUFFER_get_buf(wb) + align;
         SSL3_BUFFER_set_offset(wb, align);
@@ -762,8 +762,8 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
         p = SSL3_BUFFER_get_buf(wb) + SSL3_BUFFER_get_offset(wb) + prefix_len;
     } else {
 #if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD!=0
-        align = (long)SSL3_BUFFER_get_buf(wb) + SSL3_RT_HEADER_LENGTH;
-        align = (-align) & (SSL3_ALIGN_PAYLOAD - 1);
+        align = (size_t)SSL3_BUFFER_get_buf(wb) + SSL3_RT_HEADER_LENGTH;
+        align = (0-align) & (SSL3_ALIGN_PAYLOAD - 1);
 #endif
         p = SSL3_BUFFER_get_buf(wb) + align;
         SSL3_BUFFER_set_offset(wb, align);


More information about the openssl-commits mailing list