1 From mcintosh@mcintosh.research.telcordia.com Wed Jun 2 16:18:29 1999
2 Return-Path: <mcintosh@mcintosh.research.telcordia.com>
3 Received: from mail.redhat.com (mail.redhat.com [199.183.24.239])
4 by developer.redhat.com (8.8.7/8.8.7) with ESMTP id QAA27467
5 for <bugzilla@developer.redhat.com>; Wed, 2 Jun 1999 16:18:29 -0400
6 Received: from lacrosse.corp.redhat.com (root@lacrosse.corp.redhat.com [207.175.42.154])
7 by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA15161
8 for <bugzilla@developer.redhat.com>; Wed, 2 Jun 1999 16:18:28 -0400
9 Received: from mail.redhat.com (mail.redhat.com [199.183.24.239])
10 by lacrosse.corp.redhat.com (8.9.3/8.9.3) with ESMTP id QAA31733
11 for <bugzilla@lacrosse.redhat.com>; Wed, 2 Jun 1999 16:18:28 -0400
12 Received: from mcintosh.research.telcordia.com (mcintosh.research.telcordia.com [192.4.12.155])
13 by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA15157
14 for <bugzilla@redhat.com>; Wed, 2 Jun 1999 16:18:27 -0400
15 Received: (from mcintosh@localhost)
16 by mcintosh.research.telcordia.com (8.8.7/8.8.7) id QAA01342
17 for bugzilla@redhat.com; Wed, 2 Jun 1999 16:17:56 -0400
18 Date: Wed, 2 Jun 1999 16:17:56 -0400
19 From: Allen Mcintosh <mcintosh@research.telcordia.com>
20 Message-Id: <199906022017.QAA01342@mcintosh.research.telcordia.com>
21 To: bugzilla@redhat.com
24 This fixes a couple of problems in the DIP S/Key code, and tries to use
25 the big/little endian code in /usr/include to keep the same problem from
26 coming back on the next architecture.
28 *** skey/md4.c 1999/05/27 17:34:00 1.1
29 --- skey/md4.c 1999/05/27 17:56:17
32 * MDupdate modifies has a side-effect on its input array (the order of bytes
33 * in each word are reversed). If this is undesired a call to MDreverse(X) can
34 * reverse the bytes of X back into order after each call to MDupdate.
39 ! #if (defined(__MSDOS__) || defined(MPU8086) || defined(MPU8080) \
40 ! || defined(vax) || defined (MIPSEL) || defined(__alpha__))
41 #define LOWBYTEFIRST TRUE /* Low order bytes are first in memory */
42 #else /* Almost all other machines are big-endian */
43 #define LOWBYTEFIRST FALSE
45 * MDupdate modifies has a side-effect on its input array (the order of bytes
46 * in each word are reversed). If this is undesired a call to MDreverse(X) can
47 * reverse the bytes of X back into order after each call to MDupdate.
49 + * If something included endian.h, use that
54 ! #if (defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN) \
55 ! || (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) \
56 ! || (defined(__MSDOS__) || defined(MPU8086) || defined(MPU8080) \
57 ! || defined(vax) || defined (MIPSEL) || defined(__alpha__)) \
58 ! || defined(i386) || defined(__i386__)
59 #define LOWBYTEFIRST TRUE /* Low order bytes are first in memory */
60 #else /* Almost all other machines are big-endian */
61 #define LOWBYTEFIRST FALSE
66 *** skey/skeysubr.c 1999/05/27 17:35:32 1.1
67 --- skey/skeysubr.c 1999/05/27 18:01:30
73 ! #if (defined(__MSDOS__) || defined(MPU8086) || defined(MPU8080) \
74 ! || defined(vax) || defined (MIPSEL))
75 ! #define LITTLE_ENDIAN
84 ! * If something included endian.h, use that
87 ! #if (defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN) \
88 ! || (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) \
89 ! || defined(__MSDOS__) || defined(MPU8086) || defined(MPU8080) \
90 ! || defined(vax) || defined (MIPSEL) || defined(i386) || defined(__i386__)
91 ! #define Little_Endian
100 ! #ifndef LITTLE_ENDIAN
108 ! #ifndef Little_Endian
114 md.buffer[0] ^= md.buffer[2];
115 md.buffer[1] ^= md.buffer[3];
117 ! #ifdef LITTLE_ENDIAN
118 /* Only works on byte-addressed little-endian machines!! */
119 memcpy(result,(char *)md.buffer,8);
122 md.buffer[0] ^= md.buffer[2];
123 md.buffer[1] ^= md.buffer[3];
125 ! #ifdef Little_Endian
126 /* Only works on byte-addressed little-endian machines!! */
127 memcpy(result,(char *)md.buffer,8);
134 ! #ifndef LITTLE_ENDIAN
142 ! #ifndef Little_Endian
148 md.buffer[0] ^= md.buffer[2];
149 md.buffer[1] ^= md.buffer[3];
151 ! #ifdef LITTLE_ENDIAN
152 /* Only works on byte-addressed little-endian machines!! */
153 memcpy(x,(char *)md.buffer,8);
156 md.buffer[0] ^= md.buffer[2];
157 md.buffer[1] ^= md.buffer[3];
159 ! #ifdef Little_Endian
160 /* Only works on byte-addressed little-endian machines!! */
161 memcpy(x,(char *)md.buffer,8);