Bad packet length in 2.5.1 with rijndael
Mark D. Baushke
mdb at juniper.net
Tue Feb 27 23:07:13 EST 2001
> Date: Tue, 27 Feb 2001 12:35:16 +0100
> From: Markus Friedl <markus.friedl at informatik.uni-erlangen.de>
>
> it seems that this check does not work on solaris
>
> #if BYTE_ORDER != LITTLE_ENDIAN
> #define BYTE_SWAP
> #endif
>
> could you please check that BYTE_SWAP is defined
> in rijndael.c
>
> -m
BYTE_SWAP is NOT defined on my Solaris 2.6 sparc system.
It might be useful to check if BYTE_ORDER and LITTLE_ENDIAN are
defined before seeing if they are not the same... On Solaris,
__BYTE_ORDER__ and __LITTLE_ENDIAN__ and __BIG_ENDIAN__ are defined in
/usr/local/gcc-2.7.2.3/lib/gcc-lib/sparc-sun-solaris2.6/2.7.2.3/include/sys/byteorder.h
Something like this patch seems to work for me. It might be better to
do something in config.h and test it with configure...
--- rijndael.c- Mon Feb 5 10:16:28 2001
+++ rijndael.c Tue Feb 27 03:55:49 2001
@@ -58,6 +58,21 @@
#define byte(x,n) ((u1byte)((x) >> (8 * n)))
+#ifndef BYTE_ORDER
+#ifdef __BYTE_ORDER__
+#define BYTE_ORDER __BYTE_ORDER__
+#else
+#error BYTE_ORDER is not defined
+#endif
+#endif
+#ifndef LITTLE_ENDIAN
+#ifdef __LITTLE_ENDIAN__
+#define LITTLE_ENDIAN __LITTLE_ENDIAN__
+#else
+#error LITTLE_ENDIAN is not defined
+#endif
+#endif
+
#if BYTE_ORDER != LITTLE_ENDIAN
#define BYTE_SWAP
#endif
Note that the /usr/include/sys/byteorder.h file does not define either
BYTE_ORDER or LITTLE_ENDIAN or __BYTE_ORDER__ or __LITTLE_ENDIAN__ but
instead references _BIG_ENDIAN and other .h files reference _LITTLE_ENDIAN
even though I do not see a #define for any of them.
Enjoy!
-- Mark
More information about the openssh-unix-dev
mailing list