]>
Commit | Line | Data |
---|---|---|
724451c6 MK |
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 | |
22 | Subject: BUG ID #3218 | |
23 | ||
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. | |
27 | ||
28 | *** skey/md4.c 1999/05/27 17:34:00 1.1 | |
29 | --- skey/md4.c 1999/05/27 17:56:17 | |
30 | *************** | |
31 | *** 36,47 **** | |
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. | |
35 | */ | |
36 | #define TRUE 1 | |
37 | #define FALSE 0 | |
38 | ||
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 | |
44 | --- 36,52 ---- | |
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. | |
48 | + * | |
49 | + * If something included endian.h, use that | |
50 | */ | |
51 | #define TRUE 1 | |
52 | #define FALSE 0 | |
53 | ||
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 | |
62 | ||
63 | ||
64 | ||
65 | ||
66 | *** skey/skeysubr.c 1999/05/27 17:35:32 1.1 | |
67 | --- skey/skeysubr.c 1999/05/27 18:01:30 | |
68 | *************** | |
69 | *** 68,76 **** | |
70 | #include "md4.h" | |
71 | #include "skey.h" | |
72 | ||
73 | ! #if (defined(__MSDOS__) || defined(MPU8086) || defined(MPU8080) \ | |
74 | ! || defined(vax) || defined (MIPSEL)) | |
75 | ! #define LITTLE_ENDIAN | |
76 | #endif | |
77 | ||
78 | /* Crunch a key: | |
79 | --- 68,82 ---- | |
80 | #include "md4.h" | |
81 | #include "skey.h" | |
82 | ||
83 | ! /* | |
84 | ! * If something included endian.h, use that | |
85 | ! */ | |
86 | ! | |
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 | |
92 | #endif | |
93 | ||
94 | /* Crunch a key: | |
95 | *************** | |
96 | *** 86,92 **** | |
97 | char *buf; | |
98 | MDstruct md; | |
99 | unsigned int buflen; | |
100 | ! #ifndef LITTLE_ENDIAN | |
101 | int i; | |
102 | register __u32 tmp; | |
103 | #endif | |
104 | --- 92,98 ---- | |
105 | char *buf; | |
106 | MDstruct md; | |
107 | unsigned int buflen; | |
108 | ! #ifndef Little_Endian | |
109 | int i; | |
110 | register __u32 tmp; | |
111 | #endif | |
112 | *************** | |
113 | *** 108,114 **** | |
114 | md.buffer[0] ^= md.buffer[2]; | |
115 | md.buffer[1] ^= md.buffer[3]; | |
116 | ||
117 | ! #ifdef LITTLE_ENDIAN | |
118 | /* Only works on byte-addressed little-endian machines!! */ | |
119 | memcpy(result,(char *)md.buffer,8); | |
120 | #else | |
121 | --- 114,120 ---- | |
122 | md.buffer[0] ^= md.buffer[2]; | |
123 | md.buffer[1] ^= md.buffer[3]; | |
124 | ||
125 | ! #ifdef Little_Endian | |
126 | /* Only works on byte-addressed little-endian machines!! */ | |
127 | memcpy(result,(char *)md.buffer,8); | |
128 | #else | |
129 | *************** | |
130 | *** 135,141 **** | |
131 | char *x; | |
132 | { | |
133 | MDstruct md; | |
134 | ! #ifndef LITTLE_ENDIAN | |
135 | __u32 tmp; | |
136 | #endif | |
137 | ||
138 | --- 141,147 ---- | |
139 | char *x; | |
140 | { | |
141 | MDstruct md; | |
142 | ! #ifndef Little_Endian | |
143 | __u32 tmp; | |
144 | #endif | |
145 | ||
146 | *************** | |
147 | *** 146,152 **** | |
148 | md.buffer[0] ^= md.buffer[2]; | |
149 | md.buffer[1] ^= md.buffer[3]; | |
150 | ||
151 | ! #ifdef LITTLE_ENDIAN | |
152 | /* Only works on byte-addressed little-endian machines!! */ | |
153 | memcpy(x,(char *)md.buffer,8); | |
154 | ||
155 | --- 152,158 ---- | |
156 | md.buffer[0] ^= md.buffer[2]; | |
157 | md.buffer[1] ^= md.buffer[3]; | |
158 | ||
159 | ! #ifdef Little_Endian | |
160 | /* Only works on byte-addressed little-endian machines!! */ | |
161 | memcpy(x,(char *)md.buffer,8); | |
162 | ||
163 |