From: Ken Raeburn Date: Tue, 6 Mar 2001 02:18:47 +0000 (+0000) Subject: krb5_const -> const X-Git-Tag: krb5-1.3-alpha1~1640 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=73b74582df45303fb0d4818875bcc20e362d1587;p=krb5.git krb5_const -> const git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13058 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/ChangeLog b/src/lib/crypto/ChangeLog index 4e961ab9e..adb000d74 100644 --- a/src/lib/crypto/ChangeLog +++ b/src/lib/crypto/ChangeLog @@ -3,6 +3,10 @@ * prng.c: Clean up some comments. (enc): Use des3 now. + * decrypt.c, encrypt.c, hmac.c, make_checksum.c, nfold.c, + old_api_glue.c, string_to_key.c, verify_checksum.c: Use const + instead of krb5_const. + 2001-01-29 Ken Raeburn * make_checksum.c (krb5_c_make_checksum): Clear checksum contents diff --git a/src/lib/crypto/crc32/ChangeLog b/src/lib/crypto/crc32/ChangeLog index e1c64e457..3a50f9f5c 100644 --- a/src/lib/crypto/crc32/ChangeLog +++ b/src/lib/crypto/crc32/ChangeLog @@ -1,3 +1,7 @@ +2001-03-05 Ken Raeburn + + * crc-32.h, crc.c, crc32.c: Use const instead of krb5_const. + 1999-10-26 Wilfredo Sanchez * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES, diff --git a/src/lib/crypto/crc32/crc-32.h b/src/lib/crypto/crc32/crc-32.h index e366d6970..94e6431c8 100644 --- a/src/lib/crypto/crc32/crc-32.h +++ b/src/lib/crypto/crc32/crc-32.h @@ -60,7 +60,7 @@ #define CRC32_CKSUM_LENGTH 4 void -mit_crc32 PROTOTYPE((krb5_const krb5_pointer in, krb5_const size_t in_length, +mit_crc32 PROTOTYPE((const krb5_pointer in, const size_t in_length, unsigned long *c)); extern krb5_checksum_entry crc32_cksumtable_entry; diff --git a/src/lib/crypto/crc32/crc.c b/src/lib/crypto/crc32/crc.c index 313076f92..4377f1c5b 100644 --- a/src/lib/crypto/crc32/crc.c +++ b/src/lib/crypto/crc32/crc.c @@ -150,26 +150,26 @@ static u_long const crc_table[256] = { static krb5_error_code crc32_sum_func PROTOTYPE(( - krb5_const krb5_pointer in, - krb5_const size_t in_length, - krb5_const krb5_pointer seed, - krb5_const size_t seed_length, + const krb5_pointer in, + const size_t in_length, + const krb5_pointer seed, + const size_t seed_length, krb5_checksum FAR *outcksum)); static krb5_error_code crc32_verify_func PROTOTYPE(( - krb5_const krb5_checksum FAR *cksum, - krb5_const krb5_pointer in, - krb5_const size_t in_length, - krb5_const krb5_pointer seed, - krb5_const size_t seed_length)); + const krb5_checksum FAR *cksum, + const krb5_pointer in, + const size_t in_length, + const krb5_pointer seed, + const size_t seed_length)); static krb5_error_code crc32_sum_func(in, in_length, seed, seed_length, outcksum) - krb5_const krb5_pointer in; - krb5_const size_t in_length; - krb5_const krb5_pointer seed; - krb5_const size_t seed_length; + const krb5_pointer in; + const size_t in_length; + const krb5_pointer seed; + const size_t seed_length; krb5_checksum FAR *outcksum; { register u_char *data; @@ -199,11 +199,11 @@ crc32_sum_func(in, in_length, seed, seed_length, outcksum) static krb5_error_code crc32_verify_func(cksum, in, in_length, seed, seed_length) - krb5_const krb5_checksum FAR *cksum; - krb5_const krb5_pointer in; - krb5_const size_t in_length; - krb5_const krb5_pointer seed; - krb5_const size_t seed_length; + const krb5_checksum FAR *cksum; + const krb5_pointer in; + const size_t in_length; + const krb5_pointer seed; + const size_t seed_length; { register u_char *data; register u_long c = 0; diff --git a/src/lib/crypto/crc32/crc32.c b/src/lib/crypto/crc32/crc32.c index 9b2bc4f6a..00be8fd65 100644 --- a/src/lib/crypto/crc32/crc32.c +++ b/src/lib/crypto/crc32/crc32.c @@ -148,8 +148,8 @@ static u_long const crc_table[256] = { void mit_crc32(in, in_length, cksum) - krb5_const krb5_pointer in; - krb5_const size_t in_length; + const krb5_pointer in; + const size_t in_length; unsigned long *cksum; { register u_char *data; diff --git a/src/lib/crypto/decrypt.c b/src/lib/crypto/decrypt.c index 0d66ec0c0..4e759a50c 100644 --- a/src/lib/crypto/decrypt.c +++ b/src/lib/crypto/decrypt.c @@ -30,10 +30,10 @@ KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_c_decrypt(context, key, usage, ivec, input, output) krb5_context context; - krb5_const krb5_keyblock *key; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *ivec; - krb5_const krb5_enc_data *input; + const krb5_data *ivec; + const krb5_enc_data *input; krb5_data *output; { int i; diff --git a/src/lib/crypto/dk/ChangeLog b/src/lib/crypto/dk/ChangeLog index ac67ff9e5..7e9c1900b 100644 --- a/src/lib/crypto/dk/ChangeLog +++ b/src/lib/crypto/dk/ChangeLog @@ -1,3 +1,8 @@ +2001-03-05 Ken Raeburn + + * checksum.c, derive.c, dk.h, dk_decrypt.c, dk_encrypt.c, + stringtokey.c: Use const instead of krb5_const. + 2001-01-23 Ken Raeburn * stringtokey.c (kerberos): Now const. diff --git a/src/lib/crypto/dk/checksum.c b/src/lib/crypto/dk/checksum.c index 535ea7c04..ab1d00a92 100644 --- a/src/lib/crypto/dk/checksum.c +++ b/src/lib/crypto/dk/checksum.c @@ -32,10 +32,10 @@ krb5_error_code krb5_dk_make_checksum(hash, key, usage, input, output) - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *input; + const krb5_data *input; krb5_data *output; { int i; @@ -106,10 +106,10 @@ cleanup: #ifdef ATHENA_DES3_KLUDGE krb5_error_code krb5_marc_dk_make_checksum(hash, key, usage, input, output) - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *input; + const krb5_data *input; krb5_data *output; { int i; diff --git a/src/lib/crypto/dk/derive.c b/src/lib/crypto/dk/derive.c index dbd4a2a2d..8129ae8aa 100644 --- a/src/lib/crypto/dk/derive.c +++ b/src/lib/crypto/dk/derive.c @@ -29,10 +29,10 @@ krb5_error_code krb5_derive_key(enc, inkey, outkey, in_constant) - krb5_const struct krb5_enc_provider *enc; - krb5_const krb5_keyblock *inkey; + const struct krb5_enc_provider *enc; + const krb5_keyblock *inkey; krb5_keyblock *outkey; - krb5_const krb5_data *in_constant; + const krb5_data *in_constant; { size_t blocksize, keybytes, keylength, n; unsigned char *inblockdata, *outblockdata, *rawkey; diff --git a/src/lib/crypto/dk/dk.h b/src/lib/crypto/dk/dk.h index 996fed1f2..57be71db7 100644 --- a/src/lib/crypto/dk/dk.h +++ b/src/lib/crypto/dk/dk.h @@ -27,61 +27,61 @@ #include "k5-int.h" void krb5_dk_encrypt_length -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, +KRB5_PROTOTYPE((const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, size_t input, size_t *length)); krb5_error_code krb5_dk_encrypt -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, - krb5_const krb5_keyblock *key, krb5_keyusage usage, - krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output)); +KRB5_PROTOTYPE((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_error_code krb5_dk_decrypt -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, - krb5_const krb5_keyblock *key, krb5_keyusage usage, - krb5_const krb5_data *ivec, krb5_const krb5_data *input, +KRB5_PROTOTYPE((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 *arg_output)); krb5_error_code krb5_dk_string_to_key -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const krb5_data *string, krb5_const krb5_data *salt, +KRB5_PROTOTYPE((const struct krb5_enc_provider *enc, + const krb5_data *string, const krb5_data *salt, krb5_keyblock *key)); krb5_error_code krb5_derive_key -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const krb5_keyblock *inkey, - krb5_keyblock *outkey, krb5_const krb5_data *in_constant)); +KRB5_PROTOTYPE((const struct krb5_enc_provider *enc, + const krb5_keyblock *inkey, + krb5_keyblock *outkey, const krb5_data *in_constant)); krb5_error_code krb5_dk_make_checksum -KRB5_PROTOTYPE((krb5_const struct krb5_hash_provider *hash, - krb5_const krb5_keyblock *key, krb5_keyusage usage, - krb5_const krb5_data *input, krb5_data *output)); +KRB5_PROTOTYPE((const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *input, krb5_data *output)); #ifdef ATHENA_DES3_KLUDGE void krb5_marc_dk_encrypt_length -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, +KRB5_PROTOTYPE((const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, size_t input, size_t *length)); krb5_error_code krb5_marc_dk_encrypt -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, - krb5_const krb5_keyblock *key, krb5_keyusage usage, - krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output)); +KRB5_PROTOTYPE((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_error_code krb5_marc_dk_decrypt -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, - krb5_const krb5_keyblock *key, krb5_keyusage usage, - krb5_const krb5_data *ivec, krb5_const krb5_data *input, +KRB5_PROTOTYPE((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 *arg_output)); krb5_error_code krb5_marc_dk_make_checksum -KRB5_PROTOTYPE((krb5_const struct krb5_hash_provider *hash, - krb5_const krb5_keyblock *key, krb5_keyusage usage, - krb5_const krb5_data *input, krb5_data *output)); +KRB5_PROTOTYPE((const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *input, krb5_data *output)); #endif /* ATHENA_DES3_KLUDGE */ diff --git a/src/lib/crypto/dk/dk_decrypt.c b/src/lib/crypto/dk/dk_decrypt.c index d6e7c0db3..cd43c09a8 100644 --- a/src/lib/crypto/dk/dk_decrypt.c +++ b/src/lib/crypto/dk/dk_decrypt.c @@ -31,12 +31,12 @@ krb5_error_code krb5_dk_decrypt(enc, hash, key, usage, ivec, input, output) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *ivec; - krb5_const krb5_data *input; + const krb5_data *ivec; + const krb5_data *input; krb5_data *output; { krb5_error_code ret; @@ -161,12 +161,12 @@ cleanup: #ifdef ATHENA_DES3_KLUDGE krb5_error_code krb5_marc_dk_decrypt(enc, hash, key, usage, ivec, input, output) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *ivec; - krb5_const krb5_data *input; + const krb5_data *ivec; + const krb5_data *input; krb5_data *output; { krb5_error_code ret; diff --git a/src/lib/crypto/dk/dk_encrypt.c b/src/lib/crypto/dk/dk_encrypt.c index 2bc2b6ba4..eb9fe5fa3 100644 --- a/src/lib/crypto/dk/dk_encrypt.c +++ b/src/lib/crypto/dk/dk_encrypt.c @@ -38,8 +38,8 @@ void krb5_dk_encrypt_length(enc, hash, inputlen, length) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; size_t inputlen; size_t *length; { @@ -53,12 +53,12 @@ krb5_dk_encrypt_length(enc, hash, inputlen, length) krb5_error_code krb5_dk_encrypt(enc, hash, key, usage, ivec, input, output) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *ivec; - krb5_const krb5_data *input; + const krb5_data *ivec; + const krb5_data *input; krb5_data *output; { size_t blocksize, keybytes, keylength, plainlen, enclen; @@ -180,8 +180,8 @@ cleanup: #ifdef ATHENA_DES3_KLUDGE void krb5_marc_dk_encrypt_length(enc, hash, inputlen, length) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; size_t inputlen; size_t *length; { @@ -195,12 +195,12 @@ krb5_marc_dk_encrypt_length(enc, hash, inputlen, length) krb5_error_code krb5_marc_dk_encrypt(enc, hash, key, usage, ivec, input, output) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *ivec; - krb5_const krb5_data *input; + const krb5_data *ivec; + const krb5_data *input; krb5_data *output; { size_t blocksize, keybytes, keylength, plainlen, enclen; diff --git a/src/lib/crypto/dk/stringtokey.c b/src/lib/crypto/dk/stringtokey.c index 549a2e178..1bbbe5731 100644 --- a/src/lib/crypto/dk/stringtokey.c +++ b/src/lib/crypto/dk/stringtokey.c @@ -31,9 +31,9 @@ static const unsigned char kerberos[] = "kerberos"; krb5_error_code krb5_dk_string_to_key(enc, string, salt, key) - krb5_const struct krb5_enc_provider *enc; - krb5_const krb5_data *string; - krb5_const krb5_data *salt; + const struct krb5_enc_provider *enc; + const krb5_data *string; + const krb5_data *salt; krb5_keyblock *key; { krb5_error_code ret; diff --git a/src/lib/crypto/enc_provider/ChangeLog b/src/lib/crypto/enc_provider/ChangeLog index f95a62210..6b504648e 100644 --- a/src/lib/crypto/enc_provider/ChangeLog +++ b/src/lib/crypto/enc_provider/ChangeLog @@ -1,3 +1,7 @@ +2001-03-05 Ken Raeburn + + * des.c, des3.c: Use const instead of krb5_const. + 2000-06-28 Ezra Peisach * des.c, des3.c: Remove unused variables. diff --git a/src/lib/crypto/enc_provider/des.c b/src/lib/crypto/enc_provider/des.c index d4cc729a6..3560a06b1 100644 --- a/src/lib/crypto/enc_provider/des.c +++ b/src/lib/crypto/enc_provider/des.c @@ -44,8 +44,8 @@ k5_des_keysize(size_t *keybytes, size_t *keylength) } static krb5_error_code -k5_des_docrypt(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output, int encrypt) +k5_des_docrypt(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, krb5_data *output, int encrypt) { mit_des_key_schedule schedule; @@ -80,21 +80,21 @@ k5_des_docrypt(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, } static krb5_error_code -k5_des_encrypt(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output) +k5_des_encrypt(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, krb5_data *output) { return(k5_des_docrypt(key, ivec, input, output, 1)); } static krb5_error_code -k5_des_decrypt(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output) +k5_des_decrypt(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, krb5_data *output) { return(k5_des_docrypt(key, ivec, input, output, 0)); } static krb5_error_code -k5_des_make_key(krb5_const krb5_data *randombits, krb5_keyblock *key) +k5_des_make_key(const krb5_data *randombits, krb5_keyblock *key) { if (key->length != 8) return(KRB5_BAD_KEYSIZE); diff --git a/src/lib/crypto/enc_provider/des3.c b/src/lib/crypto/enc_provider/des3.c index 92b5491d1..9631be395 100644 --- a/src/lib/crypto/enc_provider/des3.c +++ b/src/lib/crypto/enc_provider/des3.c @@ -43,8 +43,8 @@ k5_des3_keysize(size_t *keybytes, size_t *keylength) } static krb5_error_code -k5_des3_docrypt(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output, int encrypt) +k5_des3_docrypt(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, krb5_data *output, int encrypt) { mit_des3_key_schedule schedule; @@ -81,21 +81,21 @@ k5_des3_docrypt(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, } static krb5_error_code -k5_des3_encrypt(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output) +k5_des3_encrypt(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, krb5_data *output) { return(k5_des3_docrypt(key, ivec, input, output, 1)); } static krb5_error_code -k5_des3_decrypt(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output) +k5_des3_decrypt(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, krb5_data *output) { return(k5_des3_docrypt(key, ivec, input, output, 0)); } static krb5_error_code -k5_des3_make_key(krb5_const krb5_data *randombits, krb5_keyblock *key) +k5_des3_make_key(const krb5_data *randombits, krb5_keyblock *key) { int i; diff --git a/src/lib/crypto/encrypt.c b/src/lib/crypto/encrypt.c index 76b8c8403..2a3a0eda0 100644 --- a/src/lib/crypto/encrypt.c +++ b/src/lib/crypto/encrypt.c @@ -30,10 +30,10 @@ KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_c_encrypt(context, key, usage, ivec, input, output) krb5_context context; - krb5_const krb5_keyblock *key; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *ivec; - krb5_const krb5_data *input; + const krb5_data *ivec; + const krb5_data *input; krb5_enc_data *output; { int i; diff --git a/src/lib/crypto/hash_provider/ChangeLog b/src/lib/crypto/hash_provider/ChangeLog index 146b003b1..9669a725b 100644 --- a/src/lib/crypto/hash_provider/ChangeLog +++ b/src/lib/crypto/hash_provider/ChangeLog @@ -1,3 +1,8 @@ +2001-03-05 Ken Raeburn + + * hash_crc32.c, hash_md4.c, hash_md5.c, hash_sha1.c: Use const + instead of krb5_const. + 2000-10-17 Ezra Peisach * hash_sha1.c (k5_sha1_hash): Cast length field in shsUpdate call diff --git a/src/lib/crypto/hash_provider/hash_crc32.c b/src/lib/crypto/hash_provider/hash_crc32.c index 4606ba2b5..1d8e28ec8 100644 --- a/src/lib/crypto/hash_provider/hash_crc32.c +++ b/src/lib/crypto/hash_provider/hash_crc32.c @@ -41,7 +41,7 @@ k5_crc32_block_size(size_t *output) } static krb5_error_code -k5_crc32_hash(unsigned int icount, krb5_const krb5_data *input, +k5_crc32_hash(unsigned int icount, const krb5_data *input, krb5_data *output) { unsigned long c, cn; diff --git a/src/lib/crypto/hash_provider/hash_md4.c b/src/lib/crypto/hash_provider/hash_md4.c index 09afa53ad..2a3f27826 100644 --- a/src/lib/crypto/hash_provider/hash_md4.c +++ b/src/lib/crypto/hash_provider/hash_md4.c @@ -41,7 +41,7 @@ k5_md4_block_size(size_t *output) } static krb5_error_code -k5_md4_hash(unsigned int icount, krb5_const krb5_data *input, +k5_md4_hash(unsigned int icount, const krb5_data *input, krb5_data *output) { krb5_MD4_CTX ctx; diff --git a/src/lib/crypto/hash_provider/hash_md5.c b/src/lib/crypto/hash_provider/hash_md5.c index c030cbfa1..e3375d08d 100644 --- a/src/lib/crypto/hash_provider/hash_md5.c +++ b/src/lib/crypto/hash_provider/hash_md5.c @@ -41,7 +41,7 @@ k5_md5_block_size(size_t *output) } static krb5_error_code -k5_md5_hash(unsigned int icount, krb5_const krb5_data *input, +k5_md5_hash(unsigned int icount, const krb5_data *input, krb5_data *output) { krb5_MD5_CTX ctx; diff --git a/src/lib/crypto/hash_provider/hash_sha1.c b/src/lib/crypto/hash_provider/hash_sha1.c index 2c215456b..ad3765fc1 100644 --- a/src/lib/crypto/hash_provider/hash_sha1.c +++ b/src/lib/crypto/hash_provider/hash_sha1.c @@ -41,7 +41,7 @@ k5_sha1_block_size(size_t *output) } static krb5_error_code -k5_sha1_hash(unsigned int icount, krb5_const krb5_data *input, +k5_sha1_hash(unsigned int icount, const krb5_data *input, krb5_data *output) { SHS_INFO ctx; diff --git a/src/lib/crypto/hmac.c b/src/lib/crypto/hmac.c index 013e4eeae..0b856b4ce 100644 --- a/src/lib/crypto/hmac.c +++ b/src/lib/crypto/hmac.c @@ -40,10 +40,10 @@ krb5_error_code krb5_hmac(hash, key, icount, input, output) - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; unsigned int icount; - krb5_const krb5_data *input; + const krb5_data *input; krb5_data *output; { size_t hashsize, blocksize; diff --git a/src/lib/crypto/keyhash_provider/ChangeLog b/src/lib/crypto/keyhash_provider/ChangeLog index 92b15c31e..3860fe446 100644 --- a/src/lib/crypto/keyhash_provider/ChangeLog +++ b/src/lib/crypto/keyhash_provider/ChangeLog @@ -1,3 +1,8 @@ +2001-03-05 Ken Raeburn + + * descbc.c, k5_md4des.c, k5_md5des.c: Use const instead of + krb5_const. + 2000-09-25 Ezra Peisach * descbc.c, k5_md4des.c, k5_md5des.c, t_cksum.c: Cleanup unsigned diff --git a/src/lib/crypto/keyhash_provider/descbc.c b/src/lib/crypto/keyhash_provider/descbc.c index 53a0e47f9..b1dfc4651 100644 --- a/src/lib/crypto/keyhash_provider/descbc.c +++ b/src/lib/crypto/keyhash_provider/descbc.c @@ -37,8 +37,8 @@ k5_descbc_hash_size(size_t *output) } static krb5_error_code -k5_descbc_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output) +k5_descbc_hash(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, krb5_data *output) { mit_des_key_schedule schedule; diff --git a/src/lib/crypto/keyhash_provider/k5_md4des.c b/src/lib/crypto/keyhash_provider/k5_md4des.c index 360a81009..b91b472ac 100644 --- a/src/lib/crypto/keyhash_provider/k5_md4des.c +++ b/src/lib/crypto/keyhash_provider/k5_md4des.c @@ -48,8 +48,8 @@ k5_md4des_hash_size(size_t *output) that's less efficient, and there's no need for this to be generic */ static krb5_error_code -k5_md4des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output) +k5_md4des_hash(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, krb5_data *output) { krb5_error_code ret; krb5_data data; @@ -110,8 +110,8 @@ k5_md4des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, } static krb5_error_code -k5_md4des_verify(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_const krb5_data *hash, +k5_md4des_verify(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, const krb5_data *hash, krb5_boolean *valid) { krb5_error_code ret; diff --git a/src/lib/crypto/keyhash_provider/k5_md5des.c b/src/lib/crypto/keyhash_provider/k5_md5des.c index bf9e5f7be..e628a1262 100644 --- a/src/lib/crypto/keyhash_provider/k5_md5des.c +++ b/src/lib/crypto/keyhash_provider/k5_md5des.c @@ -48,8 +48,8 @@ k5_md5des_hash_size(size_t *output) that's less efficient, and there's no need for this to be generic */ static krb5_error_code -k5_md5des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_data *output) +k5_md5des_hash(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, krb5_data *output) { krb5_error_code ret; krb5_data data; @@ -110,8 +110,8 @@ k5_md5des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, } static krb5_error_code -k5_md5des_verify(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, - krb5_const krb5_data *input, krb5_const krb5_data *hash, +k5_md5des_verify(const krb5_keyblock *key, const krb5_data *ivec, + const krb5_data *input, const krb5_data *hash, krb5_boolean *valid) { krb5_error_code ret; diff --git a/src/lib/crypto/make_checksum.c b/src/lib/crypto/make_checksum.c index 64f63894c..afd512533 100644 --- a/src/lib/crypto/make_checksum.c +++ b/src/lib/crypto/make_checksum.c @@ -33,9 +33,9 @@ KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_c_make_checksum(context, cksumtype, key, usage, input, cksum) krb5_context context; krb5_cksumtype cksumtype; - krb5_const krb5_keyblock *key; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *input; + const krb5_data *input; krb5_checksum *cksum; { int i, e1, e2; diff --git a/src/lib/crypto/nfold.c b/src/lib/crypto/nfold.c index d9bc804a1..937f09669 100644 --- a/src/lib/crypto/nfold.c +++ b/src/lib/crypto/nfold.c @@ -48,7 +48,7 @@ n-fold(k-bits): void krb5_nfold(inbits, in, outbits, out) unsigned int inbits; - krb5_const unsigned char *in; + const unsigned char *in; unsigned int outbits; unsigned char *out; { diff --git a/src/lib/crypto/old/ChangeLog b/src/lib/crypto/old/ChangeLog index 7446daa2c..b859386af 100644 --- a/src/lib/crypto/old/ChangeLog +++ b/src/lib/crypto/old/ChangeLog @@ -1,3 +1,8 @@ +2001-03-05 Ken Raeburn + + * des_stringtokey.c, old.h, old_decrypt.c, old_encrypt.c: Use + const instead of krb5_const. + 2000-06-03 Tom Yu * old_encrypt.c (krb5_old_encrypt): Chain ivecs. diff --git a/src/lib/crypto/old/des_stringtokey.c b/src/lib/crypto/old/des_stringtokey.c index 8aaac792e..3369442bc 100644 --- a/src/lib/crypto/old/des_stringtokey.c +++ b/src/lib/crypto/old/des_stringtokey.c @@ -35,9 +35,9 @@ KRB5_PROTOTYPE ((krb5_keyblock FAR * keyblock, krb5_error_code krb5_des_string_to_key(enc, string, salt, key) - krb5_const struct krb5_enc_provider *enc; - krb5_const krb5_data *string; - krb5_const krb5_data *salt; + const struct krb5_enc_provider *enc; + const krb5_data *string; + const krb5_data *salt; krb5_keyblock *key; { return(mit_des_string_to_key_int(key, string, salt)); diff --git a/src/lib/crypto/old/old.h b/src/lib/crypto/old/old.h index 9c7abc2fa..a0523254e 100644 --- a/src/lib/crypto/old/old.h +++ b/src/lib/crypto/old/old.h @@ -27,25 +27,25 @@ #include "k5-int.h" void krb5_old_encrypt_length -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, +KRB5_PROTOTYPE((const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, size_t input, size_t *length)); krb5_error_code krb5_old_encrypt -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, - krb5_const krb5_keyblock *key, krb5_keyusage usage, - krb5_const krb5_data *ivec, krb5_const krb5_data *input, +KRB5_PROTOTYPE((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_error_code krb5_old_decrypt -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, - krb5_const krb5_keyblock *key, krb5_keyusage usage, - krb5_const krb5_data *ivec, krb5_const krb5_data *input, +KRB5_PROTOTYPE((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 *arg_output)); krb5_error_code krb5_des_string_to_key -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const krb5_data *string, krb5_const krb5_data *salt, +KRB5_PROTOTYPE((const struct krb5_enc_provider *enc, + const krb5_data *string, const krb5_data *salt, krb5_keyblock *key)); diff --git a/src/lib/crypto/old/old_decrypt.c b/src/lib/crypto/old/old_decrypt.c index bfbe56a10..6606be754 100644 --- a/src/lib/crypto/old/old_decrypt.c +++ b/src/lib/crypto/old/old_decrypt.c @@ -35,12 +35,12 @@ krb5_error_code krb5_old_decrypt(enc, hash, key, usage, ivec, input, arg_output) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *ivec; - krb5_const krb5_data *input; + const krb5_data *ivec; + const krb5_data *input; krb5_data *arg_output; { krb5_error_code ret; diff --git a/src/lib/crypto/old/old_encrypt.c b/src/lib/crypto/old/old_encrypt.c index 8860ba5ff..374bbad08 100644 --- a/src/lib/crypto/old/old_encrypt.c +++ b/src/lib/crypto/old/old_encrypt.c @@ -29,8 +29,8 @@ void krb5_old_encrypt_length(enc, hash, inputlen, length) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; size_t inputlen; size_t *length; { @@ -44,12 +44,12 @@ krb5_old_encrypt_length(enc, hash, inputlen, length) krb5_error_code krb5_old_encrypt(enc, hash, key, usage, ivec, input, output) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *ivec; - krb5_const krb5_data *input; + const krb5_data *ivec; + const krb5_data *input; krb5_data *output; { krb5_error_code ret; diff --git a/src/lib/crypto/old_api_glue.c b/src/lib/crypto/old_api_glue.c index 429307e6f..16b6b1e8e 100644 --- a/src/lib/crypto/old_api_glue.c +++ b/src/lib/crypto/old_api_glue.c @@ -29,9 +29,9 @@ KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_encrypt(context, inptr, outptr, size, eblock, ivec) krb5_context context; - krb5_const krb5_pointer inptr; + const krb5_pointer inptr; krb5_pointer outptr; - krb5_const size_t size; + const size_t size; krb5_encrypt_block FAR * eblock; krb5_pointer ivec; { @@ -68,9 +68,9 @@ krb5_encrypt(context, inptr, outptr, size, eblock, ivec) KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_decrypt(context, inptr, outptr, size, eblock, ivec) krb5_context context; - krb5_const krb5_pointer inptr; + const krb5_pointer inptr; krb5_pointer outptr; - krb5_const size_t size; + const size_t size; krb5_encrypt_block FAR * eblock; krb5_pointer ivec; { @@ -106,7 +106,7 @@ KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_process_key(context, eblock, key) krb5_context context; krb5_encrypt_block FAR * eblock; - krb5_const krb5_keyblock FAR * key; + const krb5_keyblock FAR * key; { eblock->key = (krb5_keyblock *) key; @@ -124,10 +124,10 @@ krb5_finish_key(context, eblock) KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_string_to_key(context, eblock, keyblock, data, salt) krb5_context context; - krb5_const krb5_encrypt_block FAR * eblock; + const krb5_encrypt_block FAR * eblock; krb5_keyblock FAR * keyblock; - krb5_const krb5_data FAR * data; - krb5_const krb5_data FAR * salt; + const krb5_data FAR * data; + const krb5_data FAR * salt; { return(krb5_c_string_to_key(context, eblock->crypto_entry, data, salt, keyblock)); @@ -136,8 +136,8 @@ krb5_string_to_key(context, eblock, keyblock, data, salt) KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_init_random_key(context, eblock, keyblock, ptr) krb5_context context; - krb5_const krb5_encrypt_block FAR * eblock; - krb5_const krb5_keyblock FAR * keyblock; + const krb5_encrypt_block FAR * eblock; + const krb5_keyblock FAR * keyblock; krb5_pointer FAR * ptr; { krb5_data data; @@ -151,7 +151,7 @@ krb5_init_random_key(context, eblock, keyblock, ptr) KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_finish_random_key(context, eblock, ptr) krb5_context context; - krb5_const krb5_encrypt_block FAR * eblock; + const krb5_encrypt_block FAR * eblock; krb5_pointer FAR * ptr; { return(0); @@ -160,7 +160,7 @@ krb5_finish_random_key(context, eblock, ptr) KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_random_key(context, eblock, ptr, keyblock) krb5_context context; - krb5_const krb5_encrypt_block FAR * eblock; + const krb5_encrypt_block FAR * eblock; krb5_pointer ptr; krb5_keyblock FAR * FAR * keyblock; { @@ -181,7 +181,7 @@ krb5_random_key(context, eblock, ptr, keyblock) KRB5_DLLIMP krb5_enctype KRB5_CALLCONV krb5_eblock_enctype(context, eblock) krb5_context context; - krb5_const krb5_encrypt_block FAR * eblock; + const krb5_encrypt_block FAR * eblock; { return(eblock->crypto_entry); } @@ -190,7 +190,7 @@ KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_use_enctype(context, eblock, enctype) krb5_context context; krb5_encrypt_block FAR * eblock; - krb5_const krb5_enctype enctype; + const krb5_enctype enctype; { eblock->crypto_entry = enctype; @@ -227,11 +227,11 @@ KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_calculate_checksum(context, ctype, in, in_length, seed, seed_length, outcksum) krb5_context context; - krb5_const krb5_cksumtype ctype; - krb5_const krb5_pointer in; - krb5_const size_t in_length; - krb5_const krb5_pointer seed; - krb5_const size_t seed_length; + const krb5_cksumtype ctype; + const krb5_pointer in; + const size_t in_length; + const krb5_pointer seed; + const size_t seed_length; krb5_checksum FAR * outcksum; { krb5_data input; @@ -269,11 +269,11 @@ krb5_verify_checksum(context, ctype, cksum, in, in_length, seed, seed_length) krb5_context context; krb5_cksumtype ctype; - krb5_const krb5_checksum FAR * cksum; - krb5_const krb5_pointer in; - krb5_const size_t in_length; - krb5_const krb5_pointer seed; - krb5_const size_t seed_length; + const krb5_checksum FAR * cksum; + const krb5_pointer in; + const size_t in_length; + const krb5_pointer seed; + const size_t seed_length; { krb5_data input; krb5_keyblock key; diff --git a/src/lib/crypto/raw/ChangeLog b/src/lib/crypto/raw/ChangeLog index f898238f1..bf10d3e49 100644 --- a/src/lib/crypto/raw/ChangeLog +++ b/src/lib/crypto/raw/ChangeLog @@ -1,3 +1,8 @@ +2001-03-05 Ken Raeburn + + * raw.h, raw_decrypt.c, raw_encrypt.c: Use const instead of + krb5_const. + 1999-10-26 Wilfredo Sanchez * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES, diff --git a/src/lib/crypto/raw/raw.h b/src/lib/crypto/raw/raw.h index 5cfeae67e..79c235d28 100644 --- a/src/lib/crypto/raw/raw.h +++ b/src/lib/crypto/raw/raw.h @@ -27,20 +27,20 @@ #include "k5-int.h" void krb5_raw_encrypt_length -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, +KRB5_PROTOTYPE((const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, size_t input, size_t *length)); krb5_error_code krb5_raw_encrypt -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, - krb5_const krb5_keyblock *key, krb5_keyusage usage, - krb5_const krb5_data *ivec, krb5_const krb5_data *input, +KRB5_PROTOTYPE((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_error_code krb5_raw_decrypt -KRB5_PROTOTYPE((krb5_const struct krb5_enc_provider *enc, - krb5_const struct krb5_hash_provider *hash, - krb5_const krb5_keyblock *key, krb5_keyusage usage, - krb5_const krb5_data *ivec, krb5_const krb5_data *input, +KRB5_PROTOTYPE((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 *arg_output)); diff --git a/src/lib/crypto/raw/raw_decrypt.c b/src/lib/crypto/raw/raw_decrypt.c index 2c9c2d7b6..9c26968cd 100644 --- a/src/lib/crypto/raw/raw_decrypt.c +++ b/src/lib/crypto/raw/raw_decrypt.c @@ -29,12 +29,12 @@ krb5_error_code krb5_raw_decrypt(enc, hash, key, usage, ivec, input, output) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *ivec; - krb5_const krb5_data *input; + 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 d1a84ba8c..8505534ec 100644 --- a/src/lib/crypto/raw/raw_encrypt.c +++ b/src/lib/crypto/raw/raw_encrypt.c @@ -29,8 +29,8 @@ void krb5_raw_encrypt_length(enc, hash, inputlen, length) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; size_t inputlen; size_t *length; { @@ -43,12 +43,12 @@ krb5_raw_encrypt_length(enc, hash, inputlen, length) krb5_error_code krb5_raw_encrypt(enc, hash, key, usage, ivec, input, output) - krb5_const struct krb5_enc_provider *enc; - krb5_const struct krb5_hash_provider *hash; - krb5_const krb5_keyblock *key; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *ivec; - krb5_const krb5_data *input; + const krb5_data *ivec; + const krb5_data *input; krb5_data *output; { return((*(enc->encrypt))(key, ivec, input, output)); diff --git a/src/lib/crypto/string_to_key.c b/src/lib/crypto/string_to_key.c index c9a3d33e9..378050800 100644 --- a/src/lib/crypto/string_to_key.c +++ b/src/lib/crypto/string_to_key.c @@ -31,8 +31,8 @@ KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_c_string_to_key(context, enctype, string, salt, key) krb5_context context; krb5_enctype enctype; - krb5_const krb5_data *string; - krb5_const krb5_data *salt; + const krb5_data *string; + const krb5_data *salt; krb5_keyblock *key; { int i; diff --git a/src/lib/crypto/verify_checksum.c b/src/lib/crypto/verify_checksum.c index c54007b40..3056e50ed 100644 --- a/src/lib/crypto/verify_checksum.c +++ b/src/lib/crypto/verify_checksum.c @@ -30,10 +30,10 @@ KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_c_verify_checksum(context, key, usage, data, cksum, valid) krb5_context context; - krb5_const krb5_keyblock *key; + const krb5_keyblock *key; krb5_keyusage usage; - krb5_const krb5_data *data; - krb5_const krb5_checksum *cksum; + const krb5_data *data; + const krb5_checksum *cksum; krb5_boolean *valid; { int i;