s4:torture: Adapt KDC canon test to Heimdal upstream changes
[samba.git] / third_party / heimdal / lib / gssapi / gssapi / gssapi.h
1 /*
2  * Copyright (c) 1997 - 2018 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 #ifndef GSSAPI_GSSAPI_H_
35 #define GSSAPI_GSSAPI_H_
36
37 /*
38  * First, include stddef.h to get size_t defined.
39  */
40 #include <stdarg.h>
41 #include <stddef.h>
42
43 #include <krb5-types.h>
44
45 #ifndef BUILD_GSSAPI_LIB
46 #if defined(_WIN32)
47 #define GSSAPI_LIB_FUNCTION __declspec(dllimport)
48 #define GSSAPI_LIB_CALL     __stdcall
49 #define GSSAPI_LIB_VARIABLE __declspec(dllimport)
50 #else
51 #define GSSAPI_LIB_FUNCTION
52 #define GSSAPI_LIB_CALL
53 #define GSSAPI_LIB_VARIABLE
54 #endif
55 #endif
56
57 #ifndef GSSAPI_DEPRECATED_FUNCTION
58 #if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 )))
59 #define GSSAPI_DEPRECATED_FUNCTION(X) __attribute__((deprecated))
60 #else
61 #define GSSAPI_DEPRECATED_FUNCTION(X)
62 #endif
63 #endif
64
65 /* Compatiblity with MIT Kerberos on the Mac */
66 #if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
67 #pragma pack(push,2)
68 #endif
69
70 #ifdef __cplusplus
71 #define GSSAPI_CPP_START        extern "C" {
72 #define GSSAPI_CPP_END          }
73 #else
74 #define GSSAPI_CPP_START
75 #define GSSAPI_CPP_END
76 #endif
77
78 #ifdef _WIN32
79 #define GSSAPI_CALLCONV __stdcall
80 #else
81 #define GSSAPI_CALLCONV
82 #endif
83
84 /*
85  * Now define the three implementation-dependent types.
86  */
87
88 typedef uint32_t OM_uint32;
89 typedef uint64_t OM_uint64;
90
91 typedef uint32_t gss_uint32;
92
93 struct gss_name_t_desc_struct;
94 typedef struct gss_name_t_desc_struct *gss_name_t;
95 typedef const struct gss_name_t_desc_struct *gss_const_name_t;
96
97 struct gss_ctx_id_t_desc_struct;
98 typedef struct gss_ctx_id_t_desc_struct *gss_ctx_id_t;
99 typedef const struct gss_ctx_id_t_desc_struct *gss_const_ctx_id_t;
100
101 typedef struct gss_OID_desc_struct {
102       OM_uint32 length;
103       void      *elements;
104 } gss_OID_desc, *gss_OID;
105 typedef const gss_OID_desc * gss_const_OID;
106
107 typedef struct gss_OID_set_desc_struct  {
108       size_t     count;
109       gss_OID    elements;
110 } gss_OID_set_desc, *gss_OID_set;
111 typedef const gss_OID_set_desc * gss_const_OID_set;
112
113 typedef int gss_cred_usage_t;
114
115 struct gss_cred_id_t_desc_struct;
116 typedef struct gss_cred_id_t_desc_struct *gss_cred_id_t;
117 typedef const struct gss_cred_id_t_desc_struct *gss_const_cred_id_t;
118
119 typedef struct gss_buffer_desc_struct {
120       size_t length;
121       void *value;
122 } gss_buffer_desc, *gss_buffer_t;
123 typedef const gss_buffer_desc * gss_const_buffer_t;
124
125 typedef struct gss_channel_bindings_struct {
126       OM_uint32 initiator_addrtype;
127       gss_buffer_desc initiator_address;
128       OM_uint32 acceptor_addrtype;
129       gss_buffer_desc acceptor_address;
130       gss_buffer_desc application_data;
131 } *gss_channel_bindings_t;
132 typedef const struct gss_channel_bindings_struct *gss_const_channel_bindings_t;
133
134 /* GGF extension data types */
135 typedef struct gss_buffer_set_desc_struct {
136       size_t count;
137       gss_buffer_desc *elements;
138 } gss_buffer_set_desc, *gss_buffer_set_t;
139
140 typedef struct gss_iov_buffer_desc_struct {
141     OM_uint32 type;
142     gss_buffer_desc buffer;
143 } gss_iov_buffer_desc, *gss_iov_buffer_t;
144
145 /* Credential store extensions */
146 typedef struct gss_key_value_element_struct {
147     const char *key;
148     const char *value;
149 } gss_key_value_element_desc;
150
151 typedef struct gss_key_value_set_struct {
152     OM_uint32 count; /* should be size_t, but for MIT compat */
153     gss_key_value_element_desc *elements;
154 } gss_key_value_set_desc, *gss_key_value_set_t;
155
156 typedef const gss_key_value_set_desc *gss_const_key_value_set_t;
157
158 /*
159  * For now, define a QOP-type as an OM_uint32
160  */
161 typedef OM_uint32 gss_qop_t;
162
163
164 /*
165  * Flag bits for context-level services.
166  */
167 #define GSS_C_DELEG_FLAG 1
168 #define GSS_C_MUTUAL_FLAG 2
169 #define GSS_C_REPLAY_FLAG 4
170 #define GSS_C_SEQUENCE_FLAG 8
171 #define GSS_C_CONF_FLAG 16
172 #define GSS_C_INTEG_FLAG 32
173 #define GSS_C_ANON_FLAG 64
174 #define GSS_C_PROT_READY_FLAG 128
175 #define GSS_C_TRANS_FLAG 256
176
177 #define GSS_C_CHANNEL_BOUND_FLAG 2048
178 #define GSS_C_DCE_STYLE 4096
179 #define GSS_C_IDENTIFY_FLAG 8192
180 #define GSS_C_EXTENDED_ERROR_FLAG 16384
181 #define GSS_C_DELEG_POLICY_FLAG 32768
182
183 /*
184  * Credential usage options
185  */
186 #define GSS_C_BOTH 0
187 #define GSS_C_INITIATE 1
188 #define GSS_C_ACCEPT 2
189
190 /*
191  * Status code types for gss_display_status
192  */
193 #define GSS_C_GSS_CODE 1
194 #define GSS_C_MECH_CODE 2
195
196 /*
197  * The constant definitions for channel-bindings address families
198  */
199 #define GSS_C_AF_UNSPEC     0
200 #define GSS_C_AF_LOCAL      1
201 #define GSS_C_AF_INET       2
202 #define GSS_C_AF_IMPLINK    3
203 #define GSS_C_AF_PUP        4
204 #define GSS_C_AF_CHAOS      5
205 #define GSS_C_AF_NS         6
206 #define GSS_C_AF_NBS        7
207 #define GSS_C_AF_ECMA       8
208 #define GSS_C_AF_DATAKIT    9
209 #define GSS_C_AF_CCITT      10
210 #define GSS_C_AF_SNA        11
211 #define GSS_C_AF_DECnet     12
212 #define GSS_C_AF_DLI        13
213 #define GSS_C_AF_LAT        14
214 #define GSS_C_AF_HYLINK     15
215 #define GSS_C_AF_APPLETALK  16
216 #define GSS_C_AF_BSC        17
217 #define GSS_C_AF_DSS        18
218 #define GSS_C_AF_OSI        19
219 #define GSS_C_AF_X25        21
220 #define GSS_C_AF_INET6      24
221
222 #define GSS_C_AF_NULLADDR   255
223
224 /*
225  * Various Null values
226  */
227 #define GSS_C_NO_NAME ((gss_name_t) 0)
228 #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
229 #define GSS_C_NO_BUFFER_SET ((gss_buffer_set_t) 0)
230 #define GSS_C_NO_OID ((gss_OID) 0)
231 #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
232 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
233 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
234 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
235 #define GSS_C_EMPTY_BUFFER {0, NULL}
236 #define GSS_C_NO_IOV_BUFFER ((gss_iov_buffer_t)0)
237 #define GSS_C_NO_CRED_STORE ((gss_key_value_set_t)0)
238
239 /*
240  * Some alternate names for a couple of the above
241  * values.  These are defined for V1 compatibility.
242  */
243 #define GSS_C_NULL_OID GSS_C_NO_OID
244 #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
245
246 /*
247  * Define the default Quality of Protection for per-message
248  * services.  Note that an implementation that offers multiple
249  * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
250  * (as done here) to mean "default protection", or to a specific
251  * explicit QOP value.  However, a value of 0 should always be
252  * interpreted by a GSSAPI implementation as a request for the
253  * default protection level.
254  */
255 #define GSS_C_QOP_DEFAULT 0
256
257 #define GSS_KRB5_CONF_C_QOP_DES         0x0100
258 #define GSS_KRB5_CONF_C_QOP_DES3_KD     0x0200
259
260 /*
261  * Expiration time of 2^32-1 seconds means infinite lifetime for a
262  * credential or security context
263  */
264 #define GSS_C_INDEFINITE 0xfffffffful
265
266 /*
267  * Type of gss_wrap_iov()/gss_unwrap_iov().
268  */
269
270 #define GSS_IOV_BUFFER_TYPE_EMPTY 0
271 #define GSS_IOV_BUFFER_TYPE_DATA 1
272 #define GSS_IOV_BUFFER_TYPE_HEADER 2
273 #define GSS_IOV_BUFFER_TYPE_MECH_PARAMS 3
274
275 #define GSS_IOV_BUFFER_TYPE_TRAILER 7
276 #define GSS_IOV_BUFFER_TYPE_PADDING 9
277 #define GSS_IOV_BUFFER_TYPE_STREAM 10
278 #define GSS_IOV_BUFFER_TYPE_SIGN_ONLY 11
279
280 #define GSS_IOV_BUFFER_TYPE_FLAG_MASK           0xffff0000
281 #define GSS_IOV_BUFFER_FLAG_ALLOCATE            0x00010000
282 #define GSS_IOV_BUFFER_FLAG_ALLOCATED           0x00020000
283
284 #define GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATE       0x00010000 /* old name */
285 #define GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATED      0x00020000 /* old name */
286
287 #define GSS_IOV_BUFFER_TYPE(_t) ((_t) & ~GSS_IOV_BUFFER_TYPE_FLAG_MASK)
288 #define GSS_IOV_BUFFER_FLAGS(_t) ((_t) & GSS_IOV_BUFFER_TYPE_FLAG_MASK)
289
290 GSSAPI_CPP_START
291
292 #include <gssapi/gssapi_oid.h>
293
294 /*
295  * The implementation must reserve static storage for a
296  * gss_OID_desc object containing the value
297  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
298  *              "\x01\x02\x01\x01"},
299  * corresponding to an object-identifier value of
300  * {iso(1) member-body(2) United States(840) mit(113554)
301  *  infosys(1) gssapi(2) generic(1) user_name(1)}.  The constant
302  * GSS_C_NT_USER_NAME should be initialized to point
303  * to that gss_OID_desc.
304  */
305 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_user_name_oid_desc;
306 #define GSS_C_NT_USER_NAME (&__gss_c_nt_user_name_oid_desc)
307
308 /*
309  * The implementation must reserve static storage for a
310  * gss_OID_desc object containing the value
311  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
312  *              "\x01\x02\x01\x02"},
313  * corresponding to an object-identifier value of
314  * {iso(1) member-body(2) United States(840) mit(113554)
315  *  infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
316  * The constant GSS_C_NT_MACHINE_UID_NAME should be
317  * initialized to point to that gss_OID_desc.
318  */
319 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_machine_uid_name_oid_desc;
320 #define GSS_C_NT_MACHINE_UID_NAME (&__gss_c_nt_machine_uid_name_oid_desc)
321
322 /*
323  * The implementation must reserve static storage for a
324  * gss_OID_desc object containing the value
325  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
326  *              "\x01\x02\x01\x03"},
327  * corresponding to an object-identifier value of
328  * {iso(1) member-body(2) United States(840) mit(113554)
329  *  infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
330  * The constant GSS_C_NT_STRING_UID_NAME should be
331  * initialized to point to that gss_OID_desc.
332  */
333 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_string_uid_name_oid_desc;
334 #define GSS_C_NT_STRING_UID_NAME (&__gss_c_nt_string_uid_name_oid_desc)
335
336 /*
337  * The implementation must reserve static storage for a
338  * gss_OID_desc object containing the value
339  * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
340  * corresponding to an object-identifier value of
341  * {iso(1) org(3) dod(6) internet(1) security(5)
342  * nametypes(6) gss-host-based-services(2)).  The constant
343  * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
344  * to that gss_OID_desc.  This is a deprecated OID value, and
345  * implementations wishing to support hostbased-service names
346  * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
347  * defined below, to identify such names;
348  * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
349  * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
350  * parameter, but should not be emitted by GSS-API
351  * implementations
352  */
353 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_hostbased_service_x_oid_desc;
354 #define GSS_C_NT_HOSTBASED_SERVICE_X (&__gss_c_nt_hostbased_service_x_oid_desc)
355
356 /*
357  * The implementation must reserve static storage for a
358  * gss_OID_desc object containing the value
359  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
360  *              "\x01\x02\x01\x04"}, corresponding to an
361  * object-identifier value of {iso(1) member-body(2)
362  * Unites States(840) mit(113554) infosys(1) gssapi(2)
363  * generic(1) service_name(4)}.  The constant
364  * GSS_C_NT_HOSTBASED_SERVICE should be initialized
365  * to point to that gss_OID_desc.
366  */
367 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_hostbased_service_oid_desc;
368 #define GSS_C_NT_HOSTBASED_SERVICE (&__gss_c_nt_hostbased_service_oid_desc)
369
370 /*
371  * The implementation must reserve static storage for a
372  * gss_OID_desc object containing the value
373  * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
374  * corresponding to an object identifier value of
375  * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
376  * 6(nametypes), 3(gss-anonymous-name)}.  The constant
377  * and GSS_C_NT_ANONYMOUS should be initialized to point
378  * to that gss_OID_desc.
379  */
380 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_anonymous_oid_desc;
381 #define GSS_C_NT_ANONYMOUS (&__gss_c_nt_anonymous_oid_desc)
382
383 /*
384  * The implementation must reserve static storage for a
385  * gss_OID_desc object containing the value
386  * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
387  * corresponding to an object-identifier value of
388  * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
389  * 6(nametypes), 4(gss-api-exported-name)}.  The constant
390  * GSS_C_NT_EXPORT_NAME should be initialized to point
391  * to that gss_OID_desc.
392  */
393 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_export_name_oid_desc;
394 #define GSS_C_NT_EXPORT_NAME (&__gss_c_nt_export_name_oid_desc)
395
396 /* Major status codes */
397
398 #define GSS_S_COMPLETE 0
399
400 /*
401  * Some "helper" definitions to make the status code macros obvious.
402  */
403 #define GSS_C_CALLING_ERROR_OFFSET 24
404 #define GSS_C_ROUTINE_ERROR_OFFSET 16
405 #define GSS_C_SUPPLEMENTARY_OFFSET 0
406 #define GSS_C_CALLING_ERROR_MASK 0377ul
407 #define GSS_C_ROUTINE_ERROR_MASK 0377ul
408 #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
409
410 /*
411  * The macros that test status codes for error conditions.
412  * Note that the GSS_ERROR() macro has changed slightly from
413  * the V1 GSSAPI so that it now evaluates its argument
414  * only once.
415  */
416 #define GSS_CALLING_ERROR(x) \
417   (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
418 #define GSS_ROUTINE_ERROR(x) \
419   (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
420 #define GSS_SUPPLEMENTARY_INFO(x) \
421   (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
422 #define GSS_ERROR(x) \
423   (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
424         (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
425
426 /*
427  * Now the actual status code definitions
428  */
429
430 /*
431  * Calling errors:
432  */
433 #define GSS_S_CALL_INACCESSIBLE_READ \
434                              (1ul << GSS_C_CALLING_ERROR_OFFSET)
435 #define GSS_S_CALL_INACCESSIBLE_WRITE \
436                              (2ul << GSS_C_CALLING_ERROR_OFFSET)
437 #define GSS_S_CALL_BAD_STRUCTURE \
438                              (3ul << GSS_C_CALLING_ERROR_OFFSET)
439
440 /*
441  * Routine errors:
442  */
443 #define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
444 #define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
445 #define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
446
447 #define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
448 #define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
449 #define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
450 #define GSS_S_BAD_MIC GSS_S_BAD_SIG
451 #define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
452 #define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
453 #define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
454 #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
455 #define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
456 #define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
457 #define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
458 #define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
459 #define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
460 #define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
461 #define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
462 #define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
463 #define GSS_S_BAD_MECH_ATTR (19ul << GSS_C_ROUTINE_ERROR_OFFSET)
464
465 /*
466  * Apparently awating spec fix.
467  */
468 #define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
469
470 /*
471  * Supplementary info bits:
472  */
473 #define GSS_S_CONTINUE_NEEDED (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
474 #define GSS_S_DUPLICATE_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
475 #define GSS_S_OLD_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
476 #define GSS_S_UNSEQ_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
477 #define GSS_S_GAP_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
478
479 /*
480  * Finally, function prototypes for the GSS-API routines.
481  */
482
483 #define GSS_C_OPTION_MASK 0xffff
484 #define GSS_C_CRED_NO_UI  0x10000
485
486 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_acquire_cred
487            (OM_uint32 * /*minor_status*/,
488             gss_const_name_t /*desired_name*/,
489             OM_uint32 /*time_req*/,
490             const gss_OID_set /*desired_mechs*/,
491             gss_cred_usage_t /*cred_usage*/,
492             gss_cred_id_t * /*output_cred_handle*/,
493             gss_OID_set * /*actual_mechs*/,
494             OM_uint32 * /*time_rec*/
495            );
496
497 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_cred
498            (OM_uint32 * /*minor_status*/,
499             gss_cred_id_t * /*cred_handle*/
500            );
501
502 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_init_sec_context
503            (OM_uint32 * /*minor_status*/,
504             gss_const_cred_id_t /*initiator_cred_handle*/,
505             gss_ctx_id_t * /*context_handle*/,
506             gss_const_name_t /*target_name*/,
507             const gss_OID /*mech_type*/,
508             OM_uint32 /*req_flags*/,
509             OM_uint32 /*time_req*/,
510             const gss_channel_bindings_t /*input_chan_bindings*/,
511             const gss_buffer_t /*input_token*/,
512             gss_OID * /*actual_mech_type*/,
513             gss_buffer_t /*output_token*/,
514             OM_uint32 * /*ret_flags*/,
515             OM_uint32 * /*time_rec*/
516            );
517
518 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_accept_sec_context
519            (OM_uint32 * /*minor_status*/,
520             gss_ctx_id_t * /*context_handle*/,
521             gss_const_cred_id_t /*acceptor_cred_handle*/,
522             const gss_buffer_t /*input_token_buffer*/,
523             const gss_channel_bindings_t /*input_chan_bindings*/,
524             gss_name_t * /*src_name*/,
525             gss_OID * /*mech_type*/,
526             gss_buffer_t /*output_token*/,
527             OM_uint32 * /*ret_flags*/,
528             OM_uint32 * /*time_rec*/,
529             gss_cred_id_t * /*delegated_cred_handle*/
530            );
531
532 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_process_context_token
533            (OM_uint32 * /*minor_status*/,
534             gss_const_ctx_id_t /*context_handle*/,
535             const gss_buffer_t /*token_buffer*/
536            );
537
538 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_delete_sec_context
539            (OM_uint32 * /*minor_status*/,
540             gss_ctx_id_t * /*context_handle*/,
541             gss_buffer_t /*output_token*/
542            );
543
544 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_context_time
545            (OM_uint32 * /*minor_status*/,
546             gss_const_ctx_id_t /*context_handle*/,
547             OM_uint32 * /*time_rec*/
548            );
549
550 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_get_mic
551            (OM_uint32 * /*minor_status*/,
552             gss_const_ctx_id_t /*context_handle*/,
553             gss_qop_t /*qop_req*/,
554             const gss_buffer_t /*message_buffer*/,
555             gss_buffer_t /*message_token*/
556            );
557
558 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_verify_mic
559            (OM_uint32 * /*minor_status*/,
560             gss_const_ctx_id_t /*context_handle*/,
561             const gss_buffer_t /*message_buffer*/,
562             const gss_buffer_t /*token_buffer*/,
563             gss_qop_t * /*qop_state*/
564            );
565
566 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_wrap
567            (OM_uint32 * /*minor_status*/,
568             gss_const_ctx_id_t /*context_handle*/,
569             int /*conf_req_flag*/,
570             gss_qop_t /*qop_req*/,
571             const gss_buffer_t /*input_message_buffer*/,
572             int * /*conf_state*/,
573             gss_buffer_t /*output_message_buffer*/
574            );
575
576 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_unwrap
577            (OM_uint32 * /*minor_status*/,
578             gss_const_ctx_id_t /*context_handle*/,
579             const gss_buffer_t /*input_message_buffer*/,
580             gss_buffer_t /*output_message_buffer*/,
581             int * /*conf_state*/,
582             gss_qop_t * /*qop_state*/
583            );
584
585 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_display_status
586            (OM_uint32 * /*minor_status*/,
587             OM_uint32 /*status_value*/,
588             int /*status_type*/,
589             const gss_OID /*mech_type*/,
590             OM_uint32 * /*message_context*/,
591             gss_buffer_t /*status_string*/
592            );
593
594 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_indicate_mechs
595            (OM_uint32 * /*minor_status*/,
596             gss_OID_set * /*mech_set*/
597            );
598
599 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_compare_name
600            (OM_uint32 * /*minor_status*/,
601             gss_const_name_t /*name1*/,
602             gss_const_name_t /*name2*/,
603             int * /*name_equal*/
604            );
605
606 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_display_name
607            (OM_uint32 * /*minor_status*/,
608             gss_const_name_t /*input_name*/,
609             gss_buffer_t /*output_name_buffer*/,
610             gss_OID * /*output_name_type*/
611            );
612
613 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_import_name
614            (OM_uint32 * /*minor_status*/,
615             const gss_buffer_t /*input_name_buffer*/,
616             const gss_OID /*input_name_type*/,
617             gss_name_t * /*output_name*/
618            );
619
620 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_export_name
621            (OM_uint32  * /*minor_status*/,
622             gss_const_name_t /*input_name*/,
623             gss_buffer_t /*exported_name*/
624            );
625
626 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_name
627            (OM_uint32 * /*minor_status*/,
628             gss_name_t * /*input_name*/
629            );
630
631 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_buffer
632            (OM_uint32 * /*minor_status*/,
633             gss_buffer_t /*buffer*/
634            );
635
636 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_oid_set
637            (OM_uint32 * /*minor_status*/,
638             gss_OID_set * /*set*/
639            );
640
641 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_cred
642            (OM_uint32 * /*minor_status*/,
643             gss_const_cred_id_t /*cred_handle*/,
644             gss_name_t * /*name*/,
645             OM_uint32 * /*lifetime*/,
646             gss_cred_usage_t * /*cred_usage*/,
647             gss_OID_set * /*mechanisms*/
648            );
649
650 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_context (
651             OM_uint32 * /*minor_status*/,
652             gss_const_ctx_id_t /*context_handle*/,
653             gss_name_t * /*src_name*/,
654             gss_name_t * /*targ_name*/,
655             OM_uint32 * /*lifetime_rec*/,
656             gss_OID * /*mech_type*/,
657             OM_uint32 * /*ctx_flags*/,
658             int * /*locally_initiated*/,
659             int * /*open_context*/
660            );
661
662 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_wrap_size_limit (
663             OM_uint32 * /*minor_status*/,
664             gss_const_ctx_id_t /*context_handle*/,
665             int /*conf_req_flag*/,
666             gss_qop_t /*qop_req*/,
667             OM_uint32 /*req_output_size*/,
668             OM_uint32 * /*max_input_size*/
669            );
670
671 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_add_cred (
672             OM_uint32 * /*minor_status*/,
673             gss_const_cred_id_t /*input_cred_handle*/,
674             gss_const_name_t /*desired_name*/,
675             const gss_OID /*desired_mech*/,
676             gss_cred_usage_t /*cred_usage*/,
677             OM_uint32 /*initiator_time_req*/,
678             OM_uint32 /*acceptor_time_req*/,
679             gss_cred_id_t * /*output_cred_handle*/,
680             gss_OID_set * /*actual_mechs*/,
681             OM_uint32 * /*initiator_time_rec*/,
682             OM_uint32 * /*acceptor_time_rec*/
683            );
684
685 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_cred_by_mech (
686             OM_uint32 * /*minor_status*/,
687             gss_const_cred_id_t /*cred_handle*/,
688             const gss_OID /*mech_type*/,
689             gss_name_t * /*name*/,
690             OM_uint32 * /*initiator_lifetime*/,
691             OM_uint32 * /*acceptor_lifetime*/,
692             gss_cred_usage_t * /*cred_usage*/
693            );
694
695 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_export_sec_context (
696             OM_uint32 * /*minor_status*/,
697             gss_ctx_id_t * /*context_handle*/,
698             gss_buffer_t /*interprocess_token*/
699            );
700
701 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_import_sec_context (
702             OM_uint32 * /*minor_status*/,
703             const gss_buffer_t /*interprocess_token*/,
704             gss_ctx_id_t * /*context_handle*/
705            );
706
707 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_create_empty_oid_set (
708             OM_uint32 * /*minor_status*/,
709             gss_OID_set * /*oid_set*/
710            );
711
712 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_add_oid_set_member (
713             OM_uint32 * /*minor_status*/,
714             const gss_OID /*member_oid*/,
715             gss_OID_set * /*oid_set*/
716            );
717
718 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_test_oid_set_member (
719             OM_uint32 * /*minor_status*/,
720             const gss_OID /*member*/,
721             const gss_OID_set /*set*/,
722             int * /*present*/
723            );
724
725 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_names_for_mech (
726             OM_uint32 * /*minor_status*/,
727             const gss_OID /*mechanism*/,
728             gss_OID_set * /*name_types*/
729            );
730
731 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_mechs_for_name (
732             OM_uint32 * /*minor_status*/,
733             gss_const_name_t /*input_name*/,
734             gss_OID_set * /*mech_types*/
735            );
736
737 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_canonicalize_name (
738             OM_uint32 * /*minor_status*/,
739             gss_const_name_t /*input_name*/,
740             const gss_OID /*mech_type*/,
741             gss_name_t * /*output_name*/
742            );
743
744 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_duplicate_name (
745             OM_uint32 * /*minor_status*/,
746             gss_const_name_t /*src_name*/,
747             gss_name_t * /*dest_name*/
748            );
749
750 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_duplicate_oid (
751             OM_uint32 * /* minor_status */,
752             gss_OID /* src_oid */,
753             gss_OID * /* dest_oid */
754            );
755
756 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_duplicate_oid_set (
757             OM_uint32 * /* minor_status */,
758             gss_OID_set /* src_oid */,
759             gss_OID_set * /* dest_oid */
760            );
761
762 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
763 gss_release_oid
764         (OM_uint32 * /*minor_status*/,
765          gss_OID * /* oid */
766         );
767
768 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
769 gss_oid_to_str(
770             OM_uint32 * /*minor_status*/,
771             gss_OID /* oid */,
772             gss_buffer_t /* str */
773            );
774
775 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
776 gss_inquire_sec_context_by_oid(
777             OM_uint32 * minor_status,
778             gss_const_ctx_id_t context_handle,
779             const gss_OID desired_object,
780             gss_buffer_set_t *data_set
781            );
782
783 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
784 gss_set_sec_context_option (OM_uint32 *minor_status,
785                             gss_ctx_id_t *context_handle,
786                             const gss_OID desired_object,
787                             const gss_buffer_t value);
788
789 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
790 gss_set_cred_option (OM_uint32 *minor_status,
791                      gss_cred_id_t *cred_handle,
792                      const gss_OID object,
793                      const gss_buffer_t value);
794
795 GSSAPI_LIB_FUNCTION int GSSAPI_LIB_CALL
796 gss_oid_equal(gss_const_OID a, gss_const_OID b);
797
798 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
799 gss_create_empty_buffer_set
800            (OM_uint32 * minor_status,
801             gss_buffer_set_t *buffer_set);
802
803 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
804 gss_add_buffer_set_member
805            (OM_uint32 * minor_status,
806             const gss_buffer_t member_buffer,
807             gss_buffer_set_t *buffer_set);
808
809 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
810 gss_release_buffer_set
811            (OM_uint32 * minor_status,
812             gss_buffer_set_t *buffer_set);
813
814 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
815 gss_inquire_cred_by_oid(OM_uint32 *minor_status,
816                         gss_const_cred_id_t cred_handle,
817                         const gss_OID desired_object,
818                         gss_buffer_set_t *data_set);
819
820 /*
821  * RFC 4401
822  */
823
824 #define GSS_C_PRF_KEY_FULL 0
825 #define GSS_C_PRF_KEY_PARTIAL 1
826
827 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
828 gss_pseudo_random
829         (OM_uint32 *minor_status,
830          gss_ctx_id_t context,
831          int prf_key,
832          const gss_buffer_t prf_in,
833          ssize_t desired_output_len,
834          gss_buffer_t prf_out
835         );
836
837 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
838 gss_store_cred(OM_uint32         * /* minor_status */,
839                gss_cred_id_t     /* input_cred_handle */,
840                gss_cred_usage_t  /* cred_usage */,
841                const gss_OID     /* desired_mech */,
842                OM_uint32         /* overwrite_cred */,
843                OM_uint32         /* default_cred */,
844                gss_OID_set       * /* elements_stored */,
845                gss_cred_usage_t  * /* cred_usage_stored */);
846
847
848 /*
849  * Query functions
850  */
851
852 typedef struct {
853     size_t header; /**< size of header */
854     size_t trailer; /**< size of trailer */
855     size_t max_msg_size; /**< maximum message size */
856     size_t buffers; /**< extra GSS_IOV_BUFFER_TYPE_EMPTY buffer to pass */
857     size_t blocksize; /**< Specificed optimal size of messages, also
858                          is the maximum padding size
859                          (GSS_IOV_BUFFER_TYPE_PADDING) */
860 } gss_context_stream_sizes;
861
862 extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_attr_stream_sizes_oid_desc;
863 #define GSS_C_ATTR_STREAM_SIZES (&__gss_c_attr_stream_sizes_oid_desc)
864
865
866 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
867 gss_context_query_attributes(OM_uint32 * /* minor_status */,
868                              gss_const_ctx_id_t /* context_handle */,
869                              const gss_OID /* attribute */,
870                              void * /*data*/,
871                              size_t /* len */);
872 /*
873  * The following routines are obsolete variants of gss_get_mic,
874  * gss_verify_mic, gss_wrap and gss_unwrap.  They should be
875  * provided by GSSAPI V2 implementations for backwards
876  * compatibility with V1 applications.  Distinct entrypoints
877  * (as opposed to #defines) should be provided, both to allow
878  * GSSAPI V1 applications to link against GSSAPI V2 implementations,
879  * and to retain the slight parameter type differences between the
880  * obsolete versions of these routines and their current forms.
881  */
882
883 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_sign
884            (OM_uint32 * /*minor_status*/,
885             gss_ctx_id_t /*context_handle*/,
886             int /*qop_req*/,
887             gss_buffer_t /*message_buffer*/,
888             gss_buffer_t /*message_token*/
889             ) GSSAPI_DEPRECATED_FUNCTION("Use gss_get_mic");
890
891 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_verify
892            (OM_uint32 * /*minor_status*/,
893             gss_ctx_id_t /*context_handle*/,
894             gss_buffer_t /*message_buffer*/,
895             gss_buffer_t /*token_buffer*/,
896             int * /*qop_state*/
897             ) GSSAPI_DEPRECATED_FUNCTION("Use gss_verify_mic");
898
899 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_seal
900            (OM_uint32 * /*minor_status*/,
901             gss_ctx_id_t /*context_handle*/,
902             int /*conf_req_flag*/,
903             int /*qop_req*/,
904             gss_buffer_t /*input_message_buffer*/,
905             int * /*conf_state*/,
906             gss_buffer_t /*output_message_buffer*/
907            ) GSSAPI_DEPRECATED_FUNCTION("Use gss_wrap");
908
909 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_unseal
910            (OM_uint32 * /*minor_status*/,
911             gss_ctx_id_t /*context_handle*/,
912             gss_buffer_t /*input_message_buffer*/,
913             gss_buffer_t /*output_message_buffer*/,
914             int * /*conf_state*/,
915             int * /*qop_state*/
916            )  GSSAPI_DEPRECATED_FUNCTION("Use gss_unwrap");
917
918 /**
919  *
920  */
921
922 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
923 gss_encapsulate_token(gss_const_buffer_t /* input_token */,
924                       gss_const_OID /* oid */,
925                       gss_buffer_t /* output_token */);
926
927 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
928 gss_decapsulate_token(gss_const_buffer_t /* input_token */,
929                       gss_const_OID /* oid */,
930                       gss_buffer_t /* output_token */);
931
932
933
934 /*
935  * AEAD support
936  */
937
938 /*
939  * GSS_IOV
940  */
941
942 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
943 gss_wrap_iov(OM_uint32 *, gss_ctx_id_t, int, gss_qop_t, int *,
944              gss_iov_buffer_desc *, int);
945
946
947 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
948 gss_unwrap_iov(OM_uint32 *, gss_ctx_id_t, int *, gss_qop_t *,
949                gss_iov_buffer_desc *, int);
950
951 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
952 gss_wrap_iov_length(OM_uint32 *, gss_ctx_id_t, int, gss_qop_t, int *,
953                     gss_iov_buffer_desc *, int);
954
955 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
956 gss_release_iov_buffer(OM_uint32 *, gss_iov_buffer_desc *, int);
957
958 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
959 gss_wrap_aead(OM_uint32 *, gss_ctx_id_t, int, gss_qop_t,
960               gss_buffer_t, gss_buffer_t, int *, gss_buffer_t);
961
962 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
963 gss_unwrap_aead(OM_uint32 *, gss_ctx_id_t, gss_buffer_t,
964                 gss_buffer_t, gss_buffer_t, int *, gss_qop_t *);
965
966 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
967 gss_export_cred(OM_uint32 * /* minor_status */,
968                 gss_cred_id_t /* cred_handle */,
969                 gss_buffer_t /* cred_token */);
970
971 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
972 gss_import_cred(OM_uint32 * /* minor_status */,
973                 gss_buffer_t /* cred_token */,
974                 gss_cred_id_t * /* cred_handle */);
975
976 /*
977  * mech option
978  */
979
980 GSSAPI_LIB_FUNCTION int GSSAPI_LIB_CALL
981 gss_mo_set(gss_const_OID mech, gss_const_OID option,
982            int enable, gss_buffer_t value);
983
984 GSSAPI_LIB_FUNCTION int GSSAPI_LIB_CALL
985 gss_mo_get(gss_const_OID mech, gss_const_OID option, gss_buffer_t value);
986
987 GSSAPI_LIB_FUNCTION void GSSAPI_LIB_CALL
988 gss_mo_list(gss_const_OID mech, gss_OID_set *options);
989
990 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
991 gss_mo_name(gss_const_OID mech, gss_const_OID options, gss_buffer_t name);
992
993 /*
994  * SASL glue functions and mech inquire
995  */
996
997 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
998 gss_inquire_saslname_for_mech(OM_uint32 *minor_status,
999                               const gss_OID desired_mech,
1000                               gss_buffer_t sasl_mech_name,
1001                               gss_buffer_t mech_name,
1002                               gss_buffer_t mech_description);
1003
1004 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1005 gss_inquire_mech_for_saslname(OM_uint32 *minor_status,
1006                               const gss_buffer_t sasl_mech_name,
1007                               gss_OID *mech_type);
1008
1009 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1010 gss_indicate_mechs_by_attrs(OM_uint32 * minor_status,
1011                             gss_const_OID_set desired_mech_attrs,
1012                             gss_const_OID_set except_mech_attrs,
1013                             gss_const_OID_set critical_mech_attrs,
1014                             gss_OID_set *mechs);
1015
1016 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1017 gss_inquire_attrs_for_mech(OM_uint32 * minor_status,
1018                            gss_const_OID mech,
1019                            gss_OID_set *mech_attr,
1020                            gss_OID_set *known_mech_attrs);
1021
1022 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1023 gss_display_mech_attr(OM_uint32 * minor_status,
1024                       gss_const_OID mech_attr,
1025                       gss_buffer_t name,
1026                       gss_buffer_t short_desc,
1027                       gss_buffer_t long_desc);
1028
1029 /*
1030  * Solaris compat
1031  */
1032
1033 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_acquire_cred_with_password
1034            (OM_uint32 * /*minor_status*/,
1035             gss_const_name_t /*desired_name*/,
1036             const gss_buffer_t /*password*/,
1037             OM_uint32 /*time_req*/,
1038             const gss_OID_set /*desired_mechs*/,
1039             gss_cred_usage_t /*cred_usage*/,
1040             gss_cred_id_t * /*output_cred_handle*/,
1041             gss_OID_set * /*actual_mechs*/,
1042             OM_uint32 * /*time_rec*/
1043            );
1044
1045 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_add_cred_with_password (
1046             OM_uint32 * /*minor_status*/,
1047             gss_const_cred_id_t /*input_cred_handle*/,
1048             gss_const_name_t /*desired_name*/,
1049             const gss_OID /*desired_mech*/,
1050             const gss_buffer_t /*password*/,
1051             gss_cred_usage_t /*cred_usage*/,
1052             OM_uint32 /*initiator_time_req*/,
1053             OM_uint32 /*acceptor_time_req*/,
1054             gss_cred_id_t * /*output_cred_handle*/,
1055             gss_OID_set * /*actual_mechs*/,
1056             OM_uint32 * /*initiator_time_rec*/,
1057             OM_uint32 * /*acceptor_time_rec*/
1058            );
1059
1060 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1061 gss_localname(
1062         OM_uint32 *minor,
1063         gss_const_name_t name,
1064         const gss_OID mech_type,
1065         gss_buffer_t localname);
1066
1067 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1068 gss_pname_to_uid(
1069         OM_uint32 *minor,
1070         gss_const_name_t name,
1071         const gss_OID mech_type,
1072         uid_t *uidOut);
1073
1074 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1075 gss_authorize_localname(
1076         OM_uint32 *minor,
1077         gss_const_name_t name,
1078         gss_const_name_t user);
1079
1080 GSSAPI_LIB_FUNCTION int GSSAPI_LIB_CALL
1081 gss_userok(gss_const_name_t name,
1082            const char *user);
1083
1084 extern GSSAPI_LIB_VARIABLE gss_buffer_desc __gss_c_attr_local_login_user;
1085 #define GSS_C_ATTR_LOCAL_LOGIN_USER (&__gss_c_attr_local_login_user)
1086
1087 /*
1088  * Naming extensions
1089  */
1090
1091 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_display_name_ext (
1092     OM_uint32 *,        /* minor_status */
1093     gss_name_t,         /* name */
1094     gss_OID,            /* display_as_name_type */
1095     gss_buffer_t        /* display_name */
1096     );
1097
1098 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_name (
1099     OM_uint32 *,        /* minor_status */
1100     gss_name_t,         /* name */
1101     int *,              /* name_is_MN */
1102     gss_OID *,          /* MN_mech */
1103     gss_buffer_set_t *  /* attrs */
1104     );
1105
1106 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_get_name_attribute (
1107     OM_uint32 *,        /* minor_status */
1108     gss_name_t,         /* name */
1109     gss_buffer_t,       /* attr */
1110     int *,              /* authenticated */
1111     int *,              /* complete */
1112     gss_buffer_t,       /* value */
1113     gss_buffer_t,       /* display_value */
1114     int *               /* more */
1115     );
1116
1117 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_set_name_attribute (
1118     OM_uint32 *,        /* minor_status */
1119     gss_name_t,         /* name */
1120     int,                /* complete */
1121     gss_buffer_t,       /* attr */
1122     gss_buffer_t        /* value */
1123     );
1124
1125 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_delete_name_attribute (
1126     OM_uint32 *,        /* minor_status */
1127     gss_name_t,         /* name */
1128     gss_buffer_t        /* attr */
1129     );
1130
1131 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_export_name_composite (
1132     OM_uint32 *,        /* minor_status */
1133     gss_name_t,         /* name */
1134     gss_buffer_t        /* exp_composite_name */
1135     );
1136
1137 /*
1138  * Other extensions
1139  */
1140
1141
1142 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_duplicate_cred (
1143             OM_uint32 * /*minor_status*/,
1144             gss_const_cred_id_t /*input_cred_handle*/,
1145             gss_cred_id_t * /*output_cred_handle*/
1146            );
1147
1148 /* Return a mechanism short name from an OID */
1149 GSSAPI_LIB_FUNCTION const char * GSSAPI_LIB_CALL
1150 gss_oid_to_name(gss_const_OID oid);
1151
1152 /* Return a mechanism OID from a short name or dotted OID */
1153 GSSAPI_LIB_FUNCTION gss_OID GSSAPI_LIB_CALL
1154 gss_name_to_oid(const char *name);
1155
1156 /*
1157  * Credential store extensions
1158  */
1159 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1160 gss_acquire_cred_from(
1161     OM_uint32 * /* minor_status */,
1162     gss_const_name_t /* desired_name */,
1163     OM_uint32 /* time_req */,
1164     const gss_OID_set /* desired_mechs */,
1165     gss_cred_usage_t /* cred_usage */,
1166     gss_const_key_value_set_t /* cred_store */,
1167     gss_cred_id_t * /* output_cred_handle */,
1168     gss_OID_set * /* actual_mechs */,
1169     OM_uint32 * /* time_rec */
1170     );
1171
1172 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1173 gss_add_cred_from(
1174     OM_uint32 * /* minor_status */,
1175     gss_cred_id_t /* input_cred_handle */,
1176     gss_const_name_t /* desired_name */,
1177     const gss_OID /* desired_mech */,
1178     gss_cred_usage_t /* cred_usage */,
1179     OM_uint32 /* initiator_time_req */,
1180     OM_uint32 /* acceptor_time_req */,
1181     gss_const_key_value_set_t /* cred_store */,
1182     gss_cred_id_t * /* output_cred_handle */,
1183     gss_OID_set * /* actual_mechs */,
1184     OM_uint32 * /* initiator_time_rec */,
1185     OM_uint32 * /*acceptor_time_rec */
1186     );
1187
1188 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1189 gss_store_cred_into(
1190     OM_uint32 * /* minor_status */,
1191     gss_const_cred_id_t /* input_cred_handle */,
1192     gss_cred_usage_t /* input_usage */,
1193     const gss_OID /* desired_mech */,
1194     OM_uint32 /* overwrite_cred */,
1195     OM_uint32 /* default_cred */,
1196     gss_const_key_value_set_t /* cred_store */,
1197     gss_OID_set * /* elements_stored */,
1198     gss_cred_usage_t * /* cred_usage_stored */
1199     );
1200
1201 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1202 gss_store_cred_into2(
1203     OM_uint32 * /* minor_status */,
1204     gss_const_cred_id_t /* input_cred_handle */,
1205     gss_cred_usage_t /* input_usage */,
1206     const gss_OID /* desired_mech */,
1207     OM_uint32 /* store_cred_flags */,
1208     gss_const_key_value_set_t /* cred_store */,
1209     gss_OID_set * /* elements_stored */,
1210     gss_cred_usage_t * /* cred_usage_stored */,
1211     gss_buffer_set_t * /* env */
1212     );
1213
1214 enum gss_store_cred_flags {
1215     GSS_C_STORE_CRED_DEFAULT = 1,
1216     GSS_C_STORE_CRED_OVERWRITE = 2,
1217     GSS_C_STORE_CRED_SET_PROCESS = 4,
1218 };
1219 #define GSS_C_STORE_CRED_DEFAULT GSS_C_STORE_CRED_DEFAULT
1220 #define GSS_C_STORE_CRED_OVERWRITE GSS_C_STORE_CRED_OVERWRITE
1221 #define GSS_C_STORE_CRED_SET_PROCESS GSS_C_STORE_CRED_SET_PROCESS
1222
1223
1224 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_CALLCONV
1225 gss_set_neg_mechs(
1226     OM_uint32 * /* minor_status */,
1227     gss_cred_id_t /* cred_handle */,
1228     const gss_OID_set /* mech_list */);
1229
1230 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_CALLCONV
1231 gss_get_neg_mechs(
1232     OM_uint32 * /* minor_status */,
1233     gss_const_cred_id_t /* cred_handle */,
1234     gss_OID_set * /* mech_list */);
1235
1236 GSSAPI_LIB_FUNCTION void GSSAPI_LIB_CALL
1237 gss_set_log_function(void *ctx, void (*func)(void * ctx, int level, const char *fmt, va_list));
1238
1239 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1240 gss_destroy_cred(OM_uint32 *minor_status,
1241                  gss_cred_id_t *cred_handle);
1242
1243 GSSAPI_LIB_FUNCTION uintptr_t GSSAPI_CALLCONV
1244 gss_get_instance(const char *libname);
1245
1246 /*
1247  * S4UProxy and S4USelf extensions.
1248  */
1249
1250 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_CALLCONV
1251 gss_acquire_cred_impersonate_name(
1252     OM_uint32 * /* minor_status */,
1253     gss_const_cred_id_t /* icred */,
1254     gss_const_name_t /* desired_name */,
1255     OM_uint32 /* time_req */,
1256     gss_OID_set /* desired_mechs */,
1257     gss_cred_usage_t /* cred_usage */,
1258     gss_cred_id_t * /* output_cred */,
1259     gss_OID_set * /* actual_mechs */,
1260     OM_uint32 * /* time_rec */
1261     );
1262
1263 GSSAPI_CPP_END
1264
1265 #if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
1266 #pragma pack(pop)
1267 #endif
1268
1269 #undef GSSAPI_DEPRECATED_FUNCTION
1270
1271 #endif /* GSSAPI_GSSAPI_H_ */