From: Ken Raeburn <raeburn@mit.edu>
Date: Thu, 19 Dec 2002 05:23:44 +0000 (+0000)
Subject: Clean up some broken uses of "const" in function interfaces
X-Git-Tag: krb5-1.3-alpha1~216
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bd867767370aabf9f4a3f575b8b2d004f44791ae;p=krb5.git

Clean up some broken uses of "const" in function interfaces

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15058 dc483132-0cff-0310-8789-dd5450dbe970
---

diff --git a/src/include/ChangeLog b/src/include/ChangeLog
index 90cee6c97..dd72428b4 100644
--- a/src/include/ChangeLog
+++ b/src/include/ChangeLog
@@ -1,3 +1,15 @@
+2002-12-19  Ken Raeburn  <raeburn@mit.edu>
+
+	* krb5.hin (krb5_encrypt, krb5_decrypt, krb5_use_enctype,
+	krb5_calculate_checksum, krb5_verify_checksum,
+	krb5_get_credentials, krb5_get_credentials_validate,
+	krb5_get_credentials_renew, krb5_get_cred_via_tkt, krb5_mk_req,
+	krb5_mk_req_extended, krb5_524_conv_principal, krb5_send_tgs,
+	krb5_get_in_tkt, krb5_get_in_tkt_with_password,
+	krb5_get_in_tkt_with_skey, krb5_get_in_tkt_with_keytab,
+	krb5_aname_to_localname): Clean up use of "const" in API, where it
+	was applied to the value passed and not something pointed to.
+
 2002-12-12  Tom Yu  <tlyu@mit.edu>
 
 	* krb5.hin: Update comment on krb5_kt_free_entry prototype to
diff --git a/src/include/krb5.hin b/src/include/krb5.hin
index 78bd1e0c5..9d2d1ef8e 100644
--- a/src/include/krb5.hin
+++ b/src/include/krb5.hin
@@ -577,16 +577,16 @@ krb5_boolean KRB5_CALLCONV is_keyed_cksum
  */
 krb5_error_code KRB5_CALLCONV krb5_encrypt
 	(krb5_context context,
-		const krb5_pointer inptr,
+		krb5_const_pointer inptr,
 		krb5_pointer outptr,
-		const size_t size,
+		size_t size,
 		krb5_encrypt_block * eblock,
 		krb5_pointer ivec);
 krb5_error_code KRB5_CALLCONV krb5_decrypt
 	(krb5_context context,
-		const krb5_pointer inptr,
+		krb5_const_pointer inptr,
 		krb5_pointer outptr,
-		const size_t size,
+		size_t size,
 		krb5_encrypt_block * eblock,
 		krb5_pointer ivec);
 krb5_error_code KRB5_CALLCONV krb5_process_key
@@ -622,7 +622,7 @@ krb5_enctype KRB5_CALLCONV krb5_eblock_enctype
 krb5_error_code KRB5_CALLCONV krb5_use_enctype
 	(krb5_context context,
 		krb5_encrypt_block * eblock,
-		const krb5_enctype enctype);
+		krb5_enctype enctype);
 size_t KRB5_CALLCONV krb5_encrypt_size
 	(size_t length,
 		krb5_enctype crypto);
@@ -631,16 +631,16 @@ size_t KRB5_CALLCONV krb5_checksum_size
 		krb5_cksumtype ctype);
 krb5_error_code KRB5_CALLCONV krb5_calculate_checksum
 	(krb5_context context,
-		const krb5_cksumtype ctype,
-		const krb5_pointer in, const size_t in_length,
-		const krb5_pointer seed, const size_t seed_length,
+		krb5_cksumtype ctype,
+		krb5_const_pointer in, size_t in_length,
+		krb5_const_pointer seed, size_t seed_length,
 		krb5_checksum * outcksum);
 krb5_error_code KRB5_CALLCONV krb5_verify_checksum
 	(krb5_context context,
 		krb5_cksumtype ctype,
 		const krb5_checksum * cksum,
-		const krb5_pointer in, const size_t in_length,
-		const krb5_pointer seed, const size_t seed_length);
+		krb5_const_pointer in, size_t in_length,
+		krb5_const_pointer seed, size_t seed_length);
 
 #if KRB5_PRIVATE
 krb5_error_code KRB5_CALLCONV krb5_random_confounder
@@ -1447,19 +1447,19 @@ void KRB5_CALLCONV krb5_free_tgt_creds
 
 krb5_error_code KRB5_CALLCONV krb5_get_credentials
 	(krb5_context,
-		const krb5_flags,
+		krb5_flags,
 		krb5_ccache,
 		krb5_creds *,
 		krb5_creds **);
 krb5_error_code KRB5_CALLCONV krb5_get_credentials_validate
 	(krb5_context,
-		const krb5_flags,
+		krb5_flags,
 		krb5_ccache,
 		krb5_creds *,
 		krb5_creds **);
 krb5_error_code KRB5_CALLCONV krb5_get_credentials_renew
 	(krb5_context,
-		const krb5_flags,
+		krb5_flags,
 		krb5_ccache,
 		krb5_creds *,
 		krb5_creds **);
@@ -1467,7 +1467,7 @@ krb5_error_code KRB5_CALLCONV krb5_get_credentials_renew
 krb5_error_code krb5_get_cred_via_tkt
 	(krb5_context,
 		   krb5_creds *,
-		   const krb5_flags,
+		   krb5_flags,
 		   krb5_address * const *,
 		   krb5_creds *,
 		   krb5_creds **);
@@ -1475,7 +1475,7 @@ krb5_error_code krb5_get_cred_via_tkt
 krb5_error_code KRB5_CALLCONV krb5_mk_req
 	(krb5_context,
 		krb5_auth_context *,
-		const krb5_flags,
+		krb5_flags,
 		char *,
 		char *,
 		krb5_data *,
@@ -1484,7 +1484,7 @@ krb5_error_code KRB5_CALLCONV krb5_mk_req
 krb5_error_code KRB5_CALLCONV krb5_mk_req_extended
 	(krb5_context,
 		krb5_auth_context *,
-		const krb5_flags,
+		krb5_flags,
 		krb5_data *,
 		krb5_creds *,
 		krb5_data * );
@@ -1642,7 +1642,7 @@ krb5_error_code KRB5_CALLCONV krb5_425_conv_principal
 		krb5_principal *princ);
 
 krb5_error_code KRB5_CALLCONV krb5_524_conv_principal
-	(krb5_context context, const krb5_principal princ, 
+	(krb5_context context, krb5_const_principal princ, 
 		char *name, char *inst, char *realm);
 
 #if KRB5_PRIVATE
@@ -1880,7 +1880,7 @@ krb5_get_profile
 #if KRB5_PRIVATE
 krb5_error_code krb5_send_tgs
 	(krb5_context,
-		const krb5_flags,
+		krb5_flags,
 		const krb5_ticket_times *,
 		const krb5_enctype *,
 		krb5_const_principal,
@@ -1895,12 +1895,12 @@ krb5_error_code krb5_send_tgs
 #if KRB5_DEPRECATED
 krb5_error_code KRB5_CALLCONV krb5_get_in_tkt
 	(krb5_context,
-		const krb5_flags,
+		krb5_flags,
 		krb5_address * const *,
 		krb5_enctype *,
 		krb5_preauthtype *,
 		krb5_error_code ( * )(krb5_context,
-					const krb5_enctype,
+					krb5_enctype,
 					krb5_data *,
 					krb5_const_pointer,
 					krb5_keyblock **),
@@ -1916,7 +1916,7 @@ krb5_error_code KRB5_CALLCONV krb5_get_in_tkt
 
 krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_password
 	(krb5_context,
-		const krb5_flags,
+		krb5_flags,
 		krb5_address * const *,
 		krb5_enctype *,
 		krb5_preauthtype *,
@@ -1927,7 +1927,7 @@ krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_password
 
 krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_skey
 	(krb5_context,
-		const krb5_flags,
+		krb5_flags,
 		krb5_address * const *,
 		krb5_enctype *,
 		krb5_preauthtype *,
@@ -1938,11 +1938,11 @@ krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_skey
 
 krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_keytab
 	(krb5_context,
-		const krb5_flags,
+		krb5_flags,
 		krb5_address * const *,
 		krb5_enctype *,
 		krb5_preauthtype *,
-		const krb5_keytab,
+		krb5_keytab,
 		krb5_ccache,
 		krb5_creds *,
 		krb5_kdc_rep ** );
@@ -2234,7 +2234,7 @@ krb5_error_code KRB5_CALLCONV krb5_read_password
 krb5_error_code KRB5_CALLCONV krb5_aname_to_localname
 	(krb5_context,
 		krb5_const_principal,
-		const int,
+		int,
 		char * );
 #if KRB5_PRIVATE
 krb5_error_code KRB5_CALLCONV krb5_get_host_realm
diff --git a/src/lib/crypto/ChangeLog b/src/lib/crypto/ChangeLog
index f513de9d5..c7af891f1 100644
--- a/src/lib/crypto/ChangeLog
+++ b/src/lib/crypto/ChangeLog
@@ -1,3 +1,9 @@
+2002-12-19  Ken Raeburn  <raeburn@mit.edu>
+
+	* old_api_glue.c (krb5_encrypt, krb5_decrypt,
+	krb5_calculate_checksum, krb5_verify_checksum): Clean up use of
+	"const" in API.
+
 2002-12-06  Ezra Peisach  <epeisach@bu.edu>
 
 	* Makefile.in (clean): Clean up more test executables and object
diff --git a/src/lib/crypto/old_api_glue.c b/src/lib/crypto/old_api_glue.c
index b6847a6c5..695f91e5b 100644
--- a/src/lib/crypto/old_api_glue.c
+++ b/src/lib/crypto/old_api_glue.c
@@ -29,9 +29,9 @@
 krb5_error_code KRB5_CALLCONV
 krb5_encrypt(context, inptr, outptr, size, eblock, ivec)
      krb5_context context;
-     const krb5_pointer inptr;
+     krb5_const_pointer inptr;
      krb5_pointer outptr;
-     const size_t size;
+     size_t size;
      krb5_encrypt_block * eblock;
      krb5_pointer ivec;
 {
@@ -68,9 +68,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;
-     const krb5_pointer inptr;
+     krb5_const_pointer inptr;
      krb5_pointer outptr;
-     const size_t size;
+     size_t size;
      krb5_encrypt_block * eblock;
      krb5_pointer ivec;
 {
@@ -227,11 +227,11 @@ krb5_error_code KRB5_CALLCONV
 krb5_calculate_checksum(context, ctype, in, in_length,
 					seed, seed_length, outcksum)
      krb5_context context;
-     const krb5_cksumtype ctype;
-     const krb5_pointer in;
-     const size_t in_length;
-     const krb5_pointer seed;
-     const size_t seed_length;
+     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;
@@ -270,10 +270,10 @@ krb5_verify_checksum(context, ctype, cksum, in, in_length,
      krb5_context context;
      krb5_cksumtype ctype;
      const krb5_checksum * cksum;
-     const krb5_pointer in;
-     const size_t in_length;
-     const krb5_pointer seed;
-     const size_t seed_length;
+     krb5_const_pointer in;
+     size_t in_length;
+     krb5_const_pointer seed;
+     size_t seed_length;
 {
     krb5_data input;
     krb5_keyblock key;
diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog
index e3f181917..a5543e901 100644
--- a/src/lib/krb5/krb/ChangeLog
+++ b/src/lib/krb5/krb/ChangeLog
@@ -1,3 +1,8 @@
+2002-12-19  Ken Raeburn  <raeburn@mit.edu>
+
+	* conv_princ.c (krb5_524_conv_principal): Clean up use of "const"
+	in API.
+
 2002-11-14  Ezra Peisach  <epeisach@bu.edu>
 
 	* get_in_tkt.c (krb5_get_in_tkt): Do not pass NULL when an
diff --git a/src/lib/krb5/krb/conv_princ.c b/src/lib/krb5/krb/conv_princ.c
index a4d04e89a..6134baa0a 100644
--- a/src/lib/krb5/krb/conv_princ.c
+++ b/src/lib/krb5/krb/conv_princ.c
@@ -147,11 +147,11 @@ static char *strnchr(register char *s, register char c,
 #define KRB5_INVALID_PRINCIPAL KRB5_LNAME_BADFORMAT
 
 krb5_error_code KRB5_CALLCONV
-krb5_524_conv_principal(krb5_context context, const krb5_principal princ,
+krb5_524_conv_principal(krb5_context context, krb5_const_principal princ,
 			char *name, char *inst, char *realm)
 {
      const struct krb_convert *p;
-     krb5_data *compo;
+     const krb5_data *compo;
      char *c, *tmp_realm, *tmp_prealm;
      unsigned int tmp_realm_len;
      int retval;