From 6c6ba503a75ded60735f982b20013b0d2cfbff8c Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 23 Feb 2002 03:20:52 +0000 Subject: [PATCH] Use const instead of krb5_const git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14161 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/arcfour/ChangeLog | 5 +++++ src/lib/crypto/arcfour/arcfour.c | 24 ++++++++++----------- src/lib/crypto/arcfour/arcfour.h | 30 +++++++++++++------------- src/lib/crypto/arcfour/string_to_key.c | 6 +++--- src/lib/crypto/enc_provider/ChangeLog | 4 ++++ src/lib/crypto/enc_provider/arcfour.c | 12 +++++------ src/lib/kdb/ChangeLog | 5 +++++ src/lib/kdb/kdb_xdr.c | 2 +- 8 files changed, 51 insertions(+), 37 deletions(-) diff --git a/src/lib/crypto/arcfour/ChangeLog b/src/lib/crypto/arcfour/ChangeLog index 74647d521..820167178 100644 --- a/src/lib/crypto/arcfour/ChangeLog +++ b/src/lib/crypto/arcfour/ChangeLog @@ -1,3 +1,8 @@ +2002-02-22 Ken Raeburn + + * arcfour.h, arcfour.c, string_to_key.c: Use const instead of + krb5_const. + 2001-12-05 Ezra Peisach * string_to_key.c (krb5_arcfour_string_to_key): Use size_t instead diff --git a/src/lib/crypto/arcfour/arcfour.c b/src/lib/crypto/arcfour/arcfour.c index acf70820b..c4b06bb87 100644 --- a/src/lib/crypto/arcfour/arcfour.c +++ b/src/lib/crypto/arcfour/arcfour.c @@ -12,8 +12,8 @@ const char *l40 = "fortybits"; void krb5_arcfour_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; { @@ -64,12 +64,12 @@ case 7: /* tgs-req authenticator */ krb5_error_code krb5_arcfour_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_keyblock k1, k2, k3; @@ -192,12 +192,12 @@ 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) - 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_keyblock k1,k2,k3; diff --git a/src/lib/crypto/arcfour/arcfour.h b/src/lib/crypto/arcfour/arcfour.h index c16ae774f..39bf8240a 100644 --- a/src/lib/crypto/arcfour/arcfour.h +++ b/src/lib/crypto/arcfour/arcfour.h @@ -2,33 +2,33 @@ #define ARCFOUR_H extern void -krb5_arcfour_encrypt_length(krb5_const struct krb5_enc_provider *, - krb5_const struct krb5_hash_provider *, +krb5_arcfour_encrypt_length(const struct krb5_enc_provider *, + const struct krb5_hash_provider *, size_t, size_t *); extern -krb5_error_code krb5_arcfour_encrypt(krb5_const struct krb5_enc_provider *, - krb5_const struct krb5_hash_provider *, - krb5_const krb5_keyblock *, +krb5_error_code krb5_arcfour_encrypt(const struct krb5_enc_provider *, + const struct krb5_hash_provider *, + const krb5_keyblock *, krb5_keyusage, - krb5_const krb5_data *, - krb5_const krb5_data *, + const krb5_data *, + const krb5_data *, krb5_data *); extern -krb5_error_code krb5_arcfour_decrypt(krb5_const struct krb5_enc_provider *, - krb5_const struct krb5_hash_provider *, - krb5_const krb5_keyblock *, +krb5_error_code krb5_arcfour_decrypt(const struct krb5_enc_provider *, + const struct krb5_hash_provider *, + const krb5_keyblock *, krb5_keyusage, - krb5_const krb5_data *, - krb5_const krb5_data *, + const krb5_data *, + const krb5_data *, krb5_data *); extern krb5_error_code krb5_arcfour_string_to_key( - krb5_const struct krb5_enc_provider *, - krb5_const krb5_data *, - krb5_const krb5_data *, + const struct krb5_enc_provider *, + const krb5_data *, + const krb5_data *, krb5_keyblock *); extern const struct krb5_enc_provider krb5int_enc_arcfour; diff --git a/src/lib/crypto/arcfour/string_to_key.c b/src/lib/crypto/arcfour/string_to_key.c index a40f1ff34..1fecd4df0 100644 --- a/src/lib/crypto/arcfour/string_to_key.c +++ b/src/lib/crypto/arcfour/string_to_key.c @@ -13,9 +13,9 @@ static void asctouni(unsigned char *unicode, unsigned char *ascii, size_t len) krb5_error_code krb5_arcfour_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; { size_t len,slen; diff --git a/src/lib/crypto/enc_provider/ChangeLog b/src/lib/crypto/enc_provider/ChangeLog index 4b06974c2..bb66d7b8d 100644 --- a/src/lib/crypto/enc_provider/ChangeLog +++ b/src/lib/crypto/enc_provider/ChangeLog @@ -1,3 +1,7 @@ +2002-02-22 Ken Raeburn + + * arcfour.c: Use const instead of krb5_const. + 2001-11-06 Sam Hartman * arcfour.c (k5_arcfour_docrypt): Treat state as an diff --git a/src/lib/crypto/enc_provider/arcfour.c b/src/lib/crypto/enc_provider/arcfour.c index 28627b784..bfdc19372 100644 --- a/src/lib/crypto/enc_provider/arcfour.c +++ b/src/lib/crypto/enc_provider/arcfour.c @@ -26,8 +26,8 @@ static void k5_arcfour_crypt(ArcfourContext *ctx, unsigned char *dest, /* Interface layer to kerb5 crypto layer */ static krb5_error_code -k5_arcfour_docrypt(krb5_const krb5_keyblock *, krb5_const krb5_data *, - krb5_const krb5_data *, krb5_data *); +k5_arcfour_docrypt(const krb5_keyblock *, const krb5_data *, + const krb5_data *, krb5_data *); /* The blocksize for the enctype */ @@ -38,7 +38,7 @@ static void k5_arcfour_keysize(size_t *, size_t *); /* from a random bitstrem, construct a key */ static krb5_error_code -k5_arcfour_make_key(krb5_const krb5_data *, krb5_keyblock *); +k5_arcfour_make_key(const krb5_data *, krb5_keyblock *); static unsigned char arcfour_weakkey1[] = {0x00, 0x00, 0xfd}; static unsigned char arcfour_weakkey2[] = {0x03, 0xfd, 0xfc}; @@ -142,8 +142,8 @@ k5_arcfour_keysize(size_t *keybytes, size_t *keylength) /* The workhorse of the arcfour system, this impliments the cipher */ static krb5_error_code -k5_arcfour_docrypt(krb5_const krb5_keyblock *key, krb5_const krb5_data *state, - krb5_const krb5_data *input, krb5_data *output) +k5_arcfour_docrypt(const krb5_keyblock *key, const krb5_data *state, + const krb5_data *input, krb5_data *output) { ArcfourContext *arcfour_ctx; ArcFourCipherState *cipher_state; @@ -185,7 +185,7 @@ k5_arcfour_docrypt(krb5_const krb5_keyblock *key, krb5_const krb5_data *state, } static krb5_error_code -k5_arcfour_make_key(krb5_const krb5_data *randombits, krb5_keyblock *key) +k5_arcfour_make_key(const krb5_data *randombits, krb5_keyblock *key) { if (key->length != 16) return(KRB5_BAD_KEYSIZE); diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index 74cac9048..0be133d0b 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,8 @@ +2002-02-22 Ken Raeburn + + * kdb_xdr.c (krb5_dbe_lookup_mod_princ_data): Use const instead of + krb5_const. + 2001-11-19 Ezra Peisach * t_kdb.c (do_testing): Invoke krb5_free_principal and diff --git a/src/lib/kdb/kdb_xdr.c b/src/lib/kdb/kdb_xdr.c index adcfbd758..0dcf1badf 100644 --- a/src/lib/kdb/kdb_xdr.c +++ b/src/lib/kdb/kdb_xdr.c @@ -237,7 +237,7 @@ krb5_dbe_lookup_mod_princ_data(context, entry, mod_time, mod_princ) /* Mod Princ */ if ((code = krb5_parse_name(context, - (krb5_const char *) (tl_data.tl_data_contents+4), + (const char *) (tl_data.tl_data_contents+4), mod_princ))) return(code); -- 2.26.2