gssapi.h revision 179021
1/*
2 * Copyright (C) The Internet Society (2000).  All Rights Reserved.
3 *
4 * This document and translations of it may be copied and furnished to
5 * others, and derivative works that comment on or otherwise explain it
6 * or assist in its implementation may be prepared, copied, published
7 * and distributed, in whole or in part, without restriction of any
8 * kind, provided that the above copyright notice and this paragraph are
9 * included on all such copies and derivative works.  However, this
10 * document itself may not be modified in any way, such as by removing
11 * the copyright notice or references to the Internet Society or other
12 * Internet organizations, except as needed for the purpose of
13 * developing Internet standards in which case the procedures for
14 * copyrights defined in the Internet Standards process must be
15 * followed, or as required to translate it into languages other than
16 * English.
17 *
18 * The limited permissions granted above are perpetual and will not be
19 * revoked by the Internet Society or its successors or assigns.
20 *
21 * This document and the information contained herein is provided on an
22 * "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
23 * TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
24 * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
25 * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
26 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 * $FreeBSD: head/include/gssapi/gssapi.h 179021 2008-05-15 19:55:19Z dfr $
29 */
30
31#ifndef _GSSAPI_GSSAPI_H_
32#define _GSSAPI_GSSAPI_H_
33
34/*
35 * First, include stddef.h to get size_t defined.
36 */
37#include <stddef.h>
38
39/*
40 * Include stdint.h to get explicitly sized data types.
41 */
42#include <stdint.h>
43
44#ifndef _SSIZE_T_DECLARED
45typedef	__ssize_t	ssize_t;
46#define	_SSIZE_T_DECLARED
47#endif
48
49#if 0
50/*
51 * If the platform supports the xom.h header file, it should be
52 * included here.
53 */
54#include <xom.h>
55#endif
56
57
58/*
59 * Now define the three implementation-dependent types.
60 */
61typedef struct _gss_ctx_id_t *gss_ctx_id_t;
62typedef struct _gss_cred_id_t *gss_cred_id_t;
63typedef struct _gss_name_t *gss_name_t;
64
65/*
66 * The following type must be defined as the smallest natural
67 * unsigned integer supported by the platform that has at least
68 * 32 bits of precision.
69 */
70typedef uint32_t gss_uint32;
71
72
73#ifdef OM_STRING
74/*
75 * We have included the xom.h header file.  Verify that OM_uint32
76 * is defined correctly.
77 */
78
79#if sizeof(gss_uint32) != sizeof(OM_uint32)
80#error Incompatible definition of OM_uint32 from xom.h
81#endif
82
83typedef OM_object_identifier gss_OID_desc, *gss_OID;
84
85#else
86
87/*
88 * We can't use X/Open definitions, so roll our own.
89 */
90
91typedef gss_uint32 OM_uint32;
92typedef uint64_t OM_uint64;
93
94typedef struct gss_OID_desc_struct {
95  OM_uint32 length;
96  void      *elements;
97} gss_OID_desc, *gss_OID;
98
99#endif
100
101typedef struct gss_OID_set_desc_struct  {
102  size_t     count;
103  gss_OID    elements;
104} gss_OID_set_desc, *gss_OID_set;
105
106typedef struct gss_buffer_desc_struct {
107  size_t length;
108  void *value;
109} gss_buffer_desc, *gss_buffer_t;
110
111typedef struct gss_channel_bindings_struct {
112  OM_uint32 initiator_addrtype;
113  gss_buffer_desc initiator_address;
114  OM_uint32 acceptor_addrtype;
115  gss_buffer_desc acceptor_address;
116  gss_buffer_desc application_data;
117} *gss_channel_bindings_t;
118
119/*
120 * For now, define a QOP-type as an OM_uint32
121 */
122typedef OM_uint32 gss_qop_t;
123
124typedef int gss_cred_usage_t;
125
126/*
127 * Flag bits for context-level services.
128 */
129#define GSS_C_DELEG_FLAG      1
130#define GSS_C_MUTUAL_FLAG     2
131#define GSS_C_REPLAY_FLAG     4
132#define GSS_C_SEQUENCE_FLAG   8
133#define GSS_C_CONF_FLAG       16
134#define GSS_C_INTEG_FLAG      32
135#define GSS_C_ANON_FLAG       64
136#define GSS_C_PROT_READY_FLAG 128
137#define GSS_C_TRANS_FLAG      256
138
139/*
140 * Credential usage options
141 */
142#define GSS_C_BOTH     0
143#define GSS_C_INITIATE 1
144#define GSS_C_ACCEPT   2
145
146/*
147 * Status code types for gss_display_status
148 */
149#define GSS_C_GSS_CODE  1
150#define GSS_C_MECH_CODE 2
151
152/*
153 * The constant definitions for channel-bindings address families
154 */
155#define GSS_C_AF_UNSPEC     0
156#define GSS_C_AF_LOCAL      1
157#define GSS_C_AF_INET       2
158#define GSS_C_AF_IMPLINK    3
159#define GSS_C_AF_PUP        4
160#define GSS_C_AF_CHAOS      5
161#define GSS_C_AF_NS         6
162#define GSS_C_AF_NBS        7
163#define GSS_C_AF_ECMA       8
164#define GSS_C_AF_DATAKIT    9
165#define GSS_C_AF_CCITT      10
166#define GSS_C_AF_SNA        11
167#define GSS_C_AF_DECnet     12
168#define GSS_C_AF_DLI        13
169#define GSS_C_AF_LAT        14
170#define GSS_C_AF_HYLINK     15
171#define GSS_C_AF_APPLETALK  16
172#define GSS_C_AF_BSC        17
173#define GSS_C_AF_DSS        18
174#define GSS_C_AF_OSI        19
175#define GSS_C_AF_X25        21
176#define GSS_C_AF_NULLADDR   255
177
178/*
179 * Various Null values
180 */
181#define GSS_C_NO_NAME ((gss_name_t) 0)
182#define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
183#define GSS_C_NO_OID ((gss_OID) 0)
184#define GSS_C_NO_OID_SET ((gss_OID_set) 0)
185#define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
186#define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
187#define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
188#define GSS_C_EMPTY_BUFFER {0, NULL}
189
190/*
191 * Some alternate names for a couple of the above
192 * values.  These are defined for V1 compatibility.
193 */
194#define GSS_C_NULL_OID GSS_C_NO_OID
195#define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
196
197/*
198 * Define the default Quality of Protection for per-message
199 * services.  Note that an implementation that offers multiple
200 * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
201 * (as done here) to mean "default protection", or to a specific
202 * explicit QOP value.  However, a value of 0 should always be
203 * interpreted by a GSS-API implementation as a request for the
204 * default protection level.
205 */
206#define GSS_C_QOP_DEFAULT 0
207
208/*
209 * Expiration time of 2^32-1 seconds means infinite lifetime for a
210 * credential or security context
211 */
212#define GSS_C_INDEFINITE 0xfffffffful
213
214/*
215 * The implementation must reserve static storage for a
216 * gss_OID_desc object containing the value
217 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
218 * "\x01\x02\x01\x01"},
219 * corresponding to an object-identifier value of
220 * {iso(1) member-body(2) United States(840) mit(113554)
221 * infosys(1) gssapi(2) generic(1) user_name(1)}.  The constant
222 * GSS_C_NT_USER_NAME should be initialized to point
223 * to that gss_OID_desc.
224 */
225extern gss_OID GSS_C_NT_USER_NAME;
226
227/*
228 * The implementation must reserve static storage for a
229 * gss_OID_desc object containing the value
230 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
231 *              "\x01\x02\x01\x02"},
232 * corresponding to an object-identifier value of
233 * {iso(1) member-body(2) United States(840) mit(113554)
234 * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
235 * The constant GSS_C_NT_MACHINE_UID_NAME should be
236 * initialized to point to that gss_OID_desc.
237 */
238extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
239
240/*
241 * The implementation must reserve static storage for a
242 * gss_OID_desc object containing the value
243 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
244 *              "\x01\x02\x01\x03"},
245 * corresponding to an object-identifier value of
246 * {iso(1) member-body(2) United States(840) mit(113554)
247 * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
248 * The constant GSS_C_NT_STRING_UID_NAME should be
249 * initialized to point to that gss_OID_desc.
250 */
251extern gss_OID GSS_C_NT_STRING_UID_NAME;
252
253/*
254 * The implementation must reserve static storage for a
255 * gss_OID_desc object containing the value
256 * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
257 * corresponding to an object-identifier value of
258 * {iso(1) org(3) dod(6) internet(1) security(5)
259 * nametypes(6) gss-host-based-services(2)).  The constant
260 * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
261 * to that gss_OID_desc.  This is a deprecated OID value, and
262 * implementations wishing to support hostbased-service names
263 * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
264 * defined below, to identify such names;
265 * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
266 * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
267 * parameter, but should not be emitted by GSS-API
268 * implementations
269 */
270extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
271
272/*
273 * The implementation must reserve static storage for a
274 * gss_OID_desc object containing the value
275 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
276 *              "\x01\x02\x01\x04"}, corresponding to an
277 * object-identifier value of {iso(1) member-body(2)
278 * Unites States(840) mit(113554) infosys(1) gssapi(2)
279 * generic(1) service_name(4)}.  The constant
280 * GSS_C_NT_HOSTBASED_SERVICE should be initialized
281 * to point to that gss_OID_desc.
282 */
283extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
284
285/*
286 * The implementation must reserve static storage for a
287 * gss_OID_desc object containing the value
288 * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
289 * corresponding to an object identifier value of
290 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
291 * 6(nametypes), 3(gss-anonymous-name)}.  The constant
292 * and GSS_C_NT_ANONYMOUS should be initialized to point
293 * to that gss_OID_desc.
294 */
295extern gss_OID GSS_C_NT_ANONYMOUS;
296
297
298/*
299 * The implementation must reserve static storage for a
300 * gss_OID_desc object containing the value
301 * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
302 * corresponding to an object-identifier value of
303 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
304 * 6(nametypes), 4(gss-api-exported-name)}.  The constant
305 * GSS_C_NT_EXPORT_NAME should be initialized to point
306 * to that gss_OID_desc.
307 */
308extern gss_OID GSS_C_NT_EXPORT_NAME;
309
310/*
311 *   This name form shall be represented by the Object Identifier {iso(1)
312 *   member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
313 *   krb5(2) krb5_name(1)}.  The recommended symbolic name for this type
314 *   is "GSS_KRB5_NT_PRINCIPAL_NAME".
315 */
316extern gss_OID GSS_KRB5_NT_PRINCIPAL_NAME;
317
318/*
319 * This name form shall be represented by the Object Identifier {iso(1)
320 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
321 * generic(1) user_name(1)}.  The recommended symbolic name for this
322 * type is "GSS_KRB5_NT_USER_NAME".
323 */
324extern gss_OID GSS_KRB5_NT_USER_NAME;
325
326/*
327 * This name form shall be represented by the Object Identifier {iso(1)
328 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
329 * generic(1) machine_uid_name(2)}.  The recommended symbolic name for
330 * this type is "GSS_KRB5_NT_MACHINE_UID_NAME".
331 */
332extern gss_OID GSS_KRB5_NT_MACHINE_UID_NAME;
333
334/*
335 * This name form shall be represented by the Object Identifier {iso(1)
336 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
337 * generic(1) string_uid_name(3)}.  The recommended symbolic name for
338 * this type is "GSS_KRB5_NT_STRING_UID_NAME".
339 */
340extern gss_OID GSS_KRB5_NT_STRING_UID_NAME;
341
342/* Major status codes */
343
344#define GSS_S_COMPLETE 0
345
346/*
347 * Some "helper" definitions to make the status code macros obvious.
348 */
349#define GSS_C_CALLING_ERROR_OFFSET 24
350#define GSS_C_ROUTINE_ERROR_OFFSET 16
351#define GSS_C_SUPPLEMENTARY_OFFSET 0
352#define GSS_C_CALLING_ERROR_MASK 0377ul
353#define GSS_C_ROUTINE_ERROR_MASK 0377ul
354#define GSS_C_SUPPLEMENTARY_MASK 0177777ul
355
356/*
357 * The macros that test status codes for error conditions.
358 * Note that the GSS_ERROR() macro has changed slightly from
359 * the V1 GSS-API so that it now evaluates its argument
360 * only once.
361 */
362#define GSS_CALLING_ERROR(x) \
363 (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
364#define GSS_ROUTINE_ERROR(x) \
365 (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
366#define GSS_SUPPLEMENTARY_INFO(x) \
367 (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
368#define GSS_ERROR(x) \
369 (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
370       (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
371
372/*
373 * Now the actual status code definitions
374 */
375
376/*
377 * Calling errors:
378 */
379#define GSS_S_CALL_INACCESSIBLE_READ \
380(1ul << GSS_C_CALLING_ERROR_OFFSET)
381#define GSS_S_CALL_INACCESSIBLE_WRITE \
382(2ul << GSS_C_CALLING_ERROR_OFFSET)
383#define GSS_S_CALL_BAD_STRUCTURE \
384(3ul << GSS_C_CALLING_ERROR_OFFSET)
385
386/*
387 * Routine errors:
388 */
389#define GSS_S_BAD_MECH             (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
390#define GSS_S_BAD_NAME             (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
391#define GSS_S_BAD_NAMETYPE         (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
392#define GSS_S_BAD_BINDINGS         (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
393#define GSS_S_BAD_STATUS           (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
394#define GSS_S_BAD_SIG              (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
395#define GSS_S_BAD_MIC		   GSS_S_BAD_SIG
396#define GSS_S_NO_CRED              (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
397#define GSS_S_NO_CONTEXT           (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
398#define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
399#define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
400#define GSS_S_CREDENTIALS_EXPIRED  (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
401#define GSS_S_CONTEXT_EXPIRED      (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
402#define GSS_S_FAILURE              (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
403#define GSS_S_BAD_QOP              (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
404#define GSS_S_UNAUTHORIZED         (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
405#define GSS_S_UNAVAILABLE          (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
406#define GSS_S_DUPLICATE_ELEMENT    (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
407#define GSS_S_NAME_NOT_MN          (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
408
409/*
410 * Supplementary info bits:
411 */
412#define GSS_S_CONTINUE_NEEDED \
413	 (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
414#define GSS_S_DUPLICATE_TOKEN \
415	 (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
416#define GSS_S_OLD_TOKEN \
417	 (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
418#define GSS_S_UNSEQ_TOKEN \
419	 (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
420#define GSS_S_GAP_TOKEN \
421	 (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
422
423/*
424 * Finally, function prototypes for the GSS-API routines.
425 */
426OM_uint32 gss_acquire_cred
427	      (OM_uint32 *,            /* minor_status */
428	       const gss_name_t,       /* desired_name */
429	       OM_uint32,              /* time_req */
430	       const gss_OID_set,      /* desired_mechs */
431	       gss_cred_usage_t,       /* cred_usage */
432	       gss_cred_id_t *,        /* output_cred_handle */
433	       gss_OID_set *,          /* actual_mechs */
434	       OM_uint32 *             /* time_rec */
435	      );
436
437OM_uint32 gss_release_cred
438	      (OM_uint32 *,            /* minor_status */
439	       gss_cred_id_t *         /* cred_handle */
440	      );
441
442OM_uint32 gss_init_sec_context
443	      (OM_uint32 *,            /* minor_status */
444	       const gss_cred_id_t,    /* initiator_cred_handle */
445	       gss_ctx_id_t *,         /* context_handle */
446	       const gss_name_t,       /* target_name */
447	       const gss_OID,          /* mech_type */
448	       OM_uint32,              /* req_flags */
449	       OM_uint32,              /* time_req */
450	       const gss_channel_bindings_t,
451				       /* input_chan_bindings */
452	       const gss_buffer_t,     /* input_token */
453	       gss_OID *,              /* actual_mech_type */
454	       gss_buffer_t,           /* output_token */
455	       OM_uint32 *,            /* ret_flags */
456	       OM_uint32 *             /* time_rec */
457	      );
458
459OM_uint32 gss_accept_sec_context
460	      (OM_uint32 *,            /* minor_status */
461	       gss_ctx_id_t *,         /* context_handle */
462	       const gss_cred_id_t,    /* acceptor_cred_handle */
463	       const gss_buffer_t,     /* input_token_buffer */
464	       const gss_channel_bindings_t,
465				       /* input_chan_bindings */
466	       gss_name_t *,           /* src_name */
467	       gss_OID *,              /* mech_type */
468	       gss_buffer_t,           /* output_token */
469	       OM_uint32 *,            /* ret_flags */
470	       OM_uint32 *,            /* time_rec */
471	       gss_cred_id_t *         /* delegated_cred_handle */
472	      );
473
474OM_uint32 gss_process_context_token
475	      (OM_uint32 *,            /* minor_status */
476	       const gss_ctx_id_t,     /* context_handle */
477	       const gss_buffer_t      /* token_buffer */
478	      );
479
480OM_uint32 gss_delete_sec_context
481	      (OM_uint32 *,            /* minor_status */
482	       gss_ctx_id_t *,         /* context_handle */
483	       gss_buffer_t            /* output_token */
484	      );
485
486OM_uint32 gss_context_time
487	      (OM_uint32 *,            /* minor_status */
488	       const gss_ctx_id_t,     /* context_handle */
489	       OM_uint32 *             /* time_rec */
490	      );
491
492OM_uint32 gss_get_mic
493	      (OM_uint32 *,            /* minor_status */
494	       const gss_ctx_id_t,     /* context_handle */
495	       gss_qop_t,              /* qop_req */
496	       const gss_buffer_t,     /* message_buffer */
497	       gss_buffer_t            /* message_token */
498	      );
499
500OM_uint32 gss_verify_mic
501	      (OM_uint32 *,            /* minor_status */
502	       const gss_ctx_id_t,     /* context_handle */
503	       const gss_buffer_t,     /* message_buffer */
504	       const gss_buffer_t,     /* token_buffer */
505	       gss_qop_t *             /* qop_state */
506	      );
507
508OM_uint32 gss_wrap
509	      (OM_uint32 *,            /* minor_status */
510	       const gss_ctx_id_t,     /* context_handle */
511	       int,                    /* conf_req_flag */
512	       gss_qop_t,              /* qop_req */
513	       const gss_buffer_t,     /* input_message_buffer */
514	       int *,                  /* conf_state */
515	       gss_buffer_t            /* output_message_buffer */
516	      );
517
518OM_uint32 gss_unwrap
519	      (OM_uint32 *,            /* minor_status */
520	       const gss_ctx_id_t,     /* context_handle */
521	       const gss_buffer_t,     /* input_message_buffer */
522	       gss_buffer_t,           /* output_message_buffer */
523	       int *,                  /* conf_state */
524	       gss_qop_t *             /* qop_state */
525	      );
526
527OM_uint32 gss_display_status
528	      (OM_uint32 *,            /* minor_status */
529	       OM_uint32,              /* status_value */
530	       int,                    /* status_type */
531	       const gss_OID,          /* mech_type */
532	       OM_uint32 *,            /* message_context */
533	       gss_buffer_t            /* status_string */
534	      );
535
536OM_uint32 gss_indicate_mechs
537	      (OM_uint32 *,            /* minor_status */
538	       gss_OID_set *           /* mech_set */
539	      );
540
541OM_uint32 gss_compare_name
542	      (OM_uint32 *,            /* minor_status */
543	       const gss_name_t,       /* name1 */
544	       const gss_name_t,       /* name2 */
545	       int *                   /* name_equal */
546	      );
547
548OM_uint32 gss_display_name
549	      (OM_uint32 *,            /* minor_status */
550	       const gss_name_t,       /* input_name */
551	       gss_buffer_t,           /* output_name_buffer */
552	       gss_OID *               /* output_name_type */
553	      );
554
555OM_uint32 gss_import_name
556	      (OM_uint32 *,            /* minor_status */
557	       const gss_buffer_t,     /* input_name_buffer */
558	       const gss_OID,          /* input_name_type */
559	       gss_name_t *            /* output_name */
560	      );
561
562OM_uint32 gss_export_name
563	      (OM_uint32 *,            /* minor_status */
564	       const gss_name_t,       /* input_name */
565	       gss_buffer_t            /* exported_name */
566	      );
567
568OM_uint32 gss_release_name
569	      (OM_uint32 *,            /* minor_status */
570	       gss_name_t *            /* input_name */
571	      );
572
573OM_uint32 gss_release_buffer
574	      (OM_uint32 *,            /* minor_status */
575	       gss_buffer_t            /* buffer */
576	      );
577
578OM_uint32 gss_release_oid_set
579	      (OM_uint32 *,            /* minor_status */
580	       gss_OID_set *           /* set */
581	      );
582
583OM_uint32 gss_inquire_cred
584	      (OM_uint32 *,            /* minor_status */
585	       const gss_cred_id_t,    /* cred_handle */
586	       gss_name_t *,           /* name */
587	       OM_uint32 *,            /* lifetime */
588	       gss_cred_usage_t *,     /* cred_usage */
589	       gss_OID_set *           /* mechanisms */
590	      );
591
592OM_uint32 gss_inquire_context (
593	       OM_uint32 *,            /* minor_status */
594	       const gss_ctx_id_t,     /* context_handle */
595	       gss_name_t *,           /* src_name */
596	       gss_name_t *,           /* targ_name */
597	       OM_uint32 *,            /* lifetime_rec */
598	       gss_OID *,              /* mech_type */
599	       OM_uint32 *,            /* ctx_flags */
600	       int *,                  /* locally_initiated */
601	       int *                   /* open */
602	      );
603
604OM_uint32 gss_wrap_size_limit (
605	       OM_uint32 *,            /* minor_status */
606	       const gss_ctx_id_t,     /* context_handle */
607	       int,                    /* conf_req_flag */
608	       gss_qop_t,              /* qop_req */
609	       OM_uint32,              /* req_output_size */
610	       OM_uint32 *             /* max_input_size */
611	      );
612
613OM_uint32 gss_add_cred (
614	       OM_uint32 *,            /* minor_status */
615	       const gss_cred_id_t,    /* input_cred_handle */
616	       const gss_name_t,       /* desired_name */
617	       const gss_OID,          /* desired_mech */
618	       gss_cred_usage_t,       /* cred_usage */
619	       OM_uint32,              /* initiator_time_req */
620	       OM_uint32,              /* acceptor_time_req */
621	       gss_cred_id_t *,        /* output_cred_handle */
622	       gss_OID_set *,          /* actual_mechs */
623	       OM_uint32 *,            /* initiator_time_rec */
624	       OM_uint32 *             /* acceptor_time_rec */
625	      );
626
627OM_uint32 gss_inquire_cred_by_mech (
628	       OM_uint32 *,            /* minor_status */
629	       const gss_cred_id_t,    /* cred_handle */
630	       const gss_OID,          /* mech_type */
631	       gss_name_t *,           /* name */
632	       OM_uint32 *,            /* initiator_lifetime */
633	       OM_uint32 *,            /* acceptor_lifetime */
634	       gss_cred_usage_t *      /* cred_usage */
635	      );
636
637OM_uint32 gss_export_sec_context (
638	       OM_uint32 *,            /* minor_status */
639	       gss_ctx_id_t *,         /* context_handle */
640	       gss_buffer_t            /* interprocess_token */
641	      );
642
643OM_uint32 gss_import_sec_context (
644	       OM_uint32 *,            /* minor_status */
645	       const gss_buffer_t,     /* interprocess_token */
646	       gss_ctx_id_t *          /* context_handle */
647	      );
648
649OM_uint32 gss_create_empty_oid_set (
650	       OM_uint32 *,            /* minor_status */
651	       gss_OID_set *           /* oid_set */
652	      );
653
654OM_uint32 gss_add_oid_set_member (
655	       OM_uint32 *,            /* minor_status */
656	       const gss_OID,          /* member_oid */
657	       gss_OID_set *           /* oid_set */
658	      );
659
660OM_uint32 gss_test_oid_set_member (
661	       OM_uint32 *,            /* minor_status */
662	       const gss_OID,          /* member */
663	       const gss_OID_set,      /* set */
664	       int *                   /* present */
665	      );
666
667OM_uint32 gss_inquire_names_for_mech (
668	       OM_uint32 *,            /* minor_status */
669	       const gss_OID,          /* mechanism */
670	       gss_OID_set *           /* name_types */
671	      );
672
673OM_uint32 gss_inquire_mechs_for_name (
674	       OM_uint32 *,            /* minor_status */
675	       const gss_name_t,       /* input_name */
676	       gss_OID_set *           /* mech_types */
677	      );
678
679OM_uint32 gss_canonicalize_name (
680	       OM_uint32 *,            /* minor_status */
681	       const gss_name_t,       /* input_name */
682	       const gss_OID,          /* mech_type */
683	       gss_name_t *            /* output_name */
684	      );
685
686OM_uint32 gss_duplicate_name (
687	       OM_uint32 *,            /* minor_status */
688	       const gss_name_t,       /* src_name */
689	       gss_name_t *            /* dest_name */
690	      );
691
692/*
693 * The following routines are obsolete variants of gss_get_mic,
694 * gss_verify_mic, gss_wrap and gss_unwrap.  They should be
695 * provided by GSS-API V2 implementations for backwards
696 * compatibility with V1 applications.  Distinct entrypoints
697 * (as opposed to #defines) should be provided, both to allow
698 * GSS-API V1 applications to link against GSS-API V2 implementations,
699 * and to retain the slight parameter type differences between the
700 * obsolete versions of these routines and their current forms.
701 */
702
703OM_uint32 gss_sign
704	      (OM_uint32 *,       /* minor_status */
705	       gss_ctx_id_t,      /* context_handle */
706	       int,               /* qop_req */
707	       gss_buffer_t,      /* message_buffer */
708	       gss_buffer_t       /* message_token */
709	      );
710
711
712OM_uint32 gss_verify
713	      (OM_uint32 *,       /* minor_status */
714	       gss_ctx_id_t,      /* context_handle */
715	       gss_buffer_t,      /* message_buffer */
716	       gss_buffer_t,      /* token_buffer */
717	       int *              /* qop_state */
718	      );
719
720OM_uint32 gss_seal
721	      (OM_uint32 *,       /* minor_status */
722	       gss_ctx_id_t,      /* context_handle */
723	       int,               /* conf_req_flag */
724	       int,               /* qop_req */
725	       gss_buffer_t,      /* input_message_buffer */
726	       int *,             /* conf_state */
727	       gss_buffer_t       /* output_message_buffer */
728	      );
729
730
731OM_uint32 gss_unseal
732	      (OM_uint32 *,       /* minor_status */
733	       gss_ctx_id_t,      /* context_handle */
734	       gss_buffer_t,      /* input_message_buffer */
735	       gss_buffer_t,      /* output_message_buffer */
736	       int *,             /* conf_state */
737	       int *              /* qop_state */
738	      );
739
740/*
741 * Other extensions and helper functions.
742 */
743
744int gss_oid_equal
745	      (const gss_OID,	  /* first OID to compare */
746	       const gss_OID	  /* second OID to compare */
747	      );
748
749OM_uint32 gss_release_oid
750	      (OM_uint32 *,	  /* minor status */
751	       gss_OID *	  /* oid to free */
752	      );
753
754OM_uint32 gss_decapsulate_token
755	      (const gss_buffer_t,  /* mechanism independent token */
756	       gss_OID,		 /* desired mechanism */
757	       gss_buffer_t	 /* decapsulated mechanism dependant token */
758	      );
759
760OM_uint32 gss_encapsulate_token
761	      (const gss_buffer_t,  /* mechanism dependant token */
762	       gss_OID,		 /* desired mechanism */
763	       gss_buffer_t	 /* encapsulated mechanism independent token */
764	      );
765
766OM_uint32 gss_duplicate_oid
767              (OM_uint32 *,	/* minor status */
768	       const gss_OID,	/* oid to copy */
769	       gss_OID *	/* result */
770	      );
771
772OM_uint32 gss_oid_to_str
773	      (OM_uint32 *,	/* minor status */
774	       gss_OID,		/* oid to convert */
775	       gss_buffer_t	/* buffer to contain string */
776	      );
777
778typedef struct gss_buffer_set_desc_struct  {
779  size_t	count;
780  gss_buffer_desc *elements;
781} gss_buffer_set_desc, *gss_buffer_set_t;
782
783#define GSS_C_NO_BUFFER_SET ((gss_buffer_set_t) 0)
784
785OM_uint32 gss_create_empty_buffer_set
786	      (OM_uint32 *,		/* minor status */
787	       gss_buffer_set_t *	/* location for new buffer set */
788	      );
789
790OM_uint32 gss_add_buffer_set_member
791	      (OM_uint32 *,		/* minor status */
792	       gss_buffer_t,		/* buffer to add */
793	       gss_buffer_set_t *	/* set to add to */
794	      );
795
796OM_uint32 gss_release_buffer_set
797	      (OM_uint32 *,		/* minor status */
798	       gss_buffer_set_t *	/* set to release */
799	      );
800
801OM_uint32 gss_inquire_sec_context_by_oid
802	      (OM_uint32 *,		/* minor_status */
803	       const gss_ctx_id_t,	/* context_handle */
804	       const gss_OID,		/* desired_object */
805	       gss_buffer_set_t *	/* result */
806	      );
807
808OM_uint32 gss_inquire_cred_by_oid
809	      (OM_uint32 *,		/* minor_status */
810	       const gss_cred_id_t,	/* cred_handle */
811	       const gss_OID,		/* desired_object */
812	       gss_buffer_set_t *	/* result */
813	      );
814
815OM_uint32 gss_set_sec_context_option
816	      (OM_uint32 *,		/* minor status */
817	       gss_ctx_id_t *,		/* context */
818	       const gss_OID,		/* option to set */
819	       const gss_buffer_t	/* option value */
820	      );
821
822OM_uint32 gss_set_cred_option
823	      (OM_uint32 *,		/* minor status */
824	       gss_cred_id_t *,		/* cred */
825	       const gss_OID,		/* option to set */
826	       const gss_buffer_t	/* option value */
827	      );
828
829OM_uint32 gss_pseudo_random
830	      (OM_uint32 *,		/* minor status */
831	       gss_ctx_id_t,		/* context handle */
832	       int prf_key,		/* XXX */
833	       const gss_buffer_t,	/* data to seed generator */
834	       ssize_t,			/* amount of data required */
835	       gss_buffer_t		/* buffer for result */
836	      );
837
838#endif /* _GSSAPI_GSSAPI_H_ */
839