[2024] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

SHS broken on Intel in 5b6

daemon@ATHENA.MIT.EDU (shields@crosslink.net)
Thu Jun 20 16:42:58 1996

From: shields@crosslink.net
Date: Thu, 20 Jun 1996 16:42:25 -0400
To: krb5-bugs@MIT.EDU

Kerberos 5 beta6 does not detect endianness correctly in the SHS code,
at least on Linux.  Because of this SHS fails its tests.  This patch
lets configure check it, which works.

Index: ChangeLog
===================================================================
RCS file: /usr/src/master/kerberos/src/lib/crypto/sha/ChangeLog,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ChangeLog
--- ChangeLog	1996/06/19 21:14:21	1.1.1.1
+++ ChangeLog	1996/06/20 20:39:46
@@ -1,3 +1,7 @@
+Thu Jun 20 20:39:18 1996  Michael Shields  <shields@crosslink.net>
+
+	* shs.c (longReverse), configure.in: Let configure check endianness.
+
 Thu Jun  6 15:43:26 1996  Theodore Y. Ts'o  <tytso@mit.edu>
 
 	* shs.c (longReverse): Don't use htonl(); it doesn't exist under
Index: configure.in
===================================================================
RCS file: /usr/src/master/kerberos/src/lib/crypto/sha/configure.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 configure.in
--- configure.in	1996/06/19 21:14:21	1.1.1.1
+++ configure.in	1996/06/20 20:38:15
@@ -1,5 +1,6 @@
 AC_INIT(configure.in)
 CONFIG_RULES
+AC_C_BIGENDIAN
 dnl AC_DEFINE(NEW_SHS)
 V5_SHARED_LIB_OBJS
 SubdirLibraryRule([${OBJS}])
Index: shs.c
===================================================================
RCS file: /usr/src/master/kerberos/src/lib/crypto/sha/shs.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 shs.c
--- shs.c	1996/06/19 21:14:21	1.1.1.1
+++ shs.c	1996/06/20 20:39:11
@@ -213,22 +213,8 @@
 
 void longReverse( LONG *buffer, int byteCount )
 {
+#ifndef WORDS_BIGENDIAN
     LONG value;
-    static int init = 0;
-    char *cp;
-
-    switch (init) {
-    case 0:
-	cp = (char *) &init;
-	if (*cp == 1) {
-	    init=2;
-	    break;
-	}
-	init=1;
-	/* fall through - MSB */
-    case 1:
-	return;
-    }
 
     byteCount /= sizeof( LONG );
     while( byteCount-- ) {
@@ -237,6 +223,7 @@
                 ( ( value & 0x00FF00FFL ) << 8 );
         *buffer++ = ( value << 16 ) | ( value >> 16 );
     }
+#endif
 }
 
 /* Update SHS for a block of data */

home help back first fref pref prev next nref lref last post