1/*
2 * Copyright (c) 1997 - 2006 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 *
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.
16 *
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.
20 *
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
31 * SUCH DAMAGE.
32 */
33
34/* $Id$ */
35
36#ifndef GSSAPI_KRB5_H_
37#define GSSAPI_KRB5_H_
38
39#include <gssapi.h>
40
41GSSAPI_CPP_START
42
43#if !defined(__GNUC__) && !defined(__attribute__)
44#define __attribute__(x)
45#endif
46
47#ifndef GSSKRB5_FUNCTION_DEPRECATED
48#define GSSKRB5_FUNCTION_DEPRECATED __attribute__((deprecated))
49#endif
50
51
52/*
53 * This is for kerberos5 names.
54 */
55
56/* do not use this entry */
57extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_nt_principal_oid_desc;
58#define GSS_KRB5_NT_PRINCIPAL (&__gss_krb5_nt_principal_oid_desc)
59
60extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_nt_principal_name_oid_desc;
61#define GSS_KRB5_NT_PRINCIPAL_NAME (&__gss_krb5_nt_principal_name_oid_desc)
62
63extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_nt_principal_name_referral_oid_desc;
64#define GSS_KRB5_NT_PRINCIPAL_NAME_REFERRAL (&__gss_krb5_nt_principal_name_referral_oid_desc)
65
66#define GSS_KRB5_NT_USER_NAME (&__gss_c_nt_user_name_oid_desc)
67#define GSS_KRB5_NT_MACHINE_UID_NAME (&__gss_c_nt_machine_uid_name_oid_desc)
68#define GSS_KRB5_NT_STRING_UID_NAME (&__gss_c_nt_string_uid_name_oid_desc)
69
70/* for compatibility with MIT api */
71
72#define gss_mech_krb5 GSS_KRB5_MECHANISM
73#define gss_krb5_nt_general_name GSS_KRB5_NT_PRINCIPAL_NAME
74
75/*
76 * kerberos mechanism specific functions
77 */
78
79/*
80 * Lucid - NFSv4 interface to GSS-API KRB5 to expose key material to
81 * do GSS content token handling in-kernel.
82 */
83
84typedef struct gss_krb5_lucid_key {
85	OM_uint32	type;
86	OM_uint32	length;
87	void *		data;
88} gss_krb5_lucid_key_t;
89
90typedef struct gss_krb5_rfc1964_keydata {
91	OM_uint32		sign_alg;
92	OM_uint32		seal_alg;
93	gss_krb5_lucid_key_t	ctx_key;
94} gss_krb5_rfc1964_keydata_t;
95
96typedef struct gss_krb5_cfx_keydata {
97	OM_uint32		have_acceptor_subkey;
98	gss_krb5_lucid_key_t	ctx_key;
99	gss_krb5_lucid_key_t	acceptor_subkey;
100} gss_krb5_cfx_keydata_t;
101
102typedef struct gss_krb5_lucid_context_v1 {
103	OM_uint32	version;
104	OM_uint32	initiate;
105	OM_uint32	endtime;
106	OM_uint64	send_seq;
107	OM_uint64	recv_seq;
108	OM_uint32	protocol;
109	gss_krb5_rfc1964_keydata_t rfc1964_kd;
110	gss_krb5_cfx_keydata_t	   cfx_kd;
111} gss_krb5_lucid_context_v1_t;
112
113typedef struct gss_krb5_lucid_context_version {
114	OM_uint32	version;	/* Structure version number */
115} gss_krb5_lucid_context_version_t;
116
117GSSAPI_CPP_END
118
119#endif /* GSSAPI_SPNEGO_H_ */
120