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