2 * Copyright (c) 1997 - 2006 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 #ifndef GSSAPI_KRB5_H_
37 #define GSSAPI_KRB5_H_
39 #include <gssapi/gssapi.h>
46 * This is for kerberos5 names.
49 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_NT_PRINCIPAL_NAME
;
50 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_NT_USER_NAME
;
51 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_NT_MACHINE_UID_NAME
;
52 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_NT_STRING_UID_NAME
;
54 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_MECHANISM
;
56 /* for compatibility with MIT api */
58 #define gss_mech_krb5 GSS_KRB5_MECHANISM
59 #define gss_krb5_nt_general_name GSS_KRB5_NT_PRINCIPAL_NAME
61 /* Extensions set contexts options */
62 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_COPY_CCACHE_X
;
63 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_COMPAT_DES3_MIC_X
;
64 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_REGISTER_ACCEPTOR_IDENTITY_X
;
65 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_SET_DNS_CANONICALIZE_X
;
66 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_SEND_TO_KDC_X
;
67 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_SET_DEFAULT_REALM_X
;
68 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_CCACHE_NAME_X
;
69 /* Extensions inquire context */
70 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_TKT_FLAGS_X
;
71 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_EXTRACT_AUTHZ_DATA_FROM_SEC_CONTEXT_X
;
72 extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_PEER_HAS_UPDATED_SPNEGO
;
73 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_EXPORT_LUCID_CONTEXT_X
;
74 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_EXPORT_LUCID_CONTEXT_V1_X
;
75 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_SUBKEY_X
;
76 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_INITIATOR_SUBKEY_X
;
77 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_ACCEPTOR_SUBKEY_X
;
78 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_AUTHTIME_X
;
79 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_SERVICE_KEYBLOCK_X
;
80 /* Extensions creds */
81 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_IMPORT_CRED_X
;
82 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X
;
83 extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_CRED_NO_CI_FLAGS_X
;
86 * kerberos mechanism specific functions
89 struct krb5_keytab_data
;
90 struct krb5_ccache_data
;
93 OM_uint32 GSSAPI_LIB_FUNCTION
94 gss_krb5_ccache_name(OM_uint32
* /*minor_status*/,
95 const char * /*name */,
96 const char ** /*out_name */);
98 OM_uint32 GSSAPI_LIB_FUNCTION gsskrb5_register_acceptor_identity
99 (const char */
*identity*/
);
101 OM_uint32 GSSAPI_LIB_FUNCTION gss_krb5_copy_ccache
102 (OM_uint32 */
*minor*/
,
103 gss_cred_id_t
/*cred*/,
104 struct krb5_ccache_data */
*out*/
);
106 OM_uint32 GSSAPI_LIB_FUNCTION
107 gss_krb5_import_cred(OM_uint32 */
*minor*/
,
108 struct krb5_ccache_data
* /*in*/,
109 struct Principal
* /*keytab_principal*/,
110 struct krb5_keytab_data
* /*keytab*/,
111 gss_cred_id_t */
*out*/
);
113 OM_uint32 GSSAPI_LIB_FUNCTION gss_krb5_get_tkt_flags
114 (OM_uint32 */
*minor*/
,
115 gss_ctx_id_t
/*context_handle*/,
116 OM_uint32 */
*tkt_flags*/
);
118 OM_uint32 GSSAPI_LIB_FUNCTION
119 gsskrb5_extract_authz_data_from_sec_context
120 (OM_uint32
* /*minor_status*/,
121 gss_ctx_id_t
/*context_handle*/,
123 gss_buffer_t
/*ad_data*/);
125 OM_uint32 GSSAPI_LIB_FUNCTION
126 gsskrb5_set_dns_canonicalize(int);
128 struct gsskrb5_send_to_kdc
{
133 OM_uint32 GSSAPI_LIB_FUNCTION
134 gsskrb5_set_send_to_kdc(struct gsskrb5_send_to_kdc
*);
136 OM_uint32 GSSAPI_LIB_FUNCTION
137 gsskrb5_set_default_realm(const char *);
139 OM_uint32 GSSAPI_LIB_FUNCTION
140 gsskrb5_extract_authtime_from_sec_context(OM_uint32
*, gss_ctx_id_t
, time_t *);
142 struct EncryptionKey
;
144 OM_uint32 GSSAPI_LIB_FUNCTION
145 gsskrb5_extract_service_keyblock(OM_uint32
*minor_status
,
146 gss_ctx_id_t context_handle
,
147 struct EncryptionKey
**out
);
148 OM_uint32 GSSAPI_LIB_FUNCTION
149 gsskrb5_get_initiator_subkey(OM_uint32
*minor_status
,
150 gss_ctx_id_t context_handle
,
151 struct EncryptionKey
**out
);
152 OM_uint32 GSSAPI_LIB_FUNCTION
153 gsskrb5_get_subkey(OM_uint32
*minor_status
,
154 gss_ctx_id_t context_handle
,
155 struct EncryptionKey
**out
);
158 * Lucid - NFSv4 interface to GSS-API KRB5 to expose key material to
159 * do GSS content token handling in-kernel.
162 typedef struct gss_krb5_lucid_key
{
166 } gss_krb5_lucid_key_t
;
168 typedef struct gss_krb5_rfc1964_keydata
{
171 gss_krb5_lucid_key_t ctx_key
;
172 } gss_krb5_rfc1964_keydata_t
;
174 typedef struct gss_krb5_cfx_keydata
{
175 OM_uint32 have_acceptor_subkey
;
176 gss_krb5_lucid_key_t ctx_key
;
177 gss_krb5_lucid_key_t acceptor_subkey
;
178 } gss_krb5_cfx_keydata_t
;
180 typedef struct gss_krb5_lucid_context_v1
{
187 gss_krb5_rfc1964_keydata_t rfc1964_kd
;
188 gss_krb5_cfx_keydata_t cfx_kd
;
189 } gss_krb5_lucid_context_v1_t
;
191 typedef struct gss_krb5_lucid_context_version
{
192 OM_uint32 version
; /* Structure version number */
193 } gss_krb5_lucid_context_version_t
;
196 * Function declarations
199 OM_uint32 GSSAPI_LIB_FUNCTION
200 gss_krb5_export_lucid_sec_context(OM_uint32
*minor_status
,
201 gss_ctx_id_t
*context_handle
,
206 OM_uint32 GSSAPI_LIB_FUNCTION
207 gss_krb5_free_lucid_sec_context(OM_uint32
*minor_status
,
211 OM_uint32 GSSAPI_LIB_FUNCTION
212 gss_krb5_set_allowable_enctypes(OM_uint32
*minor_status
,
214 OM_uint32 num_enctypes
,
221 #endif /* GSSAPI_SPNEGO_H_ */