Constify get_init_creds string input params
authorGreg Hudson <ghudson@mit.edu>
Wed, 9 May 2012 17:55:27 +0000 (17:55 +0000)
committerGreg Hudson <ghudson@mit.edu>
Wed, 9 May 2012 17:55:27 +0000 (17:55 +0000)
The get_init_creds functions take read-only string input parameters
for passwords and initial ticket services.  Make these const char *
parameters instead of just char * parameters, for caller convenience.

Reported by rra@stanford.edu.

ticket: 7121

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

src/include/k5-int.h
src/include/krb5/krb5.hin
src/lib/krb5/krb/get_in_tkt.c
src/lib/krb5/krb/gic_keytab.c
src/lib/krb5/krb/gic_pwd.c
src/lib/krb5/krb/val_renew.c

index 2a4e8a73b16860136119a24965923004ff56e985..1ea8c10c92fe85e9491c44ed72336bf2b3f55ff2 100644 (file)
@@ -1013,7 +1013,8 @@ krb5_error_code KRB5_CALLCONV
 krb5int_get_init_creds(krb5_context context, krb5_creds *creds,
                        krb5_principal client, krb5_prompter_fct prompter,
                        void *prompter_data, krb5_deltat start_time,
-                       char *in_tkt_service, krb5_get_init_creds_opt *options,
+                       const char *in_tkt_service,
+                       krb5_get_init_creds_opt *options,
                        krb5_gic_get_as_key_fct gak, void *gak_data,
                        int *master, krb5_kdc_rep **as_reply);
 
index 741477caf8b2d939f72a7cbc35ba32128ec6bae0..f319136ecb6bf60eaa177ea0babe584d745681c6 100644 (file)
@@ -6696,9 +6696,10 @@ krb5_get_init_creds_opt_set_expire_callback(krb5_context context,
  */
 krb5_error_code KRB5_CALLCONV
 krb5_get_init_creds_password(krb5_context context, krb5_creds *creds,
-                             krb5_principal client, char *password,
+                             krb5_principal client, const char *password,
                              krb5_prompter_fct prompter, void *data,
-                             krb5_deltat start_time, char *in_tkt_service,
+                             krb5_deltat start_time,
+                             const char *in_tkt_service,
                              krb5_get_init_creds_opt *k5_gic_options);
 
 struct _krb5_init_creds_context;
@@ -7040,7 +7041,7 @@ krb5_tkt_creds_get_times(krb5_context context, krb5_tkt_creds_context ctx,
 krb5_error_code KRB5_CALLCONV
 krb5_get_init_creds_keytab(krb5_context context, krb5_creds *creds,
                            krb5_principal client, krb5_keytab arg_keytab,
-                           krb5_deltat start_time, char *in_tkt_service,
+                           krb5_deltat start_time, const char *in_tkt_service,
                            krb5_get_init_creds_opt *k5_gic_options);
 
 typedef struct _krb5_verify_init_creds_opt {
@@ -7150,7 +7151,7 @@ krb5_verify_init_creds(krb5_context context, krb5_creds *creds,
 krb5_error_code KRB5_CALLCONV
 krb5_get_validated_creds(krb5_context context, krb5_creds *creds,
                          krb5_principal client, krb5_ccache ccache,
-                         char *in_tkt_service);
+                         const char *in_tkt_service);
 
 /**
  * Get renewed credential from KDC using an existing credential.
@@ -7176,7 +7177,7 @@ krb5_get_validated_creds(krb5_context context, krb5_creds *creds,
 krb5_error_code KRB5_CALLCONV
 krb5_get_renewed_creds(krb5_context context, krb5_creds *creds,
                        krb5_principal client, krb5_ccache ccache,
-                       char *in_tkt_service);
+                       const char *in_tkt_service);
 
 /**
  * Decode an ASN.1-formatted ticket.
index 738bd9c3778ed9020c730570d11edd1ddee766a3..4c634f0dc9a5f1c281c741966087bae1df32db6a 100644 (file)
@@ -437,7 +437,7 @@ sort_krb5_padata_sequence(krb5_context context, krb5_data *realm,
 
 static krb5_error_code
 build_in_tkt_name(krb5_context context,
-                  char *in_tkt_service,
+                  const char *in_tkt_service,
                   krb5_const_principal client,
                   krb5_principal *server)
 {
@@ -1616,7 +1616,7 @@ krb5int_get_init_creds(krb5_context context,
                        krb5_prompter_fct prompter,
                        void *prompter_data,
                        krb5_deltat start_time,
-                       char *in_tkt_service,
+                       const char *in_tkt_service,
                        krb5_get_init_creds_opt *options,
                        krb5_gic_get_as_key_fct gak_fct,
                        void *gak_data,
index 3554b257c9b1f94f676fff074e327578a6679db6..bae83dbb3493b98b69c8f0ac30d61e4b1e251a49 100644 (file)
@@ -209,7 +209,7 @@ krb5_init_creds_set_keytab(krb5_context context,
 static krb5_error_code
 get_init_creds_keytab(krb5_context context, krb5_creds *creds,
                       krb5_principal client, krb5_keytab keytab,
-                      krb5_deltat start_time, char *in_tkt_service,
+                      krb5_deltat start_time, const char *in_tkt_service,
                       krb5_get_init_creds_opt *options, int *use_master)
 {
     krb5_error_code ret;
@@ -250,7 +250,7 @@ krb5_get_init_creds_keytab(krb5_context context,
                            krb5_principal client,
                            krb5_keytab arg_keytab,
                            krb5_deltat start_time,
-                           char *in_tkt_service,
+                           const char *in_tkt_service,
                            krb5_get_init_creds_opt *options)
 {
     krb5_error_code ret, ret2;
index b25eb6da029c08babb80e8e67d399475204e6de2..b8406a651e6b4f488df1507fe0dad8161ce05216 100644 (file)
@@ -218,11 +218,11 @@ krb5_error_code KRB5_CALLCONV
 krb5_get_init_creds_password(krb5_context context,
                              krb5_creds *creds,
                              krb5_principal client,
-                             char *password,
+                             const char *password,
                              krb5_prompter_fct prompter,
                              void *data,
                              krb5_deltat start_time,
-                             char *in_tkt_service,
+                             const char *in_tkt_service,
                              krb5_get_init_creds_opt *options)
 {
     krb5_error_code ret, ret2;
index 39912aaa88d9055ceb717fe9c836ecf8bdc6bdf0..8550674a8bea45b9e767aa677ac921e613a2b48f 100644 (file)
@@ -136,7 +136,7 @@ krb5_get_credentials_renew(krb5_context context, krb5_flags options,
 static krb5_error_code
 get_valrenewed_creds(krb5_context context, krb5_creds *out_creds,
                      krb5_principal client, krb5_ccache ccache,
-                     char *in_tkt_service, int kdcopt)
+                     const char *in_tkt_service, int kdcopt)
 {
     krb5_error_code code;
     krb5_creds in_creds, *new_creds;
@@ -181,7 +181,7 @@ cleanup:
 krb5_error_code KRB5_CALLCONV
 krb5_get_validated_creds(krb5_context context, krb5_creds *creds,
                          krb5_principal client, krb5_ccache ccache,
-                         char *in_tkt_service)
+                         const char *in_tkt_service)
 {
     return get_valrenewed_creds(context, creds, client, ccache,
                                 in_tkt_service, KDC_OPT_VALIDATE);
@@ -190,7 +190,7 @@ krb5_get_validated_creds(krb5_context context, krb5_creds *creds,
 krb5_error_code KRB5_CALLCONV
 krb5_get_renewed_creds(krb5_context context, krb5_creds *creds,
                        krb5_principal client, krb5_ccache ccache,
-                       char *in_tkt_service)
+                       const char *in_tkt_service)
 {
     return get_valrenewed_creds(context, creds, client, ccache,
                                 in_tkt_service, KDC_OPT_RENEW);