[openssl-commits] [openssl] master update

Andy Polyakov appro at openssl.org
Sat Nov 21 13:22:20 UTC 2015


The branch master has been updated
       via  58a816d645bdf36e9f47e5e2507f0febba542181 (commit)
       via  d011253f7a1a9d5e6bca436ed597050298d25b58 (commit)
       via  fc47ad3b7f8f3eb24ded45bb7e2ecc7b95f2a74e (commit)
       via  3003e0a4220f66690778b3ef7247ad5b56b4a375 (commit)
       via  c880b3e3141ba5229d4ddf8390c4b9e09cd832f8 (commit)
      from  043b93d7323a70d4157709fbf4a804d1a0f7c824 (commit)


- Log -----------------------------------------------------------------
commit 58a816d645bdf36e9f47e5e2507f0febba542181
Author: Andy Polyakov <appro at openssl.org>
Date:   Wed Oct 28 11:49:01 2015 +0100

    Fix STRICT_ALIGNMENT for whrlpool
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit d011253f7a1a9d5e6bca436ed597050298d25b58
Author: Alessandro Ghedini <alessandro at ghedini.me>
Date:   Fri Oct 23 16:17:33 2015 +0200

    Declare cleanse_ctr variable as extern
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit fc47ad3b7f8f3eb24ded45bb7e2ecc7b95f2a74e
Author: Alessandro Ghedini <alessandro at ghedini.me>
Date:   Thu Oct 22 12:34:24 2015 +0200

    Add no-asm builds to Travis
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit 3003e0a4220f66690778b3ef7247ad5b56b4a375
Author: Alessandro Ghedini <alessandro at ghedini.me>
Date:   Sat Oct 17 21:28:25 2015 +0200

    Fix (minor) problems found by ubsan
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit c880b3e3141ba5229d4ddf8390c4b9e09cd832f8
Author: Alessandro Ghedini <alessandro at ghedini.me>
Date:   Sat Oct 17 21:00:55 2015 +0200

    Add Travis builds with undefined behavior sanitizer
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>

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

Summary of changes:
 .travis.yml                |  9 +++++++--
 crypto/evp/scrypt.c        |  2 +-
 crypto/mem_clr.c           |  1 +
 crypto/whrlpool/wp_block.c | 43 +++++++++++++++++++++++--------------------
 test/ssltest.c             |  7 ++++++-
 5 files changed, 38 insertions(+), 24 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 5d7cf69..f431989 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,6 +27,7 @@ compiler:
 env:
     - CONFIG_OPTS=""
     - CONFIG_OPTS="shared"
+    - CONFIG_OPTS="no-asm"
     - CONFIG_OPTS="--debug --strict-warnings"
 
 matrix:
@@ -36,13 +37,13 @@ matrix:
           env: CONFIG_OPTS="-fsanitize=address"
         - os: linux
           compiler: clang-3.6
-          env: CONFIG_OPTS="--debug --strict-warnings -fsanitize=address"
+          env: CONFIG_OPTS="no-asm --debug --strict-warnings -fno-sanitize-recover -fsanitize=address -fsanitize=undefined"
         - os: linux
           compiler: gcc-5
           env: CONFIG_OPTS="-fsanitize=address"
         - os: linux
           compiler: gcc-5
-          env: CONFIG_OPTS="--debug --strict-warnings -fsanitize=address"
+          env: CONFIG_OPTS="no-asm --debug --strict-warnings -fno-sanitize-recover -fsanitize=address -fsanitize=undefined"
     exclude:
         - os: osx
           compiler: clang-3.6
@@ -56,6 +57,10 @@ matrix:
           env: CONFIG_OPTS="shared"
         - compiler: x86_64-w64-mingw32-gcc
           env: CONFIG_OPTS="shared"
+        - compiler: i686-w64-mingw32-gcc
+          env: CONFIG_OPTS="no-asm"
+        - compiler: x86_64-w64-mingw32-gcc
+          env: CONFIG_OPTS="no-asm"
     allow_failures:
         - compiler: i686-w64-mingw32-gcc
           env: CONFIG_OPTS="--debug --strict-warnings"
diff --git a/crypto/evp/scrypt.c b/crypto/evp/scrypt.c
index 26b4e59..e609594 100644
--- a/crypto/evp/scrypt.c
+++ b/crypto/evp/scrypt.c
@@ -139,7 +139,7 @@ static void scryptROMix(unsigned char *B, uint64_t r, uint64_t N,
         *pV = *pB++;
         *pV |= *pB++ << 8;
         *pV |= *pB++ << 16;
-        *pV |= *pB++ << 24;
+        *pV |= (uint32_t)*pB++ << 24;
     }
 
     for (i = 1; i < N; i++, pV += 32 * r)
diff --git a/crypto/mem_clr.c b/crypto/mem_clr.c
index 1a06636..5c03dff 100644
--- a/crypto/mem_clr.c
+++ b/crypto/mem_clr.c
@@ -60,6 +60,7 @@
 #include <string.h>
 #include <openssl/crypto.h>
 
+extern unsigned char cleanse_ctr;
 unsigned char cleanse_ctr = 0;
 
 void OPENSSL_cleanse(void *ptr, size_t len)
diff --git a/crypto/whrlpool/wp_block.c b/crypto/whrlpool/wp_block.c
index 7baca60..7e49383 100644
--- a/crypto/whrlpool/wp_block.c
+++ b/crypto/whrlpool/wp_block.c
@@ -50,9 +50,10 @@ typedef unsigned long long u64;
 #define ROUNDS  10
 
 #define STRICT_ALIGNMENT
-#if defined(__i386) || defined(__i386__) || \
-    defined(__x86_64) || defined(__x86_64__) || \
-    defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64)
+#if !defined(PEDANTIC) && (defined(__i386) || defined(__i386__) || \
+                           defined(__x86_64) || defined(__x86_64__) || \
+                           defined(_M_IX86) || defined(_M_AMD64) || \
+                           defined(_M_X64))
 /*
  * Well, formally there're couple of other architectures, which permit
  * unaligned loads, specifically those not crossing cache lines, IA-64 and
@@ -82,17 +83,18 @@ typedef unsigned long long u64;
 #endif
 
 #undef ROTATE
-#if defined(_MSC_VER)
-# if defined(_WIN64)            /* applies to both IA-64 and AMD64 */
-#  pragma intrinsic(_rotl64)
-#  define ROTATE(a,n) _rotl64((a),n)
-# endif
-#elif defined(__GNUC__) && __GNUC__>=2
-# if defined(__x86_64) || defined(__x86_64__)
-#  if defined(L_ENDIAN)
-#   define ROTATE(a,n)       ({ u64 ret; asm ("rolq %1,%0"   \
+#ifndef PEDANTIC
+# if defined(_MSC_VER)
+#  if defined(_WIN64)            /* applies to both IA-64 and AMD64 */
+#   pragma intrinsic(_rotl64)
+#   define ROTATE(a,n) _rotl64((a),n)
+#  endif
+# elif defined(__GNUC__) && __GNUC__>=2
+#  if defined(__x86_64) || defined(__x86_64__)
+#   if defined(L_ENDIAN)
+#    define ROTATE(a,n)       ({ u64 ret; asm ("rolq %1,%0"   \
                                    : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; })
-#  elif defined(B_ENDIAN)
+#   elif defined(B_ENDIAN)
        /*
         * Most will argue that x86_64 is always little-endian. Well, yes, but
         * then we have stratus.com who has modified gcc to "emulate"
@@ -100,16 +102,17 @@ typedef unsigned long long u64;
         * won't do same for x86_64? Naturally no. And this line is waiting
         * ready for that brave soul:-)
         */
-#   define ROTATE(a,n)       ({ u64 ret; asm ("rorq %1,%0"   \
+#    define ROTATE(a,n)       ({ u64 ret; asm ("rorq %1,%0"   \
                                    : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; })
-#  endif
-# elif defined(__ia64) || defined(__ia64__)
-#  if defined(L_ENDIAN)
-#   define ROTATE(a,n)       ({ u64 ret; asm ("shrp %0=%1,%1,%2"     \
+#   endif
+#  elif defined(__ia64) || defined(__ia64__)
+#   if defined(L_ENDIAN)
+#    define ROTATE(a,n)       ({ u64 ret; asm ("shrp %0=%1,%1,%2"     \
                                    : "=r"(ret) : "r"(a),"M"(64-(n))); ret; })
-#  elif defined(B_ENDIAN)
-#   define ROTATE(a,n)       ({ u64 ret; asm ("shrp %0=%1,%1,%2"     \
+#   elif defined(B_ENDIAN)
+#    define ROTATE(a,n)       ({ u64 ret; asm ("shrp %0=%1,%1,%2"     \
                                    : "=r"(ret) : "r"(a),"M"(n)); ret; })
+#   endif
 #  endif
 # endif
 #endif
diff --git a/test/ssltest.c b/test/ssltest.c
index c46c211..1128ec8 100644
--- a/test/ssltest.c
+++ b/test/ssltest.c
@@ -454,7 +454,12 @@ static int verify_alpn(SSL *client, SSL *server)
     OPENSSL_free(alpn_selected);
     alpn_selected = NULL;
 
-    if (client_proto_len != server_proto_len ||
+    if (client_proto_len != server_proto_len) {
+        BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
+        goto err;
+    }
+
+    if (client_proto != NULL &&
         memcmp(client_proto, server_proto, client_proto_len) != 0) {
         BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
         goto err;


More information about the openssl-commits mailing list