[2695] in Kerberos_V5_Development
On des.h prototypes...
daemon@ATHENA.MIT.EDU (epeisach@MIT.EDU)
Thu Nov 6 16:28:07 1997
From: <epeisach@MIT.EDU>
Date: Thu, 6 Nov 1997 16:24:30 -0500
To: krbdev@MIT.EDU
Scenario: The prototypes for des_pcbc_encrypt and des_quad_cksum are wrong.
This problem was caused by integrating the cygnus krb4 and the athena
des425 libraries...
The comments imply lint cleanups and the like in the cygnus sources,
so I suspect that they really made the definitions stick....
For instance:
Cygnus:
-------
typedef unsigned char des_cblock[8]; /* crypto-block size */
/* Key schedule */
typedef struct des_ks_struct { union { KRB_INT32 pad; des_cblock _;} __; } des_key_schedule[16];
int INTERFACE
des_pcbc_encrypt PROTOTYPE ((des_cblock FAR, des_cblock FAR, long,
des_key_schedule FAR, des_cblock FAR, int));
Our include/kerberosIV/des.h:
----------------------------
typedef unsigned char des_cblock[8]; /* crypto-block size */
#define C_Block des_cblock
typedef struct des_ks_struct { DES_INT32 _[2]; } des_key_schedule[16];
#define Key_schedule des_key_schedule
KRB5_DLLIMP int KRB5_CALLCONV des_pcbc_encrypt
PROTOTYPE((C_Block FAR *in, C_Block FAR *out, long length,
Key_schedule, C_Block FAR *ivec, int encrypt));
lib/des425:
Uses simply des_cblock ivec.
----------------------------------------------
Quad cksum:
------------
Cygnus
------
extern unsigned long INTERFACE
quad_cksum PROTOTYPE ((
unsigned char *in, /* input block */
unsigned KRB_INT32 *out,/* optional longer output */
long length, /* original length in bytes */
int out_count, /* number of iterations */
des_cblock c_seed)); /* secret seed, 8 bytes */
include/kerberosIV/des.h:
Don't bother looking at it... It has arguments out of order - the only
reason we have been able to compile has been due to liberal casting.
lib/des425/quad_cksum.c
Reflects cygnus prototype except
mit_des_cblock *c_seed....
a) Which prototypes should be used. Should we reflect the sources for des425 or
should we go towards Cygnus?
b) Regardless of what we do, the quad_cksum prototype should be fixed
and all the casting removed...
c) Maybe our des425 library should move more towards Cygnus' v4 des code...
Ezra