From: Ezra Peisach Date: Sat, 26 Aug 1995 17:13:29 +0000 (+0000) Subject: * f_cksum.c: Change code to match prototypes X-Git-Tag: krb5-1.0-beta6~1257 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c5903c74334d6666132612933854c9252d88244c;p=krb5.git * f_cksum.c: Change code to match prototypes * f_cbc.c, f_ecb, f_parity, f_pcbc: Change des_cblock to mit_des_cblock and des_key_schedule to mit_des_key_schedule. Also include des_int.h. * destest.c: Change des_cblock to mit_des_cblock and add local prototypes. * cs_entry.c: Remove prototypes for mit_des_cbc_cksum and mit_des_cbc_cksum. Now in des_int.h. * cbc_cksum.c, string2key.c: Remove casts in call to mit_des_cbc_cksum * des_int.h: Add prototype for mit_des_cbc_verf_cksum. Change return code for mit_des_cbc_cksum to match source. * des.h: Remove unused structures and defines. Short end - fix des_int.h to reflect reality (i.e. source code) and then fix rest of code to agree. Also removed the use of old structures such as des_cblock and des_key_schedule. Instead the the newer mit_des_cblock and mit_des_schedule are used. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6598 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/des/ChangeLog b/src/lib/crypto/des/ChangeLog index a4e029a0c..b04331584 100644 --- a/src/lib/crypto/des/ChangeLog +++ b/src/lib/crypto/des/ChangeLog @@ -1,3 +1,24 @@ +Thu Aug 24 18:08:42 1995 Ezra Peisach + + * f_cksum.c: Change code to match prototypes. + + * f_cbc.c, f_ecb, f_parity, f_pcbc: Change des_cblock to + mit_des_cblock and des_key_schedule to + mit_des_key_schedule. Also include des_int.h. + + * destest.c: Change des_cblock to mit_des_cblock and add local + prototypes. + + * cs_entry.c: Remove prototypes for mit_des_cbc_cksum and + mit_des_cbc_cksum. Now in des_int.h. + + * cbc_cksum.c, string2key.c: Remove casts in call to + mit_des_cbc_cksum + + * des_int.h: Add prototype for mit_des_cbc_verf_cksum. Change + return code for mit_des_cbc_cksum to match source. + + * des.h: Remove unused structures and defines. Thu Jul 27 15:18:37 EDT 1995 Paul Park (pjpark@mit.edu) * des_int.h - Inline the old contents of include/krb5/mit-des.h. This diff --git a/src/lib/crypto/des/cbc_cksum.c b/src/lib/crypto/des/cbc_cksum.c index a5ea5ce4d..6004aa382 100644 --- a/src/lib/crypto/des/cbc_cksum.c +++ b/src/lib/crypto/des/cbc_cksum.c @@ -80,8 +80,7 @@ mit_des_cbc_checksum(in, in_length, key, key_size, cksum) return ENOMEM; } - mit_des_cbc_cksum((krb5_octet *)in, contents, in_length, - schedule, (krb5_octet *)key); + mit_des_cbc_cksum(in, contents, in_length, schedule, key); cksum->checksum_type = CKSUMTYPE_DESCBC; cksum->length = sizeof(mit_des_cblock); @@ -125,8 +124,7 @@ mit_des_cbc_verf_cksum(cksum, in, in_length, key, key_size) ; } - mit_des_cbc_cksum((krb5_octet *)in, contents, in_length, - schedule, (krb5_octet *)key); + mit_des_cbc_cksum(in, contents, in_length, schedule, key); retval = 0; if (cksum->checksum_type == CKSUMTYPE_DESCBC) { diff --git a/src/lib/crypto/des/cs_entry.c b/src/lib/crypto/des/cs_entry.c index 91d00013d..c32acf195 100644 --- a/src/lib/crypto/des/cs_entry.c +++ b/src/lib/crypto/des/cs_entry.c @@ -27,20 +27,6 @@ #include "k5-int.h" #include "des_int.h" -extern krb5_error_code mit_des_cbc_checksum PROTOTYPE (( - krb5_pointer , - size_t , - krb5_pointer , - size_t , - krb5_checksum FAR * )); - -extern krb5_error_code mit_des_cbc_verf_cksum PROTOTYPE (( - krb5_checksum FAR *, - krb5_pointer , - size_t , - krb5_pointer , - size_t )); - krb5_checksum_entry krb5_des_cbc_cksumtable_entry = { 0, mit_des_cbc_checksum, diff --git a/src/lib/crypto/des/des.h b/src/lib/crypto/des/des.h index 3ada2e9dc..6d8307ab7 100644 --- a/src/lib/crypto/des/des.h +++ b/src/lib/crypto/des/des.h @@ -30,14 +30,6 @@ #define KRB_UINT32 unsigned KRB_INT32 #endif -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]; - -#define DES_KEY_SZ (sizeof(des_cblock)) -#define DES_ENCRYPT 1 -#define DES_DECRYPT 0 - #ifndef NCOMPAT #define C_Block des_cblock #define Key_schedule des_key_schedule diff --git a/src/lib/crypto/des/des_int.h b/src/lib/crypto/des/des_int.h index 567406b55..cd242a361 100644 --- a/src/lib/crypto/des/des_int.h +++ b/src/lib/crypto/des/des_int.h @@ -82,11 +82,17 @@ error(MIT_DES_KEYSIZE does not equal KRB5_MIT_DES_KEYSIZE) extern krb5_error_code mit_des_cbc_checksum PROTOTYPE((krb5_pointer, size_t,krb5_pointer,size_t, krb5_checksum FAR * )); -/* cksum.c */ -extern long mit_des_cbc_cksum +extern krb5_error_code mit_des_cbc_verf_cksum + PROTOTYPE ((krb5_checksum FAR *, krb5_pointer, size_t, krb5_pointer, + size_t )); + + +/* f_cksum.c */ +extern unsigned long mit_des_cbc_cksum PROTOTYPE((krb5_octet FAR *, krb5_octet FAR *, long , mit_des_key_schedule , krb5_octet FAR *)); -/* des.c */ + +/* f_ecb.c */ extern int mit_des_ecb_encrypt PROTOTYPE((mit_des_cblock FAR *, mit_des_cblock FAR *, mit_des_key_schedule , int )); diff --git a/src/lib/crypto/des/destest.c b/src/lib/crypto/des/destest.c index 084abc440..0132fa2fe 100644 --- a/src/lib/crypto/des/destest.c +++ b/src/lib/crypto/des/destest.c @@ -35,7 +35,9 @@ extern mit_des_ecb_encrypt(); #include -void convert(); +void convert PROTOTYPE((char *, unsigned char [])); + +void des_cblock_print_file PROTOTYPE((mit_des_cblock, FILE *)); void main(argc, argv) @@ -154,6 +156,7 @@ unsigned char cblock[]; */ #include "des.h" +#include "des_int.h" int mit_des_is_weak_key(key) @@ -191,11 +194,11 @@ des_cblock_print_file(x, fp) */ int mit_des_check_key_parity(key) - register des_cblock key; + register mit_des_cblock key; { int i; - for (i=0; i