From 64d7ccb433421599976d17cddde5bb82bd92368f Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 19 Feb 2004 02:46:30 +0000 Subject: [PATCH] protoize git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16102 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/ChangeLog | 11 +++ src/lib/crypto/arcfour/ChangeLog | 4 + src/lib/crypto/arcfour/arcfour.c | 34 +++---- src/lib/crypto/block_size.c | 6 +- src/lib/crypto/checksum_length.c | 6 +- src/lib/crypto/cksumtype_to_string.c | 5 +- src/lib/crypto/coll_proof_cksum.c | 3 +- src/lib/crypto/crc32/ChangeLog | 4 + src/lib/crypto/crc32/crc32.c | 10 +-- src/lib/crypto/decrypt.c | 10 +-- src/lib/crypto/des/ChangeLog | 6 ++ src/lib/crypto/des/afsstring2key.c | 21 ++--- src/lib/crypto/des/d3_cbc.c | 12 ++- src/lib/crypto/des/d3_kysched.c | 4 +- src/lib/crypto/des/f_cbc.c | 10 +-- src/lib/crypto/des/f_cksum.c | 9 +- src/lib/crypto/des/f_parity.c | 6 +- src/lib/crypto/des/f_sched.c | 4 +- src/lib/crypto/des/key_sched.c | 4 +- src/lib/crypto/des/string2key.c | 6 +- src/lib/crypto/des/weak_key.c | 3 +- src/lib/crypto/dk/ChangeLog | 5 ++ src/lib/crypto/dk/checksum.c | 18 ++-- src/lib/crypto/dk/derive.c | 16 ++-- src/lib/crypto/dk/dk_decrypt.c | 43 ++++----- src/lib/crypto/dk/dk_encrypt.c | 42 ++++----- src/lib/crypto/encrypt.c | 10 +-- src/lib/crypto/encrypt_length.c | 7 +- src/lib/crypto/enctype_compare.c | 7 +- src/lib/crypto/enctype_to_string.c | 5 +- src/lib/crypto/hmac.c | 8 +- src/lib/crypto/keyed_checksum_types.c | 14 +-- src/lib/crypto/keyed_cksum.c | 3 +- src/lib/crypto/make_checksum.c | 10 +-- src/lib/crypto/make_random_key.c | 6 +- src/lib/crypto/md4/ChangeLog | 4 + src/lib/crypto/md4/md4.c | 15 +--- src/lib/crypto/md5/ChangeLog | 4 + src/lib/crypto/md5/md5.c | 15 +--- src/lib/crypto/nfold.c | 7 +- src/lib/crypto/old/ChangeLog | 4 + src/lib/crypto/old/des_stringtokey.c | 10 +-- src/lib/crypto/old_api_glue.c | 125 ++++++++------------------ src/lib/crypto/prng.c | 3 +- src/lib/crypto/raw/ChangeLog | 5 ++ src/lib/crypto/raw/raw_decrypt.c | 13 ++- src/lib/crypto/raw/raw_encrypt.c | 21 ++--- src/lib/crypto/sha1/ChangeLog | 4 + src/lib/crypto/sha1/shs.c | 15 +--- src/lib/crypto/string_to_cksumtype.c | 4 +- src/lib/crypto/string_to_enctype.c | 4 +- src/lib/crypto/string_to_key.c | 20 ++--- src/lib/crypto/valid_cksumtype.c | 3 +- src/lib/crypto/valid_enctype.c | 3 +- src/lib/crypto/verify_checksum.c | 10 +-- 55 files changed, 249 insertions(+), 412 deletions(-) diff --git a/src/lib/crypto/ChangeLog b/src/lib/crypto/ChangeLog index 301a5aa5b..4bd14efbd 100644 --- a/src/lib/crypto/ChangeLog +++ b/src/lib/crypto/ChangeLog @@ -1,3 +1,14 @@ +2004-02-18 Ken Raeburn + + * block_size.c, checksum_length.c, cksumtype_to_string.c, + coll_proof_cksum.c, decrypt.c, encrypt.c, encrypt_length.c, + enctype_compare.c, enctype_to_string.c, hmac.c, + keyed_checksum_types.c, keyed_cksum.c, make_checksum.c, + make_random_key.c, nfold.c, old_api_glue.c, prng.c, + string_to_cksumtype.c, string_to_enctype.c, string_to_key.c, + valid_cksumtype.c, valid_enctype.c, verify_checksum.c: Use ANSI C + style function definitions. + 2004-02-13 Ken Raeburn * t_encrypt.c (compare_results): New function. diff --git a/src/lib/crypto/arcfour/ChangeLog b/src/lib/crypto/arcfour/ChangeLog index d15a4fc4d..9e8394710 100644 --- a/src/lib/crypto/arcfour/ChangeLog +++ b/src/lib/crypto/arcfour/ChangeLog @@ -1,3 +1,7 @@ +2004-02-18 Ken Raeburn + + * arcfour.c: Use ANSI C style function definitions. + 2003-12-19 Ken Raeburn * arcfour.c (l40): Now const. diff --git a/src/lib/crypto/arcfour/arcfour.c b/src/lib/crypto/arcfour/arcfour.c index e4cf361cd..3481fadcb 100644 --- a/src/lib/crypto/arcfour/arcfour.c +++ b/src/lib/crypto/arcfour/arcfour.c @@ -11,11 +11,9 @@ of RSA Data Security) static const char *const l40 = "fortybits"; void -krb5_arcfour_encrypt_length(enc, hash, inputlen, length) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - size_t inputlen; - size_t *length; +krb5_arcfour_encrypt_length(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + size_t inputlen, size_t *length) { size_t blocksize, hashsize; @@ -62,14 +60,11 @@ case 7: /* tgs-req authenticator */ } krb5_error_code -krb5_arcfour_encrypt(enc, hash, key, usage, ivec, input, output) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_data *input; - krb5_data *output; +krb5_arcfour_encrypt(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *ivec, const krb5_data *input, + krb5_data *output) { krb5_keyblock k1, k2, k3; krb5_data d1, d2, d3, salt, plaintext, checksum, ciphertext, confounder; @@ -191,14 +186,11 @@ krb5_arcfour_encrypt(enc, hash, key, usage, ivec, input, output) /* This is the arcfour-hmac decryption routine */ krb5_error_code -krb5_arcfour_decrypt(enc, hash, key, usage, ivec, input, output) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_data *input; - krb5_data *output; +krb5_arcfour_decrypt(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *ivec, const krb5_data *input, + krb5_data *output) { krb5_keyblock k1,k2,k3; krb5_data d1,d2,d3,salt,ciphertext,plaintext,checksum; diff --git a/src/lib/crypto/block_size.c b/src/lib/crypto/block_size.c index 021f3819b..e4c11e869 100644 --- a/src/lib/crypto/block_size.c +++ b/src/lib/crypto/block_size.c @@ -28,10 +28,8 @@ #include "etypes.h" krb5_error_code KRB5_CALLCONV -krb5_c_block_size(context, enctype, blocksize) - krb5_context context; - krb5_enctype enctype; - size_t *blocksize; +krb5_c_block_size(krb5_context context, krb5_enctype enctype, + size_t *blocksize) { int i; diff --git a/src/lib/crypto/checksum_length.c b/src/lib/crypto/checksum_length.c index 4a0294c5d..16177be09 100644 --- a/src/lib/crypto/checksum_length.c +++ b/src/lib/crypto/checksum_length.c @@ -28,10 +28,8 @@ #include "cksumtypes.h" krb5_error_code KRB5_CALLCONV -krb5_c_checksum_length(context, cksumtype, length) - krb5_context context; - krb5_cksumtype cksumtype; - size_t *length; +krb5_c_checksum_length(krb5_context context, krb5_cksumtype cksumtype, + size_t *length) { int i; diff --git a/src/lib/crypto/cksumtype_to_string.c b/src/lib/crypto/cksumtype_to_string.c index 8c75eaefb..b0ac516e2 100644 --- a/src/lib/crypto/cksumtype_to_string.c +++ b/src/lib/crypto/cksumtype_to_string.c @@ -28,10 +28,7 @@ #include "cksumtypes.h" krb5_error_code KRB5_CALLCONV -krb5_cksumtype_to_string(cksumtype, buffer, buflen) - krb5_cksumtype cksumtype; - char * buffer; - size_t buflen; +krb5_cksumtype_to_string(krb5_cksumtype cksumtype, char *buffer, size_t buflen) { int i; diff --git a/src/lib/crypto/coll_proof_cksum.c b/src/lib/crypto/coll_proof_cksum.c index 0cb368435..5c3ea48d3 100644 --- a/src/lib/crypto/coll_proof_cksum.c +++ b/src/lib/crypto/coll_proof_cksum.c @@ -28,8 +28,7 @@ #include "cksumtypes.h" krb5_boolean KRB5_CALLCONV -krb5_c_is_coll_proof_cksum(ctype) - krb5_cksumtype ctype; +krb5_c_is_coll_proof_cksum(krb5_cksumtype ctype) { int i; diff --git a/src/lib/crypto/crc32/ChangeLog b/src/lib/crypto/crc32/ChangeLog index 27b58fa49..637632a29 100644 --- a/src/lib/crypto/crc32/ChangeLog +++ b/src/lib/crypto/crc32/ChangeLog @@ -1,3 +1,7 @@ +2004-02-18 Ken Raeburn + + * crc32.c: Use ANSI C style function definitions. + 2003-07-17 Ken Raeburn * Makefile.in (LIBNAME) [##WIN16##]: Don't define. diff --git a/src/lib/crypto/crc32/crc32.c b/src/lib/crypto/crc32/crc32.c index f23e65ff1..ef65476d9 100644 --- a/src/lib/crypto/crc32/crc32.c +++ b/src/lib/crypto/crc32/crc32.c @@ -147,10 +147,7 @@ static u_long const crc_table[256] = { }; void -mit_crc32(in, in_length, cksum) - const krb5_pointer in; - const size_t in_length; - unsigned long *cksum; +mit_crc32(krb5_pointer in, size_t in_length, unsigned long *cksum) { register u_char *data; register u_long c = 0; @@ -177,10 +174,7 @@ static unsigned long const tbl4[16] = { }; void -mit_crc32_shift4(in, in_length, cksum) - const krb5_pointer in; - const size_t in_length; - unsigned long *cksum; +mit_crc32_shift4(krb5_pointer in, size_t in_length, unsigned long *cksum) { register unsigned char *data, b; register unsigned long c = 0; diff --git a/src/lib/crypto/decrypt.c b/src/lib/crypto/decrypt.c index 04a51065c..c252eb7c2 100644 --- a/src/lib/crypto/decrypt.c +++ b/src/lib/crypto/decrypt.c @@ -28,13 +28,9 @@ #include "etypes.h" krb5_error_code KRB5_CALLCONV -krb5_c_decrypt(context, key, usage, ivec, input, output) - krb5_context context; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_enc_data *input; - krb5_data *output; +krb5_c_decrypt(krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *ivec, + const krb5_enc_data *input, krb5_data *output) { int i; diff --git a/src/lib/crypto/des/ChangeLog b/src/lib/crypto/des/ChangeLog index 0e469642d..409e09b34 100644 --- a/src/lib/crypto/des/ChangeLog +++ b/src/lib/crypto/des/ChangeLog @@ -1,3 +1,9 @@ +2004-02-18 Ken Raeburn + + * afsstring2key.c, d3_cbc.c, d3_kysched.c, f_cbc.c, f_cksum.c, + f_parity.c, f_sched.c, key_sched.c, string2key.c, weak_key.c: Use + ANSI C style function definitions. + 2004-02-17 Ken Raeburn * f_tables.h (DES_DO_ENCRYPT, DES_DO_DECRYPT): Allocate temporary diff --git a/src/lib/crypto/des/afsstring2key.c b/src/lib/crypto/des/afsstring2key.c index 264414b76..97ec2d8a1 100644 --- a/src/lib/crypto/des/afsstring2key.c +++ b/src/lib/crypto/des/afsstring2key.c @@ -68,10 +68,8 @@ char *afs_crypt (const char *, const char *, char *); #define min(a,b) ((a)>(b)?(b):(a)) krb5_error_code -mit_afs_string_to_key (keyblock, data, salt) - krb5_keyblock * keyblock; - const krb5_data * data; - const krb5_data * salt; +mit_afs_string_to_key (krb5_keyblock *keyblock, const krb5_data *data, + const krb5_data *salt) { /* totally different approach from MIT string2key. */ /* much of the work has already been done by the only caller @@ -338,10 +336,9 @@ static const char S[8][64] = { }; -char *afs_crypt(pw, salt, iobuf) - const char *pw; - const char *salt; - char *iobuf; /* must be at least 16 bytes */ +char *afs_crypt(const char *pw, const char *salt, + /* must be at least 16 bytes */ + char *iobuf) { int i, j, c; int temp; @@ -405,9 +402,7 @@ char *afs_crypt(pw, salt, iobuf) * Set up the key schedule from the key. */ -static void krb5_afs_crypt_setkey(key, E, KS) - char *key; - char *E, (*KS)[48]; +static void krb5_afs_crypt_setkey(char *key, char *E, char (*KS)[48]) { register int i, j, k; int t; @@ -467,9 +462,7 @@ static void krb5_afs_crypt_setkey(key, E, KS) * The payoff: encrypt a block. */ -static void krb5_afs_encrypt(block, E, KS) - char *block; - char *E, (*KS)[48]; +static void krb5_afs_encrypt(char *block, char *E, char (*KS)[48]) { const long edflag = 0; int i, ii; diff --git a/src/lib/crypto/des/d3_cbc.c b/src/lib/crypto/des/d3_cbc.c index c49c6eafb..3ff1c1186 100644 --- a/src/lib/crypto/des/d3_cbc.c +++ b/src/lib/crypto/des/d3_cbc.c @@ -29,13 +29,11 @@ #undef mit_des3_cbc_encrypt int -mit_des3_cbc_encrypt(in, out, length, ks1, ks2, ks3, ivec, enc) - const mit_des_cblock *in; - mit_des_cblock *out; - unsigned long length; - const mit_des_key_schedule ks1, ks2, ks3; - const mit_des_cblock ivec; - int enc; +mit_des3_cbc_encrypt(const mit_des_cblock *in, mit_des_cblock *out, + unsigned long length, const mit_des_key_schedule ks1, + const mit_des_key_schedule ks2, + const mit_des_key_schedule ks3, + const mit_des_cblock ivec, int enc) { if (enc) krb5int_des3_cbc_encrypt(in, out, length, ks1, ks2, ks3, ivec); diff --git a/src/lib/crypto/des/d3_kysched.c b/src/lib/crypto/des/d3_kysched.c index 2bc93a9a2..f18cc2419 100644 --- a/src/lib/crypto/des/d3_kysched.c +++ b/src/lib/crypto/des/d3_kysched.c @@ -24,9 +24,7 @@ #include "des_int.h" int -mit_des3_key_sched(k,schedule) - mit_des3_cblock k; - mit_des3_key_schedule schedule; +mit_des3_key_sched(mit_des3_cblock k, mit_des3_key_schedule schedule) { mit_des_make_key_sched(k[0],schedule[0]); mit_des_make_key_sched(k[1],schedule[1]); diff --git a/src/lib/crypto/des/f_cbc.c b/src/lib/crypto/des/f_cbc.c index aa15fefed..3dfb99724 100644 --- a/src/lib/crypto/des/f_cbc.c +++ b/src/lib/crypto/des/f_cbc.c @@ -40,13 +40,9 @@ const mit_des_cblock mit_des_zeroblock /* = all zero */; #undef mit_des_cbc_encrypt int -mit_des_cbc_encrypt(in, out, length, schedule, ivec, enc) - const mit_des_cblock *in; - mit_des_cblock *out; - unsigned long length; - const mit_des_key_schedule schedule; - const mit_des_cblock ivec; - int enc; +mit_des_cbc_encrypt(const mit_des_cblock *in, mit_des_cblock *out, + unsigned long length, const mit_des_key_schedule schedule, + const mit_des_cblock ivec, int enc) { /* * Deal with encryption and decryption separately. diff --git a/src/lib/crypto/des/f_cksum.c b/src/lib/crypto/des/f_cksum.c index 781a1f4fa..0e9ebf3f4 100644 --- a/src/lib/crypto/des/f_cksum.c +++ b/src/lib/crypto/des/f_cksum.c @@ -29,12 +29,9 @@ */ unsigned long -mit_des_cbc_cksum(in, out, length, schedule, ivec) - const krb5_octet *in; - krb5_octet *out; - unsigned long length; - const mit_des_key_schedule schedule; - const krb5_octet *ivec; +mit_des_cbc_cksum(const krb5_octet *in, krb5_octet *out, + unsigned long length, const mit_des_key_schedule schedule, + const krb5_octet *ivec) { register unsigned DES_INT32 left, right; const unsigned DES_INT32 *kp; diff --git a/src/lib/crypto/des/f_parity.c b/src/lib/crypto/des/f_parity.c index e68bdd629..26cf6039b 100644 --- a/src/lib/crypto/des/f_parity.c +++ b/src/lib/crypto/des/f_parity.c @@ -21,8 +21,7 @@ #define parity_char(x) pstep(pstep(pstep((x),4),2),1) void -mit_des_fixup_key_parity(key) - register mit_des_cblock key; +mit_des_fixup_key_parity(mit_des_cblock key) { int i; for (i=0; i + + * checksum.c, derive.c, dk_decrypt.c, dk_encrypt.c: Use ANSI C + style function definitions. + 2004-02-13 Ken Raeburn * dk_decrypt.c (krb5_dk_decrypt_maybe_trunc_hmac): New argument diff --git a/src/lib/crypto/dk/checksum.c b/src/lib/crypto/dk/checksum.c index ffdb4e7ce..4cd540d39 100644 --- a/src/lib/crypto/dk/checksum.c +++ b/src/lib/crypto/dk/checksum.c @@ -31,12 +31,9 @@ #define K5CLENGTH 5 /* 32 bit net byte order integer + one byte seed */ krb5_error_code -krb5_dk_make_checksum(hash, key, usage, input, output) - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *input; - krb5_data *output; +krb5_dk_make_checksum(const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *input, krb5_data *output) { int i; const struct krb5_enc_provider *enc; @@ -106,12 +103,9 @@ cleanup: #ifdef ATHENA_DES3_KLUDGE krb5_error_code -krb5_marc_dk_make_checksum(hash, key, usage, input, output) - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *input; - krb5_data *output; +krb5_marc_dk_make_checksum(const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *input, krb5_data *output) { int i; struct krb5_enc_provider *enc; diff --git a/src/lib/crypto/dk/derive.c b/src/lib/crypto/dk/derive.c index 6c8ff0bdc..6c55c5e52 100644 --- a/src/lib/crypto/dk/derive.c +++ b/src/lib/crypto/dk/derive.c @@ -28,11 +28,9 @@ #include "dk.h" krb5_error_code -krb5_derive_key(enc, inkey, outkey, in_constant) - const struct krb5_enc_provider *enc; - const krb5_keyblock *inkey; - krb5_keyblock *outkey; - const krb5_data *in_constant; +krb5_derive_key(const struct krb5_enc_provider *enc, + const krb5_keyblock *inkey, krb5_keyblock *outkey, + const krb5_data *in_constant) { size_t blocksize, keybytes, keylength, n; unsigned char *inblockdata, *outblockdata, *rawkey; @@ -115,11 +113,9 @@ krb5_derive_key(enc, inkey, outkey, in_constant) krb5_error_code -krb5_derive_random(enc, inkey, outrnd, in_constant) - const struct krb5_enc_provider *enc; - const krb5_keyblock *inkey; - krb5_data *outrnd; - const krb5_data *in_constant; +krb5_derive_random(const struct krb5_enc_provider *enc, + const krb5_keyblock *inkey, krb5_data *outrnd, + const krb5_data *in_constant) { size_t blocksize, keybytes, keylength, n; unsigned char *inblockdata, *outblockdata, *rawkey; diff --git a/src/lib/crypto/dk/dk_decrypt.c b/src/lib/crypto/dk/dk_decrypt.c index 823eefa27..bebd2665e 100644 --- a/src/lib/crypto/dk/dk_decrypt.c +++ b/src/lib/crypto/dk/dk_decrypt.c @@ -41,45 +41,34 @@ krb5_dk_decrypt_maybe_trunc_hmac(const struct krb5_enc_provider *enc, int ivec_mode); krb5_error_code -krb5_dk_decrypt(enc, hash, key, usage, ivec, input, output) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_data *input; - krb5_data *output; +krb5_dk_decrypt(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *ivec, const krb5_data *input, + krb5_data *output) { return krb5_dk_decrypt_maybe_trunc_hmac(enc, hash, key, usage, ivec, input, output, 0, 0); } krb5_error_code -krb5int_aes_dk_decrypt(enc, hash, key, usage, ivec, input, output) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_data *input; - krb5_data *output; +krb5int_aes_dk_decrypt(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *ivec, const krb5_data *input, + krb5_data *output) { return krb5_dk_decrypt_maybe_trunc_hmac(enc, hash, key, usage, ivec, input, output, 96 / 8, 1); } static krb5_error_code -krb5_dk_decrypt_maybe_trunc_hmac(enc, hash, key, usage, ivec, input, output, - hmacsize, ivec_mode) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_data *input; - krb5_data *output; - size_t hmacsize; - int ivec_mode; +krb5_dk_decrypt_maybe_trunc_hmac(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *ivec, const krb5_data *input, + krb5_data *output, size_t hmacsize, + int ivec_mode) { krb5_error_code ret; size_t hashsize, blocksize, keybytes, keylength, enclen, plainlen; diff --git a/src/lib/crypto/dk/dk_encrypt.c b/src/lib/crypto/dk/dk_encrypt.c index cf6b826a4..08d26856c 100644 --- a/src/lib/crypto/dk/dk_encrypt.c +++ b/src/lib/crypto/dk/dk_encrypt.c @@ -37,11 +37,9 @@ include these bits of info. */ void -krb5_dk_encrypt_length(enc, hash, inputlen, length) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - size_t inputlen; - size_t *length; +krb5_dk_encrypt_length(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + size_t inputlen, size_t *length) { size_t blocksize, hashsize; @@ -51,14 +49,11 @@ krb5_dk_encrypt_length(enc, hash, inputlen, length) } krb5_error_code -krb5_dk_encrypt(enc, hash, key, usage, ivec, input, output) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_data *input; - krb5_data *output; +krb5_dk_encrypt(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *ivec, const krb5_data *input, + krb5_data *output) { size_t blocksize, keybytes, keylength, plainlen, enclen; krb5_error_code ret; @@ -180,11 +175,9 @@ cleanup: /* Not necessarily "AES", per se, but "a CBC+CTS mode block cipher with a 96-bit truncated HMAC". */ void -krb5int_aes_encrypt_length(enc, hash, inputlen, length) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - size_t inputlen; - size_t *length; +krb5int_aes_encrypt_length(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + size_t inputlen, size_t *length) { size_t blocksize, hashsize; @@ -221,14 +214,11 @@ trunc_hmac (const struct krb5_hash_provider *hash, } krb5_error_code -krb5int_aes_dk_encrypt(enc, hash, key, usage, ivec, input, output) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_data *input; - krb5_data *output; +krb5int_aes_dk_encrypt(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *ivec, const krb5_data *input, + krb5_data *output) { size_t blocksize, keybytes, keylength, plainlen, enclen; krb5_error_code ret; diff --git a/src/lib/crypto/encrypt.c b/src/lib/crypto/encrypt.c index cc2593a6b..c215dc429 100644 --- a/src/lib/crypto/encrypt.c +++ b/src/lib/crypto/encrypt.c @@ -28,13 +28,9 @@ #include "etypes.h" krb5_error_code KRB5_CALLCONV -krb5_c_encrypt(context, key, usage, ivec, input, output) - krb5_context context; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_data *input; - krb5_enc_data *output; +krb5_c_encrypt(krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *ivec, + const krb5_data *input, krb5_enc_data *output) { int i; diff --git a/src/lib/crypto/encrypt_length.c b/src/lib/crypto/encrypt_length.c index c23e56349..71c25e735 100644 --- a/src/lib/crypto/encrypt_length.c +++ b/src/lib/crypto/encrypt_length.c @@ -28,11 +28,8 @@ #include "etypes.h" krb5_error_code KRB5_CALLCONV -krb5_c_encrypt_length(context, enctype, inputlen, length) - krb5_context context; - krb5_enctype enctype; - size_t inputlen; - size_t *length; +krb5_c_encrypt_length(krb5_context context, krb5_enctype enctype, + size_t inputlen, size_t *length) { int i; diff --git a/src/lib/crypto/enctype_compare.c b/src/lib/crypto/enctype_compare.c index 940e88ce8..55e827764 100644 --- a/src/lib/crypto/enctype_compare.c +++ b/src/lib/crypto/enctype_compare.c @@ -28,11 +28,8 @@ #include "etypes.h" krb5_error_code KRB5_CALLCONV -krb5_c_enctype_compare(context, e1, e2, similar) - krb5_context context; - krb5_enctype e1; - krb5_enctype e2; - krb5_boolean *similar; +krb5_c_enctype_compare(krb5_context context, krb5_enctype e1, krb5_enctype e2, + krb5_boolean *similar) { int i, j; diff --git a/src/lib/crypto/enctype_to_string.c b/src/lib/crypto/enctype_to_string.c index 42b7d6081..f77dbff1c 100644 --- a/src/lib/crypto/enctype_to_string.c +++ b/src/lib/crypto/enctype_to_string.c @@ -28,10 +28,7 @@ #include "etypes.h" krb5_error_code KRB5_CALLCONV -krb5_enctype_to_string(enctype, buffer, buflen) - krb5_enctype enctype; - char * buffer; - size_t buflen; +krb5_enctype_to_string(krb5_enctype enctype, char *buffer, size_t buflen) { int i; diff --git a/src/lib/crypto/hmac.c b/src/lib/crypto/hmac.c index ec3952096..cc46374c5 100644 --- a/src/lib/crypto/hmac.c +++ b/src/lib/crypto/hmac.c @@ -39,12 +39,8 @@ */ krb5_error_code -krb5_hmac(hash, key, icount, input, output) - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - unsigned int icount; - const krb5_data *input; - krb5_data *output; +krb5_hmac(const struct krb5_hash_provider *hash, const krb5_keyblock *key, + unsigned int icount, const krb5_data *input, krb5_data *output) { size_t hashsize, blocksize; unsigned char *xorkey, *ihash; diff --git a/src/lib/crypto/keyed_checksum_types.c b/src/lib/crypto/keyed_checksum_types.c index 46b672cb0..0e46466f2 100644 --- a/src/lib/crypto/keyed_checksum_types.c +++ b/src/lib/crypto/keyed_checksum_types.c @@ -28,8 +28,7 @@ #include "etypes.h" #include "cksumtypes.h" -static int etype_match(e1, e2) - krb5_enctype e1, e2; +static int etype_match(krb5_enctype e1, krb5_enctype e2) { int i1, i2; @@ -47,11 +46,8 @@ static int etype_match(e1, e2) } krb5_error_code KRB5_CALLCONV -krb5_c_keyed_checksum_types(context, enctype, count, cksumtypes) - krb5_context context; - krb5_enctype enctype; - unsigned int *count; - krb5_cksumtype **cksumtypes; +krb5_c_keyed_checksum_types(krb5_context context, krb5_enctype enctype, + unsigned int *count, krb5_cksumtype **cksumtypes) { unsigned int i, c; @@ -84,9 +80,7 @@ krb5_c_keyed_checksum_types(context, enctype, count, cksumtypes) } void KRB5_CALLCONV -krb5_free_cksumtypes(context, val) - krb5_context context; - krb5_cksumtype * val; +krb5_free_cksumtypes(krb5_context context, krb5_cksumtype *val) { if (val) krb5_xfree(val); diff --git a/src/lib/crypto/keyed_cksum.c b/src/lib/crypto/keyed_cksum.c index f5d229bb9..7056f8f99 100644 --- a/src/lib/crypto/keyed_cksum.c +++ b/src/lib/crypto/keyed_cksum.c @@ -28,8 +28,7 @@ #include "cksumtypes.h" krb5_boolean KRB5_CALLCONV -krb5_c_is_keyed_cksum(ctype) - krb5_cksumtype ctype; +krb5_c_is_keyed_cksum(krb5_cksumtype ctype) { int i; diff --git a/src/lib/crypto/make_checksum.c b/src/lib/crypto/make_checksum.c index 9d272eb79..40a181db4 100644 --- a/src/lib/crypto/make_checksum.c +++ b/src/lib/crypto/make_checksum.c @@ -30,13 +30,9 @@ #include "dk.h" krb5_error_code KRB5_CALLCONV -krb5_c_make_checksum(context, cksumtype, key, usage, input, cksum) - krb5_context context; - krb5_cksumtype cksumtype; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *input; - krb5_checksum *cksum; +krb5_c_make_checksum(krb5_context context, krb5_cksumtype cksumtype, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *input, krb5_checksum *cksum) { int i, e1, e2; krb5_data data; diff --git a/src/lib/crypto/make_random_key.c b/src/lib/crypto/make_random_key.c index c0c0debde..0ae321dca 100644 --- a/src/lib/crypto/make_random_key.c +++ b/src/lib/crypto/make_random_key.c @@ -28,10 +28,8 @@ #include "etypes.h" krb5_error_code KRB5_CALLCONV -krb5_c_make_random_key(context, enctype, random_key) - krb5_context context; - krb5_enctype enctype; - krb5_keyblock *random_key; +krb5_c_make_random_key(krb5_context context, krb5_enctype enctype, + krb5_keyblock *random_key) { int i; krb5_error_code ret; diff --git a/src/lib/crypto/md4/ChangeLog b/src/lib/crypto/md4/ChangeLog index b5bc33ca4..8968b27f2 100644 --- a/src/lib/crypto/md4/ChangeLog +++ b/src/lib/crypto/md4/ChangeLog @@ -1,3 +1,7 @@ +2004-02-18 Ken Raeburn + + * md4.c: Use ANSI C style function definitions. + 2003-07-17 Ken Raeburn * Makefile.in (LIBNAME) [##WIN16##]: Don't define. diff --git a/src/lib/crypto/md4/md4.c b/src/lib/crypto/md4/md4.c index 36bcb65a9..3541bce56 100644 --- a/src/lib/crypto/md4/md4.c +++ b/src/lib/crypto/md4/md4.c @@ -76,8 +76,7 @@ static const unsigned char PADDING[64] = { (a) = ROTATE_LEFT ((a), (s));} void -krb5_MD4Init (mdContext) -krb5_MD4_CTX *mdContext; +krb5_MD4Init (krb5_MD4_CTX *mdContext) { mdContext->i[0] = mdContext->i[1] = (krb5_ui_4)0; @@ -90,10 +89,7 @@ krb5_MD4_CTX *mdContext; } void -krb5_MD4Update (mdContext, inBuf, inLen) -krb5_MD4_CTX *mdContext; -const unsigned char *inBuf; -unsigned int inLen; +krb5_MD4Update (krb5_MD4_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) { krb5_ui_4 in[16]; int mdi; @@ -126,8 +122,7 @@ unsigned int inLen; } void -krb5_MD4Final (mdContext) -krb5_MD4_CTX *mdContext; +krb5_MD4Final (krb5_MD4_CTX *mdContext) { krb5_ui_4 in[16]; int mdi; @@ -168,9 +163,7 @@ krb5_MD4_CTX *mdContext; /* Basic MD4 step. Transform buf based on in. */ -static void Transform (buf, in) -krb5_ui_4 *buf; -krb5_ui_4 *in; +static void Transform (krb5_ui_4 *buf, krb5_ui_4 *in) { register krb5_ui_4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; diff --git a/src/lib/crypto/md5/ChangeLog b/src/lib/crypto/md5/ChangeLog index c7272b106..26f5c8f38 100644 --- a/src/lib/crypto/md5/ChangeLog +++ b/src/lib/crypto/md5/ChangeLog @@ -1,3 +1,7 @@ +2004-02-18 Ken Raeburn + + * md5.c: Use ANSI C style function definitions. + 2003-07-17 Ken Raeburn * Makefile.in (LIBNAME) [##WIN16##]: Don't define. diff --git a/src/lib/crypto/md5/md5.c b/src/lib/crypto/md5/md5.c index 98c48e494..6c4cc57a3 100644 --- a/src/lib/crypto/md5/md5.c +++ b/src/lib/crypto/md5/md5.c @@ -107,8 +107,7 @@ static const unsigned char PADDING[64] = { mdContext. All fields are set to zero. */ void -krb5_MD5Init (mdContext) -krb5_MD5_CTX *mdContext; +krb5_MD5Init (krb5_MD5_CTX *mdContext) { mdContext->i[0] = mdContext->i[1] = (krb5_ui_4)0; @@ -125,10 +124,7 @@ krb5_MD5_CTX *mdContext; in the message whose digest is being computed. */ void -krb5_MD5Update (mdContext, inBuf, inLen) -krb5_MD5_CTX *mdContext; -const unsigned char *inBuf; -unsigned int inLen; +krb5_MD5Update (krb5_MD5_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) { krb5_ui_4 in[16]; int mdi; @@ -164,8 +160,7 @@ unsigned int inLen; ends with the desired message digest in mdContext->digest[0...15]. */ void -krb5_MD5Final (mdContext) -krb5_MD5_CTX *mdContext; +krb5_MD5Final (krb5_MD5_CTX *mdContext) { krb5_ui_4 in[16]; int mdi; @@ -205,9 +200,7 @@ krb5_MD5_CTX *mdContext; /* Basic MD5 step. Transforms buf based on in. */ -static void Transform (buf, in) -krb5_ui_4 *buf; -krb5_ui_4 *in; +static void Transform (krb5_ui_4 *buf, krb5_ui_4 *in) { register krb5_ui_4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; diff --git a/src/lib/crypto/nfold.c b/src/lib/crypto/nfold.c index 937f09669..1f1902d1c 100644 --- a/src/lib/crypto/nfold.c +++ b/src/lib/crypto/nfold.c @@ -46,11 +46,8 @@ n-fold(k-bits): /* input length is in bits */ void -krb5_nfold(inbits, in, outbits, out) - unsigned int inbits; - const unsigned char *in; - unsigned int outbits; - unsigned char *out; +krb5_nfold(unsigned int inbits, const unsigned char *in, unsigned int outbits, + unsigned char *out) { int a,b,c,lcm; int byte, i, msbit; diff --git a/src/lib/crypto/old/ChangeLog b/src/lib/crypto/old/ChangeLog index 126b2f1ad..34d257f6c 100644 --- a/src/lib/crypto/old/ChangeLog +++ b/src/lib/crypto/old/ChangeLog @@ -1,3 +1,7 @@ +2004-02-18 Ken Raeburn + + * des_stringtokey.c: Use ANSI C style function definitions. + 2003-07-22 Ken Raeburn * old_decrypt.c (krb5_old_decrypt): Use block_size and hashsize diff --git a/src/lib/crypto/old/des_stringtokey.c b/src/lib/crypto/old/des_stringtokey.c index 20f2f053a..2bacb4ef9 100644 --- a/src/lib/crypto/old/des_stringtokey.c +++ b/src/lib/crypto/old/des_stringtokey.c @@ -35,12 +35,10 @@ extern krb5_error_code mit_des_string_to_key_int const krb5_data * salt); krb5_error_code -krb5int_des_string_to_key(enc, string, salt, parm, key) - const struct krb5_enc_provider *enc; - const krb5_data *string; - const krb5_data *salt; - const krb5_data *parm; - krb5_keyblock *key; +krb5int_des_string_to_key(const struct krb5_enc_provider *enc, + const krb5_data *string, + const krb5_data *salt, const krb5_data *parm, + krb5_keyblock *key) { int type; if (parm ) { diff --git a/src/lib/crypto/old_api_glue.c b/src/lib/crypto/old_api_glue.c index 695f91e5b..fda16909a 100644 --- a/src/lib/crypto/old_api_glue.c +++ b/src/lib/crypto/old_api_glue.c @@ -27,13 +27,9 @@ #include "k5-int.h" krb5_error_code KRB5_CALLCONV -krb5_encrypt(context, inptr, outptr, size, eblock, ivec) - krb5_context context; - krb5_const_pointer inptr; - krb5_pointer outptr; - size_t size; - krb5_encrypt_block * eblock; - krb5_pointer ivec; +krb5_encrypt(krb5_context context, krb5_const_pointer inptr, + krb5_pointer outptr, size_t size, krb5_encrypt_block *eblock, + krb5_pointer ivec) { krb5_data inputd, ivecd; krb5_enc_data outputd; @@ -66,13 +62,9 @@ krb5_encrypt(context, inptr, outptr, size, eblock, ivec) } krb5_error_code KRB5_CALLCONV -krb5_decrypt(context, inptr, outptr, size, eblock, ivec) - krb5_context context; - krb5_const_pointer inptr; - krb5_pointer outptr; - size_t size; - krb5_encrypt_block * eblock; - krb5_pointer ivec; +krb5_decrypt(krb5_context context, krb5_const_pointer inptr, + krb5_pointer outptr, size_t size, krb5_encrypt_block *eblock, + krb5_pointer ivec) { krb5_enc_data inputd; krb5_data outputd, ivecd; @@ -103,10 +95,8 @@ krb5_decrypt(context, inptr, outptr, size, eblock, ivec) } krb5_error_code KRB5_CALLCONV -krb5_process_key(context, eblock, key) - krb5_context context; - krb5_encrypt_block * eblock; - const krb5_keyblock * key; +krb5_process_key(krb5_context context, krb5_encrypt_block *eblock, + const krb5_keyblock *key) { eblock->key = (krb5_keyblock *) key; @@ -114,31 +104,23 @@ krb5_process_key(context, eblock, key) } krb5_error_code KRB5_CALLCONV -krb5_finish_key(context, eblock) - krb5_context context; - krb5_encrypt_block * eblock; +krb5_finish_key(krb5_context context, krb5_encrypt_block *eblock) { return(0); } krb5_error_code KRB5_CALLCONV -krb5_string_to_key(context, eblock, keyblock, data, salt) - krb5_context context; - const krb5_encrypt_block * eblock; - krb5_keyblock * keyblock; - const krb5_data * data; - const krb5_data * salt; +krb5_string_to_key(krb5_context context, const krb5_encrypt_block *eblock, + krb5_keyblock *keyblock, const krb5_data *data, + const krb5_data *salt) { return(krb5_c_string_to_key(context, eblock->crypto_entry, data, salt, keyblock)); } krb5_error_code KRB5_CALLCONV -krb5_init_random_key(context, eblock, keyblock, ptr) - krb5_context context; - const krb5_encrypt_block * eblock; - const krb5_keyblock * keyblock; - krb5_pointer * ptr; +krb5_init_random_key(krb5_context context, const krb5_encrypt_block *eblock, + const krb5_keyblock *keyblock, krb5_pointer *ptr) { krb5_data data; @@ -149,20 +131,15 @@ krb5_init_random_key(context, eblock, keyblock, ptr) } krb5_error_code KRB5_CALLCONV -krb5_finish_random_key(context, eblock, ptr) - krb5_context context; - const krb5_encrypt_block * eblock; - krb5_pointer * ptr; +krb5_finish_random_key(krb5_context context, const krb5_encrypt_block *eblock, + krb5_pointer *ptr) { return(0); } krb5_error_code KRB5_CALLCONV -krb5_random_key(context, eblock, ptr, keyblock) - krb5_context context; - const krb5_encrypt_block * eblock; - krb5_pointer ptr; - krb5_keyblock ** keyblock; +krb5_random_key(krb5_context context, const krb5_encrypt_block *eblock, + krb5_pointer ptr, krb5_keyblock **keyblock) { krb5_keyblock *key; krb5_error_code ret; @@ -179,18 +156,14 @@ krb5_random_key(context, eblock, ptr, keyblock) } krb5_enctype KRB5_CALLCONV -krb5_eblock_enctype(context, eblock) - krb5_context context; - const krb5_encrypt_block * eblock; +krb5_eblock_enctype(krb5_context context, const krb5_encrypt_block *eblock) { return(eblock->crypto_entry); } krb5_error_code KRB5_CALLCONV -krb5_use_enctype(context, eblock, enctype) - krb5_context context; - krb5_encrypt_block * eblock; - const krb5_enctype enctype; +krb5_use_enctype(krb5_context context, krb5_encrypt_block *eblock, + krb5_enctype enctype) { eblock->crypto_entry = enctype; @@ -198,9 +171,7 @@ krb5_use_enctype(context, eblock, enctype) } size_t KRB5_CALLCONV -krb5_encrypt_size(length, crypto) - size_t length; - krb5_enctype crypto; +krb5_encrypt_size(size_t length, krb5_enctype crypto) { size_t ret; @@ -211,9 +182,7 @@ krb5_encrypt_size(length, crypto) } size_t KRB5_CALLCONV -krb5_checksum_size(context, ctype) - krb5_context context; - krb5_cksumtype ctype; +krb5_checksum_size(krb5_context context, krb5_cksumtype ctype) { size_t ret; @@ -224,15 +193,10 @@ krb5_checksum_size(context, ctype) } krb5_error_code KRB5_CALLCONV -krb5_calculate_checksum(context, ctype, in, in_length, - seed, seed_length, outcksum) - krb5_context context; - krb5_cksumtype ctype; - krb5_const_pointer in; - size_t in_length; - krb5_const_pointer seed; - size_t seed_length; - krb5_checksum * outcksum; +krb5_calculate_checksum(krb5_context context, krb5_cksumtype ctype, + krb5_const_pointer in, size_t in_length, + krb5_const_pointer seed, size_t seed_length, + krb5_checksum *outcksum) { krb5_data input; krb5_keyblock key; @@ -265,15 +229,10 @@ krb5_calculate_checksum(context, ctype, in, in_length, } krb5_error_code KRB5_CALLCONV -krb5_verify_checksum(context, ctype, cksum, in, in_length, - seed, seed_length) - krb5_context context; - krb5_cksumtype ctype; - const krb5_checksum * cksum; - krb5_const_pointer in; - size_t in_length; - krb5_const_pointer seed; - size_t seed_length; +krb5_verify_checksum(krb5_context context, krb5_cksumtype ctype, + const krb5_checksum *cksum, krb5_const_pointer in, + size_t in_length, krb5_const_pointer seed, + size_t seed_length) { krb5_data input; krb5_keyblock key; @@ -297,9 +256,7 @@ krb5_verify_checksum(context, ctype, cksum, in, in_length, } krb5_error_code KRB5_CALLCONV -krb5_random_confounder(size, ptr) - size_t size; - krb5_pointer ptr; +krb5_random_confounder(size_t size, krb5_pointer ptr) { krb5_data random_data; @@ -309,12 +266,9 @@ krb5_random_confounder(size, ptr) return(krb5_c_random_make_octets(/* XXX */ 0, &random_data)); } -krb5_error_code krb5_encrypt_data(context, key, ivec, data, enc_data) - krb5_context context; - krb5_keyblock *key; - krb5_pointer ivec; - krb5_data *data; - krb5_enc_data *enc_data; +krb5_error_code krb5_encrypt_data(krb5_context context, krb5_keyblock *key, + krb5_pointer ivec, krb5_data *data, + krb5_enc_data *enc_data) { krb5_error_code ret; size_t enclen, blocksize; @@ -345,12 +299,9 @@ krb5_error_code krb5_encrypt_data(context, key, ivec, data, enc_data) return(ret); } -krb5_error_code krb5_decrypt_data(context, key, ivec, enc_data, data) - krb5_context context; - krb5_keyblock *key; - krb5_pointer ivec; - krb5_enc_data *enc_data; - krb5_data *data; +krb5_error_code krb5_decrypt_data(krb5_context context, krb5_keyblock *key, + krb5_pointer ivec, krb5_enc_data *enc_data, + krb5_data *data) { krb5_error_code ret; krb5_data ivecd; diff --git a/src/lib/crypto/prng.c b/src/lib/crypto/prng.c index 881eebd34..5f0d3864a 100644 --- a/src/lib/crypto/prng.c +++ b/src/lib/crypto/prng.c @@ -123,8 +123,7 @@ void prng_cleanup (void) #if defined(_WIN32) krb5_error_code KRB5_CALLCONV -krb5_c_random_os_entropy ( - krb5_context context, int strong, int *success) +krb5_c_random_os_entropy (krb5_context context, int strong, int *success) { if (success) *success = 0; diff --git a/src/lib/crypto/raw/ChangeLog b/src/lib/crypto/raw/ChangeLog index 1bd2a019a..937242118 100644 --- a/src/lib/crypto/raw/ChangeLog +++ b/src/lib/crypto/raw/ChangeLog @@ -1,3 +1,8 @@ +2004-02-18 Ken Raeburn + + * raw_decrypt.c, raw_encrypt.c: Use ANSI C style function + definitions. + 2003-07-22 Ken Raeburn * raw_encrypt.c (krb5_raw_encrypt_length): Use block_size field diff --git a/src/lib/crypto/raw/raw_decrypt.c b/src/lib/crypto/raw/raw_decrypt.c index 9c26968cd..767da1f9f 100644 --- a/src/lib/crypto/raw/raw_decrypt.c +++ b/src/lib/crypto/raw/raw_decrypt.c @@ -28,14 +28,11 @@ #include "raw.h" krb5_error_code -krb5_raw_decrypt(enc, hash, key, usage, ivec, input, output) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_data *input; - krb5_data *output; +krb5_raw_decrypt(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *ivec, const krb5_data *input, + krb5_data *output) { return((*(enc->decrypt))(key, ivec, input, output)); } diff --git a/src/lib/crypto/raw/raw_encrypt.c b/src/lib/crypto/raw/raw_encrypt.c index 97e1bb5ee..68b819c01 100644 --- a/src/lib/crypto/raw/raw_encrypt.c +++ b/src/lib/crypto/raw/raw_encrypt.c @@ -28,11 +28,9 @@ #include "raw.h" void -krb5_raw_encrypt_length(enc, hash, inputlen, length) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - size_t inputlen; - size_t *length; +krb5_raw_encrypt_length(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + size_t inputlen, size_t *length) { size_t blocksize; @@ -42,14 +40,11 @@ krb5_raw_encrypt_length(enc, hash, inputlen, length) } krb5_error_code -krb5_raw_encrypt(enc, hash, key, usage, ivec, input, output) - const struct krb5_enc_provider *enc; - const struct krb5_hash_provider *hash; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *ivec; - const krb5_data *input; - krb5_data *output; +krb5_raw_encrypt(const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *ivec, const krb5_data *input, + krb5_data *output) { return((*(enc->encrypt))(key, ivec, input, output)); } diff --git a/src/lib/crypto/sha1/ChangeLog b/src/lib/crypto/sha1/ChangeLog index ebdfe618c..487f09e40 100644 --- a/src/lib/crypto/sha1/ChangeLog +++ b/src/lib/crypto/sha1/ChangeLog @@ -1,3 +1,7 @@ +2004-02-18 Ken Raeburn + + * shs.c: Use ANSI C style function definitions. + 2003-07-17 Ken Raeburn * Makefile.in (LIBNAME) [##WIN16##]: Don't define. diff --git a/src/lib/crypto/sha1/shs.c b/src/lib/crypto/sha1/shs.c index 423e981fc..f97856ee4 100644 --- a/src/lib/crypto/sha1/shs.c +++ b/src/lib/crypto/sha1/shs.c @@ -76,8 +76,7 @@ /* Initialize the SHS values */ -void shsInit(shsInfo) - SHS_INFO *shsInfo; +void shsInit(SHS_INFO *shsInfo) { /* Set the h-vars to their initial values */ shsInfo->digest[ 0 ] = h0init; @@ -100,9 +99,7 @@ void shsInit(shsInfo) static void SHSTransform (SHS_LONG *digest, const SHS_LONG *data); static -void SHSTransform(digest, data) - SHS_LONG *digest; - const SHS_LONG *data; +void SHSTransform(SHS_LONG *digest, const SHS_LONG *data) { SHS_LONG A, B, C, D, E; /* Local vars */ SHS_LONG eData[ 16 ]; /* Expanded data */ @@ -215,10 +212,7 @@ void SHSTransform(digest, data) /* Update SHS for a block of data */ -void shsUpdate(shsInfo, buffer, count) - SHS_INFO *shsInfo; - const SHS_BYTE *buffer; - int count; +void shsUpdate(SHS_INFO *shsInfo, const SHS_BYTE *buffer, int count) { SHS_LONG tmp; int dataCount, canfill; @@ -314,8 +308,7 @@ void shsUpdate(shsInfo, buffer, count) /* Final wrapup - pad to SHS_DATASIZE-byte boundary with the bit pattern 1 0* (64-bit count of bits processed, MSB-first) */ -void shsFinal(shsInfo) - SHS_INFO *shsInfo; +void shsFinal(SHS_INFO *shsInfo) { int count; SHS_LONG *lp; diff --git a/src/lib/crypto/string_to_cksumtype.c b/src/lib/crypto/string_to_cksumtype.c index 873ea9b49..710f26160 100644 --- a/src/lib/crypto/string_to_cksumtype.c +++ b/src/lib/crypto/string_to_cksumtype.c @@ -28,9 +28,7 @@ #include "cksumtypes.h" krb5_error_code KRB5_CALLCONV -krb5_string_to_cksumtype(string, cksumtypep) - char * string; - krb5_cksumtype * cksumtypep; +krb5_string_to_cksumtype(char *string, krb5_cksumtype *cksumtypep) { int i; diff --git a/src/lib/crypto/string_to_enctype.c b/src/lib/crypto/string_to_enctype.c index 8862032c6..9d3245bf0 100644 --- a/src/lib/crypto/string_to_enctype.c +++ b/src/lib/crypto/string_to_enctype.c @@ -28,9 +28,7 @@ #include "etypes.h" krb5_error_code KRB5_CALLCONV -krb5_string_to_enctype(string, enctypep) - char * string; - krb5_enctype * enctypep; +krb5_string_to_enctype(char *string, krb5_enctype *enctypep) { int i; diff --git a/src/lib/crypto/string_to_key.c b/src/lib/crypto/string_to_key.c index 27f49aabe..03165ab25 100644 --- a/src/lib/crypto/string_to_key.c +++ b/src/lib/crypto/string_to_key.c @@ -37,25 +37,19 @@ krb5_c_string_to_key_with_params(krb5_context context, krb5_error_code KRB5_CALLCONV -krb5_c_string_to_key(context, enctype, string, salt, key) - krb5_context context; - krb5_enctype enctype; - const krb5_data *string; - const krb5_data *salt; - krb5_keyblock *key; +krb5_c_string_to_key(krb5_context context, krb5_enctype enctype, + const krb5_data *string, const krb5_data *salt, + krb5_keyblock *key) { return krb5_c_string_to_key_with_params(context, enctype, string, salt, NULL, key); } krb5_error_code KRB5_CALLCONV -krb5_c_string_to_key_with_params(context, enctype, string, salt, params, key) - krb5_context context; - krb5_enctype enctype; - const krb5_data *string; - const krb5_data *salt; - const krb5_data *params; - krb5_keyblock *key; +krb5_c_string_to_key_with_params(krb5_context context, krb5_enctype enctype, + const krb5_data *string, + const krb5_data *salt, + const krb5_data *params, krb5_keyblock *key) { int i; krb5_error_code ret; diff --git a/src/lib/crypto/valid_cksumtype.c b/src/lib/crypto/valid_cksumtype.c index 071a33557..bc34c0b95 100644 --- a/src/lib/crypto/valid_cksumtype.c +++ b/src/lib/crypto/valid_cksumtype.c @@ -28,8 +28,7 @@ #include "cksumtypes.h" krb5_boolean KRB5_CALLCONV -krb5_c_valid_cksumtype(ctype) - krb5_cksumtype ctype; +krb5_c_valid_cksumtype(krb5_cksumtype ctype) { int i; diff --git a/src/lib/crypto/valid_enctype.c b/src/lib/crypto/valid_enctype.c index 9b661811a..f36023084 100644 --- a/src/lib/crypto/valid_enctype.c +++ b/src/lib/crypto/valid_enctype.c @@ -28,8 +28,7 @@ #include "etypes.h" krb5_boolean KRB5_CALLCONV -krb5_c_valid_enctype(etype) - krb5_enctype etype; +krb5_c_valid_enctype(krb5_enctype etype) { int i; diff --git a/src/lib/crypto/verify_checksum.c b/src/lib/crypto/verify_checksum.c index 0c97cb598..30c9c07c0 100644 --- a/src/lib/crypto/verify_checksum.c +++ b/src/lib/crypto/verify_checksum.c @@ -28,13 +28,9 @@ #include "cksumtypes.h" krb5_error_code KRB5_CALLCONV -krb5_c_verify_checksum(context, key, usage, data, cksum, valid) - krb5_context context; - const krb5_keyblock *key; - krb5_keyusage usage; - const krb5_data *data; - const krb5_checksum *cksum; - krb5_boolean *valid; +krb5_c_verify_checksum(krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *data, + const krb5_checksum *cksum, krb5_boolean *valid) { int i; size_t hashsize; -- 2.26.2