1 /*
2  * Copyright 1993 by OpenVision Technologies, Inc.
3  *
4  * Permission to use, copy, modify, distribute, and sell this software
5  * and its documentation for any purpose is hereby granted without fee,
6  * provided that the above copyright notice appears in all copies and
7  * that both that copyright notice and this permission notice appear in
8  * supporting documentation, and that the name of OpenVision not be used
9  * in advertising or publicity pertaining to distribution of the software
10  * without specific, written prior permission. OpenVision makes no
11  * representations about the suitability of this software for any
12  * purpose.  It is provided "as is" without express or implied warranty.
13  *
14  * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16  * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
18  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20  * PERFORMANCE OF THIS SOFTWARE.
21  */
22 
23 #ifndef _GSSAPI_KRB5_H_
24 #define _GSSAPI_KRB5_H_
25 
26 #if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
27 	#include <KerberosSupport/KerberosSupport.h>
28 #endif
29 
30 #if TARGET_OS_MAC
31 #include <Kerberos5/Kerberos5.h>
32 #else
33 #include <krb5.h>
34 #endif
35 
36 /* C++ friendlyness */
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40 
41 /* Reserved static storage for GSS_oids.  See rfc 1964 for more details. */
42 
43 /* 2.1.1. Kerberos Principal Name Form: */
44 GSS_DLLIMP extern const gss_OID_desc * const GSS_KRB5_NT_PRINCIPAL_NAME;
45 /* This name form shall be represented by the Object Identifier {iso(1)
46  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
47  * krb5(2) krb5_name(1)}.  The recommended symbolic name for this type
48  * is "GSS_KRB5_NT_PRINCIPAL_NAME". */
49 
50 /* 2.1.2. Host-Based Service Name Form */
51 #define GSS_KRB5_NT_HOSTBASED_SERVICE_NAME GSS_C_NT_HOSTBASED_SERVICE
52 /* This name form shall be represented by the Object Identifier {iso(1)
53  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
54  * generic(1) service_name(4)}.  The previously recommended symbolic
55  * name for this type is "GSS_KRB5_NT_HOSTBASED_SERVICE_NAME".  The
56  * currently preferred symbolic name for this type is
57  * "GSS_C_NT_HOSTBASED_SERVICE". */
58 
59 /* 2.2.1. User Name Form */
60 #define GSS_KRB5_NT_USER_NAME GSS_C_NT_USER_NAME
61 /* This name form shall be represented by the Object Identifier {iso(1)
62  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
63  * generic(1) user_name(1)}.  The recommended symbolic name for this
64  * type is "GSS_KRB5_NT_USER_NAME". */
65 
66 /* 2.2.2. Machine UID Form */
67 #define GSS_KRB5_NT_MACHINE_UID_NAME GSS_C_NT_MACHINE_UID_NAME
68 /* This name form shall be represented by the Object Identifier {iso(1)
69  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
70  * generic(1) machine_uid_name(2)}.  The recommended symbolic name for
71  * this type is "GSS_KRB5_NT_MACHINE_UID_NAME". */
72 
73 /* 2.2.3. String UID Form */
74 #define GSS_KRB5_NT_STRING_UID_NAME GSS_C_NT_STRING_UID_NAME
75 /* This name form shall be represented by the Object Identifier {iso(1)
76  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
77  * generic(1) string_uid_name(3)}.  The recommended symbolic name for
78  * this type is "GSS_KRB5_NT_STRING_UID_NAME". */
79 
80 extern const gss_OID_desc * const gss_mech_krb5;
81 extern const gss_OID_desc * const gss_mech_krb5_old;
82 extern const gss_OID_desc * const gss_mech_krb5_v2;
83 extern const gss_OID_set_desc * const gss_mech_set_krb5;
84 extern const gss_OID_set_desc * const gss_mech_set_krb5_old;
85 extern const gss_OID_set_desc * const gss_mech_set_krb5_both;
86 extern const gss_OID_set_desc * const gss_mech_set_krb5_v2;
87 extern const gss_OID_set_desc * const gss_mech_set_krb5_v1v2;
88 
89 extern const gss_OID_desc * const gss_nt_krb5_name;
90 extern const gss_OID_desc * const gss_nt_krb5_principal;
91 
92 extern const gss_OID_desc krb5_gss_oid_array[];
93 
94 #define gss_krb5_nt_general_name	gss_nt_krb5_name
95 #define gss_krb5_nt_principal		gss_nt_krb5_principal
96 #define gss_krb5_nt_service_name	gss_nt_service_name
97 #define gss_krb5_nt_user_name		gss_nt_user_name
98 #define gss_krb5_nt_machine_uid_name	gss_nt_machine_uid_name
99 #define gss_krb5_nt_string_uid_name	gss_nt_string_uid_name
100 
101 GSS_DLLIMP OM_uint32 KRB5_CALLCONV gss_krb5_get_tkt_flags
102 	PROTOTYPE((OM_uint32 *minor_status,
103 		   gss_ctx_id_t context_handle,
104 		   krb5_flags *ticket_flags));
105 
106 GSS_DLLIMP OM_uint32 KRB5_CALLCONV gss_krb5_copy_ccache
107 	PROTOTYPE((OM_uint32 *minor_status,
108 		   gss_cred_id_t cred_handle,
109 		   krb5_ccache out_ccache));
110 
111 GSS_DLLIMP OM_uint32 KRB5_CALLCONV gss_krb5_ccache_name
112 	PROTOTYPE((OM_uint32 *minor_status, const char *name,
113 		   const char **out_name));
114 
115 #ifdef __cplusplus
116 }
117 #endif /* __cplusplus */
118 
119 #endif /* _GSSAPI_KRB5_H_ */
120