xref: /freebsd/crypto/heimdal/lib/gssapi/gssapi_mech.h (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1 /*-
2  * Copyright (c) 2005 Doug Rabson
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  *	$FreeBSD$
27  */
28 
29 #ifndef GSSAPI_MECH_H
30 #define GSSAPI_MECH_H 1
31 
32 #include <gssapi.h>
33 
34 typedef OM_uint32 GSSAPI_CALLCONV _gss_acquire_cred_t
35 	      (OM_uint32 *,            /* minor_status */
36 	       const gss_name_t,       /* desired_name */
37 	       OM_uint32,              /* time_req */
38 	       const gss_OID_set,      /* desired_mechs */
39 	       gss_cred_usage_t,       /* cred_usage */
40 	       gss_cred_id_t *,        /* output_cred_handle */
41 	       gss_OID_set *,          /* actual_mechs */
42 	       OM_uint32 *             /* time_rec */
43 	      );
44 
45 typedef OM_uint32 GSSAPI_CALLCONV _gss_release_cred_t
46 	      (OM_uint32 *,            /* minor_status */
47 	       gss_cred_id_t *         /* cred_handle */
48 	      );
49 
50 typedef OM_uint32 GSSAPI_CALLCONV _gss_init_sec_context_t
51 	      (OM_uint32 *,            /* minor_status */
52 	       const gss_cred_id_t,    /* initiator_cred_handle */
53 	       gss_ctx_id_t *,         /* context_handle */
54 	       const gss_name_t,       /* target_name */
55 	       const gss_OID,          /* mech_type */
56 	       OM_uint32,              /* req_flags */
57 	       OM_uint32,              /* time_req */
58 	       const gss_channel_bindings_t,
59 				       /* input_chan_bindings */
60 	       const gss_buffer_t,     /* input_token */
61 	       gss_OID *,              /* actual_mech_type */
62 	       gss_buffer_t,           /* output_token */
63 	       OM_uint32 *,            /* ret_flags */
64 	       OM_uint32 *             /* time_rec */
65 	      );
66 
67 typedef OM_uint32 GSSAPI_CALLCONV _gss_accept_sec_context_t
68 	      (OM_uint32 *,            /* minor_status */
69 	       gss_ctx_id_t *,         /* context_handle */
70 	       const gss_cred_id_t,    /* acceptor_cred_handle */
71 	       const gss_buffer_t,     /* input_token_buffer */
72 	       const gss_channel_bindings_t,
73 				       /* input_chan_bindings */
74 	       gss_name_t *,           /* src_name */
75 	       gss_OID *,              /* mech_type */
76 	       gss_buffer_t,           /* output_token */
77 	       OM_uint32 *,            /* ret_flags */
78 	       OM_uint32 *,            /* time_rec */
79 	       gss_cred_id_t *         /* delegated_cred_handle */
80 	      );
81 
82 typedef OM_uint32 GSSAPI_CALLCONV _gss_process_context_token_t
83 	      (OM_uint32 *,            /* minor_status */
84 	       const gss_ctx_id_t,     /* context_handle */
85 	       const gss_buffer_t      /* token_buffer */
86 	      );
87 
88 typedef OM_uint32 GSSAPI_CALLCONV _gss_delete_sec_context_t
89 	      (OM_uint32 *,            /* minor_status */
90 	       gss_ctx_id_t *,         /* context_handle */
91 	       gss_buffer_t            /* output_token */
92 	      );
93 
94 typedef OM_uint32 GSSAPI_CALLCONV _gss_context_time_t
95 	      (OM_uint32 *,            /* minor_status */
96 	       const gss_ctx_id_t,     /* context_handle */
97 	       OM_uint32 *             /* time_rec */
98 	      );
99 
100 typedef OM_uint32 GSSAPI_CALLCONV _gss_get_mic_t
101 	      (OM_uint32 *,            /* minor_status */
102 	       const gss_ctx_id_t,     /* context_handle */
103 	       gss_qop_t,              /* qop_req */
104 	       const gss_buffer_t,     /* message_buffer */
105 	       gss_buffer_t            /* message_token */
106 	      );
107 
108 typedef OM_uint32 GSSAPI_CALLCONV _gss_verify_mic_t
109 	      (OM_uint32 *,            /* minor_status */
110 	       const gss_ctx_id_t,     /* context_handle */
111 	       const gss_buffer_t,     /* message_buffer */
112 	       const gss_buffer_t,     /* token_buffer */
113 	       gss_qop_t *             /* qop_state */
114 	      );
115 
116 typedef OM_uint32 GSSAPI_CALLCONV _gss_wrap_t
117 	      (OM_uint32 *,            /* minor_status */
118 	       const gss_ctx_id_t,     /* context_handle */
119 	       int,                    /* conf_req_flag */
120 	       gss_qop_t,              /* qop_req */
121 	       const gss_buffer_t,     /* input_message_buffer */
122 	       int *,                  /* conf_state */
123 	       gss_buffer_t            /* output_message_buffer */
124 	      );
125 
126 typedef OM_uint32 GSSAPI_CALLCONV _gss_unwrap_t
127 	      (OM_uint32 *,            /* minor_status */
128 	       const gss_ctx_id_t,     /* context_handle */
129 	       const gss_buffer_t,     /* input_message_buffer */
130 	       gss_buffer_t,           /* output_message_buffer */
131 	       int *,                  /* conf_state */
132 	       gss_qop_t *             /* qop_state */
133 	      );
134 
135 typedef OM_uint32 GSSAPI_CALLCONV _gss_display_status_t
136 	      (OM_uint32 *,            /* minor_status */
137 	       OM_uint32,              /* status_value */
138 	       int,                    /* status_type */
139 	       const gss_OID,          /* mech_type */
140 	       OM_uint32 *,            /* message_context */
141 	       gss_buffer_t            /* status_string */
142 	      );
143 
144 typedef OM_uint32 GSSAPI_CALLCONV _gss_indicate_mechs_t
145 	      (OM_uint32 *,            /* minor_status */
146 	       gss_OID_set *           /* mech_set */
147 	      );
148 
149 typedef OM_uint32 GSSAPI_CALLCONV _gss_compare_name_t
150 	      (OM_uint32 *,            /* minor_status */
151 	       const gss_name_t,       /* name1 */
152 	       const gss_name_t,       /* name2 */
153 	       int *                   /* name_equal */
154 	      );
155 
156 typedef OM_uint32 GSSAPI_CALLCONV _gss_display_name_t
157 	      (OM_uint32 *,            /* minor_status */
158 	       const gss_name_t,       /* input_name */
159 	       gss_buffer_t,           /* output_name_buffer */
160 	       gss_OID *               /* output_name_type */
161 	      );
162 
163 typedef OM_uint32 GSSAPI_CALLCONV _gss_import_name_t
164 	      (OM_uint32 *,            /* minor_status */
165 	       const gss_buffer_t,     /* input_name_buffer */
166 	       const gss_OID,          /* input_name_type */
167 	       gss_name_t *            /* output_name */
168 	      );
169 
170 typedef OM_uint32 GSSAPI_CALLCONV _gss_export_name_t
171 	      (OM_uint32 *,            /* minor_status */
172 	       const gss_name_t,       /* input_name */
173 	       gss_buffer_t            /* exported_name */
174 	      );
175 
176 typedef OM_uint32 GSSAPI_CALLCONV _gss_release_name_t
177 	      (OM_uint32 *,            /* minor_status */
178 	       gss_name_t *            /* input_name */
179 	      );
180 
181 typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_t
182 	      (OM_uint32 *,            /* minor_status */
183 	       const gss_cred_id_t,    /* cred_handle */
184 	       gss_name_t *,           /* name */
185 	       OM_uint32 *,            /* lifetime */
186 	       gss_cred_usage_t *,     /* cred_usage */
187 	       gss_OID_set *           /* mechanisms */
188 	      );
189 
190 typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_context_t
191 	      (OM_uint32 *,            /* minor_status */
192 	       const gss_ctx_id_t,     /* context_handle */
193 	       gss_name_t *,           /* src_name */
194 	       gss_name_t *,           /* targ_name */
195 	       OM_uint32 *,            /* lifetime_rec */
196 	       gss_OID *,              /* mech_type */
197 	       OM_uint32 *,            /* ctx_flags */
198 	       int *,                  /* locally_initiated */
199 	       int *                   /* open */
200 	      );
201 
202 typedef OM_uint32 GSSAPI_CALLCONV _gss_wrap_size_limit_t
203 	      (OM_uint32 *,            /* minor_status */
204 	       const gss_ctx_id_t,     /* context_handle */
205 	       int,                    /* conf_req_flag */
206 	       gss_qop_t,              /* qop_req */
207 	       OM_uint32,              /* req_output_size */
208 	       OM_uint32 *             /* max_input_size */
209 	      );
210 
211 typedef OM_uint32 GSSAPI_CALLCONV _gss_add_cred_t (
212 	       OM_uint32 *,            /* minor_status */
213 	       const gss_cred_id_t,    /* input_cred_handle */
214 	       const gss_name_t,       /* desired_name */
215 	       const gss_OID,          /* desired_mech */
216 	       gss_cred_usage_t,       /* cred_usage */
217 	       OM_uint32,              /* initiator_time_req */
218 	       OM_uint32,              /* acceptor_time_req */
219 	       gss_cred_id_t *,        /* output_cred_handle */
220 	       gss_OID_set *,          /* actual_mechs */
221 	       OM_uint32 *,            /* initiator_time_rec */
222 	       OM_uint32 *             /* acceptor_time_rec */
223 	      );
224 
225 typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_by_mech_t (
226 	       OM_uint32 *,            /* minor_status */
227 	       const gss_cred_id_t,    /* cred_handle */
228 	       const gss_OID,          /* mech_type */
229 	       gss_name_t *,           /* name */
230 	       OM_uint32 *,            /* initiator_lifetime */
231 	       OM_uint32 *,            /* acceptor_lifetime */
232 	       gss_cred_usage_t *      /* cred_usage */
233 	      );
234 
235 typedef OM_uint32 GSSAPI_CALLCONV _gss_export_sec_context_t (
236 	       OM_uint32 *,            /* minor_status */
237 	       gss_ctx_id_t *,         /* context_handle */
238 	       gss_buffer_t            /* interprocess_token */
239 	      );
240 
241 typedef OM_uint32 GSSAPI_CALLCONV _gss_import_sec_context_t (
242 	       OM_uint32 *,            /* minor_status */
243 	       const gss_buffer_t,     /* interprocess_token */
244 	       gss_ctx_id_t *          /* context_handle */
245 	      );
246 
247 typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_names_for_mech_t (
248 	       OM_uint32 *,            /* minor_status */
249 	       const gss_OID,          /* mechanism */
250 	       gss_OID_set *           /* name_types */
251 	      );
252 
253 typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_mechs_for_name_t (
254 	       OM_uint32 *,            /* minor_status */
255 	       const gss_name_t,       /* input_name */
256 	       gss_OID_set *           /* mech_types */
257 	      );
258 
259 typedef OM_uint32 GSSAPI_CALLCONV _gss_canonicalize_name_t (
260 	       OM_uint32 *,            /* minor_status */
261 	       const gss_name_t,       /* input_name */
262 	       const gss_OID,          /* mech_type */
263 	       gss_name_t *            /* output_name */
264 	      );
265 
266 typedef OM_uint32 GSSAPI_CALLCONV _gss_duplicate_name_t (
267 	       OM_uint32 *,            /* minor_status */
268 	       const gss_name_t,       /* src_name */
269 	       gss_name_t *            /* dest_name */
270 	      );
271 
272 typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_sec_context_by_oid (
273 	       OM_uint32 *minor_status,
274 	       const gss_ctx_id_t context_handle,
275 	       const gss_OID desired_object,
276 	       gss_buffer_set_t *data_set
277 	      );
278 
279 typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_by_oid (
280 	       OM_uint32 *minor_status,
281 	       const gss_cred_id_t cred,
282 	       const gss_OID desired_object,
283 	       gss_buffer_set_t *data_set
284 	      );
285 
286 typedef OM_uint32 GSSAPI_CALLCONV _gss_set_sec_context_option (
287 	       OM_uint32 *minor_status,
288 	       gss_ctx_id_t *cred_handle,
289 	       const gss_OID desired_object,
290 	       const gss_buffer_t value
291  	      );
292 
293 typedef OM_uint32 GSSAPI_CALLCONV _gss_set_cred_option (
294 	       OM_uint32 *minor_status,
295 	       gss_cred_id_t *cred_handle,
296 	       const gss_OID desired_object,
297 	       const gss_buffer_t value
298  	      );
299 
300 
301 typedef OM_uint32 GSSAPI_CALLCONV _gss_pseudo_random(
302     	       OM_uint32 *minor_status,
303 	       gss_ctx_id_t context,
304 	       int prf_key,
305 	       const gss_buffer_t prf_in,
306 	       ssize_t desired_output_len,
307 	       gss_buffer_t prf_out
308               );
309 
310 typedef OM_uint32 GSSAPI_CALLCONV
311 _gss_wrap_iov_t(OM_uint32 *minor_status,
312 		gss_ctx_id_t  context_handle,
313 		int conf_req_flag,
314 		gss_qop_t qop_req,
315 		int * conf_state,
316 		gss_iov_buffer_desc *iov,
317 		int iov_count);
318 
319 typedef OM_uint32 GSSAPI_CALLCONV
320 _gss_unwrap_iov_t(OM_uint32 *minor_status,
321 		  gss_ctx_id_t context_handle,
322 		  int *conf_state,
323 		  gss_qop_t *qop_state,
324 		  gss_iov_buffer_desc *iov,
325 		  int iov_count);
326 
327 typedef OM_uint32 GSSAPI_CALLCONV
328 _gss_wrap_iov_length_t(OM_uint32 * minor_status,
329 		       gss_ctx_id_t context_handle,
330 		       int conf_req_flag,
331 		       gss_qop_t qop_req,
332 		       int *conf_state,
333 		       gss_iov_buffer_desc *iov,
334 		       int iov_count);
335 
336 typedef OM_uint32 GSSAPI_CALLCONV
337 _gss_store_cred_t(OM_uint32         *minor_status,
338 		  gss_cred_id_t     input_cred_handle,
339 		  gss_cred_usage_t  cred_usage,
340 		  const gss_OID     desired_mech,
341 		  OM_uint32         overwrite_cred,
342 		  OM_uint32         default_cred,
343 		  gss_OID_set       *elements_stored,
344 		  gss_cred_usage_t  *cred_usage_stored);
345 
346 typedef OM_uint32 GSSAPI_CALLCONV
347 _gss_export_cred_t(OM_uint32 *minor_status,
348 		   gss_cred_id_t cred_handle,
349 		   gss_buffer_t cred_token);
350 
351 typedef OM_uint32 GSSAPI_CALLCONV
352 _gss_import_cred_t(OM_uint32 * minor_status,
353 		   gss_buffer_t cred_token,
354 		   gss_cred_id_t * cred_handle);
355 
356 
357 typedef OM_uint32 GSSAPI_CALLCONV
358 _gss_acquire_cred_ext_t(OM_uint32 * /*minor_status */,
359 		        const gss_name_t /* desired_name */,
360 		        gss_const_OID /* credential_type */,
361 		        const void * /* credential_data */,
362 		        OM_uint32 /* time_req */,
363 		        gss_const_OID /* desired_mech */,
364 		        gss_cred_usage_t /* cred_usage */,
365 		        gss_cred_id_t * /* output_cred_handle */);
366 
367 typedef void GSSAPI_CALLCONV
368 _gss_iter_creds_t(OM_uint32 /* flags */,
369 		  void * /* userctx */,
370 		  void (* /*cred_iter */ )(void *, gss_OID, gss_cred_id_t));
371 
372 typedef OM_uint32 GSSAPI_CALLCONV
373 _gss_destroy_cred_t(OM_uint32 * /* minor_status */,
374 		    gss_cred_id_t * /* cred */);
375 
376 typedef OM_uint32 GSSAPI_CALLCONV
377 _gss_cred_hold_t(OM_uint32 * /* minor_status */,
378 		 gss_cred_id_t /* cred */);
379 
380 typedef OM_uint32 GSSAPI_CALLCONV
381 _gss_cred_unhold_t(OM_uint32 * /* minor_status */,
382 		   gss_cred_id_t /* cred */);
383 
384 typedef OM_uint32 GSSAPI_CALLCONV
385 _gss_cred_label_set_t(OM_uint32 * /* minor_status */,
386 		      gss_cred_id_t /* cred */,
387 		      const char * /* label */,
388 		      gss_buffer_t /* value */);
389 
390 typedef OM_uint32 GSSAPI_CALLCONV
391 _gss_cred_label_get_t(OM_uint32 * /* minor_status */,
392 		      gss_cred_id_t /* cred */,
393 		      const char * /* label */,
394 		      gss_buffer_t /* value */);
395 
396 typedef OM_uint32 GSSAPI_CALLCONV _gss_display_name_ext_t (
397 	       OM_uint32 *,            /* minor_status */
398 	       gss_name_t,             /* name */
399 	       gss_OID,                /* display_as_name_type */
400 	       gss_buffer_t            /* display_name */
401 	      );
402 
403 typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_name_t (
404 	       OM_uint32 *,            /* minor_status */
405 	       gss_name_t,             /* name */
406 	       int *,                  /* name_is_MN */
407 	       gss_OID *,              /* MN_mech */
408 	       gss_buffer_set_t *      /* attrs */
409 	      );
410 
411 typedef OM_uint32 GSSAPI_CALLCONV _gss_get_name_attribute_t (
412 	       OM_uint32 *,	      /* minor_status */
413 	       gss_name_t,            /* name */
414 	       gss_buffer_t,          /* attr */
415 	       int *,                 /* authenticated */
416 	       int *,                 /* complete */
417 	       gss_buffer_t,          /* value */
418 	       gss_buffer_t,          /* display_value */
419 	       int *                  /* more */
420 	    );
421 
422 typedef OM_uint32 GSSAPI_CALLCONV _gss_set_name_attribute_t (
423 	       OM_uint32 *,           /* minor_status */
424 	       gss_name_t,            /* name */
425 	       int,                   /* complete */
426 	       gss_buffer_t,          /* attr */
427 	       gss_buffer_t           /* value */
428 	    );
429 
430 typedef OM_uint32 GSSAPI_CALLCONV _gss_delete_name_attribute_t (
431 	       OM_uint32 *,           /* minor_status */
432 	       gss_name_t,            /* name */
433 	       gss_buffer_t           /* attr */
434 	    );
435 
436 typedef OM_uint32 GSSAPI_CALLCONV _gss_export_name_composite_t (
437 	       OM_uint32 *,           /* minor_status */
438 	       gss_name_t,            /* name */
439 	       gss_buffer_t           /* exp_composite_name */
440 	    );
441 
442 /*
443  *
444  */
445 
446 typedef struct gss_mo_desc_struct gss_mo_desc;
447 
448 typedef OM_uint32 GSSAPI_CALLCONV
449 _gss_mo_init (OM_uint32 *, gss_OID, gss_mo_desc **, size_t *);
450 
451 
452 struct gss_mo_desc_struct {
453     gss_OID option;
454     OM_uint32 flags;
455 #define GSS_MO_MA		1
456 #define GSS_MO_MA_CRITICAL	2
457     const char *name;
458     void *ctx;
459     int (*get)(gss_const_OID, gss_mo_desc *, gss_buffer_t);
460     int (*set)(gss_const_OID, gss_mo_desc *, int, gss_buffer_t);
461 };
462 
463 typedef OM_uint32 GSSAPI_CALLCONV _gss_pname_to_uid_t (
464 	       OM_uint32 *,		/* minor_status */
465 	       const gss_name_t,	/* name */
466 	       const gss_OID,		/* mech_type */
467 	       uid_t *			/* uidOut */
468 	      );
469 
470 typedef OM_uint32 GSSAPI_CALLCONV _gss_authorize_localname_t (
471 	       OM_uint32 *,		/* minor_status */
472 	       const gss_name_t,	/* name */
473 	       gss_const_buffer_t,	/* user */
474 	       gss_const_OID		/* user_name_type */
475 	      );
476 
477 /* mechglue internal */
478 struct gss_mech_compat_desc_struct;
479 
480 #define GMI_VERSION 5
481 
482 /* gm_flags */
483 #define GM_USE_MG_CRED      	1	/* uses mech glue credentials */
484 
485 typedef struct gssapi_mech_interface_desc {
486 	unsigned			gm_version;
487 	const char			*gm_name;
488 	gss_OID_desc			gm_mech_oid;
489         unsigned			gm_flags;
490 	_gss_acquire_cred_t		*gm_acquire_cred;
491 	_gss_release_cred_t		*gm_release_cred;
492 	_gss_init_sec_context_t		*gm_init_sec_context;
493 	_gss_accept_sec_context_t	*gm_accept_sec_context;
494 	_gss_process_context_token_t	*gm_process_context_token;
495 	_gss_delete_sec_context_t	*gm_delete_sec_context;
496 	_gss_context_time_t		*gm_context_time;
497 	_gss_get_mic_t			*gm_get_mic;
498 	_gss_verify_mic_t		*gm_verify_mic;
499 	_gss_wrap_t			*gm_wrap;
500 	_gss_unwrap_t			*gm_unwrap;
501 	_gss_display_status_t		*gm_display_status;
502 	_gss_indicate_mechs_t		*gm_indicate_mechs;
503 	_gss_compare_name_t		*gm_compare_name;
504 	_gss_display_name_t		*gm_display_name;
505 	_gss_import_name_t		*gm_import_name;
506 	_gss_export_name_t		*gm_export_name;
507 	_gss_release_name_t		*gm_release_name;
508 	_gss_inquire_cred_t		*gm_inquire_cred;
509 	_gss_inquire_context_t		*gm_inquire_context;
510 	_gss_wrap_size_limit_t		*gm_wrap_size_limit;
511 	_gss_add_cred_t			*gm_add_cred;
512 	_gss_inquire_cred_by_mech_t	*gm_inquire_cred_by_mech;
513 	_gss_export_sec_context_t	*gm_export_sec_context;
514 	_gss_import_sec_context_t	*gm_import_sec_context;
515 	_gss_inquire_names_for_mech_t	*gm_inquire_names_for_mech;
516 	_gss_inquire_mechs_for_name_t	*gm_inquire_mechs_for_name;
517 	_gss_canonicalize_name_t	*gm_canonicalize_name;
518 	_gss_duplicate_name_t		*gm_duplicate_name;
519 	_gss_inquire_sec_context_by_oid	*gm_inquire_sec_context_by_oid;
520 	_gss_inquire_cred_by_oid	*gm_inquire_cred_by_oid;
521 	_gss_set_sec_context_option	*gm_set_sec_context_option;
522 	_gss_set_cred_option		*gm_set_cred_option;
523 	_gss_pseudo_random		*gm_pseudo_random;
524 	_gss_wrap_iov_t			*gm_wrap_iov;
525 	_gss_unwrap_iov_t		*gm_unwrap_iov;
526 	_gss_wrap_iov_length_t		*gm_wrap_iov_length;
527 	_gss_store_cred_t		*gm_store_cred;
528 	_gss_export_cred_t		*gm_export_cred;
529 	_gss_import_cred_t		*gm_import_cred;
530 	_gss_acquire_cred_ext_t		*gm_acquire_cred_ext;
531 	_gss_iter_creds_t		*gm_iter_creds;
532 	_gss_destroy_cred_t		*gm_destroy_cred;
533 	_gss_cred_hold_t		*gm_cred_hold;
534 	_gss_cred_unhold_t		*gm_cred_unhold;
535 	_gss_cred_label_get_t		*gm_cred_label_get;
536 	_gss_cred_label_set_t		*gm_cred_label_set;
537         gss_mo_desc			*gm_mo;
538         size_t				 gm_mo_num;
539         _gss_pname_to_uid_t             *gm_pname_to_uid;
540         _gss_authorize_localname_t      *gm_authorize_localname;
541         _gss_display_name_ext_t         *gm_display_name_ext;
542         _gss_inquire_name_t             *gm_inquire_name;
543         _gss_get_name_attribute_t       *gm_get_name_attribute;
544         _gss_set_name_attribute_t       *gm_set_name_attribute;
545         _gss_delete_name_attribute_t    *gm_delete_name_attribute;
546         _gss_export_name_composite_t    *gm_export_name_composite;
547         struct gss_mech_compat_desc_struct  *gm_compat;
548 } gssapi_mech_interface_desc, *gssapi_mech_interface;
549 
550 gssapi_mech_interface
551 __gss_get_mechanism(gss_const_OID /* oid */);
552 
553 gssapi_mech_interface __gss_spnego_initialize(void);
554 gssapi_mech_interface __gss_krb5_initialize(void);
555 gssapi_mech_interface __gss_ntlm_initialize(void);
556 
557 void		gss_mg_collect_error(gss_OID, OM_uint32, OM_uint32);
558 
559 int _gss_mo_get_option_1(gss_const_OID, gss_mo_desc *, gss_buffer_t);
560 int _gss_mo_get_option_0(gss_const_OID, gss_mo_desc *, gss_buffer_t);
561 int _gss_mo_get_ctx_as_string(gss_const_OID, gss_mo_desc *, gss_buffer_t);
562 
563 struct _gss_oid_name_table {
564     gss_OID oid;
565     const char *name;
566     const char *short_desc;
567     const char *long_desc;
568 };
569 
570 extern struct _gss_oid_name_table _gss_ont_mech[];
571 extern struct _gss_oid_name_table _gss_ont_ma[];
572 
573 /*
574  * Extended credentials acqusition API, not to be exported until
575  * it or something equivalent has been standardised.
576  */
577 extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_cred_password_oid_desc;
578 #define GSS_C_CRED_PASSWORD (&__gss_c_cred_password_oid_desc)
579 
580 extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_cred_certificate_oid_desc;
581 #define GSS_C_CRED_CERTIFICATE (&__gss_c_cred_certificate_oid_desc)
582 
583 OM_uint32 _gss_acquire_cred_ext
584            (OM_uint32 * /*minor_status*/,
585             const gss_name_t /*desired_name*/,
586             gss_const_OID /*credential_type*/,
587             const void * /*credential_data*/,
588             OM_uint32 /*time_req*/,
589             gss_const_OID /*desired_mech*/,
590             gss_cred_usage_t /*cred_usage*/,
591             gss_cred_id_t * /*output_cred_handle*/
592            );
593 
594 #endif /* GSSAPI_MECH_H */
595