r19604: This is a massive commit, and I appologise in advance for it's size.
[kai/samba.git] / source4 / heimdal / lib / gssapi / gssapi / gssapi.h
1 /*
2  * Copyright (c) 1997 - 2006 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,v 1.5 2006/10/19 07:11:14 lha Exp $ */
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 /* Major status codes */
304
305 #define GSS_S_COMPLETE 0
306
307 /*
308  * Some "helper" definitions to make the status code macros obvious.
309  */
310 #define GSS_C_CALLING_ERROR_OFFSET 24
311 #define GSS_C_ROUTINE_ERROR_OFFSET 16
312 #define GSS_C_SUPPLEMENTARY_OFFSET 0
313 #define GSS_C_CALLING_ERROR_MASK 0377ul
314 #define GSS_C_ROUTINE_ERROR_MASK 0377ul
315 #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
316
317 /*
318  * The macros that test status codes for error conditions.
319  * Note that the GSS_ERROR() macro has changed slightly from
320  * the V1 GSSAPI so that it now evaluates its argument
321  * only once.
322  */
323 #define GSS_CALLING_ERROR(x) \
324   (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
325 #define GSS_ROUTINE_ERROR(x) \
326   (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
327 #define GSS_SUPPLEMENTARY_INFO(x) \
328   (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
329 #define GSS_ERROR(x) \
330   (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
331         (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
332
333 /*
334  * Now the actual status code definitions
335  */
336
337 /*
338  * Calling errors:
339  */
340 #define GSS_S_CALL_INACCESSIBLE_READ \
341                              (1ul << GSS_C_CALLING_ERROR_OFFSET)
342 #define GSS_S_CALL_INACCESSIBLE_WRITE \
343                              (2ul << GSS_C_CALLING_ERROR_OFFSET)
344 #define GSS_S_CALL_BAD_STRUCTURE \
345                              (3ul << GSS_C_CALLING_ERROR_OFFSET)
346
347 /*
348  * Routine errors:
349  */
350 #define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
351 #define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
352 #define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
353
354 #define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
355 #define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
356 #define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
357 #define GSS_S_BAD_MIC GSS_S_BAD_SIG
358 #define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
359 #define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
360 #define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
361 #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
362 #define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
363 #define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
364 #define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
365 #define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
366 #define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
367 #define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
368 #define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
369 #define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
370
371 /*
372  * Supplementary info bits:
373  */
374 #define GSS_S_CONTINUE_NEEDED (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
375 #define GSS_S_DUPLICATE_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
376 #define GSS_S_OLD_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
377 #define GSS_S_UNSEQ_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
378 #define GSS_S_GAP_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
379
380 /*
381  * From RFC1964:
382  *
383  * 4.1.1. Non-Kerberos-specific codes
384  */
385
386 #define GSS_KRB5_S_G_BAD_SERVICE_NAME 1
387            /* "No @ in SERVICE-NAME name string" */
388 #define GSS_KRB5_S_G_BAD_STRING_UID 2
389            /* "STRING-UID-NAME contains nondigits" */
390 #define GSS_KRB5_S_G_NOUSER 3
391            /* "UID does not resolve to username" */
392 #define GSS_KRB5_S_G_VALIDATE_FAILED 4
393            /* "Validation error" */
394 #define GSS_KRB5_S_G_BUFFER_ALLOC 5
395            /* "Couldn't allocate gss_buffer_t data" */
396 #define GSS_KRB5_S_G_BAD_MSG_CTX 6
397            /* "Message context invalid" */
398 #define GSS_KRB5_S_G_WRONG_SIZE 7
399            /* "Buffer is the wrong size" */
400 #define GSS_KRB5_S_G_BAD_USAGE 8
401            /* "Credential usage type is unknown" */
402 #define GSS_KRB5_S_G_UNKNOWN_QOP 9
403            /* "Unknown quality of protection specified" */
404
405   /*
406    * 4.1.2. Kerberos-specific-codes
407    */
408
409 #define GSS_KRB5_S_KG_CCACHE_NOMATCH 10
410            /* "Principal in credential cache does not match desired name" */
411 #define GSS_KRB5_S_KG_KEYTAB_NOMATCH 11
412            /* "No principal in keytab matches desired name" */
413 #define GSS_KRB5_S_KG_TGT_MISSING 12
414            /* "Credential cache has no TGT" */
415 #define GSS_KRB5_S_KG_NO_SUBKEY 13
416            /* "Authenticator has no subkey" */
417 #define GSS_KRB5_S_KG_CONTEXT_ESTABLISHED 14
418            /* "Context is already fully established" */
419 #define GSS_KRB5_S_KG_BAD_SIGN_TYPE 15
420            /* "Unknown signature type in token" */
421 #define GSS_KRB5_S_KG_BAD_LENGTH 16
422            /* "Invalid field length in token" */
423 #define GSS_KRB5_S_KG_CTX_INCOMPLETE 17
424            /* "Attempt to use incomplete security context" */
425
426 /*
427  * This is used to make sure mechs that don't want to have external
428  * references don't get any prototypes, and thus can get warnings.
429  */
430
431 /*
432  * Finally, function prototypes for the GSS-API routines.
433  */
434
435 OM_uint32 gss_acquire_cred
436            (OM_uint32 * /*minor_status*/,
437             const gss_name_t /*desired_name*/,
438             OM_uint32 /*time_req*/,
439             const gss_OID_set /*desired_mechs*/,
440             gss_cred_usage_t /*cred_usage*/,
441             gss_cred_id_t * /*output_cred_handle*/,
442             gss_OID_set * /*actual_mechs*/,
443             OM_uint32 * /*time_rec*/
444            );
445
446 OM_uint32 gss_release_cred
447            (OM_uint32 * /*minor_status*/,
448             gss_cred_id_t * /*cred_handle*/
449            );
450
451 OM_uint32 gss_init_sec_context
452            (OM_uint32 * /*minor_status*/,
453             const gss_cred_id_t /*initiator_cred_handle*/,
454             gss_ctx_id_t * /*context_handle*/,
455             const gss_name_t /*target_name*/,
456             const gss_OID /*mech_type*/,
457             OM_uint32 /*req_flags*/,
458             OM_uint32 /*time_req*/,
459             const gss_channel_bindings_t /*input_chan_bindings*/,
460             const gss_buffer_t /*input_token*/,
461             gss_OID * /*actual_mech_type*/,
462             gss_buffer_t /*output_token*/,
463             OM_uint32 * /*ret_flags*/,
464             OM_uint32 * /*time_rec*/
465            );
466
467 OM_uint32 gss_accept_sec_context
468            (OM_uint32 * /*minor_status*/,
469             gss_ctx_id_t * /*context_handle*/,
470             const gss_cred_id_t /*acceptor_cred_handle*/,
471             const gss_buffer_t /*input_token_buffer*/,
472             const gss_channel_bindings_t /*input_chan_bindings*/,
473             gss_name_t * /*src_name*/,
474             gss_OID * /*mech_type*/,
475             gss_buffer_t /*output_token*/,
476             OM_uint32 * /*ret_flags*/,
477             OM_uint32 * /*time_rec*/,
478             gss_cred_id_t * /*delegated_cred_handle*/
479            );
480
481 OM_uint32 gss_process_context_token
482            (OM_uint32 * /*minor_status*/,
483             const gss_ctx_id_t /*context_handle*/,
484             const gss_buffer_t /*token_buffer*/
485            );
486
487 OM_uint32 gss_delete_sec_context
488            (OM_uint32 * /*minor_status*/,
489             gss_ctx_id_t * /*context_handle*/,
490             gss_buffer_t /*output_token*/
491            );
492
493 OM_uint32 gss_context_time
494            (OM_uint32 * /*minor_status*/,
495             const gss_ctx_id_t /*context_handle*/,
496             OM_uint32 * /*time_rec*/
497            );
498
499 OM_uint32 gss_get_mic
500            (OM_uint32 * /*minor_status*/,
501             const gss_ctx_id_t /*context_handle*/,
502             gss_qop_t /*qop_req*/,
503             const gss_buffer_t /*message_buffer*/,
504             gss_buffer_t /*message_token*/
505            );
506
507 OM_uint32 gss_verify_mic
508            (OM_uint32 * /*minor_status*/,
509             const gss_ctx_id_t /*context_handle*/,
510             const gss_buffer_t /*message_buffer*/,
511             const gss_buffer_t /*token_buffer*/,
512             gss_qop_t * /*qop_state*/
513            );
514
515 OM_uint32 gss_wrap
516            (OM_uint32 * /*minor_status*/,
517             const gss_ctx_id_t /*context_handle*/,
518             int /*conf_req_flag*/,
519             gss_qop_t /*qop_req*/,
520             const gss_buffer_t /*input_message_buffer*/,
521             int * /*conf_state*/,
522             gss_buffer_t /*output_message_buffer*/
523            );
524
525 OM_uint32 gss_unwrap
526            (OM_uint32 * /*minor_status*/,
527             const gss_ctx_id_t /*context_handle*/,
528             const gss_buffer_t /*input_message_buffer*/,
529             gss_buffer_t /*output_message_buffer*/,
530             int * /*conf_state*/,
531             gss_qop_t * /*qop_state*/
532            );
533
534 OM_uint32 gss_display_status
535            (OM_uint32 * /*minor_status*/,
536             OM_uint32 /*status_value*/,
537             int /*status_type*/,
538             const gss_OID /*mech_type*/,
539             OM_uint32 * /*message_context*/,
540             gss_buffer_t /*status_string*/
541            );
542
543 OM_uint32 gss_indicate_mechs
544            (OM_uint32 * /*minor_status*/,
545             gss_OID_set * /*mech_set*/
546            );
547
548 OM_uint32 gss_compare_name
549            (OM_uint32 * /*minor_status*/,
550             const gss_name_t /*name1*/,
551             const gss_name_t /*name2*/,
552             int * /*name_equal*/
553            );
554
555 OM_uint32 gss_display_name
556            (OM_uint32 * /*minor_status*/,
557             const gss_name_t /*input_name*/,
558             gss_buffer_t /*output_name_buffer*/,
559             gss_OID * /*output_name_type*/
560            );
561
562 OM_uint32 gss_import_name
563            (OM_uint32 * /*minor_status*/,
564             const gss_buffer_t /*input_name_buffer*/,
565             const gss_OID /*input_name_type*/,
566             gss_name_t * /*output_name*/
567            );
568
569 OM_uint32 gss_export_name
570            (OM_uint32  * /*minor_status*/,
571             const gss_name_t /*input_name*/,
572             gss_buffer_t /*exported_name*/
573            );
574
575 OM_uint32 gss_release_name
576            (OM_uint32 * /*minor_status*/,
577             gss_name_t * /*input_name*/
578            );
579
580 OM_uint32 gss_release_buffer
581            (OM_uint32 * /*minor_status*/,
582             gss_buffer_t /*buffer*/
583            );
584
585 OM_uint32 gss_release_oid_set
586            (OM_uint32 * /*minor_status*/,
587             gss_OID_set * /*set*/
588            );
589
590 OM_uint32 gss_inquire_cred
591            (OM_uint32 * /*minor_status*/,
592             const gss_cred_id_t /*cred_handle*/,
593             gss_name_t * /*name*/,
594             OM_uint32 * /*lifetime*/,
595             gss_cred_usage_t * /*cred_usage*/,
596             gss_OID_set * /*mechanisms*/
597            );
598
599 OM_uint32 gss_inquire_context (
600             OM_uint32 * /*minor_status*/,
601             const gss_ctx_id_t /*context_handle*/,
602             gss_name_t * /*src_name*/,
603             gss_name_t * /*targ_name*/,
604             OM_uint32 * /*lifetime_rec*/,
605             gss_OID * /*mech_type*/,
606             OM_uint32 * /*ctx_flags*/,
607             int * /*locally_initiated*/,
608             int * /*open_context*/
609            );
610
611 OM_uint32 gss_wrap_size_limit (
612             OM_uint32 * /*minor_status*/,
613             const gss_ctx_id_t /*context_handle*/,
614             int /*conf_req_flag*/,
615             gss_qop_t /*qop_req*/,
616             OM_uint32 /*req_output_size*/,
617             OM_uint32 * /*max_input_size*/
618            );
619
620 OM_uint32 gss_add_cred (
621             OM_uint32 * /*minor_status*/,
622             const gss_cred_id_t /*input_cred_handle*/,
623             const gss_name_t /*desired_name*/,
624             const gss_OID /*desired_mech*/,
625             gss_cred_usage_t /*cred_usage*/,
626             OM_uint32 /*initiator_time_req*/,
627             OM_uint32 /*acceptor_time_req*/,
628             gss_cred_id_t * /*output_cred_handle*/,
629             gss_OID_set * /*actual_mechs*/,
630             OM_uint32 * /*initiator_time_rec*/,
631             OM_uint32 * /*acceptor_time_rec*/
632            );
633
634 OM_uint32 gss_inquire_cred_by_mech (
635             OM_uint32 * /*minor_status*/,
636             const gss_cred_id_t /*cred_handle*/,
637             const gss_OID /*mech_type*/,
638             gss_name_t * /*name*/,
639             OM_uint32 * /*initiator_lifetime*/,
640             OM_uint32 * /*acceptor_lifetime*/,
641             gss_cred_usage_t * /*cred_usage*/
642            );
643
644 OM_uint32 gss_export_sec_context (
645             OM_uint32 * /*minor_status*/,
646             gss_ctx_id_t * /*context_handle*/,
647             gss_buffer_t /*interprocess_token*/
648            );
649
650 OM_uint32 gss_import_sec_context (
651             OM_uint32 * /*minor_status*/,
652             const gss_buffer_t /*interprocess_token*/,
653             gss_ctx_id_t * /*context_handle*/
654            );
655
656 OM_uint32 gss_create_empty_oid_set (
657             OM_uint32 * /*minor_status*/,
658             gss_OID_set * /*oid_set*/
659            );
660
661 OM_uint32 gss_add_oid_set_member (
662             OM_uint32 * /*minor_status*/,
663             const gss_OID /*member_oid*/,
664             gss_OID_set * /*oid_set*/
665            );
666
667 OM_uint32 gss_test_oid_set_member (
668             OM_uint32 * /*minor_status*/,
669             const gss_OID /*member*/,
670             const gss_OID_set /*set*/,
671             int * /*present*/
672            );
673
674 OM_uint32 gss_inquire_names_for_mech (
675             OM_uint32 * /*minor_status*/,
676             const gss_OID /*mechanism*/,
677             gss_OID_set * /*name_types*/
678            );
679
680 OM_uint32 gss_inquire_mechs_for_name (
681             OM_uint32 * /*minor_status*/,
682             const gss_name_t /*input_name*/,
683             gss_OID_set * /*mech_types*/
684            );
685
686 OM_uint32 gss_canonicalize_name (
687             OM_uint32 * /*minor_status*/,
688             const gss_name_t /*input_name*/,
689             const gss_OID /*mech_type*/,
690             gss_name_t * /*output_name*/
691            );
692
693 OM_uint32 gss_duplicate_name (
694             OM_uint32 * /*minor_status*/,
695             const gss_name_t /*src_name*/,
696             gss_name_t * /*dest_name*/
697            );
698
699 OM_uint32 gss_duplicate_oid (
700             OM_uint32 * /* minor_status */,
701             gss_OID /* src_oid */,
702             gss_OID * /* dest_oid */
703            );
704 OM_uint32
705 gss_release_oid
706         (OM_uint32 * /*minor_status*/,
707          gss_OID * /* oid */
708         );
709
710 OM_uint32
711 gss_oid_to_str(
712             OM_uint32 * /*minor_status*/,
713             gss_OID /* oid */,
714             gss_buffer_t /* str */
715            );
716
717 OM_uint32
718 gss_inquire_sec_context_by_oid(
719             OM_uint32 * minor_status,
720             const gss_ctx_id_t context_handle,
721             const gss_OID desired_object,
722             gss_buffer_set_t *data_set
723            );
724
725 OM_uint32
726 gss_set_sec_context_option (OM_uint32 *minor_status,
727                             gss_ctx_id_t *context_handle,
728                             const gss_OID desired_object,
729                             const gss_buffer_t value);
730
731 OM_uint32
732 gss_set_cred_option (OM_uint32 *minor_status,
733                      gss_cred_id_t *cred_handle,
734                      const gss_OID object,
735                      const gss_buffer_t value);
736
737 int
738 gss_oid_equal(const gss_OID a, const gss_OID b);
739
740 OM_uint32 
741 gss_create_empty_buffer_set
742            (OM_uint32 * minor_status,
743             gss_buffer_set_t *buffer_set);
744
745 OM_uint32
746 gss_add_buffer_set_member
747            (OM_uint32 * minor_status,
748             const gss_buffer_t member_buffer,
749             gss_buffer_set_t *buffer_set);
750
751 OM_uint32
752 gss_release_buffer_set
753            (OM_uint32 * minor_status,
754             gss_buffer_set_t *buffer_set);
755
756 OM_uint32
757 gss_inquire_cred_by_oid(OM_uint32 *minor_status,
758                         const gss_cred_id_t cred_handle,
759                         const gss_OID desired_object,
760                         gss_buffer_set_t *data_set);
761
762 /*
763  * The following routines are obsolete variants of gss_get_mic,
764  * gss_verify_mic, gss_wrap and gss_unwrap.  They should be
765  * provided by GSSAPI V2 implementations for backwards
766  * compatibility with V1 applications.  Distinct entrypoints
767  * (as opposed to #defines) should be provided, both to allow
768  * GSSAPI V1 applications to link against GSSAPI V2 implementations,
769  * and to retain the slight parameter type differences between the
770  * obsolete versions of these routines and their current forms.
771  */
772
773 OM_uint32 gss_sign
774            (OM_uint32 * /*minor_status*/,
775             gss_ctx_id_t /*context_handle*/,
776             int /*qop_req*/,
777             gss_buffer_t /*message_buffer*/,
778             gss_buffer_t /*message_token*/
779            );
780
781 OM_uint32 gss_verify
782            (OM_uint32 * /*minor_status*/,
783             gss_ctx_id_t /*context_handle*/,
784             gss_buffer_t /*message_buffer*/,
785             gss_buffer_t /*token_buffer*/,
786             int * /*qop_state*/
787            );
788
789 OM_uint32 gss_seal
790            (OM_uint32 * /*minor_status*/,
791             gss_ctx_id_t /*context_handle*/,
792             int /*conf_req_flag*/,
793             int /*qop_req*/,
794             gss_buffer_t /*input_message_buffer*/,
795             int * /*conf_state*/,
796             gss_buffer_t /*output_message_buffer*/
797            );
798
799 OM_uint32 gss_unseal
800            (OM_uint32 * /*minor_status*/,
801             gss_ctx_id_t /*context_handle*/,
802             gss_buffer_t /*input_message_buffer*/,
803             gss_buffer_t /*output_message_buffer*/,
804             int * /*conf_state*/,
805             int * /*qop_state*/
806            );
807
808 /*
809  *
810  */
811
812 OM_uint32
813 gss_inquire_sec_context_by_oid (OM_uint32 *minor_status,
814                                 const gss_ctx_id_t context_handle,
815                                 const gss_OID desired_object,
816                                 gss_buffer_set_t *data_set);
817
818 OM_uint32
819 gss_encapsulate_token(gss_buffer_t /* input_token */,
820                       gss_OID /* oid */,
821                       gss_buffer_t /* output_token */);
822
823 OM_uint32
824 gss_decapsulate_token(gss_buffer_t /* input_token */,
825                       gss_OID /* oid */,
826                       gss_buffer_t /* output_token */);
827
828
829
830 #ifdef __cplusplus
831 }
832 #endif
833
834 #include <gssapi/gssapi_krb5.h>
835 #include <gssapi/gssapi_spnego.h>
836
837 #endif /* GSSAPI_GSSAPI_H_ */