+2004-02-18 Ken Raeburn <raeburn@mit.edu>
+
+ * 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 <raeburn@mit.edu>
* t_encrypt.c (compare_results): New function.
+2004-02-18 Ken Raeburn <raeburn@mit.edu>
+
+ * arcfour.c: Use ANSI C style function definitions.
+
2003-12-19 Ken Raeburn <raeburn@mit.edu>
* arcfour.c (l40): Now const.
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;
}
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;
/* 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;
#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;
#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;
#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;
#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;
+2004-02-18 Ken Raeburn <raeburn@mit.edu>
+
+ * crc32.c: Use ANSI C style function definitions.
+
2003-07-17 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (LIBNAME) [##WIN16##]: Don't define.
};
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;
};
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;
#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;
+2004-02-18 Ken Raeburn <raeburn@mit.edu>
+
+ * 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 <raeburn@mit.edu>
* f_tables.h (DES_DO_ENCRYPT, DES_DO_DECRYPT): Allocate temporary
#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
};
-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;
* 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;
* 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;
#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);
#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]);
#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.
*/
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;
#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<sizeof(mit_des_cblock); i++)
* correct des parity.
*/
int
-mit_des_check_key_parity(key)
- register mit_des_cblock key;
+mit_des_check_key_parity(mit_des_cblock key)
{
int i;
* Permute the key to give us our key schedule.
*/
int
-mit_des_make_key_sched(key, schedule)
- mit_des_cblock key;
- mit_des_key_schedule schedule;
+mit_des_make_key_sched(mit_des_cblock key, mit_des_key_schedule schedule)
{
register unsigned DES_INT32 c, d;
#include "des_int.h"
int
-mit_des_key_sched(k,schedule)
- mit_des_cblock k;
- mit_des_key_schedule schedule;
+mit_des_key_sched(mit_des_cblock k, mit_des_key_schedule schedule)
{
mit_des_make_key_sched(k,schedule);
/*#define PRINT_TEST_VECTORS*/
krb5_error_code
-mit_des_string_to_key_int (keyblock, data, salt)
- krb5_keyblock * keyblock;
- const krb5_data * data;
- const krb5_data * salt;
+mit_des_string_to_key_int (krb5_keyblock *keyblock, const krb5_data *data,
+ const krb5_data *salt)
{
register krb5_octet *str, *copystr;
register krb5_octet *key;
* Requires: key has correct odd parity.
*/
int
-mit_des_is_weak_key(key)
- mit_des_cblock key;
+mit_des_is_weak_key(mit_des_cblock key)
{
int i;
const mit_des_cblock *weak_p = weak;
+2004-02-18 Ken Raeburn <raeburn@mit.edu>
+
+ * checksum.c, derive.c, dk_decrypt.c, dk_encrypt.c: Use ANSI C
+ style function definitions.
+
2004-02-13 Ken Raeburn <raeburn@mit.edu>
* dk_decrypt.c (krb5_dk_decrypt_maybe_trunc_hmac): New argument
#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;
#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;
#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;
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;
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;
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;
}
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;
/* 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;
}
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;
#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;
#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;
#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;
#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;
*/
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;
#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;
}
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;
}
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);
#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;
#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;
#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;
+2004-02-18 Ken Raeburn <raeburn@mit.edu>
+
+ * md4.c: Use ANSI C style function definitions.
+
2003-07-17 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (LIBNAME) [##WIN16##]: Don't define.
(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;
}
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;
}
void
-krb5_MD4Final (mdContext)
-krb5_MD4_CTX *mdContext;
+krb5_MD4Final (krb5_MD4_CTX *mdContext)
{
krb5_ui_4 in[16];
int mdi;
/* 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];
+2004-02-18 Ken Raeburn <raeburn@mit.edu>
+
+ * md5.c: Use ANSI C style function definitions.
+
2003-07-17 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (LIBNAME) [##WIN16##]: Don't define.
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;
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;
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;
/* 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];
/* 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;
+2004-02-18 Ken Raeburn <raeburn@mit.edu>
+
+ * des_stringtokey.c: Use ANSI C style function definitions.
+
2003-07-22 Ken Raeburn <raeburn@mit.edu>
* old_decrypt.c (krb5_old_decrypt): Use block_size and hashsize
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 ) {
#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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
#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;
+2004-02-18 Ken Raeburn <raeburn@mit.edu>
+
+ * raw_decrypt.c, raw_encrypt.c: Use ANSI C style function
+ definitions.
+
2003-07-22 Ken Raeburn <raeburn@mit.edu>
* raw_encrypt.c (krb5_raw_encrypt_length): Use block_size field
#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));
}
#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;
}
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));
}
+2004-02-18 Ken Raeburn <raeburn@mit.edu>
+
+ * shs.c: Use ANSI C style function definitions.
+
2003-07-17 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (LIBNAME) [##WIN16##]: Don't define.
/* 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;
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 */
/* 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;
/* 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;
#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;
#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;
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;
#include "cksumtypes.h"
krb5_boolean KRB5_CALLCONV
-krb5_c_valid_cksumtype(ctype)
- krb5_cksumtype ctype;
+krb5_c_valid_cksumtype(krb5_cksumtype ctype)
{
int i;
#include "etypes.h"
krb5_boolean KRB5_CALLCONV
-krb5_c_valid_enctype(etype)
- krb5_enctype etype;
+krb5_c_valid_enctype(krb5_enctype etype)
{
int i;
#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;