diff --git a/src/des/crypt.c b/src/des/crypt.c index 72a1883e59..adb85e1eca 100644 --- a/src/des/crypt.c +++ b/src/des/crypt.c @@ -119,13 +119,6 @@ RCSID #ifndef STATIC #define STATIC static #endif -STATIC void init_des(); -STATIC void permute(); -STATIC void init_perm(); - -STATIC int des_setkey(const char *key); -STATIC int des_cipher(const char *in, char *out, long salt, int num_iter); - #ifdef CRYPT_DEBUG STATIC prtab(); #endif @@ -314,11 +307,7 @@ typedef union { { C_block tblk; permute(cpp,&tblk,p,4); LOAD (d,d0,d1,tblk); } STATIC void -permute(cp, out, p, chars_in) - unsigned char *cp; - C_block *out; - register C_block *p; - int chars_in; +permute(unsigned char *cp, C_block *out, register C_block *p, int chars_in) { register DCL_BLOCK(D, D0, D1); register C_block *tp; @@ -338,6 +327,13 @@ permute(cp, out, p, chars_in) } #endif /* LARGEDATA */ +STATIC void init_des(void); +STATIC void init_perm(C_block [64 / CHUNKBITS][1 << CHUNKBITS], + unsigned char [64], int, int); +STATIC int des_setkey(const char *key); +STATIC int des_cipher(const char *in, char *out, long salt, int num_iter); + + /* ===== (mostly) Standard DES Tables ==================== */ @@ -496,9 +492,7 @@ static char cryptresult[1 + 4 + 4 + 11 + 1]; /* encrypted result */ * followed by an encryption produced by the "key" and "setting". */ char * -crypt(key, setting) - register const char *key; - register const char *setting; +crypt(register const char *key, register const char *setting) { register char *encp; register long i; @@ -611,8 +605,7 @@ static C_block KS[KS_SIZE]; * Set up the key schedule from the key. */ STATIC int -des_setkey(key) - register const char *key; +des_setkey(register const char *key) { register DCL_BLOCK(K, K0, K1); register C_block *ptabp; @@ -646,11 +639,7 @@ des_setkey(key) * compiler and machine architecture. */ STATIC int -des_cipher(in, out, salt, num_iter) - const char *in; - char *out; - long salt; - int num_iter; +des_cipher(const char *in, char *out, long salt, int num_iter) { /* variables that we want in registers, most important first */ #if defined(pdp11) @@ -779,7 +768,7 @@ des_cipher(in, out, salt, num_iter) * done at compile time, if the compiler were capable of that sort of thing. */ STATIC void -init_des() +init_des(void) { register int i, j; register long k; @@ -920,10 +909,8 @@ init_des() * "perm" must be all-zeroes on entry to this routine. */ STATIC void -init_perm(perm, p, chars_in, chars_out) - C_block perm[64 / CHUNKBITS][1 << CHUNKBITS]; - unsigned char p[64]; - int chars_in, chars_out; +init_perm(C_block perm[64 / CHUNKBITS][1 << CHUNKBITS], + unsigned char p[64], int chars_in, int chars_out) { register int i, j, k, l; @@ -998,10 +985,7 @@ encrypt(block, flag) #ifdef CRYPT_DEBUG STATIC -prtab(s, t, num_rows) - char *s; - unsigned char *t; - int num_rows; +prtab(char *s, unsigned char *t, int num_rows) { register int i, j; diff --git a/src/des/des_prototypes.h b/src/des/des_prototypes.h index dee7c20f17..11322efd76 100644 --- a/src/des/des_prototypes.h +++ b/src/des/des_prototypes.h @@ -77,6 +77,6 @@ extern void des_set_random_generator_seed(des_cblock key); /* read_pssword.c */ extern int des_read_password(des_cblock * k, char *prompt, int verify); - +extern int des_read_pw_string(char *, int, char *, int); #endif diff --git a/src/des/key_sched.c b/src/des/key_sched.c index a49354fb2f..85ba11efbc 100644 --- a/src/des/key_sched.c +++ b/src/des/key_sched.c @@ -44,7 +44,7 @@ RCSID typedef char key[64]; /* the following are really void but cc86 doesnt allow it */ -static int make_key_sched(); +static int make_key_sched(key Key, des_key_schedule Schedule); #ifdef AFS_DUX40_ENV #pragma weak des_key_sched = afs_des_key_sched diff --git a/src/des/make_odd.c b/src/des/make_odd.c index b8ce5ec990..ee2ae3487d 100644 --- a/src/des/make_odd.c +++ b/src/des/make_odd.c @@ -17,8 +17,7 @@ RCSID #include void -gen(stream) - FILE *stream; +gen(FILE *stream) { /* * map a byte into its equivalent with odd parity, where odd diff --git a/src/des/read_pssword.c b/src/des/read_pssword.c index 4105dbe5f3..34236d44ce 100644 --- a/src/des/read_pssword.c +++ b/src/des/read_pssword.c @@ -86,8 +86,7 @@ static sigtype sig_restore(); static push_signals(), pop_signals(); #endif -int des_read_pw_string(char *, int, char *, int); -void des_string_to_key(char *, des_cblock *); +#include "des_prototypes.h" /*** Routines ****************************************************** */ int @@ -128,11 +127,7 @@ static void catch(int); * Returns 0 on success, non-zero on failure. */ int -des_read_pw_string(s, maxa, prompt, verify) - char *s; - int maxa; - char *prompt; - int verify; +des_read_pw_string(char *s, int maxa, char *prompt, int verify) { int ok = 0, cnt1 = 0; char *ptr; diff --git a/src/des/stats.h b/src/des/stats.h index 3fd1fb6bd5..dd26fb270b 100644 --- a/src/des/stats.h +++ b/src/des/stats.h @@ -70,8 +70,8 @@ struct rxkad_global_stats { extern pthread_mutex_t rxkad_global_stats_lock; extern pthread_key_t rxkad_stats_key; -extern void rxkad_global_stats_init(); -extern rxkad_stats_t * rxkad_thr_stats_init(); +extern void rxkad_global_stats_init(void); +extern rxkad_stats_t * rxkad_thr_stats_init(void); extern int rxkad_stats_agg(rxkad_stats_t *); #ifndef BEGIN diff --git a/src/des/strng_to_key.c b/src/des/strng_to_key.c index d7e0128384..cee71421bf 100644 --- a/src/des/strng_to_key.c +++ b/src/des/strng_to_key.c @@ -119,6 +119,6 @@ des_string_to_key(char *str, register des_cblock * key) des_fixup_key_parity(key); if (des_debug) - fprintf(stdout, "\nResulting string_to_key = 0x%lx 0x%lx\n", + fprintf(stdout, "\nResulting string_to_key = 0x%x 0x%x\n", *((afs_uint32 *) key), *((afs_uint32 *) key + 1)); }