From 4f6f620875ba9a2f1946025232daefed762fd811 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 26 May 2004 17:50:11 +0000 Subject: pullup from trunk ticket: 2564 version_fixed: 1.3.4 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-3@16365 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/aes/ChangeLog | 8 ++++++++ src/lib/crypto/aes/aesopt.h | 26 +++++++++++++++----------- src/util/db2/ChangeLog | 4 ++++ src/util/db2/configure.in | 3 ++- src/util/db2/include/ChangeLog | 4 ++++ src/util/db2/include/db-int.h | 3 +++ 6 files changed, 36 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/lib/crypto/aes/ChangeLog b/src/lib/crypto/aes/ChangeLog index f937690..6955bc1 100644 --- a/src/lib/crypto/aes/ChangeLog +++ b/src/lib/crypto/aes/ChangeLog @@ -1,3 +1,11 @@ +2004-05-25 Tom Yu + + * aesopt.h (PLATFORM_BYTE_ORDER): Treat _WIN32 as always + little-endian. Default to little-endian if there's no other + compile-time way to detect endianness, noting it as a guess. + (SAFE_IO): Error out if SAFE_IO is not set and endianness was + guessed. + 2004-05-07 Ken Raeburn * aesopt.h (PLATFORM_BYTE_ORDER): Check for _MIPSEB, _MIPSEL. If diff --git a/src/lib/crypto/aes/aesopt.h b/src/lib/crypto/aes/aesopt.h index da5c83b..0eebd46 100644 --- a/src/lib/crypto/aes/aesopt.h +++ b/src/lib/crypto/aes/aesopt.h @@ -180,7 +180,9 @@ # define PLATFORM_BYTE_ORDER AES_BIG_ENDIAN #elif defined(_MIPSEL) # define PLATFORM_BYTE_ORDER AES_LITTLE_ENDIAN -#elif !defined(WIN32) +#elif defined(_WIN32) +# define PLATFORM_BYTE_ORDER AES_LITTLE_ENDIAN +#elif !defined(_WIN32) # include # if defined(HAVE_ENDIAN_H) # include @@ -236,19 +238,12 @@ #define PLATFORM_BYTE_ORDER AES_LITTLE_ENDIAN #elif 0 /* **** EDIT HERE IF NECESSARY **** */ #define PLATFORM_BYTE_ORDER AES_BIG_ENDIAN -#else -# error "barf" -/*#elif (('1234' >> 24) == '1') -# define PLATFORM_BYTE_ORDER AES_LITTLE_ENDIAN -#elif (('4321' >> 24) == '1') -# define PLATFORM_BYTE_ORDER AES_BIG_ENDIAN*/ +#elif 1 +#define PLATFORM_BYTE_ORDER AES_LITTLE_ENDIAN +#define UNKNOWN_BYTE_ORDER /* we're guessing */ #endif #endif -#if !defined(PLATFORM_BYTE_ORDER) -# error Please set undetermined byte order (lines 229 or 231 of aesopt.h). -#endif - /* 3. ASSEMBLER SUPPORT If the assembler code is used for encryption and decryption this file only @@ -352,6 +347,15 @@ #define SAFE_IO #endif +/* + * If PLATFORM_BYTE_ORDER does not match the actual machine byte + * order, the fast word-access code will cause incorrect results. + * Therefore, SAFE_IO is required when the byte order is unknown. + */ +#if !defined(SAFE_IO) && defined(UNKNOWN_BYTE_ORDER) +# error "SAFE_IO must be defined if machine byte order is unknown." +#endif + /* 7. LOOP UNROLLING The code for encryption and decrytpion cycles through a number of rounds diff --git a/src/util/db2/ChangeLog b/src/util/db2/ChangeLog index 53542b9..4259b31 100644 --- a/src/util/db2/ChangeLog +++ b/src/util/db2/ChangeLog @@ -1,3 +1,7 @@ +2004-05-23 Ken Raeburn + + * configure.in: Check for sys/param.h too. + 2004-05-07 Ken Raeburn * configure.in: Check for machine/endian.h too. diff --git a/src/util/db2/configure.in b/src/util/db2/configure.in index dc1fb1a..c5930b5 100644 --- a/src/util/db2/configure.in +++ b/src/util/db2/configure.in @@ -65,7 +65,8 @@ dnl checks for structures dnl checks for compiler characteristics dnl AC_C_BIGENDIAN - No, check at compile time; Darwin can build for multiple dnl targets in one tree. -AC_CHECK_HEADERS(endian.h machine/endian.h) +AC_CHECK_HEADERS(endian.h machine/endian.h sys/param.h) +dnl sys/param.h for AIX 4.3.3 (actually sys/machine.h) dnl There's also sys/endian.h on IRIX, but we already check _MIPSE{L,B}. AC_C_CONST AC_CHECK_SIZEOF(int) diff --git a/src/util/db2/include/ChangeLog b/src/util/db2/include/ChangeLog index 1ad2200..676bbd4 100644 --- a/src/util/db2/include/ChangeLog +++ b/src/util/db2/include/ChangeLog @@ -1,3 +1,7 @@ +2004-05-23 Ken Raeburn + + * db-int.h: Include sys/param.h if available. + 2004-05-07 Ken Raeburn * db-int.h: Include machine/endian.h if available. Check for diff --git a/src/util/db2/include/db-int.h b/src/util/db2/include/db-int.h index f50f6d0..bbb2292 100644 --- a/src/util/db2/include/db-int.h +++ b/src/util/db2/include/db-int.h @@ -51,6 +51,9 @@ #ifdef HAVE_MACHINE_ENDIAN_H # include #endif +#ifdef HAVE_SYS_PARAM_H +# include +#endif /* Handle both BIG and LITTLE defined and BYTE_ORDER matches one, or just one defined; both with and without leading underscores. -- cgit v1.1