From 6ffb2100cb6bdabce3b956ef2c827add590c41a5 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Tue, 6 Jun 1995 01:07:44 +0000 Subject: [PATCH] Convert longs to KRB_32 for 64 bit architectures. (only detected in v4kadmind) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5951 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/des425/ChangeLog | 4 ++++ src/lib/des425/quad_cksum.c | 26 ++++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/lib/des425/ChangeLog b/src/lib/des425/ChangeLog index d1c133a47..730fe4124 100644 --- a/src/lib/des425/ChangeLog +++ b/src/lib/des425/ChangeLog @@ -1,3 +1,7 @@ +Mon Jun 5 21:02:37 1995 Ezra Peisach (epeisach@kangaroo.mit.edu) + + * quad_cksum: Convert longs to KRB_INT32 for 64 bit platforms. + Fri May 26 21:43:52 1995 Theodore Y. Ts'o (tytso@dcl) * util.c: Added new function, des_cblock_print_file(), which is diff --git a/src/lib/des425/quad_cksum.c b/src/lib/des425/quad_cksum.c index 0e803ad75..6a5a76bcc 100644 --- a/src/lib/des425/quad_cksum.c +++ b/src/lib/des425/quad_cksum.c @@ -88,6 +88,20 @@ /* Application include files */ #include "k5-int.h" #include "des.h" + + +#ifndef KRB_INT32 +#if (SIZEOF_LONG == 4) +#define KRB_INT32 long +#elif (SIZEOF_INT == 4) +#define KRB_INT32 int +#elif (SIZEOF_SHORT == 4) +#define KRB_INT32 short +#else + ?== No 32 bit type available +#endif +#endif /* !KRB_INT32 */ + /* Definitions for byte swapping */ /* vax byte order is LSB first. This is not performance critical, and @@ -110,7 +124,7 @@ unsigned long des_quad_cksum(in,out,length,out_count,c_seed) mit_des_cblock *c_seed; /* secret seed, 8 bytes */ unsigned char *in; /* input block */ - unsigned long *out; /* optional longer output */ + unsigned KRB_INT32 *out; /* optional longer output */ int out_count; /* number of iterations */ long length; /* original length in bytes */ { @@ -122,12 +136,12 @@ des_quad_cksum(in,out,length,out_count,c_seed) * checksum is written unto the address pointed to. */ - register unsigned long z; - register unsigned long z2; - register unsigned long x; - register unsigned long x2; + register unsigned KRB_INT32 z; + register unsigned KRB_INT32 z2; + register unsigned KRB_INT32 x; + register unsigned KRB_INT32 x2; register unsigned char *p; - register long len; + register KRB_INT32 len; register int i; /* use all 8 bytes of seed */ -- 2.26.2