[openssl-commits] [openssl] master update

Viktor Dukhovni viktor at openssl.org
Wed Jan 13 17:38:34 UTC 2016


The branch master has been updated
       via  bdb1d0c24b3df3e2253cd8289cd619093524464e (commit)
       via  dbc8541b86aee7b6e13e2208545fe625fc13cd7b (commit)
      from  aa1477926769dcdf839f8fccd9db79847899aa86 (commit)


- Log -----------------------------------------------------------------
commit bdb1d0c24b3df3e2253cd8289cd619093524464e
Author: Viktor Dukhovni <openssl-users at dukhovni.org>
Date:   Wed Jan 13 12:12:17 2016 -0500

    Fix DES_LONG breakage
    
    For some strange reason opensslconf.h was only defining DES_LONG
    when included via des.h, but that's exceedingly fragile (as a
    result of include guards the include via des.h might not actually
    process the content again).
    
    Ripped out the nesting constraint, now always define OSSL_DES_LONG
    if not already defined.  Note, this could just be DES_LONG, but
    trying to avoid exposing DES_LONG in places where it has never been
    seen before, so it is up to des.h to actually define DES_LONG as
    OSSL_DES_LONG.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit dbc8541b86aee7b6e13e2208545fe625fc13cd7b
Author: Viktor Dukhovni <openssl-users at dukhovni.org>
Date:   Wed Jan 13 11:16:08 2016 -0500

    For stroimax need C99 inttypes.h
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 Configure                  |  4 ++--
 apps/apps.h                |  2 +-
 apps/opt.c                 |  4 ++--
 crypto/des/rpc_des.h       |  5 -----
 crypto/opensslconf.h.in    |  6 +++---
 include/openssl/des.h      |  2 ++
 include/openssl/e_os2.h    | 24 ++++++++----------------
 include/openssl/ossl_typ.h |  2 +-
 makevms.com                |  8 ++++----
 9 files changed, 23 insertions(+), 34 deletions(-)

diff --git a/Configure b/Configure
index ee60a39..4867475 100755
--- a/Configure
+++ b/Configure
@@ -2089,8 +2089,8 @@ while (<IN>)
 		{ printf OUT "#%s EIGHT_BIT\n",($b8)?"define":"undef"; }
 	elsif	(/^#((define)|(undef))\s+BN_LLONG\s*$/)
 		{ printf OUT "#%s BN_LLONG\n",($bn_ll)?"define":"undef"; }
-	elsif	(/^\#define\s+DES_LONG\s+.*/)
-		{ printf OUT "#define DES_LONG unsigned %s\n",
+	elsif	(/^\#define\s+OSSL_DES_LONG\s+.*/)
+		{ printf OUT "#define OSSL_DES_LONG unsigned %s\n",
 			($des_int)?'int':'long'; }
 	elsif	(/^\#(define|undef)\s+DES_PTR/)
 		{ printf OUT "#%s DES_PTR\n",($des_ptr)?'define':'undef'; }
diff --git a/apps/apps.h b/apps/apps.h
index 3ab453b..e242414 100644
--- a/apps/apps.h
+++ b/apps/apps.h
@@ -385,7 +385,7 @@ int opt_format(const char *s, unsigned long flags, int *result);
 int opt_int(const char *arg, int *result);
 int opt_ulong(const char *arg, unsigned long *result);
 int opt_long(const char *arg, long *result);
-#if defined(INTMAX_MAX) && defined(UINTMAX_MAX)
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 int opt_imax(const char *arg, intmax_t *result);
 int opt_umax(const char *arg, uintmax_t *result);
 #endif
diff --git a/apps/opt.c b/apps/opt.c
index b814d98..516b3de 100644
--- a/apps/opt.c
+++ b/apps/opt.c
@@ -75,7 +75,7 @@ static const OPTIONS *unknown;
 static const OPTIONS *opts;
 static char prog[40];
 
-#if !defined(INTMAX_MAX) || !defined(UINTMAX_MAX)
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
 #define opt_imax opt_long
 #define opt_umax opt_ulong
 #endif
@@ -397,7 +397,7 @@ int opt_long(const char *value, long *result)
     return 1;
 }
 
-#if defined(INTMAX_MAX) && defined(UINTMAX_MAX)
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* Parse an intmax_t, put it into *result; return 0 on failure, else 1. */
 int opt_imax(const char *value, intmax_t *result)
diff --git a/crypto/des/rpc_des.h b/crypto/des/rpc_des.h
index 4db9062..986ac55 100644
--- a/crypto/des/rpc_des.h
+++ b/crypto/des/rpc_des.h
@@ -94,11 +94,6 @@
 #define DES_MAXLEN      65536   /* maximum # of bytes to encrypt */
 #define DES_QUICKLEN    16      /* maximum # of bytes to encrypt quickly */
 
-#ifdef HEADER_DES_H
-# undef ENCRYPT
-# undef DECRYPT
-#endif
-
 enum desdir { ENCRYPT, DECRYPT };
 enum desmode { CBC, ECB };
 
diff --git a/crypto/opensslconf.h.in b/crypto/opensslconf.h.in
index 20a420f..27c725f 100644
--- a/crypto/opensslconf.h.in
+++ b/crypto/opensslconf.h.in
@@ -89,11 +89,11 @@
 #endif
 #endif
 
-#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
+#ifndef OSSL_DES_LONG
 /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
  * %20 speed up (longs are 8 bytes, int's are 4). */
-#ifndef DES_LONG
-#define DES_LONG unsigned long
+#ifndef OSSL_DES_LONG
+#define OSSL_DES_LONG unsigned long
 #endif
 #endif
 
diff --git a/include/openssl/des.h b/include/openssl/des.h
index 6bb037d..9bb2e77 100644
--- a/include/openssl/des.h
+++ b/include/openssl/des.h
@@ -66,6 +66,8 @@
 #  error DES is disabled.
 # endif
 
+# define DES_LONG OSSL_DES_LONG
+
 # ifdef OPENSSL_BUILD_SHLIBCRYPTO
 #  undef OPENSSL_EXTERN
 #  define OPENSSL_EXTERN OPENSSL_EXPORT
diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h
index 3e7f16c..ceecbfa 100644
--- a/include/openssl/e_os2.h
+++ b/include/openssl/e_os2.h
@@ -53,11 +53,11 @@
  *
  */
 
-#include <openssl/opensslconf.h>
-
 #ifndef HEADER_E_OS2_H
 # define HEADER_E_OS2_H
 
+# include <openssl/opensslconf.h>
+
 #ifdef  __cplusplus
 extern "C" {
 #endif
@@ -285,7 +285,9 @@ extern "C" {
 # endif
 
 /* Standard integer types */
-# if defined(__osf__) || defined(__sgi) || defined(__hpux) || defined(OPENSSL_SYS_VMS)
+# if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
+     defined(__osf__) || defined(__sgi) || defined(__hpux) || \
+     defined(OPENSSL_SYS_VMS)
 #  include <inttypes.h>
 # elif defined(OPENSSL_SYS_UEFI)
 typedef INT8 int8_t;
@@ -314,21 +316,11 @@ typedef unsigned __int64 uint64_t;
 # endif
 
 /*
- * We need a format operator for some client tools for uint64_t.
- * This is an attempt at doing so in a portable manner.
- * If we can't use a built-in definition, we'll revert to the previous
- * behavior that was hard-coded but now causing compiler warnings on
- * some systems (e.g. Mac OS X).
+ * We need a format operator for some client tools for uint64_t.  If inttypes.h
+ * isn't available or did not define it, just go with hard-coded.
  */
 # ifndef PRIu64
-#  ifdef __STDC_VERSION__
-#   if (__STDC_VERSION__ >= 199901L)
-#    include <inttypes.h>
-#   endif
-#  endif
-#  ifndef PRIu64
-#   define PRIu64 "lu"
-#  endif
+#  define PRIu64 "lu"
 # endif
 
 /* ossl_inline: portable inline definition usable in public headers */
diff --git a/include/openssl/ossl_typ.h b/include/openssl/ossl_typ.h
index f754136..059d386 100644
--- a/include/openssl/ossl_typ.h
+++ b/include/openssl/ossl_typ.h
@@ -201,7 +201,7 @@ typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
 typedef struct ocsp_response_st OCSP_RESPONSE;
 typedef struct ocsp_responder_id_st OCSP_RESPID;
 
-#if defined(INTMAX_MAX) && defined(UINTMAX_MAX)
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 typedef intmax_t ossl_intmax_t;
 typedef uintmax_t ossl_uintmax_t;
 #else
diff --git a/makevms.com b/makevms.com
index b26804b..ed0ac04 100755
--- a/makevms.com
+++ b/makevms.com
@@ -585,8 +585,8 @@ $   WRITE H_FILE "#define RC4_CHUNK unsigned long long"
 $   WRITE H_FILE "#endif"
 $!
 $   WRITE H_FILE "#if defined(HEADER_DES_LOCL_H)"
-$   WRITE H_FILE "#undef DES_LONG"
-$   WRITE H_FILE "#define DES_LONG unsigned int"
+$   WRITE H_FILE "#undef OSSL_DES_LONG"
+$   WRITE H_FILE "#define OSSL_DES_LONG unsigned int"
 $   WRITE H_FILE "#undef DES_PTR"
 $   WRITE H_FILE "#define DES_PTR"
 $   WRITE H_FILE "#undef DES_RISC1"
@@ -622,8 +622,8 @@ $   WRITE H_FILE "#define RC4_CHUNK unsigned long"
 $   WRITE H_FILE "#endif"
 $!
 $   WRITE H_FILE "#if defined(HEADER_DES_LOCL_H)"
-$   WRITE H_FILE "#undef DES_LONG"
-$   WRITE H_FILE "#define DES_LONG unsigned long"
+$   WRITE H_FILE "#undef OSSL_DES_LONG"
+$   WRITE H_FILE "#define OSSL_DES_LONG unsigned long"
 $   WRITE H_FILE "#undef DES_PTR"
 $   WRITE H_FILE "#define DES_PTR"
 $   WRITE H_FILE "#undef DES_RISC1"


More information about the openssl-commits mailing list