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_
40 #include <gssapi/gssapi_oid.h>
44 #if !defined(__GNUC__) && !defined(__attribute__)
45 #define __attribute__(x)
48 #ifndef GSSKRB5_FUNCTION_DEPRECATED
49 #define GSSKRB5_FUNCTION_DEPRECATED __attribute__((deprecated))
54 * This is for kerberos5 names.
57 extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_nt_principal_name_oid_desc
;
58 #define GSS_KRB5_NT_PRINCIPAL_NAME (&__gss_krb5_nt_principal_name_oid_desc)
60 #define GSS_KRB5_NT_USER_NAME (&__gss_c_nt_user_name_oid_desc)
61 #define GSS_KRB5_NT_MACHINE_UID_NAME (&__gss_c_nt_machine_uid_name_oid_desc)
62 #define GSS_KRB5_NT_STRING_UID_NAME (&__gss_c_nt_string_uid_name_oid_desc)
64 /* for compatibility with MIT api */
66 #define gss_mech_krb5 GSS_KRB5_MECHANISM
67 #define gss_krb5_nt_general_name GSS_KRB5_NT_PRINCIPAL_NAME
70 * kerberos mechanism specific functions
73 struct krb5_keytab_data
;
74 struct krb5_ccache_data
;
77 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
78 gss_krb5_ccache_name(OM_uint32
* /*minor_status*/,
79 const char * /*name */,
80 const char ** /*out_name */);
82 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gsskrb5_register_acceptor_identity
83 (const char * /*identity*/);
85 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL krb5_gss_register_acceptor_identity
86 (const char * /*identity*/);
88 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_krb5_copy_ccache
89 (OM_uint32
* /*minor*/,
90 gss_cred_id_t
/*cred*/,
91 struct krb5_ccache_data
* /*out*/);
93 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
94 gss_krb5_import_cred(OM_uint32
* /*minor*/,
95 struct krb5_ccache_data
* /*in*/,
96 struct Principal
* /*keytab_principal*/,
97 struct krb5_keytab_data
* /*keytab*/,
98 gss_cred_id_t
* /*out*/);
100 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_krb5_get_tkt_flags
101 (OM_uint32
* /*minor*/,
102 gss_ctx_id_t
/*context_handle*/,
103 OM_uint32
* /*tkt_flags*/);
105 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
106 gsskrb5_extract_authz_data_from_sec_context
107 (OM_uint32
* /*minor_status*/,
108 gss_ctx_id_t
/*context_handle*/,
110 gss_buffer_t
/*ad_data*/);
112 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
113 gsskrb5_set_dns_canonicalize(int);
115 struct gsskrb5_send_to_kdc
{
120 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
121 gsskrb5_set_send_to_kdc(struct gsskrb5_send_to_kdc
*)
122 GSSKRB5_FUNCTION_DEPRECATED
;
124 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
125 gsskrb5_set_default_realm(const char *);
127 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
128 gsskrb5_extract_authtime_from_sec_context(OM_uint32
*, gss_ctx_id_t
, time_t *);
130 struct EncryptionKey
;
132 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
133 gsskrb5_extract_service_keyblock(OM_uint32
*minor_status
,
134 gss_ctx_id_t context_handle
,
135 struct EncryptionKey
**out
);
136 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
137 gsskrb5_get_initiator_subkey(OM_uint32
*minor_status
,
138 gss_ctx_id_t context_handle
,
139 struct EncryptionKey
**out
);
140 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
141 gsskrb5_get_subkey(OM_uint32
*minor_status
,
142 gss_ctx_id_t context_handle
,
143 struct EncryptionKey
**out
);
145 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
146 gsskrb5_set_time_offset(int);
148 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
149 gsskrb5_get_time_offset(int *);
151 struct gsskrb5_krb5_plugin
{
157 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
158 gsskrb5_plugin_register(struct gsskrb5_krb5_plugin
*);
162 * Lucid - NFSv4 interface to GSS-API KRB5 to expose key material to
163 * do GSS content token handling in-kernel.
166 typedef struct gss_krb5_lucid_key
{
170 } gss_krb5_lucid_key_t
;
172 typedef struct gss_krb5_rfc1964_keydata
{
175 gss_krb5_lucid_key_t ctx_key
;
176 } gss_krb5_rfc1964_keydata_t
;
178 typedef struct gss_krb5_cfx_keydata
{
179 OM_uint32 have_acceptor_subkey
;
180 gss_krb5_lucid_key_t ctx_key
;
181 gss_krb5_lucid_key_t acceptor_subkey
;
182 } gss_krb5_cfx_keydata_t
;
184 typedef struct gss_krb5_lucid_context_v1
{
191 gss_krb5_rfc1964_keydata_t rfc1964_kd
;
192 gss_krb5_cfx_keydata_t cfx_kd
;
193 } gss_krb5_lucid_context_v1_t
;
195 typedef struct gss_krb5_lucid_context_version
{
196 OM_uint32 version
; /* Structure version number */
197 } gss_krb5_lucid_context_version_t
;
200 * Function declarations
203 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
204 gss_krb5_export_lucid_sec_context(OM_uint32
*minor_status
,
205 gss_ctx_id_t
*context_handle
,
210 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
211 gss_krb5_free_lucid_sec_context(OM_uint32
*minor_status
,
215 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
216 gss_krb5_set_allowable_enctypes(OM_uint32
*minor_status
,
218 OM_uint32 num_enctypes
,
223 #endif /* GSSAPI_SPNEGO_H_ */