xref: /freebsd/crypto/heimdal/lib/gssapi/gssapi/gssapi.h (revision 884a2a699669ec61e2366e3e358342dbc94be24a)
1 /*
2  * Copyright (c) 1997 - 2007 Kungliga Tekniska H�gskolan
3  * (Royal Institute of Technology, Stockholm, Sweden).
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the Institute nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  */
33 
34 /* $Id: gssapi.h 21004 2007-06-08 01:53:10Z lha $ */
35 
36 #ifndef GSSAPI_GSSAPI_H_
37 #define GSSAPI_GSSAPI_H_
38 
39 /*
40  * First, include stddef.h to get size_t defined.
41  */
42 #include <stddef.h>
43 
44 #include <krb5-types.h>
45 
46 /*
47  * Now define the three implementation-dependent types.
48  */
49 
50 typedef uint32_t OM_uint32;
51 typedef uint64_t OM_uint64;
52 
53 typedef uint32_t gss_uint32;
54 
55 struct gss_name_t_desc_struct;
56 typedef struct gss_name_t_desc_struct *gss_name_t;
57 
58 struct gss_ctx_id_t_desc_struct;
59 typedef struct gss_ctx_id_t_desc_struct *gss_ctx_id_t;
60 
61 typedef struct gss_OID_desc_struct {
62       OM_uint32 length;
63       void      *elements;
64 } gss_OID_desc, *gss_OID;
65 
66 typedef struct gss_OID_set_desc_struct  {
67       size_t     count;
68       gss_OID    elements;
69 } gss_OID_set_desc, *gss_OID_set;
70 
71 typedef int gss_cred_usage_t;
72 
73 struct gss_cred_id_t_desc_struct;
74 typedef struct gss_cred_id_t_desc_struct *gss_cred_id_t;
75 
76 typedef struct gss_buffer_desc_struct {
77       size_t length;
78       void *value;
79 } gss_buffer_desc, *gss_buffer_t;
80 
81 typedef struct gss_channel_bindings_struct {
82       OM_uint32 initiator_addrtype;
83       gss_buffer_desc initiator_address;
84       OM_uint32 acceptor_addrtype;
85       gss_buffer_desc acceptor_address;
86       gss_buffer_desc application_data;
87 } *gss_channel_bindings_t;
88 
89 /* GGF extension data types */
90 typedef struct gss_buffer_set_desc_struct {
91       size_t count;
92       gss_buffer_desc *elements;
93 } gss_buffer_set_desc, *gss_buffer_set_t;
94 
95 /*
96  * For now, define a QOP-type as an OM_uint32
97  */
98 typedef OM_uint32 gss_qop_t;
99 
100 /*
101  * Flag bits for context-level services.
102  */
103 #define GSS_C_DELEG_FLAG 1
104 #define GSS_C_MUTUAL_FLAG 2
105 #define GSS_C_REPLAY_FLAG 4
106 #define GSS_C_SEQUENCE_FLAG 8
107 #define GSS_C_CONF_FLAG 16
108 #define GSS_C_INTEG_FLAG 32
109 #define GSS_C_ANON_FLAG 64
110 #define GSS_C_PROT_READY_FLAG 128
111 #define GSS_C_TRANS_FLAG 256
112 
113 #define GSS_C_DCE_STYLE 4096
114 #define GSS_C_IDENTIFY_FLAG 8192
115 #define GSS_C_EXTENDED_ERROR_FLAG 16384
116 
117 /*
118  * Credential usage options
119  */
120 #define GSS_C_BOTH 0
121 #define GSS_C_INITIATE 1
122 #define GSS_C_ACCEPT 2
123 
124 /*
125  * Status code types for gss_display_status
126  */
127 #define GSS_C_GSS_CODE 1
128 #define GSS_C_MECH_CODE 2
129 
130 /*
131  * The constant definitions for channel-bindings address families
132  */
133 #define GSS_C_AF_UNSPEC     0
134 #define GSS_C_AF_LOCAL      1
135 #define GSS_C_AF_INET       2
136 #define GSS_C_AF_IMPLINK    3
137 #define GSS_C_AF_PUP        4
138 #define GSS_C_AF_CHAOS      5
139 #define GSS_C_AF_NS         6
140 #define GSS_C_AF_NBS        7
141 #define GSS_C_AF_ECMA       8
142 #define GSS_C_AF_DATAKIT    9
143 #define GSS_C_AF_CCITT      10
144 #define GSS_C_AF_SNA        11
145 #define GSS_C_AF_DECnet     12
146 #define GSS_C_AF_DLI        13
147 #define GSS_C_AF_LAT        14
148 #define GSS_C_AF_HYLINK     15
149 #define GSS_C_AF_APPLETALK  16
150 #define GSS_C_AF_BSC        17
151 #define GSS_C_AF_DSS        18
152 #define GSS_C_AF_OSI        19
153 #define GSS_C_AF_X25        21
154 #define GSS_C_AF_INET6	    24
155 
156 #define GSS_C_AF_NULLADDR   255
157 
158 /*
159  * Various Null values
160  */
161 #define GSS_C_NO_NAME ((gss_name_t) 0)
162 #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
163 #define GSS_C_NO_BUFFER_SET ((gss_buffer_set_t) 0)
164 #define GSS_C_NO_OID ((gss_OID) 0)
165 #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
166 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
167 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
168 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
169 #define GSS_C_EMPTY_BUFFER {0, NULL}
170 
171 /*
172  * Some alternate names for a couple of the above
173  * values.  These are defined for V1 compatibility.
174  */
175 #define GSS_C_NULL_OID GSS_C_NO_OID
176 #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
177 
178 /*
179  * Define the default Quality of Protection for per-message
180  * services.  Note that an implementation that offers multiple
181  * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
182  * (as done here) to mean "default protection", or to a specific
183  * explicit QOP value.  However, a value of 0 should always be
184  * interpreted by a GSSAPI implementation as a request for the
185  * default protection level.
186  */
187 #define GSS_C_QOP_DEFAULT 0
188 
189 #define GSS_KRB5_CONF_C_QOP_DES		0x0100
190 #define GSS_KRB5_CONF_C_QOP_DES3_KD	0x0200
191 
192 /*
193  * Expiration time of 2^32-1 seconds means infinite lifetime for a
194  * credential or security context
195  */
196 #define GSS_C_INDEFINITE 0xfffffffful
197 
198 #ifdef __cplusplus
199 extern "C" {
200 #endif
201 
202 /*
203  * The implementation must reserve static storage for a
204  * gss_OID_desc object containing the value
205  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
206  *              "\x01\x02\x01\x01"},
207  * corresponding to an object-identifier value of
208  * {iso(1) member-body(2) United States(840) mit(113554)
209  *  infosys(1) gssapi(2) generic(1) user_name(1)}.  The constant
210  * GSS_C_NT_USER_NAME should be initialized to point
211  * to that gss_OID_desc.
212  */
213 extern gss_OID GSS_C_NT_USER_NAME;
214 
215 /*
216  * The implementation must reserve static storage for a
217  * gss_OID_desc object containing the value
218  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
219  *              "\x01\x02\x01\x02"},
220  * corresponding to an object-identifier value of
221  * {iso(1) member-body(2) United States(840) mit(113554)
222  *  infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
223  * The constant GSS_C_NT_MACHINE_UID_NAME should be
224  * initialized to point to that gss_OID_desc.
225  */
226 extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
227 
228 /*
229  * The implementation must reserve static storage for a
230  * gss_OID_desc object containing the value
231  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
232  *              "\x01\x02\x01\x03"},
233  * corresponding to an object-identifier value of
234  * {iso(1) member-body(2) United States(840) mit(113554)
235  *  infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
236  * The constant GSS_C_NT_STRING_UID_NAME should be
237  * initialized to point to that gss_OID_desc.
238  */
239 extern gss_OID GSS_C_NT_STRING_UID_NAME;
240 
241 /*
242  * The implementation must reserve static storage for a
243  * gss_OID_desc object containing the value
244  * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
245  * corresponding to an object-identifier value of
246  * {iso(1) org(3) dod(6) internet(1) security(5)
247  * nametypes(6) gss-host-based-services(2)).  The constant
248  * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
249  * to that gss_OID_desc.  This is a deprecated OID value, and
250  * implementations wishing to support hostbased-service names
251  * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
252  * defined below, to identify such names;
253  * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
254  * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
255  * parameter, but should not be emitted by GSS-API
256  * implementations
257  */
258 extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
259 
260 /*
261  * The implementation must reserve static storage for a
262  * gss_OID_desc object containing the value
263  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
264  *              "\x01\x02\x01\x04"}, corresponding to an
265  * object-identifier value of {iso(1) member-body(2)
266  * Unites States(840) mit(113554) infosys(1) gssapi(2)
267  * generic(1) service_name(4)}.  The constant
268  * GSS_C_NT_HOSTBASED_SERVICE should be initialized
269  * to point to that gss_OID_desc.
270  */
271 extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
272 
273 /*
274  * The implementation must reserve static storage for a
275  * gss_OID_desc object containing the value
276  * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
277  * corresponding to an object identifier value of
278  * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
279  * 6(nametypes), 3(gss-anonymous-name)}.  The constant
280  * and GSS_C_NT_ANONYMOUS should be initialized to point
281  * to that gss_OID_desc.
282  */
283 extern gss_OID GSS_C_NT_ANONYMOUS;
284 
285 /*
286  * The implementation must reserve static storage for a
287  * gss_OID_desc object containing the value
288  * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
289  * corresponding to an object-identifier value of
290  * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
291  * 6(nametypes), 4(gss-api-exported-name)}.  The constant
292  * GSS_C_NT_EXPORT_NAME should be initialized to point
293  * to that gss_OID_desc.
294  */
295 extern gss_OID GSS_C_NT_EXPORT_NAME;
296 
297 /*
298  * Digest mechanism
299  */
300 
301 extern gss_OID GSS_SASL_DIGEST_MD5_MECHANISM;
302 
303 /*
304  * NTLM mechanism
305  */
306 
307 extern gss_OID GSS_NTLM_MECHANISM;
308 
309 /* Major status codes */
310 
311 #define GSS_S_COMPLETE 0
312 
313 /*
314  * Some "helper" definitions to make the status code macros obvious.
315  */
316 #define GSS_C_CALLING_ERROR_OFFSET 24
317 #define GSS_C_ROUTINE_ERROR_OFFSET 16
318 #define GSS_C_SUPPLEMENTARY_OFFSET 0
319 #define GSS_C_CALLING_ERROR_MASK 0377ul
320 #define GSS_C_ROUTINE_ERROR_MASK 0377ul
321 #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
322 
323 /*
324  * The macros that test status codes for error conditions.
325  * Note that the GSS_ERROR() macro has changed slightly from
326  * the V1 GSSAPI so that it now evaluates its argument
327  * only once.
328  */
329 #define GSS_CALLING_ERROR(x) \
330   (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
331 #define GSS_ROUTINE_ERROR(x) \
332   (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
333 #define GSS_SUPPLEMENTARY_INFO(x) \
334   (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
335 #define GSS_ERROR(x) \
336   (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
337         (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
338 
339 /*
340  * Now the actual status code definitions
341  */
342 
343 /*
344  * Calling errors:
345  */
346 #define GSS_S_CALL_INACCESSIBLE_READ \
347                              (1ul << GSS_C_CALLING_ERROR_OFFSET)
348 #define GSS_S_CALL_INACCESSIBLE_WRITE \
349                              (2ul << GSS_C_CALLING_ERROR_OFFSET)
350 #define GSS_S_CALL_BAD_STRUCTURE \
351                              (3ul << GSS_C_CALLING_ERROR_OFFSET)
352 
353 /*
354  * Routine errors:
355  */
356 #define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
357 #define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
358 #define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
359 
360 #define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
361 #define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
362 #define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
363 #define GSS_S_BAD_MIC GSS_S_BAD_SIG
364 #define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
365 #define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
366 #define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
367 #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
368 #define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
369 #define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
370 #define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
371 #define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
372 #define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
373 #define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
374 #define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
375 #define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
376 
377 /*
378  * Supplementary info bits:
379  */
380 #define GSS_S_CONTINUE_NEEDED (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
381 #define GSS_S_DUPLICATE_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
382 #define GSS_S_OLD_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
383 #define GSS_S_UNSEQ_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
384 #define GSS_S_GAP_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
385 
386 /*
387  * Finally, function prototypes for the GSS-API routines.
388  */
389 
390 OM_uint32 gss_acquire_cred
391            (OM_uint32 * /*minor_status*/,
392             const gss_name_t /*desired_name*/,
393             OM_uint32 /*time_req*/,
394             const gss_OID_set /*desired_mechs*/,
395             gss_cred_usage_t /*cred_usage*/,
396             gss_cred_id_t * /*output_cred_handle*/,
397             gss_OID_set * /*actual_mechs*/,
398             OM_uint32 * /*time_rec*/
399            );
400 
401 OM_uint32 gss_release_cred
402            (OM_uint32 * /*minor_status*/,
403             gss_cred_id_t * /*cred_handle*/
404            );
405 
406 OM_uint32 gss_init_sec_context
407            (OM_uint32 * /*minor_status*/,
408             const gss_cred_id_t /*initiator_cred_handle*/,
409             gss_ctx_id_t * /*context_handle*/,
410             const gss_name_t /*target_name*/,
411             const gss_OID /*mech_type*/,
412             OM_uint32 /*req_flags*/,
413             OM_uint32 /*time_req*/,
414             const gss_channel_bindings_t /*input_chan_bindings*/,
415             const gss_buffer_t /*input_token*/,
416             gss_OID * /*actual_mech_type*/,
417             gss_buffer_t /*output_token*/,
418             OM_uint32 * /*ret_flags*/,
419             OM_uint32 * /*time_rec*/
420            );
421 
422 OM_uint32 gss_accept_sec_context
423            (OM_uint32 * /*minor_status*/,
424             gss_ctx_id_t * /*context_handle*/,
425             const gss_cred_id_t /*acceptor_cred_handle*/,
426             const gss_buffer_t /*input_token_buffer*/,
427             const gss_channel_bindings_t /*input_chan_bindings*/,
428             gss_name_t * /*src_name*/,
429             gss_OID * /*mech_type*/,
430             gss_buffer_t /*output_token*/,
431             OM_uint32 * /*ret_flags*/,
432             OM_uint32 * /*time_rec*/,
433             gss_cred_id_t * /*delegated_cred_handle*/
434            );
435 
436 OM_uint32 gss_process_context_token
437            (OM_uint32 * /*minor_status*/,
438             const gss_ctx_id_t /*context_handle*/,
439             const gss_buffer_t /*token_buffer*/
440            );
441 
442 OM_uint32 gss_delete_sec_context
443            (OM_uint32 * /*minor_status*/,
444             gss_ctx_id_t * /*context_handle*/,
445             gss_buffer_t /*output_token*/
446            );
447 
448 OM_uint32 gss_context_time
449            (OM_uint32 * /*minor_status*/,
450             const gss_ctx_id_t /*context_handle*/,
451             OM_uint32 * /*time_rec*/
452            );
453 
454 OM_uint32 gss_get_mic
455            (OM_uint32 * /*minor_status*/,
456             const gss_ctx_id_t /*context_handle*/,
457             gss_qop_t /*qop_req*/,
458             const gss_buffer_t /*message_buffer*/,
459             gss_buffer_t /*message_token*/
460            );
461 
462 OM_uint32 gss_verify_mic
463            (OM_uint32 * /*minor_status*/,
464             const gss_ctx_id_t /*context_handle*/,
465             const gss_buffer_t /*message_buffer*/,
466             const gss_buffer_t /*token_buffer*/,
467             gss_qop_t * /*qop_state*/
468            );
469 
470 OM_uint32 gss_wrap
471            (OM_uint32 * /*minor_status*/,
472             const gss_ctx_id_t /*context_handle*/,
473             int /*conf_req_flag*/,
474             gss_qop_t /*qop_req*/,
475             const gss_buffer_t /*input_message_buffer*/,
476             int * /*conf_state*/,
477             gss_buffer_t /*output_message_buffer*/
478            );
479 
480 OM_uint32 gss_unwrap
481            (OM_uint32 * /*minor_status*/,
482             const gss_ctx_id_t /*context_handle*/,
483             const gss_buffer_t /*input_message_buffer*/,
484             gss_buffer_t /*output_message_buffer*/,
485             int * /*conf_state*/,
486             gss_qop_t * /*qop_state*/
487            );
488 
489 OM_uint32 gss_display_status
490            (OM_uint32 * /*minor_status*/,
491             OM_uint32 /*status_value*/,
492             int /*status_type*/,
493             const gss_OID /*mech_type*/,
494             OM_uint32 * /*message_context*/,
495             gss_buffer_t /*status_string*/
496            );
497 
498 OM_uint32 gss_indicate_mechs
499            (OM_uint32 * /*minor_status*/,
500             gss_OID_set * /*mech_set*/
501            );
502 
503 OM_uint32 gss_compare_name
504            (OM_uint32 * /*minor_status*/,
505             const gss_name_t /*name1*/,
506             const gss_name_t /*name2*/,
507             int * /*name_equal*/
508            );
509 
510 OM_uint32 gss_display_name
511            (OM_uint32 * /*minor_status*/,
512             const gss_name_t /*input_name*/,
513             gss_buffer_t /*output_name_buffer*/,
514             gss_OID * /*output_name_type*/
515            );
516 
517 OM_uint32 gss_import_name
518            (OM_uint32 * /*minor_status*/,
519             const gss_buffer_t /*input_name_buffer*/,
520             const gss_OID /*input_name_type*/,
521             gss_name_t * /*output_name*/
522            );
523 
524 OM_uint32 gss_export_name
525            (OM_uint32  * /*minor_status*/,
526             const gss_name_t /*input_name*/,
527             gss_buffer_t /*exported_name*/
528            );
529 
530 OM_uint32 gss_release_name
531            (OM_uint32 * /*minor_status*/,
532             gss_name_t * /*input_name*/
533            );
534 
535 OM_uint32 gss_release_buffer
536            (OM_uint32 * /*minor_status*/,
537             gss_buffer_t /*buffer*/
538            );
539 
540 OM_uint32 gss_release_oid_set
541            (OM_uint32 * /*minor_status*/,
542             gss_OID_set * /*set*/
543            );
544 
545 OM_uint32 gss_inquire_cred
546            (OM_uint32 * /*minor_status*/,
547             const gss_cred_id_t /*cred_handle*/,
548             gss_name_t * /*name*/,
549             OM_uint32 * /*lifetime*/,
550             gss_cred_usage_t * /*cred_usage*/,
551             gss_OID_set * /*mechanisms*/
552            );
553 
554 OM_uint32 gss_inquire_context (
555             OM_uint32 * /*minor_status*/,
556             const gss_ctx_id_t /*context_handle*/,
557             gss_name_t * /*src_name*/,
558             gss_name_t * /*targ_name*/,
559             OM_uint32 * /*lifetime_rec*/,
560             gss_OID * /*mech_type*/,
561             OM_uint32 * /*ctx_flags*/,
562             int * /*locally_initiated*/,
563             int * /*open_context*/
564            );
565 
566 OM_uint32 gss_wrap_size_limit (
567             OM_uint32 * /*minor_status*/,
568             const gss_ctx_id_t /*context_handle*/,
569             int /*conf_req_flag*/,
570             gss_qop_t /*qop_req*/,
571             OM_uint32 /*req_output_size*/,
572             OM_uint32 * /*max_input_size*/
573            );
574 
575 OM_uint32 gss_add_cred (
576             OM_uint32 * /*minor_status*/,
577             const gss_cred_id_t /*input_cred_handle*/,
578             const gss_name_t /*desired_name*/,
579             const gss_OID /*desired_mech*/,
580             gss_cred_usage_t /*cred_usage*/,
581             OM_uint32 /*initiator_time_req*/,
582             OM_uint32 /*acceptor_time_req*/,
583             gss_cred_id_t * /*output_cred_handle*/,
584             gss_OID_set * /*actual_mechs*/,
585             OM_uint32 * /*initiator_time_rec*/,
586             OM_uint32 * /*acceptor_time_rec*/
587            );
588 
589 OM_uint32 gss_inquire_cred_by_mech (
590             OM_uint32 * /*minor_status*/,
591             const gss_cred_id_t /*cred_handle*/,
592             const gss_OID /*mech_type*/,
593             gss_name_t * /*name*/,
594             OM_uint32 * /*initiator_lifetime*/,
595             OM_uint32 * /*acceptor_lifetime*/,
596             gss_cred_usage_t * /*cred_usage*/
597            );
598 
599 OM_uint32 gss_export_sec_context (
600             OM_uint32 * /*minor_status*/,
601             gss_ctx_id_t * /*context_handle*/,
602             gss_buffer_t /*interprocess_token*/
603            );
604 
605 OM_uint32 gss_import_sec_context (
606             OM_uint32 * /*minor_status*/,
607             const gss_buffer_t /*interprocess_token*/,
608             gss_ctx_id_t * /*context_handle*/
609            );
610 
611 OM_uint32 gss_create_empty_oid_set (
612             OM_uint32 * /*minor_status*/,
613             gss_OID_set * /*oid_set*/
614            );
615 
616 OM_uint32 gss_add_oid_set_member (
617             OM_uint32 * /*minor_status*/,
618             const gss_OID /*member_oid*/,
619             gss_OID_set * /*oid_set*/
620            );
621 
622 OM_uint32 gss_test_oid_set_member (
623             OM_uint32 * /*minor_status*/,
624             const gss_OID /*member*/,
625             const gss_OID_set /*set*/,
626             int * /*present*/
627            );
628 
629 OM_uint32 gss_inquire_names_for_mech (
630             OM_uint32 * /*minor_status*/,
631             const gss_OID /*mechanism*/,
632             gss_OID_set * /*name_types*/
633            );
634 
635 OM_uint32 gss_inquire_mechs_for_name (
636             OM_uint32 * /*minor_status*/,
637             const gss_name_t /*input_name*/,
638             gss_OID_set * /*mech_types*/
639            );
640 
641 OM_uint32 gss_canonicalize_name (
642             OM_uint32 * /*minor_status*/,
643             const gss_name_t /*input_name*/,
644             const gss_OID /*mech_type*/,
645             gss_name_t * /*output_name*/
646            );
647 
648 OM_uint32 gss_duplicate_name (
649             OM_uint32 * /*minor_status*/,
650             const gss_name_t /*src_name*/,
651             gss_name_t * /*dest_name*/
652            );
653 
654 OM_uint32 gss_duplicate_oid (
655 	    OM_uint32 * /* minor_status */,
656 	    gss_OID /* src_oid */,
657 	    gss_OID * /* dest_oid */
658            );
659 OM_uint32
660 gss_release_oid
661 	(OM_uint32 * /*minor_status*/,
662 	 gss_OID * /* oid */
663 	);
664 
665 OM_uint32
666 gss_oid_to_str(
667 	    OM_uint32 * /*minor_status*/,
668 	    gss_OID /* oid */,
669 	    gss_buffer_t /* str */
670            );
671 
672 OM_uint32
673 gss_inquire_sec_context_by_oid(
674 	    OM_uint32 * minor_status,
675             const gss_ctx_id_t context_handle,
676             const gss_OID desired_object,
677             gss_buffer_set_t *data_set
678            );
679 
680 OM_uint32
681 gss_set_sec_context_option (OM_uint32 *minor_status,
682 			    gss_ctx_id_t *context_handle,
683 			    const gss_OID desired_object,
684 			    const gss_buffer_t value);
685 
686 OM_uint32
687 gss_set_cred_option (OM_uint32 *minor_status,
688 		     gss_cred_id_t *cred_handle,
689 		     const gss_OID object,
690 		     const gss_buffer_t value);
691 
692 int
693 gss_oid_equal(const gss_OID a, const gss_OID b);
694 
695 OM_uint32
696 gss_create_empty_buffer_set
697 	   (OM_uint32 * minor_status,
698 	    gss_buffer_set_t *buffer_set);
699 
700 OM_uint32
701 gss_add_buffer_set_member
702 	   (OM_uint32 * minor_status,
703 	    const gss_buffer_t member_buffer,
704 	    gss_buffer_set_t *buffer_set);
705 
706 OM_uint32
707 gss_release_buffer_set
708 	   (OM_uint32 * minor_status,
709 	    gss_buffer_set_t *buffer_set);
710 
711 OM_uint32
712 gss_inquire_cred_by_oid(OM_uint32 *minor_status,
713 	                const gss_cred_id_t cred_handle,
714 	                const gss_OID desired_object,
715 	                gss_buffer_set_t *data_set);
716 
717 /*
718  * RFC 4401
719  */
720 
721 #define GSS_C_PRF_KEY_FULL 0
722 #define GSS_C_PRF_KEY_PARTIAL 1
723 
724 OM_uint32
725 gss_pseudo_random
726 	(OM_uint32 *minor_status,
727 	 gss_ctx_id_t context,
728 	 int prf_key,
729 	 const gss_buffer_t prf_in,
730 	 ssize_t desired_output_len,
731 	 gss_buffer_t prf_out
732 	);
733 
734 /*
735  * The following routines are obsolete variants of gss_get_mic,
736  * gss_verify_mic, gss_wrap and gss_unwrap.  They should be
737  * provided by GSSAPI V2 implementations for backwards
738  * compatibility with V1 applications.  Distinct entrypoints
739  * (as opposed to #defines) should be provided, both to allow
740  * GSSAPI V1 applications to link against GSSAPI V2 implementations,
741  * and to retain the slight parameter type differences between the
742  * obsolete versions of these routines and their current forms.
743  */
744 
745 OM_uint32 gss_sign
746            (OM_uint32 * /*minor_status*/,
747             gss_ctx_id_t /*context_handle*/,
748             int /*qop_req*/,
749             gss_buffer_t /*message_buffer*/,
750             gss_buffer_t /*message_token*/
751            );
752 
753 OM_uint32 gss_verify
754            (OM_uint32 * /*minor_status*/,
755             gss_ctx_id_t /*context_handle*/,
756             gss_buffer_t /*message_buffer*/,
757             gss_buffer_t /*token_buffer*/,
758             int * /*qop_state*/
759            );
760 
761 OM_uint32 gss_seal
762            (OM_uint32 * /*minor_status*/,
763             gss_ctx_id_t /*context_handle*/,
764             int /*conf_req_flag*/,
765             int /*qop_req*/,
766             gss_buffer_t /*input_message_buffer*/,
767             int * /*conf_state*/,
768             gss_buffer_t /*output_message_buffer*/
769            );
770 
771 OM_uint32 gss_unseal
772            (OM_uint32 * /*minor_status*/,
773             gss_ctx_id_t /*context_handle*/,
774             gss_buffer_t /*input_message_buffer*/,
775             gss_buffer_t /*output_message_buffer*/,
776             int * /*conf_state*/,
777             int * /*qop_state*/
778            );
779 
780 /*
781  *
782  */
783 
784 OM_uint32
785 gss_inquire_sec_context_by_oid (OM_uint32 *minor_status,
786 	                        const gss_ctx_id_t context_handle,
787 	                        const gss_OID desired_object,
788 	                        gss_buffer_set_t *data_set);
789 
790 OM_uint32
791 gss_encapsulate_token(gss_buffer_t /* input_token */,
792 		      gss_OID /* oid */,
793 		      gss_buffer_t /* output_token */);
794 
795 OM_uint32
796 gss_decapsulate_token(gss_buffer_t /* input_token */,
797 		      gss_OID /* oid */,
798 		      gss_buffer_t /* output_token */);
799 
800 
801 
802 #ifdef __cplusplus
803 }
804 #endif
805 
806 #include <gssapi/gssapi_krb5.h>
807 #include <gssapi/gssapi_spnego.h>
808 
809 #endif /* GSSAPI_GSSAPI_H_ */
810