Hide differences between MIT and Heimdal in macros
[nfs-utils.git] / utils / gssd / krb5_util.h
1 #ifndef KRB5_UTIL_H
2 #define KRB5_UTIL_H
3
4 #include <krb5.h>
5
6 /*
7  * List of principals from our keytab that we
8  * may try to get credentials for
9  */
10 struct gssd_k5_kt_princ {
11         struct gssd_k5_kt_princ *next;
12         krb5_principal princ;
13         char *ccname;
14         char *realm;
15         krb5_timestamp endtime;
16 };
17
18
19 void gssd_setup_krb5_user_gss_ccache(uid_t uid, char *servername);
20 int  gssd_get_krb5_machine_cred_list(char ***list);
21 int  gssd_refresh_krb5_machine_creds(void);
22 void gssd_free_krb5_machine_cred_list(char **list);
23 void gssd_setup_krb5_machine_gss_ccache(char *servername);
24 void gssd_destroy_krb5_machine_creds(void);
25
26 #ifdef HAVE_SET_ALLOWABLE_ENCTYPES
27 int limit_krb5_enctypes(struct rpc_gss_sec *sec, uid_t uid);
28 #endif
29
30 /*
31  * Hide away some of the MIT vs. Heimdal differences
32  * here with macros...
33  */
34
35 #ifdef HAVE_KRB5
36 #define k5_free_unparsed_name(ctx, name)        krb5_free_unparsed_name((ctx), (name))
37 #define k5_free_default_realm(ctx, realm)       krb5_free_default_realm((ctx), (realm))
38 #define k5_free_kt_entry(ctx, kte)              krb5_free_keytab_entry_contents((ctx),(kte))
39 #else   /* Heimdal */
40 #define k5_free_unparsed_name(ctx, name)        free(name)
41 #define k5_free_default_realm(ctx, realm)       free(realm)
42 #define k5_free_kt_entry(ctx, kte)              krb5_kt_free_entry((ctx),(kte))
43 #endif
44
45 #endif /* KRB5_UTIL_H */