Unify krb5_get_init_creds_keytab code paths
[krb5.git] / src / lib / krb5 / krb / int-proto.h
index 4450bfcf12bd9e57e8b187bd7b8db7e3f2c7a9b6..899579f75677f60c07c4fea799c75c879461110c 100644 (file)
@@ -1,7 +1,6 @@
 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/* lib/krb5/krb/int-proto.h - Prototypes for libkrb5 internal functions */
 /*
- * lib/krb5/krb/int-proto.h
- *
  * Copyright 1990,1991 the Massachusetts Institute of Technology.
  * All Rights Reserved.
  *
  * M.I.T. makes no representations about the suitability of
  * this software for any purpose.  It is provided "as is" without express
  * or implied warranty.
- *
- *
- * Function prototypes for Kerberos V5 library internal functions.
  */
 
-
 #ifndef KRB5_INT_FUNC_PROTO__
 #define KRB5_INT_FUNC_PROTO__
 
+struct krb5int_fast_request_state;
+
 krb5_error_code
-krb5_tgtname(krb5_context context, const krb5_data *, const krb5_data *,
-             krb5_principal *);
+krb5int_tgtname(krb5_context context, const krb5_data *, const krb5_data *,
+                krb5_principal *);
 
 krb5_error_code
 krb5int_libdefault_boolean(krb5_context, const krb5_data *, const char *,
@@ -59,9 +56,12 @@ krb5_preauth_supply_preauth_data(krb5_context context,
                                  const char *value);
 
 krb5_error_code
-krb5_get_cred_from_kdc_opt(krb5_context context, krb5_ccache ccache,
-                           krb5_creds *in_cred, krb5_creds **out_cred,
-                           krb5_creds ***tgts, int kdcopt);
+clpreauth_encrypted_challenge_initvt(krb5_context context, int maj_ver,
+                                     int min_ver, krb5_plugin_vtable vtable);
+
+krb5_error_code
+clpreauth_encrypted_timestamp_initvt(krb5_context context, int maj_ver,
+                                     int min_ver, krb5_plugin_vtable vtable);
 
 krb5_error_code
 krb5int_construct_matching_creds(krb5_context context, krb5_flags options,
@@ -91,6 +91,7 @@ krb5_get_cred_via_tkt_ext (krb5_context context, krb5_creds *tkt,
 
 krb5_error_code
 krb5int_make_tgs_request_ext(krb5_context context,
+                             struct krb5int_fast_request_state *,
                              krb5_flags kdcoptions,
                              const krb5_ticket_times *timestruct,
                              const krb5_enctype *ktypes,
@@ -112,6 +113,7 @@ krb5int_make_tgs_request_ext(krb5_context context,
 
 krb5_error_code
 krb5int_make_tgs_request(krb5_context context,
+                         struct krb5int_fast_request_state *,
                          krb5_creds *tkt,
                          krb5_flags kdcoptions,
                          krb5_address *const *address,
@@ -129,6 +131,7 @@ krb5int_make_tgs_request(krb5_context context,
 
 krb5_error_code
 krb5int_process_tgs_reply(krb5_context context,
+                          struct krb5int_fast_request_state *,
                           krb5_data *response_data,
                           krb5_creds *tkt,
                           krb5_flags kdcoptions,
@@ -142,26 +145,59 @@ krb5int_process_tgs_reply(krb5_context context,
                           krb5_pa_data ***out_enc_padata,
                           krb5_creds **out_cred);
 
-krb5_error_code krb5int_send_tgs(krb5_context, krb5_flags,
-                                 const krb5_ticket_times *,
-                                 const krb5_enctype *,
-                                 krb5_const_principal, krb5_address *const *,
-                                 krb5_authdata *const *,
-                                 krb5_pa_data *const *, const krb5_data *,
-                                 krb5_creds *,
-                                 krb5_error_code (*gcvt_fct)(krb5_context,
-                                                             krb5_keyblock *,
-                                                             krb5_kdc_req *,
-                                                             void *),
-                                 void *gcvt_data, krb5_response *,
-                                 krb5_keyblock **subkey);
 /* The subkey field is an output parameter; if a
  * tgs-rep is received then the subkey will be filled
  * in with the subkey needed to decrypt the TGS
  * response. Otherwise it will be set to null.
  */
-krb5_error_code krb5int_decode_tgs_rep(krb5_context, krb5_data *,
+krb5_error_code krb5int_decode_tgs_rep(krb5_context,
+                                       struct krb5int_fast_request_state *,
+                                       krb5_data *,
                                        const krb5_keyblock *, krb5_keyusage,
                                        krb5_kdc_rep ** );
 
+/* Utility functions for zero-terminated enctype lists. */
+size_t krb5int_count_etypes(const krb5_enctype *list);
+krb5_error_code krb5int_copy_etypes(const krb5_enctype *old_list,
+                                    krb5_enctype **new_list);
+
+krb5_error_code
+krb5int_validate_times(krb5_context, krb5_ticket_times *);
+
+krb5_error_code
+krb5int_copy_authdatum(krb5_context, const krb5_authdata *, krb5_authdata **);
+
+krb5_boolean
+k5_privsafe_check_seqnum(krb5_context ctx, krb5_auth_context ac,
+                         krb5_ui_4 in_seq);
+
+krb5_error_code
+k5_privsafe_check_addrs(krb5_context context, krb5_auth_context ac,
+                        krb5_address *msg_s_addr, krb5_address *msg_r_addr);
+
+krb5_error_code
+krb5int_mk_chpw_req(krb5_context context, krb5_auth_context auth_context,
+                    krb5_data *ap_req, char *passwd, krb5_data *packet);
+
+krb5_error_code
+krb5int_rd_chpw_rep(krb5_context context, krb5_auth_context auth_context,
+                    krb5_data *packet, int *result_code,
+                    krb5_data *result_data);
+
+krb5_error_code KRB5_CALLCONV
+krb5_chpw_result_code_string(krb5_context context, int result_code,
+                             char **result_codestr);
+
+krb5_error_code
+krb5int_mk_setpw_req(krb5_context context, krb5_auth_context auth_context,
+                     krb5_data *ap_req, krb5_principal targetprinc,
+                     char *passwd, krb5_data *packet);
+
+void
+k5_ccselect_free_context(krb5_context context);
+
+krb5_error_code
+k5_init_creds_get(krb5_context context, krb5_init_creds_context ctx,
+                  int *use_master);
+
 #endif /* KRB5_INT_FUNC_PROTO__ */