[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Rich Salz rsalz at openssl.org
Sat Jan 30 19:41:29 UTC 2016


The branch OpenSSL_1_0_2-stable has been updated
       via  e0fde613acb2dcd5be0750f002e80bf345401a2e (commit)
      from  2454accb6eac2c1aca37fff588d9c65503c7f3ec (commit)


- Log -----------------------------------------------------------------
commit e0fde613acb2dcd5be0750f002e80bf345401a2e
Author: Rich Salz <rsalz at akamai.com>
Date:   Fri Jan 29 12:09:05 2016 -0500

    GH102: Add volatile to CRYPTO_memcmp
    
    Can't hurt and seems to prevent problems from some over-aggressive
    (LTO?) compilers.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (cherry picked from commit 98ab57644f44d2d83595c2d0f69138a284d6096b)

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

Summary of changes:
 crypto/cryptlib.c | 6 +++---
 crypto/crypto.h   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c
index c9f674b..1925428 100644
--- a/crypto/cryptlib.c
+++ b/crypto/cryptlib.c
@@ -1016,11 +1016,11 @@ void *OPENSSL_stderr(void)
     return stderr;
 }
 
-int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len)
+int CRYPTO_memcmp(const volatile void *in_a, const volatile void *in_b, size_t len)
 {
     size_t i;
-    const unsigned char *a = in_a;
-    const unsigned char *b = in_b;
+    const volatile unsigned char *a = in_a;
+    const volatile unsigned char *b = in_b;
     unsigned char x = 0;
 
     for (i = 0; i < len; i++)
diff --git a/crypto/crypto.h b/crypto/crypto.h
index c450d7a..6c644ce 100644
--- a/crypto/crypto.h
+++ b/crypto/crypto.h
@@ -628,7 +628,7 @@ void OPENSSL_init(void);
  * into a defined order as the return value when a != b is undefined, other
  * than to be non-zero.
  */
-int CRYPTO_memcmp(const void *a, const void *b, size_t len);
+int CRYPTO_memcmp(const volatile void *a, const volatile void *b, size_t len);
 
 /* BEGIN ERROR CODES */
 /*


More information about the openssl-commits mailing list