xref: /freebsd/crypto/krb5/src/lib/gssapi/mechglue/mglueP.h (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert /* lib/gssapi/mechglue/mglueP.h */
2*7f2fe78bSCy Schubert 
3*7f2fe78bSCy Schubert /*
4*7f2fe78bSCy Schubert  * Copyright (c) 1995, by Sun Microsystems, Inc.
5*7f2fe78bSCy Schubert  * All rights reserved.
6*7f2fe78bSCy Schubert  */
7*7f2fe78bSCy Schubert 
8*7f2fe78bSCy Schubert /* This header contains the private mechglue definitions. */
9*7f2fe78bSCy Schubert 
10*7f2fe78bSCy Schubert #ifndef _GSS_MECHGLUEP_H
11*7f2fe78bSCy Schubert #define _GSS_MECHGLUEP_H
12*7f2fe78bSCy Schubert 
13*7f2fe78bSCy Schubert #include "autoconf.h"
14*7f2fe78bSCy Schubert #include "mechglue.h"
15*7f2fe78bSCy Schubert #include "gssapiP_generic.h"
16*7f2fe78bSCy Schubert 
17*7f2fe78bSCy Schubert #define	g_OID_copy(o1, o2)					\
18*7f2fe78bSCy Schubert do {								\
19*7f2fe78bSCy Schubert 	memcpy((o1)->elements, (o2)->elements, (o2)->length);	\
20*7f2fe78bSCy Schubert 	(o1)->length = (o2)->length;				\
21*7f2fe78bSCy Schubert } while (0)
22*7f2fe78bSCy Schubert 
23*7f2fe78bSCy Schubert /*
24*7f2fe78bSCy Schubert  * Array of context IDs typed by mechanism OID
25*7f2fe78bSCy Schubert  */
26*7f2fe78bSCy Schubert typedef struct gss_union_ctx_id_struct {
27*7f2fe78bSCy Schubert 	struct gss_union_ctx_id_struct *loopback;
28*7f2fe78bSCy Schubert 	gss_OID			mech_type;
29*7f2fe78bSCy Schubert 	gss_ctx_id_t		internal_ctx_id;
30*7f2fe78bSCy Schubert } gss_union_ctx_id_desc, *gss_union_ctx_id_t;
31*7f2fe78bSCy Schubert 
32*7f2fe78bSCy Schubert /*
33*7f2fe78bSCy Schubert  * Generic GSSAPI names.  A name can either be a generic name, or a
34*7f2fe78bSCy Schubert  * mechanism specific name....
35*7f2fe78bSCy Schubert  */
36*7f2fe78bSCy Schubert typedef struct gss_name_struct {
37*7f2fe78bSCy Schubert 	struct gss_name_struct *loopback;
38*7f2fe78bSCy Schubert 	gss_OID			name_type;
39*7f2fe78bSCy Schubert 	gss_buffer_t		external_name;
40*7f2fe78bSCy Schubert 	/*
41*7f2fe78bSCy Schubert 	 * These last two fields are only filled in for mechanism
42*7f2fe78bSCy Schubert 	 * names.
43*7f2fe78bSCy Schubert 	 */
44*7f2fe78bSCy Schubert 	gss_OID			mech_type;
45*7f2fe78bSCy Schubert 	gss_name_t		mech_name;
46*7f2fe78bSCy Schubert } gss_union_name_desc, *gss_union_name_t;
47*7f2fe78bSCy Schubert 
48*7f2fe78bSCy Schubert /*
49*7f2fe78bSCy Schubert  * Structure for holding list of mechanism-specific name types
50*7f2fe78bSCy Schubert  */
51*7f2fe78bSCy Schubert typedef struct gss_mech_spec_name_t {
52*7f2fe78bSCy Schubert     gss_OID	name_type;
53*7f2fe78bSCy Schubert     gss_OID	mech;
54*7f2fe78bSCy Schubert     struct gss_mech_spec_name_t	*next, *prev;
55*7f2fe78bSCy Schubert } gss_mech_spec_name_desc, *gss_mech_spec_name;
56*7f2fe78bSCy Schubert 
57*7f2fe78bSCy Schubert /*
58*7f2fe78bSCy Schubert  * Set of Credentials typed on mechanism OID
59*7f2fe78bSCy Schubert  */
60*7f2fe78bSCy Schubert typedef struct gss_cred_id_struct {
61*7f2fe78bSCy Schubert 	struct gss_cred_id_struct *loopback;
62*7f2fe78bSCy Schubert 	int			count;
63*7f2fe78bSCy Schubert 	gss_OID			mechs_array;
64*7f2fe78bSCy Schubert 	gss_cred_id_t		*cred_array;
65*7f2fe78bSCy Schubert } gss_union_cred_desc, *gss_union_cred_t;
66*7f2fe78bSCy Schubert 
67*7f2fe78bSCy Schubert /*
68*7f2fe78bSCy Schubert  * Rudimentary pointer validation macro to check whether the
69*7f2fe78bSCy Schubert  * "loopback" field of an opaque struct points back to itself.  This
70*7f2fe78bSCy Schubert  * field also catches some programming errors where an opaque pointer
71*7f2fe78bSCy Schubert  * is passed to a function expecting the address of the opaque
72*7f2fe78bSCy Schubert  * pointer.
73*7f2fe78bSCy Schubert  */
74*7f2fe78bSCy Schubert #define GSSINT_CHK_LOOP(p) (!((p) != NULL && (p)->loopback == (p)))
75*7f2fe78bSCy Schubert 
76*7f2fe78bSCy Schubert /********************************************************/
77*7f2fe78bSCy Schubert /* The Mechanism Dispatch Table -- a mechanism needs to */
78*7f2fe78bSCy Schubert /* define one of these and provide a function to return */
79*7f2fe78bSCy Schubert /* it to initialize the GSSAPI library		  */
80*7f2fe78bSCy Schubert int gssint_mechglue_initialize_library(void);
81*7f2fe78bSCy Schubert 
82*7f2fe78bSCy Schubert OM_uint32 gssint_get_mech_type_oid(gss_OID OID, gss_buffer_t token);
83*7f2fe78bSCy Schubert 
84*7f2fe78bSCy Schubert /*
85*7f2fe78bSCy Schubert  * This table is used to access mechanism-specific versions of the GSSAPI
86*7f2fe78bSCy Schubert  * functions.  It contains all of the functions defined in gssapi.h except for
87*7f2fe78bSCy Schubert  * gss_release_buffer() and gss_release_oid_set(), which are assumed to be
88*7f2fe78bSCy Schubert  * identical across mechanisms.
89*7f2fe78bSCy Schubert  */
90*7f2fe78bSCy Schubert typedef struct gss_config {
91*7f2fe78bSCy Schubert     gss_OID_desc    mech_type;
92*7f2fe78bSCy Schubert     void *	    context;
93*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_acquire_cred)
94*7f2fe78bSCy Schubert 	(
95*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
96*7f2fe78bSCy Schubert 		    gss_name_t,		/* desired_name */
97*7f2fe78bSCy Schubert 		    OM_uint32,		/* time_req */
98*7f2fe78bSCy Schubert 		    gss_OID_set,	/* desired_mechs */
99*7f2fe78bSCy Schubert 		    int,		/* cred_usage */
100*7f2fe78bSCy Schubert 		    gss_cred_id_t*,	/* output_cred_handle */
101*7f2fe78bSCy Schubert 		    gss_OID_set*,	/* actual_mechs */
102*7f2fe78bSCy Schubert 		    OM_uint32*		/* time_rec */
103*7f2fe78bSCy Schubert 		    );
104*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_release_cred)
105*7f2fe78bSCy Schubert 	(
106*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
107*7f2fe78bSCy Schubert 		    gss_cred_id_t*	/* cred_handle */
108*7f2fe78bSCy Schubert 		    );
109*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_init_sec_context)
110*7f2fe78bSCy Schubert 	(
111*7f2fe78bSCy Schubert 		    OM_uint32*,			/* minor_status */
112*7f2fe78bSCy Schubert 		    gss_cred_id_t,		/* claimant_cred_handle */
113*7f2fe78bSCy Schubert 		    gss_ctx_id_t*,		/* context_handle */
114*7f2fe78bSCy Schubert 		    gss_name_t,			/* target_name */
115*7f2fe78bSCy Schubert 		    gss_OID,			/* mech_type */
116*7f2fe78bSCy Schubert 		    OM_uint32,			/* req_flags */
117*7f2fe78bSCy Schubert 		    OM_uint32,			/* time_req */
118*7f2fe78bSCy Schubert 		    gss_channel_bindings_t,	/* input_chan_bindings */
119*7f2fe78bSCy Schubert 		    gss_buffer_t,		/* input_token */
120*7f2fe78bSCy Schubert 		    gss_OID*,			/* actual_mech_type */
121*7f2fe78bSCy Schubert 		    gss_buffer_t,		/* output_token */
122*7f2fe78bSCy Schubert 		    OM_uint32*,			/* ret_flags */
123*7f2fe78bSCy Schubert 		    OM_uint32*			/* time_rec */
124*7f2fe78bSCy Schubert 		    );
125*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_accept_sec_context)
126*7f2fe78bSCy Schubert 	(
127*7f2fe78bSCy Schubert 		    OM_uint32*,			/* minor_status */
128*7f2fe78bSCy Schubert 		    gss_ctx_id_t*,		/* context_handle */
129*7f2fe78bSCy Schubert 		    gss_cred_id_t,		/* verifier_cred_handle */
130*7f2fe78bSCy Schubert 		    gss_buffer_t,		/* input_token_buffer */
131*7f2fe78bSCy Schubert 		    gss_channel_bindings_t,	/* input_chan_bindings */
132*7f2fe78bSCy Schubert 		    gss_name_t*,		/* src_name */
133*7f2fe78bSCy Schubert 		    gss_OID*,			/* mech_type */
134*7f2fe78bSCy Schubert 		    gss_buffer_t,		/* output_token */
135*7f2fe78bSCy Schubert 		    OM_uint32*,			/* ret_flags */
136*7f2fe78bSCy Schubert 		    OM_uint32*,			/* time_rec */
137*7f2fe78bSCy Schubert 		    gss_cred_id_t*		/* delegated_cred_handle */
138*7f2fe78bSCy Schubert 		    );
139*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_process_context_token)
140*7f2fe78bSCy Schubert 	(
141*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
142*7f2fe78bSCy Schubert 		    gss_ctx_id_t,	/* context_handle */
143*7f2fe78bSCy Schubert 		    gss_buffer_t	/* token_buffer */
144*7f2fe78bSCy Schubert 		    );
145*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_delete_sec_context)
146*7f2fe78bSCy Schubert 	(
147*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
148*7f2fe78bSCy Schubert 		    gss_ctx_id_t*,	/* context_handle */
149*7f2fe78bSCy Schubert 		    gss_buffer_t	/* output_token */
150*7f2fe78bSCy Schubert 		    );
151*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_context_time)
152*7f2fe78bSCy Schubert 	(
153*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
154*7f2fe78bSCy Schubert 		    gss_ctx_id_t,	/* context_handle */
155*7f2fe78bSCy Schubert 		    OM_uint32*		/* time_rec */
156*7f2fe78bSCy Schubert 		    );
157*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_get_mic)
158*7f2fe78bSCy Schubert 	(
159*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
160*7f2fe78bSCy Schubert 		    gss_ctx_id_t,	/* context_handle */
161*7f2fe78bSCy Schubert 		    gss_qop_t,		/* qop_req */
162*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* message_buffer */
163*7f2fe78bSCy Schubert 		    gss_buffer_t	/* message_token */
164*7f2fe78bSCy Schubert 		    );
165*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_verify_mic)
166*7f2fe78bSCy Schubert 	(
167*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
168*7f2fe78bSCy Schubert 		    gss_ctx_id_t,	/* context_handle */
169*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* message_buffer */
170*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* token_buffer */
171*7f2fe78bSCy Schubert 		    gss_qop_t*		/* qop_state */
172*7f2fe78bSCy Schubert 		    );
173*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_wrap)
174*7f2fe78bSCy Schubert 	(
175*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
176*7f2fe78bSCy Schubert 		    gss_ctx_id_t,	/* context_handle */
177*7f2fe78bSCy Schubert 		    int,		/* conf_req_flag */
178*7f2fe78bSCy Schubert 		    gss_qop_t,		/* qop_req */
179*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* input_message_buffer */
180*7f2fe78bSCy Schubert 		    int*,		/* conf_state */
181*7f2fe78bSCy Schubert 		    gss_buffer_t	/* output_message_buffer */
182*7f2fe78bSCy Schubert 		    );
183*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_unwrap)
184*7f2fe78bSCy Schubert 	(
185*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
186*7f2fe78bSCy Schubert 		    gss_ctx_id_t,	/* context_handle */
187*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* input_message_buffer */
188*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* output_message_buffer */
189*7f2fe78bSCy Schubert 		    int*,		/* conf_state */
190*7f2fe78bSCy Schubert 		    gss_qop_t*		/* qop_state */
191*7f2fe78bSCy Schubert 		    );
192*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_display_status)
193*7f2fe78bSCy Schubert 	(
194*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
195*7f2fe78bSCy Schubert 		    OM_uint32,		/* status_value */
196*7f2fe78bSCy Schubert 		    int,		/* status_type */
197*7f2fe78bSCy Schubert 		    gss_OID,		/* mech_type */
198*7f2fe78bSCy Schubert 		    OM_uint32*,		/* message_context */
199*7f2fe78bSCy Schubert 		    gss_buffer_t	/* status_string */
200*7f2fe78bSCy Schubert 		    );
201*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_indicate_mechs)
202*7f2fe78bSCy Schubert 	(
203*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
204*7f2fe78bSCy Schubert 		    gss_OID_set*	/* mech_set */
205*7f2fe78bSCy Schubert 		    );
206*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_compare_name)
207*7f2fe78bSCy Schubert 	(
208*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
209*7f2fe78bSCy Schubert 		    gss_name_t,		/* name1 */
210*7f2fe78bSCy Schubert 		    gss_name_t,		/* name2 */
211*7f2fe78bSCy Schubert 		    int*		/* name_equal */
212*7f2fe78bSCy Schubert 		    );
213*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_display_name)
214*7f2fe78bSCy Schubert 	(
215*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
216*7f2fe78bSCy Schubert 		    gss_name_t,		/* input_name */
217*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* output_name_buffer */
218*7f2fe78bSCy Schubert 		    gss_OID*		/* output_name_type */
219*7f2fe78bSCy Schubert 		    );
220*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_import_name)
221*7f2fe78bSCy Schubert 	(
222*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
223*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* input_name_buffer */
224*7f2fe78bSCy Schubert 		    gss_OID,		/* input_name_type */
225*7f2fe78bSCy Schubert 		    gss_name_t*		/* output_name */
226*7f2fe78bSCy Schubert 		    );
227*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_release_name)
228*7f2fe78bSCy Schubert 	(
229*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
230*7f2fe78bSCy Schubert 		    gss_name_t*		/* input_name */
231*7f2fe78bSCy Schubert 		    );
232*7f2fe78bSCy Schubert     OM_uint32       (KRB5_CALLCONV *gss_inquire_cred)
233*7f2fe78bSCy Schubert 	(
234*7f2fe78bSCy Schubert 		    OM_uint32 *,		/* minor_status */
235*7f2fe78bSCy Schubert 		    gss_cred_id_t,		/* cred_handle */
236*7f2fe78bSCy Schubert 		    gss_name_t *,		/* name */
237*7f2fe78bSCy Schubert 		    OM_uint32 *,		/* lifetime */
238*7f2fe78bSCy Schubert 		    int *,			/* cred_usage */
239*7f2fe78bSCy Schubert 		    gss_OID_set *		/* mechanisms */
240*7f2fe78bSCy Schubert 		    );
241*7f2fe78bSCy Schubert     OM_uint32	    (KRB5_CALLCONV *gss_add_cred)
242*7f2fe78bSCy Schubert 	(
243*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* minor_status */
244*7f2fe78bSCy Schubert 		    gss_cred_id_t,	/* input_cred_handle */
245*7f2fe78bSCy Schubert 		    gss_name_t,		/* desired_name */
246*7f2fe78bSCy Schubert 		    gss_OID,		/* desired_mech */
247*7f2fe78bSCy Schubert 		    gss_cred_usage_t,	/* cred_usage */
248*7f2fe78bSCy Schubert 		    OM_uint32,		/* initiator_time_req */
249*7f2fe78bSCy Schubert 		    OM_uint32,		/* acceptor_time_req */
250*7f2fe78bSCy Schubert 		    gss_cred_id_t *,	/* output_cred_handle */
251*7f2fe78bSCy Schubert 		    gss_OID_set *,	/* actual_mechs */
252*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* initiator_time_rec */
253*7f2fe78bSCy Schubert 		    OM_uint32 *		/* acceptor_time_rec */
254*7f2fe78bSCy Schubert 		    );
255*7f2fe78bSCy Schubert     OM_uint32	    (KRB5_CALLCONV *gss_export_sec_context)
256*7f2fe78bSCy Schubert 	(
257*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* minor_status */
258*7f2fe78bSCy Schubert 		    gss_ctx_id_t *,	/* context_handle */
259*7f2fe78bSCy Schubert 		    gss_buffer_t	/* interprocess_token */
260*7f2fe78bSCy Schubert 		    );
261*7f2fe78bSCy Schubert     OM_uint32	    (KRB5_CALLCONV *gss_import_sec_context)
262*7f2fe78bSCy Schubert 	(
263*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* minor_status */
264*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* interprocess_token */
265*7f2fe78bSCy Schubert 		    gss_ctx_id_t *	/* context_handle */
266*7f2fe78bSCy Schubert 		    );
267*7f2fe78bSCy Schubert     OM_uint32 	    (KRB5_CALLCONV *gss_inquire_cred_by_mech)
268*7f2fe78bSCy Schubert 	(
269*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* minor_status */
270*7f2fe78bSCy Schubert 		    gss_cred_id_t,	/* cred_handle */
271*7f2fe78bSCy Schubert 		    gss_OID,		/* mech_type */
272*7f2fe78bSCy Schubert 		    gss_name_t *,	/* name */
273*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* initiator_lifetime */
274*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* acceptor_lifetime */
275*7f2fe78bSCy Schubert 		    gss_cred_usage_t *	/* cred_usage */
276*7f2fe78bSCy Schubert 		    );
277*7f2fe78bSCy Schubert     OM_uint32	    (KRB5_CALLCONV *gss_inquire_names_for_mech)
278*7f2fe78bSCy Schubert 	(
279*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* minor_status */
280*7f2fe78bSCy Schubert 		    gss_OID,		/* mechanism */
281*7f2fe78bSCy Schubert 		    gss_OID_set *	/* name_types */
282*7f2fe78bSCy Schubert 		    );
283*7f2fe78bSCy Schubert     OM_uint32	(KRB5_CALLCONV *gss_inquire_context)
284*7f2fe78bSCy Schubert 	(
285*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* minor_status */
286*7f2fe78bSCy Schubert 		    gss_ctx_id_t,	/* context_handle */
287*7f2fe78bSCy Schubert 		    gss_name_t *,	/* src_name */
288*7f2fe78bSCy Schubert 		    gss_name_t *,	/* targ_name */
289*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* lifetime_rec */
290*7f2fe78bSCy Schubert 		    gss_OID *,		/* mech_type */
291*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* ctx_flags */
292*7f2fe78bSCy Schubert 		    int *,	   	/* locally_initiated */
293*7f2fe78bSCy Schubert 		    int *		/* open */
294*7f2fe78bSCy Schubert 		    );
295*7f2fe78bSCy Schubert     OM_uint32	    (KRB5_CALLCONV *gss_internal_release_oid)
296*7f2fe78bSCy Schubert 	(
297*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* minor_status */
298*7f2fe78bSCy Schubert 		    gss_OID *		/* OID */
299*7f2fe78bSCy Schubert 	 );
300*7f2fe78bSCy Schubert     OM_uint32	     (KRB5_CALLCONV *gss_wrap_size_limit)
301*7f2fe78bSCy Schubert 	(
302*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* minor_status */
303*7f2fe78bSCy Schubert 		    gss_ctx_id_t,	/* context_handle */
304*7f2fe78bSCy Schubert 		    int,		/* conf_req_flag */
305*7f2fe78bSCy Schubert 		    gss_qop_t,		/* qop_req */
306*7f2fe78bSCy Schubert 		    OM_uint32,		/* req_output_size */
307*7f2fe78bSCy Schubert 		    OM_uint32 *		/* max_input_size */
308*7f2fe78bSCy Schubert 	 );
309*7f2fe78bSCy Schubert     OM_uint32	     (KRB5_CALLCONV *gss_localname)
310*7f2fe78bSCy Schubert 	(
311*7f2fe78bSCy Schubert 		    OM_uint32 *,        /* minor */
312*7f2fe78bSCy Schubert 		    const gss_name_t,	/* name */
313*7f2fe78bSCy Schubert 		    gss_const_OID,	/* mech_type */
314*7f2fe78bSCy Schubert 		    gss_buffer_t /* localname */
315*7f2fe78bSCy Schubert 	    );
316*7f2fe78bSCy Schubert 	OM_uint32		(KRB5_CALLCONV *gssspi_authorize_localname)
317*7f2fe78bSCy Schubert 	(
318*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* minor_status */
319*7f2fe78bSCy Schubert 		    const gss_name_t,	/* pname */
320*7f2fe78bSCy Schubert 		    gss_const_buffer_t,	/* local user */
321*7f2fe78bSCy Schubert 		    gss_const_OID	/* local nametype */
322*7f2fe78bSCy Schubert 	/* */);
323*7f2fe78bSCy Schubert 	OM_uint32		(KRB5_CALLCONV *gss_export_name)
324*7f2fe78bSCy Schubert 	(
325*7f2fe78bSCy Schubert 		OM_uint32 *,		/* minor_status */
326*7f2fe78bSCy Schubert 		const gss_name_t,	/* input_name */
327*7f2fe78bSCy Schubert 		gss_buffer_t		/* exported_name */
328*7f2fe78bSCy Schubert 	/* */);
329*7f2fe78bSCy Schubert         OM_uint32       (KRB5_CALLCONV *gss_duplicate_name)
330*7f2fe78bSCy Schubert 	(
331*7f2fe78bSCy Schubert 		    OM_uint32*,		/* minor_status */
332*7f2fe78bSCy Schubert 		    const gss_name_t,	/* input_name */
333*7f2fe78bSCy Schubert 		    gss_name_t *	/* output_name */
334*7f2fe78bSCy Schubert 	/* */);
335*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_store_cred)
336*7f2fe78bSCy Schubert 	(
337*7f2fe78bSCy Schubert 		OM_uint32 *,		/* minor_status */
338*7f2fe78bSCy Schubert 		const gss_cred_id_t,	/* input_cred */
339*7f2fe78bSCy Schubert 		gss_cred_usage_t,	/* cred_usage */
340*7f2fe78bSCy Schubert 		const gss_OID,		/* desired_mech */
341*7f2fe78bSCy Schubert 		OM_uint32,		/* overwrite_cred */
342*7f2fe78bSCy Schubert 		OM_uint32,		/* default_cred */
343*7f2fe78bSCy Schubert 		gss_OID_set *,		/* elements_stored */
344*7f2fe78bSCy Schubert 		gss_cred_usage_t *	/* cred_usage_stored */
345*7f2fe78bSCy Schubert 	/* */);
346*7f2fe78bSCy Schubert 
347*7f2fe78bSCy Schubert 
348*7f2fe78bSCy Schubert 	/* GGF extensions */
349*7f2fe78bSCy Schubert 
350*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gss_inquire_sec_context_by_oid)
351*7f2fe78bSCy Schubert     	(
352*7f2fe78bSCy Schubert     		    OM_uint32 *,	/* minor_status */
353*7f2fe78bSCy Schubert     		    const gss_ctx_id_t, /* context_handle */
354*7f2fe78bSCy Schubert     		    const gss_OID,      /* OID */
355*7f2fe78bSCy Schubert     		    gss_buffer_set_t *  /* data_set */
356*7f2fe78bSCy Schubert     		    );
357*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gss_inquire_cred_by_oid)
358*7f2fe78bSCy Schubert     	(
359*7f2fe78bSCy Schubert     		    OM_uint32 *,	/* minor_status */
360*7f2fe78bSCy Schubert     		    const gss_cred_id_t, /* cred_handle */
361*7f2fe78bSCy Schubert     		    const gss_OID,      /* OID */
362*7f2fe78bSCy Schubert     		    gss_buffer_set_t *  /* data_set */
363*7f2fe78bSCy Schubert     		    );
364*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gss_set_sec_context_option)
365*7f2fe78bSCy Schubert     	(
366*7f2fe78bSCy Schubert     		    OM_uint32 *,	/* minor_status */
367*7f2fe78bSCy Schubert     		    gss_ctx_id_t *,     /* context_handle */
368*7f2fe78bSCy Schubert     		    const gss_OID,      /* OID */
369*7f2fe78bSCy Schubert     		    const gss_buffer_t  /* value */
370*7f2fe78bSCy Schubert     		    );
371*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gssspi_set_cred_option)
372*7f2fe78bSCy Schubert     	(
373*7f2fe78bSCy Schubert     		    OM_uint32 *,	/* minor_status */
374*7f2fe78bSCy Schubert     		    gss_cred_id_t *,    /* cred_handle */
375*7f2fe78bSCy Schubert     		    const gss_OID,      /* OID */
376*7f2fe78bSCy Schubert     		    const gss_buffer_t	/* value */
377*7f2fe78bSCy Schubert     		    );
378*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gssspi_mech_invoke)
379*7f2fe78bSCy Schubert     	(
380*7f2fe78bSCy Schubert     		    OM_uint32*,		/* minor_status */
381*7f2fe78bSCy Schubert     		    const gss_OID, 	/* mech OID */
382*7f2fe78bSCy Schubert     		    const gss_OID,      /* OID */
383*7f2fe78bSCy Schubert     		    gss_buffer_t 	/* value */
384*7f2fe78bSCy Schubert     		    );
385*7f2fe78bSCy Schubert 
386*7f2fe78bSCy Schubert 	/* AEAD extensions */
387*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_wrap_aead)
388*7f2fe78bSCy Schubert 	(
389*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
390*7f2fe78bSCy Schubert 	    gss_ctx_id_t,		/* context_handle */
391*7f2fe78bSCy Schubert 	    int,			/* conf_req_flag */
392*7f2fe78bSCy Schubert 	    gss_qop_t,			/* qop_req */
393*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* input_assoc_buffer */
394*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* input_payload_buffer */
395*7f2fe78bSCy Schubert 	    int *,			/* conf_state */
396*7f2fe78bSCy Schubert 	    gss_buffer_t		/* output_message_buffer */
397*7f2fe78bSCy Schubert 	/* */);
398*7f2fe78bSCy Schubert 
399*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_unwrap_aead)
400*7f2fe78bSCy Schubert 	(
401*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
402*7f2fe78bSCy Schubert 	    gss_ctx_id_t,		/* context_handle */
403*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* input_message_buffer */
404*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* input_assoc_buffer */
405*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* output_payload_buffer */
406*7f2fe78bSCy Schubert 	    int *,			/* conf_state */
407*7f2fe78bSCy Schubert 	    gss_qop_t *			/* qop_state */
408*7f2fe78bSCy Schubert 	/* */);
409*7f2fe78bSCy Schubert 
410*7f2fe78bSCy Schubert 	/* SSPI extensions */
411*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_wrap_iov)
412*7f2fe78bSCy Schubert 	(
413*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
414*7f2fe78bSCy Schubert 	    gss_ctx_id_t,		/* context_handle */
415*7f2fe78bSCy Schubert 	    int,			/* conf_req_flag */
416*7f2fe78bSCy Schubert 	    gss_qop_t,			/* qop_req */
417*7f2fe78bSCy Schubert 	    int *,			/* conf_state */
418*7f2fe78bSCy Schubert 	    gss_iov_buffer_desc *,	/* iov */
419*7f2fe78bSCy Schubert 	    int				/* iov_count */
420*7f2fe78bSCy Schubert 	/* */);
421*7f2fe78bSCy Schubert 
422*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_unwrap_iov)
423*7f2fe78bSCy Schubert 	(
424*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
425*7f2fe78bSCy Schubert 	    gss_ctx_id_t,		/* context_handle */
426*7f2fe78bSCy Schubert 	    int *,			/* conf_state */
427*7f2fe78bSCy Schubert 	    gss_qop_t *,		/* qop_state */
428*7f2fe78bSCy Schubert 	    gss_iov_buffer_desc *,	/* iov */
429*7f2fe78bSCy Schubert 	    int				/* iov_count */
430*7f2fe78bSCy Schubert 	/* */);
431*7f2fe78bSCy Schubert 
432*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_wrap_iov_length)
433*7f2fe78bSCy Schubert 	(
434*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
435*7f2fe78bSCy Schubert 	    gss_ctx_id_t,		/* context_handle */
436*7f2fe78bSCy Schubert 	    int,			/* conf_req_flag*/
437*7f2fe78bSCy Schubert 	    gss_qop_t, 			/* qop_req */
438*7f2fe78bSCy Schubert 	    int *, 			/* conf_state */
439*7f2fe78bSCy Schubert 	    gss_iov_buffer_desc *,	/* iov */
440*7f2fe78bSCy Schubert 	    int				/* iov_count */
441*7f2fe78bSCy Schubert 	/* */);
442*7f2fe78bSCy Schubert 
443*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gss_complete_auth_token)
444*7f2fe78bSCy Schubert     	(
445*7f2fe78bSCy Schubert     		    OM_uint32*,		/* minor_status */
446*7f2fe78bSCy Schubert     		    const gss_ctx_id_t,	/* context_handle */
447*7f2fe78bSCy Schubert     		    gss_buffer_t	/* input_message_buffer */
448*7f2fe78bSCy Schubert     		    );
449*7f2fe78bSCy Schubert 
450*7f2fe78bSCy Schubert 	/* New for 1.8 */
451*7f2fe78bSCy Schubert 
452*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_acquire_cred_impersonate_name)
453*7f2fe78bSCy Schubert 	(
454*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
455*7f2fe78bSCy Schubert 	    const gss_cred_id_t,	/* impersonator_cred_handle */
456*7f2fe78bSCy Schubert 	    const gss_name_t,		/* desired_name */
457*7f2fe78bSCy Schubert 	    OM_uint32,			/* time_req */
458*7f2fe78bSCy Schubert 	    const gss_OID_set,		/* desired_mechs */
459*7f2fe78bSCy Schubert 	    gss_cred_usage_t,		/* cred_usage */
460*7f2fe78bSCy Schubert 	    gss_cred_id_t *,		/* output_cred_handle */
461*7f2fe78bSCy Schubert 	    gss_OID_set *,		/* actual_mechs */
462*7f2fe78bSCy Schubert 	    OM_uint32 *			/* time_rec */
463*7f2fe78bSCy Schubert 	/* */);
464*7f2fe78bSCy Schubert 
465*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_add_cred_impersonate_name)
466*7f2fe78bSCy Schubert 	(
467*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
468*7f2fe78bSCy Schubert 	    gss_cred_id_t,		/* input_cred_handle */
469*7f2fe78bSCy Schubert 	    const gss_cred_id_t,	/* impersonator_cred_handle */
470*7f2fe78bSCy Schubert 	    const gss_name_t,		/* desired_name */
471*7f2fe78bSCy Schubert 	    const gss_OID,		/* desired_mech */
472*7f2fe78bSCy Schubert 	    gss_cred_usage_t,		/* cred_usage */
473*7f2fe78bSCy Schubert 	    OM_uint32,			/* initiator_time_req */
474*7f2fe78bSCy Schubert 	    OM_uint32,			/* acceptor_time_req */
475*7f2fe78bSCy Schubert 	    gss_cred_id_t *,		/* output_cred_handle */
476*7f2fe78bSCy Schubert 	    gss_OID_set *,		/* actual_mechs */
477*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* initiator_time_rec */
478*7f2fe78bSCy Schubert 	    OM_uint32 *			/* acceptor_time_rec */
479*7f2fe78bSCy Schubert 	/* */);
480*7f2fe78bSCy Schubert 
481*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_display_name_ext)
482*7f2fe78bSCy Schubert 	(
483*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
484*7f2fe78bSCy Schubert 	    gss_name_t,			/* name */
485*7f2fe78bSCy Schubert 	    gss_OID,			/* display_as_name_type */
486*7f2fe78bSCy Schubert 	    gss_buffer_t		/* display_name */
487*7f2fe78bSCy Schubert 	/* */);
488*7f2fe78bSCy Schubert 
489*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_inquire_name)
490*7f2fe78bSCy Schubert 	(
491*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
492*7f2fe78bSCy Schubert 	    gss_name_t,			/* name */
493*7f2fe78bSCy Schubert 	    int *,			/* name_is_MN */
494*7f2fe78bSCy Schubert 	    gss_OID *,			/* MN_mech */
495*7f2fe78bSCy Schubert 	    gss_buffer_set_t *		/* attrs */
496*7f2fe78bSCy Schubert 	/* */);
497*7f2fe78bSCy Schubert 
498*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_get_name_attribute)
499*7f2fe78bSCy Schubert 	(
500*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
501*7f2fe78bSCy Schubert 	    gss_name_t,			/* name */
502*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* attr */
503*7f2fe78bSCy Schubert 	    int *,			/* authenticated */
504*7f2fe78bSCy Schubert 	    int *,			/* complete */
505*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* value */
506*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* display_value */
507*7f2fe78bSCy Schubert 	    int *			/* more */
508*7f2fe78bSCy Schubert 	/* */);
509*7f2fe78bSCy Schubert 
510*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_set_name_attribute)
511*7f2fe78bSCy Schubert 	(
512*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
513*7f2fe78bSCy Schubert 	    gss_name_t,			/* name */
514*7f2fe78bSCy Schubert 	    int,			/* complete */
515*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* attr */
516*7f2fe78bSCy Schubert 	    gss_buffer_t		/* value */
517*7f2fe78bSCy Schubert 	/* */);
518*7f2fe78bSCy Schubert 
519*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_delete_name_attribute)
520*7f2fe78bSCy Schubert 	(
521*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
522*7f2fe78bSCy Schubert 	    gss_name_t,			/* name */
523*7f2fe78bSCy Schubert 	    gss_buffer_t		/* attr */
524*7f2fe78bSCy Schubert 	/* */);
525*7f2fe78bSCy Schubert 
526*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_export_name_composite)
527*7f2fe78bSCy Schubert 	(
528*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
529*7f2fe78bSCy Schubert 	    gss_name_t,			/* name */
530*7f2fe78bSCy Schubert 	    gss_buffer_t		/* exp_composite_name */
531*7f2fe78bSCy Schubert 	/* */);
532*7f2fe78bSCy Schubert 
533*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_map_name_to_any)
534*7f2fe78bSCy Schubert 	(
535*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
536*7f2fe78bSCy Schubert 	    gss_name_t,			/* name */
537*7f2fe78bSCy Schubert 	    int,			/* authenticated */
538*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* type_id */
539*7f2fe78bSCy Schubert 	    gss_any_t *			/* output */
540*7f2fe78bSCy Schubert 	/* */);
541*7f2fe78bSCy Schubert 
542*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_release_any_name_mapping)
543*7f2fe78bSCy Schubert 	(
544*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
545*7f2fe78bSCy Schubert 	    gss_name_t,			/* name */
546*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* type_id */
547*7f2fe78bSCy Schubert 	    gss_any_t *			/* input */
548*7f2fe78bSCy Schubert 	/* */);
549*7f2fe78bSCy Schubert 
550*7f2fe78bSCy Schubert         OM_uint32       (KRB5_CALLCONV *gss_pseudo_random)
551*7f2fe78bSCy Schubert         (
552*7f2fe78bSCy Schubert             OM_uint32 *,                /* minor_status */
553*7f2fe78bSCy Schubert             gss_ctx_id_t,               /* context */
554*7f2fe78bSCy Schubert             int,                        /* prf_key */
555*7f2fe78bSCy Schubert             const gss_buffer_t,         /* prf_in */
556*7f2fe78bSCy Schubert             ssize_t,                    /* desired_output_len */
557*7f2fe78bSCy Schubert             gss_buffer_t                /* prf_out */
558*7f2fe78bSCy Schubert         /* */);
559*7f2fe78bSCy Schubert 
560*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_set_neg_mechs)
561*7f2fe78bSCy Schubert 	(
562*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
563*7f2fe78bSCy Schubert 	    gss_cred_id_t,		/* cred_handle */
564*7f2fe78bSCy Schubert 	    const gss_OID_set		/* mech_set */
565*7f2fe78bSCy Schubert 	/* */);
566*7f2fe78bSCy Schubert 
567*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_inquire_saslname_for_mech)
568*7f2fe78bSCy Schubert 	(
569*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
570*7f2fe78bSCy Schubert 	    const gss_OID,		/* desired_mech */
571*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* sasl_mech_name */
572*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* mech_name */
573*7f2fe78bSCy Schubert 	    gss_buffer_t		/* mech_description */
574*7f2fe78bSCy Schubert 	/* */);
575*7f2fe78bSCy Schubert 
576*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_inquire_mech_for_saslname)
577*7f2fe78bSCy Schubert 	(
578*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
579*7f2fe78bSCy Schubert 	    const gss_buffer_t,		/* sasl_mech_name */
580*7f2fe78bSCy Schubert 	    gss_OID *			/* mech_type */
581*7f2fe78bSCy Schubert 	/* */);
582*7f2fe78bSCy Schubert 
583*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_inquire_attrs_for_mech)
584*7f2fe78bSCy Schubert 	(
585*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
586*7f2fe78bSCy Schubert 	    gss_const_OID,		/* mech */
587*7f2fe78bSCy Schubert 	    gss_OID_set *,		/* mech_attrs */
588*7f2fe78bSCy Schubert 	    gss_OID_set *		/* known_mech_attrs */
589*7f2fe78bSCy Schubert 	/* */);
590*7f2fe78bSCy Schubert 
591*7f2fe78bSCy Schubert 	/* Credential store extensions */
592*7f2fe78bSCy Schubert 
593*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gss_acquire_cred_from)
594*7f2fe78bSCy Schubert 	(
595*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
596*7f2fe78bSCy Schubert 	    gss_name_t,			/* desired_name */
597*7f2fe78bSCy Schubert 	    OM_uint32,			/* time_req */
598*7f2fe78bSCy Schubert 	    gss_OID_set,		/* desired_mechs */
599*7f2fe78bSCy Schubert 	    gss_cred_usage_t,		/* cred_usage */
600*7f2fe78bSCy Schubert 	    gss_const_key_value_set_t,	/* cred_store */
601*7f2fe78bSCy Schubert 	    gss_cred_id_t *,		/* output_cred_handle */
602*7f2fe78bSCy Schubert 	    gss_OID_set *,		/* actual_mechs */
603*7f2fe78bSCy Schubert 	    OM_uint32 *			/* time_rec */
604*7f2fe78bSCy Schubert 	/* */);
605*7f2fe78bSCy Schubert 
606*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gss_store_cred_into)
607*7f2fe78bSCy Schubert 	(
608*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
609*7f2fe78bSCy Schubert 	    gss_cred_id_t,		/* input_cred_handle */
610*7f2fe78bSCy Schubert 	    gss_cred_usage_t,		/* input_usage */
611*7f2fe78bSCy Schubert 	    gss_OID,			/* desired_mech */
612*7f2fe78bSCy Schubert 	    OM_uint32,			/* overwrite_cred */
613*7f2fe78bSCy Schubert 	    OM_uint32,			/* default_cred */
614*7f2fe78bSCy Schubert 	    gss_const_key_value_set_t,	/* cred_store */
615*7f2fe78bSCy Schubert 	    gss_OID_set *,		/* elements_stored */
616*7f2fe78bSCy Schubert 	    gss_cred_usage_t *		/* cred_usage_stored */
617*7f2fe78bSCy Schubert 	/* */);
618*7f2fe78bSCy Schubert 
619*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gssspi_acquire_cred_with_password)
620*7f2fe78bSCy Schubert 	(
621*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
622*7f2fe78bSCy Schubert 	    const gss_name_t,		/* desired_name */
623*7f2fe78bSCy Schubert 	    const gss_buffer_t,	 /* password */
624*7f2fe78bSCy Schubert 	    OM_uint32,			/* time_req */
625*7f2fe78bSCy Schubert 	    const gss_OID_set,		/* desired_mechs */
626*7f2fe78bSCy Schubert 	    int,			/* cred_usage */
627*7f2fe78bSCy Schubert 	    gss_cred_id_t *,		/* output_cred_handle */
628*7f2fe78bSCy Schubert 	    gss_OID_set *,		/* actual_mechs */
629*7f2fe78bSCy Schubert 	    OM_uint32 *			/* time_rec */
630*7f2fe78bSCy Schubert 	/* */);
631*7f2fe78bSCy Schubert 
632*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gss_export_cred)
633*7f2fe78bSCy Schubert 	(
634*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
635*7f2fe78bSCy Schubert 	    gss_cred_id_t,		/* cred_handle */
636*7f2fe78bSCy Schubert 	    gss_buffer_t		/* token */
637*7f2fe78bSCy Schubert 	/* */);
638*7f2fe78bSCy Schubert 
639*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gss_import_cred)
640*7f2fe78bSCy Schubert 	(
641*7f2fe78bSCy Schubert 		OM_uint32 *,		/* minor_status */
642*7f2fe78bSCy Schubert 		gss_buffer_t,		/* token */
643*7f2fe78bSCy Schubert 		gss_cred_id_t *		/* cred_handle */
644*7f2fe78bSCy Schubert 	/* */);
645*7f2fe78bSCy Schubert 
646*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gssspi_import_sec_context_by_mech)
647*7f2fe78bSCy Schubert 	(
648*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
649*7f2fe78bSCy Schubert 	    gss_OID,			/* desired_mech */
650*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* interprocess_token */
651*7f2fe78bSCy Schubert 	    gss_ctx_id_t *		/* context_handle */
652*7f2fe78bSCy Schubert 	/* */);
653*7f2fe78bSCy Schubert 
654*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gssspi_import_name_by_mech)
655*7f2fe78bSCy Schubert 	(
656*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
657*7f2fe78bSCy Schubert 	    gss_OID,			/* mech_type */
658*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* input_name_buffer */
659*7f2fe78bSCy Schubert 	    gss_OID,			/* input_name_type */
660*7f2fe78bSCy Schubert 	    gss_name_t*			/* output_name */
661*7f2fe78bSCy Schubert 	/* */);
662*7f2fe78bSCy Schubert 
663*7f2fe78bSCy Schubert 	OM_uint32       (KRB5_CALLCONV *gssspi_import_cred_by_mech)
664*7f2fe78bSCy Schubert 	(
665*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
666*7f2fe78bSCy Schubert 	    gss_OID,			/* mech_type */
667*7f2fe78bSCy Schubert 	    gss_buffer_t,		/* token */
668*7f2fe78bSCy Schubert 	    gss_cred_id_t *		/* cred_handle */
669*7f2fe78bSCy Schubert 	/* */);
670*7f2fe78bSCy Schubert 
671*7f2fe78bSCy Schubert 	/* get_mic_iov extensions, added in 1.12 */
672*7f2fe78bSCy Schubert 
673*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_get_mic_iov)
674*7f2fe78bSCy Schubert 	(
675*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
676*7f2fe78bSCy Schubert 	    gss_ctx_id_t,		/* context_handle */
677*7f2fe78bSCy Schubert 	    gss_qop_t,			/* qop_req */
678*7f2fe78bSCy Schubert 	    gss_iov_buffer_desc *,	/* iov */
679*7f2fe78bSCy Schubert 	    int				/* iov_count */
680*7f2fe78bSCy Schubert 	);
681*7f2fe78bSCy Schubert 
682*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_verify_mic_iov)
683*7f2fe78bSCy Schubert 	(
684*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
685*7f2fe78bSCy Schubert 	    gss_ctx_id_t,		/* context_handle */
686*7f2fe78bSCy Schubert 	    gss_qop_t *,		/* qop_state */
687*7f2fe78bSCy Schubert 	    gss_iov_buffer_desc *,	/* iov */
688*7f2fe78bSCy Schubert 	    int				/* iov_count */
689*7f2fe78bSCy Schubert 	);
690*7f2fe78bSCy Schubert 
691*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gss_get_mic_iov_length)
692*7f2fe78bSCy Schubert 	(
693*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
694*7f2fe78bSCy Schubert 	    gss_ctx_id_t,		/* context_handle */
695*7f2fe78bSCy Schubert 	    gss_qop_t,			/* qop_req */
696*7f2fe78bSCy Schubert 	    gss_iov_buffer_desc *,	/* iov */
697*7f2fe78bSCy Schubert 	    int				/* iov_count */
698*7f2fe78bSCy Schubert 	);
699*7f2fe78bSCy Schubert 
700*7f2fe78bSCy Schubert 	/* NegoEx extensions added in 1.18 */
701*7f2fe78bSCy Schubert 
702*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gssspi_query_meta_data)
703*7f2fe78bSCy Schubert 	(
704*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
705*7f2fe78bSCy Schubert 	    gss_const_OID,		/* mech_oid */
706*7f2fe78bSCy Schubert 	    gss_cred_id_t,		/* cred_handle */
707*7f2fe78bSCy Schubert 	    gss_ctx_id_t *,		/* context_handle */
708*7f2fe78bSCy Schubert 	    const gss_name_t,		/* targ_name */
709*7f2fe78bSCy Schubert 	    OM_uint32,			/* req_flags */
710*7f2fe78bSCy Schubert 	    gss_buffer_t		/* meta_data */
711*7f2fe78bSCy Schubert 	/* */);
712*7f2fe78bSCy Schubert 
713*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gssspi_exchange_meta_data)
714*7f2fe78bSCy Schubert 	(
715*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
716*7f2fe78bSCy Schubert 	    gss_const_OID,		/* mech_oid */
717*7f2fe78bSCy Schubert 	    gss_cred_id_t,		/* cred_handle */
718*7f2fe78bSCy Schubert 	    gss_ctx_id_t *,		/* context_handle */
719*7f2fe78bSCy Schubert 	    const gss_name_t,		/* targ_name */
720*7f2fe78bSCy Schubert 	    OM_uint32,			/* req_flags */
721*7f2fe78bSCy Schubert 	    gss_const_buffer_t		/* meta_data */
722*7f2fe78bSCy Schubert 	/* */);
723*7f2fe78bSCy Schubert 
724*7f2fe78bSCy Schubert 	OM_uint32	(KRB5_CALLCONV *gssspi_query_mechanism_info)
725*7f2fe78bSCy Schubert 	(
726*7f2fe78bSCy Schubert 	    OM_uint32 *,		/* minor_status */
727*7f2fe78bSCy Schubert 	    gss_const_OID,		/* mech_oid */
728*7f2fe78bSCy Schubert 	    unsigned char[16]		/* auth_scheme */
729*7f2fe78bSCy Schubert 	/* */);
730*7f2fe78bSCy Schubert 
731*7f2fe78bSCy Schubert } *gss_mechanism;
732*7f2fe78bSCy Schubert 
733*7f2fe78bSCy Schubert /*
734*7f2fe78bSCy Schubert  * In the user space we use a wrapper structure to encompass the
735*7f2fe78bSCy Schubert  * mechanism entry points.  The wrapper contain the mechanism
736*7f2fe78bSCy Schubert  * entry points and other data which is only relevant to the gss-api
737*7f2fe78bSCy Schubert  * layer.  In the kernel we use only the gss_config structure because
738*7f2fe78bSCy Schubert  * the kernel does not cantain any of the extra gss-api specific data.
739*7f2fe78bSCy Schubert  */
740*7f2fe78bSCy Schubert typedef struct gss_mech_config {
741*7f2fe78bSCy Schubert 	char *kmodName;			/* kernel module name */
742*7f2fe78bSCy Schubert 	char *uLibName;			/* user library name */
743*7f2fe78bSCy Schubert 	char *mechNameStr;		/* mechanism string name */
744*7f2fe78bSCy Schubert 	char *optionStr;		/* optional mech parameters */
745*7f2fe78bSCy Schubert 	void *dl_handle;		/* RTLD object handle for the mech */
746*7f2fe78bSCy Schubert 	gss_OID mech_type;		/* mechanism oid */
747*7f2fe78bSCy Schubert 	gss_mechanism mech;		/* mechanism initialization struct */
748*7f2fe78bSCy Schubert  	int priority;			/* mechanism preference order */
749*7f2fe78bSCy Schubert 	int freeMech;			/* free mech table */
750*7f2fe78bSCy Schubert 	int is_interposer;		/* interposer mechanism flag */
751*7f2fe78bSCy Schubert 	gss_OID int_mech_type;		/* points to the interposer OID */
752*7f2fe78bSCy Schubert 	gss_mechanism int_mech;		/* points to the interposer mech */
753*7f2fe78bSCy Schubert 	struct gss_mech_config *next;	/* next element in the list */
754*7f2fe78bSCy Schubert } *gss_mech_info;
755*7f2fe78bSCy Schubert 
756*7f2fe78bSCy Schubert /********************************************************/
757*7f2fe78bSCy Schubert /* Internal mechglue routines */
758*7f2fe78bSCy Schubert 
759*7f2fe78bSCy Schubert OM_uint32 gssint_select_mech_type(OM_uint32 *minor, gss_const_OID in_oid,
760*7f2fe78bSCy Schubert 				  gss_OID *selected_oid);
761*7f2fe78bSCy Schubert gss_OID gssint_get_public_oid(gss_const_OID internal_oid);
762*7f2fe78bSCy Schubert OM_uint32 gssint_make_public_oid_set(OM_uint32 *minor_status, gss_OID oids,
763*7f2fe78bSCy Schubert 				     int count, gss_OID_set *public_set);
764*7f2fe78bSCy Schubert gss_mechanism gssint_get_mechanism (gss_const_OID);
765*7f2fe78bSCy Schubert OM_uint32 gssint_get_mech_type (gss_OID, gss_buffer_t);
766*7f2fe78bSCy Schubert char *gssint_get_kmodName(const gss_OID);
767*7f2fe78bSCy Schubert char *gssint_get_modOptions(const gss_OID);
768*7f2fe78bSCy Schubert OM_uint32 gssint_import_internal_name (OM_uint32 *, gss_OID, gss_union_name_t,
769*7f2fe78bSCy Schubert 				      gss_name_t *);
770*7f2fe78bSCy Schubert OM_uint32 gssint_export_internal_name(OM_uint32 *, const gss_OID,
771*7f2fe78bSCy Schubert 	const gss_name_t, gss_buffer_t);
772*7f2fe78bSCy Schubert OM_uint32 gssint_display_internal_name (OM_uint32 *, gss_OID, gss_name_t,
773*7f2fe78bSCy Schubert 				       gss_buffer_t, gss_OID *);
774*7f2fe78bSCy Schubert OM_uint32 gssint_release_internal_name (OM_uint32 *, gss_OID, gss_name_t *);
775*7f2fe78bSCy Schubert OM_uint32 gssint_delete_internal_sec_context (OM_uint32 *, gss_OID,
776*7f2fe78bSCy Schubert 					      gss_ctx_id_t *, gss_buffer_t);
777*7f2fe78bSCy Schubert #ifdef _GSS_STATIC_LINK
778*7f2fe78bSCy Schubert int gssint_register_mechinfo(gss_mech_info template);
779*7f2fe78bSCy Schubert #endif
780*7f2fe78bSCy Schubert 
781*7f2fe78bSCy Schubert OM_uint32 gssint_convert_name_to_union_name
782*7f2fe78bSCy Schubert 	  (OM_uint32 *,		/* minor_status */
783*7f2fe78bSCy Schubert 	   gss_mechanism,	/* mech */
784*7f2fe78bSCy Schubert 	   gss_name_t,		/* internal_name */
785*7f2fe78bSCy Schubert 	   gss_name_t *		/* external_name */
786*7f2fe78bSCy Schubert 	   );
787*7f2fe78bSCy Schubert gss_cred_id_t gssint_get_mechanism_cred
788*7f2fe78bSCy Schubert 	  (gss_union_cred_t,	/* union_cred */
789*7f2fe78bSCy Schubert 	   gss_OID		/* mech_type */
790*7f2fe78bSCy Schubert 	   );
791*7f2fe78bSCy Schubert 
792*7f2fe78bSCy Schubert OM_uint32 gssint_create_copy_buffer(
793*7f2fe78bSCy Schubert 	const gss_buffer_t,	/* src buffer */
794*7f2fe78bSCy Schubert 	gss_buffer_t *,		/* destination buffer */
795*7f2fe78bSCy Schubert 	int			/* NULL terminate buffer ? */
796*7f2fe78bSCy Schubert );
797*7f2fe78bSCy Schubert 
798*7f2fe78bSCy Schubert OM_uint32 gssint_create_union_context(
799*7f2fe78bSCy Schubert 	OM_uint32 *minor,	/* minor_status */
800*7f2fe78bSCy Schubert 	gss_const_OID,		/* mech_oid */
801*7f2fe78bSCy Schubert 	gss_union_ctx_id_t *	/* ctx_out */
802*7f2fe78bSCy Schubert );
803*7f2fe78bSCy Schubert 
804*7f2fe78bSCy Schubert OM_uint32 gssint_copy_oid_set(
805*7f2fe78bSCy Schubert 	OM_uint32 *,			/* minor_status */
806*7f2fe78bSCy Schubert 	const gss_OID_set_desc * const,	/* oid set */
807*7f2fe78bSCy Schubert 	gss_OID_set *			/* new oid set */
808*7f2fe78bSCy Schubert );
809*7f2fe78bSCy Schubert 
810*7f2fe78bSCy Schubert gss_OID gss_find_mechanism_from_name_type (gss_OID); /* name_type */
811*7f2fe78bSCy Schubert 
812*7f2fe78bSCy Schubert OM_uint32 gss_add_mech_name_type
813*7f2fe78bSCy Schubert 	   (OM_uint32 *,	/* minor_status */
814*7f2fe78bSCy Schubert 	    gss_OID,		/* name_type */
815*7f2fe78bSCy Schubert 	    gss_OID		/* mech */
816*7f2fe78bSCy Schubert 	       );
817*7f2fe78bSCy Schubert 
818*7f2fe78bSCy Schubert /*
819*7f2fe78bSCy Schubert  * Sun extensions to GSS-API v2
820*7f2fe78bSCy Schubert  */
821*7f2fe78bSCy Schubert 
822*7f2fe78bSCy Schubert OM_uint32
823*7f2fe78bSCy Schubert gssint_wrap_aead (gss_mechanism,	/* mech */
824*7f2fe78bSCy Schubert 		  OM_uint32 *,		/* minor_status */
825*7f2fe78bSCy Schubert 		  gss_union_ctx_id_t,	/* ctx */
826*7f2fe78bSCy Schubert 		  int,			/* conf_req_flag */
827*7f2fe78bSCy Schubert 		  gss_qop_t,		/* qop_req_flag */
828*7f2fe78bSCy Schubert 		  gss_buffer_t,		/* input_assoc_buffer */
829*7f2fe78bSCy Schubert 		  gss_buffer_t,		/* input_payload_buffer */
830*7f2fe78bSCy Schubert 		  int *,		/* conf_state */
831*7f2fe78bSCy Schubert 		  gss_buffer_t);	/* output_message_buffer */
832*7f2fe78bSCy Schubert OM_uint32
833*7f2fe78bSCy Schubert gssint_unwrap_aead (gss_mechanism,	/* mech */
834*7f2fe78bSCy Schubert 		    OM_uint32 *,	/* minor_status */
835*7f2fe78bSCy Schubert 		    gss_union_ctx_id_t,	/* ctx */
836*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* input_message_buffer */
837*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* input_assoc_buffer */
838*7f2fe78bSCy Schubert 		    gss_buffer_t,	/* output_payload_buffer */
839*7f2fe78bSCy Schubert 		    int *,		/* conf_state */
840*7f2fe78bSCy Schubert 		    gss_qop_t *);	/* qop_state */
841*7f2fe78bSCy Schubert 
842*7f2fe78bSCy Schubert 
843*7f2fe78bSCy Schubert /* Use this to map an error code that was returned from a mech
844*7f2fe78bSCy Schubert    operation; the mech will be asked to produce the associated error
845*7f2fe78bSCy Schubert    messages.
846*7f2fe78bSCy Schubert 
847*7f2fe78bSCy Schubert    Remember that if the minor status code cannot be returned to the
848*7f2fe78bSCy Schubert    caller (e.g., if it's stuffed in an automatic variable and then
849*7f2fe78bSCy Schubert    ignored), then we don't care about producing a mapping.  */
850*7f2fe78bSCy Schubert #define map_error(MINORP, MECH) \
851*7f2fe78bSCy Schubert     (*(MINORP) = gssint_mecherrmap_map(*(MINORP), &(MECH)->mech_type))
852*7f2fe78bSCy Schubert #define map_error_oid(MINORP, MECHOID) \
853*7f2fe78bSCy Schubert     (*(MINORP) = gssint_mecherrmap_map(*(MINORP), (MECHOID)))
854*7f2fe78bSCy Schubert 
855*7f2fe78bSCy Schubert /* Use this to map an errno value or com_err error code being
856*7f2fe78bSCy Schubert    generated within the mechglue code (e.g., by calling generic oid
857*7f2fe78bSCy Schubert    ops).  Any errno or com_err values produced by mech operations
858*7f2fe78bSCy Schubert    should be processed with map_error.  This means they'll be stored
859*7f2fe78bSCy Schubert    separately even if the mech uses com_err, because we can't assume
860*7f2fe78bSCy Schubert    that it will use com_err.  */
861*7f2fe78bSCy Schubert #define map_errcode(MINORP) \
862*7f2fe78bSCy Schubert     (*(MINORP) = gssint_mecherrmap_map_errcode(*(MINORP)))
863*7f2fe78bSCy Schubert 
864*7f2fe78bSCy Schubert #endif /* _GSS_MECHGLUEP_H */
865