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