From 0708255641548ebe74499090c282aa334ca70bee Mon Sep 17 00:00:00 2001 From: Keith Vetter Date: Wed, 15 Mar 1995 22:21:50 +0000 Subject: [PATCH] Changes in des425 due to adding prototypes for called functions git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5129 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/des425/ChangeLog | 14 +++++++++++++- src/lib/des425/des.h | 1 + src/lib/des425/enc_dec.c | 4 +++- src/lib/des425/key_sched.c | 5 ----- src/lib/des425/new_rnd_key.c | 11 ----------- src/lib/des425/random_key.c | 8 ++++---- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/lib/des425/ChangeLog b/src/lib/des425/ChangeLog index 529fbed4b..4d17a2350 100644 --- a/src/lib/des425/ChangeLog +++ b/src/lib/des425/ChangeLog @@ -1,8 +1,20 @@ +Wed Mar 15 13:44:23 1995 Keith Vetter (keithv@fusion.com) + + * des.h: now includes des_int.h for proper prototypes. + * enc_dec.c: cast the types of the input/output buffers in calling + the encrypt routine. + * key_sched.c: removed prototype of a non-existent routine. + * new_rnd_key.c: removed prototypes in the file and instead include + header file with the real prototypes. + * random_key.c: code, as it was, could never have worked. Adding + prototypes revealed that it was passing KEY with the wrong level + of indirection. + Tue Mar 7 19:57:28 1995 Keith Vetter (keithv@fusion.com) * pcbc_enc.c: added casts on the long->char assignments. * str_to_key.c: converted int->long to match types. - * read_passwd.c: converted int->long. + Wed Mar 8 17:13:44 1995 Theodore Y. Ts'o diff --git a/src/lib/des425/des.h b/src/lib/des425/des.h index 893f2503f..9bd6885ea 100644 --- a/src/lib/des425/des.h +++ b/src/lib/des425/des.h @@ -32,6 +32,7 @@ #define DES_DEFS #include "k5-int.h" +#include "des_int.h" typedef mit_des_cblock des_cblock; /* crypto-block size */ diff --git a/src/lib/des425/enc_dec.c b/src/lib/des425/enc_dec.c index 90de9253a..cf6bfc8a0 100644 --- a/src/lib/des425/enc_dec.c +++ b/src/lib/des425/enc_dec.c @@ -66,6 +66,8 @@ des_cbc_encrypt(in,out,length,key,iv,encrypt) krb5_octet *iv; /* 8 bytes of ivec */ int encrypt; /* 0 ==> decrypt, else encrypt */ { - return(mit_des_cbc_encrypt(in,out,length,key,iv,encrypt)); + return (mit_des_cbc_encrypt((const des_cblock *) in, + (des_cblock *) out, + length, key, iv, encrypt)); } diff --git a/src/lib/des425/key_sched.c b/src/lib/des425/key_sched.c index c801f1344..96c7d4984 100644 --- a/src/lib/des425/key_sched.c +++ b/src/lib/des425/key_sched.c @@ -48,11 +48,6 @@ #include #include "des.h" -typedef char key[64]; - -/* the following are really void but cc86 doesnt allow it */ -static void make_key_sched PROTOTYPE((key, mit_des_key_schedule)); - int INTERFACE des_key_sched(k,schedule) register mit_des_cblock k; /* r11 */ diff --git a/src/lib/des425/new_rnd_key.c b/src/lib/des425/new_rnd_key.c index 3ade2ce13..5e4d5aa3b 100644 --- a/src/lib/des425/new_rnd_key.c +++ b/src/lib/des425/new_rnd_key.c @@ -26,17 +26,6 @@ #include "des.h" -extern int INTERFACE mit_des_init_random_number_generator(); -extern void INTERFACE mit_des_set_random_generator_seed(); -extern void INTERFACE mit_des_set_sequence_number(); -extern void INTERFACE mit_des_generate_random_block(); -extern int INTERFACE mit_des_new_random_key(); - - -void INTERFACE des_set_random_generator_seed(); -void INTERFACE des_set_sequence_number(); -void INTERFACE des_generate_random_block(); - /* * The secret des key schedule and sequence number for the current * stream of random numbers diff --git a/src/lib/des425/random_key.c b/src/lib/des425/random_key.c index 498f8848d..945e20f40 100644 --- a/src/lib/des425/random_key.c +++ b/src/lib/des425/random_key.c @@ -35,12 +35,12 @@ des_random_key(key) mit_des_cblock nullkey; memset(nullkey, 0, sizeof(mit_des_cblock)); - mit_des_fixup_key_parity(key); + mit_des_fixup_key_parity(*key); mit_des_init_random_number_generator(nullkey,&p_seed); do { - mit_des_generate_random_block(key, &p_seed); - mit_des_fixup_key_parity(key); - } while (mit_des_is_weak_key(key)); + mit_des_generate_random_block(*key, &p_seed); + mit_des_fixup_key_parity(*key); + } while (mit_des_is_weak_key(*key)); return(0); } -- 2.26.2