1/*
2 * This file is auto generated.  Please do not edit it.
3 */
4
5#ifndef __GSSAPI__
6#define __GSSAPI__
7
8/* This is the gssapi.h prologue. */
9#include <stdint.h>
10#include <inttypes.h>
11/* no xom.h */
12/* End of gssapi.h prologue. */
13/* -*- mode: c; indent-tabs-mode: nil -*- */
14/*
15 * Copyright 1993 by OpenVision Technologies, Inc.
16 *
17 * Permission to use, copy, modify, distribute, and sell this software
18 * and its documentation for any purpose is hereby granted without fee,
19 * provided that the above copyright notice appears in all copies and
20 * that both that copyright notice and this permission notice appear in
21 * supporting documentation, and that the name of OpenVision not be used
22 * in advertising or publicity pertaining to distribution of the software
23 * without specific, written prior permission. OpenVision makes no
24 * representations about the suitability of this software for any
25 * purpose.  It is provided "as is" without express or implied warranty.
26 *
27 * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
28 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
29 * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
30 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
31 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
32 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
33 * PERFORMANCE OF THIS SOFTWARE.
34 */
35
36#ifndef _GSSAPI_H_
37#define _GSSAPI_H_
38
39/*
40 * Determine platform-dependent configuration.
41 */
42
43#if defined(__MACH__) && defined(__APPLE__)
44#       include <TargetConditionals.h>
45#       if TARGET_RT_MAC_CFM
46#               error "Use KfM 4.0 SDK headers for CFM compilation."
47#       endif
48#endif
49
50#ifdef __cplusplus
51extern "C" {
52#endif /* __cplusplus */
53
54#if TARGET_OS_MAC
55#    pragma pack(push,2)
56#endif
57
58#if defined(_MSDOS) || defined(_WIN32)
59#include <win-mac.h>
60#endif
61
62#ifndef KRB5_CALLCONV
63#define KRB5_CALLCONV
64#endif
65#ifndef KRB5_CALLCONV_C
66#define KRB5_CALLCONV_C
67#endif
68
69/*
70 * First, include stddef.h to get size_t defined.
71 */
72#include <stddef.h>
73
74/*
75 * POSIX says that sys/types.h is where size_t is defined.
76 */
77#include <sys/types.h>
78
79/*
80 * $Id: gssapi.hin 20876 2008-10-15 21:58:43Z tlyu $
81 */
82
83/*
84 * First, define the three platform-dependent pointer types.
85 */
86
87struct gss_name_struct;
88typedef struct gss_name_struct * gss_name_t;
89
90struct gss_cred_id_struct;
91typedef struct gss_cred_id_struct * gss_cred_id_t;
92
93struct gss_ctx_id_struct;
94typedef struct gss_ctx_id_struct * gss_ctx_id_t;
95
96/*
97 * The following type must be defined as the smallest natural unsigned integer
98 * supported by the platform that has at least 32 bits of precision.
99 */
100typedef uint32_t gss_uint32;
101typedef int32_t gss_int32;
102
103#ifdef  OM_STRING
104/*
105 * We have included the xom.h header file.  Use the definition for
106 * OM_object identifier.
107 */
108typedef OM_object_identifier    gss_OID_desc, *gss_OID;
109#else   /* OM_STRING */
110/*
111 * We can't use X/Open definitions, so roll our own.
112 */
113typedef gss_uint32      OM_uint32;
114
115typedef struct gss_OID_desc_struct {
116    OM_uint32 length;
117    void *elements;
118} gss_OID_desc, *gss_OID;
119#endif  /* OM_STRING */
120
121typedef struct gss_OID_set_desc_struct  {
122    size_t  count;
123    gss_OID elements;
124} gss_OID_set_desc, *gss_OID_set;
125
126typedef struct gss_buffer_desc_struct {
127    size_t length;
128    void *value;
129} gss_buffer_desc, *gss_buffer_t;
130
131typedef struct gss_channel_bindings_struct {
132    OM_uint32 initiator_addrtype;
133    gss_buffer_desc initiator_address;
134    OM_uint32 acceptor_addrtype;
135    gss_buffer_desc acceptor_address;
136    gss_buffer_desc application_data;
137} *gss_channel_bindings_t;
138
139/*
140 * For now, define a QOP-type as an OM_uint32 (pending resolution of ongoing
141 * discussions).
142 */
143typedef OM_uint32       gss_qop_t;
144typedef int             gss_cred_usage_t;
145
146/*
147 * Flag bits for context-level services.
148 */
149#define GSS_C_DELEG_FLAG        1
150#define GSS_C_MUTUAL_FLAG       2
151#define GSS_C_REPLAY_FLAG       4
152#define GSS_C_SEQUENCE_FLAG     8
153#define GSS_C_CONF_FLAG         16
154#define GSS_C_INTEG_FLAG        32
155#define GSS_C_ANON_FLAG         64
156#define GSS_C_PROT_READY_FLAG   128
157#define GSS_C_TRANS_FLAG        256
158#define GSS_C_DELEG_POLICY_FLAG 32768
159
160/*
161 * Credential usage options
162 */
163#define GSS_C_BOTH      0
164#define GSS_C_INITIATE  1
165#define GSS_C_ACCEPT    2
166
167/*
168 * Status code types for gss_display_status
169 */
170#define GSS_C_GSS_CODE  1
171#define GSS_C_MECH_CODE 2
172
173/*
174 * The constant definitions for channel-bindings address families
175 */
176#define GSS_C_AF_UNSPEC     0
177#define GSS_C_AF_LOCAL      1
178#define GSS_C_AF_INET       2
179#define GSS_C_AF_IMPLINK    3
180#define GSS_C_AF_PUP        4
181#define GSS_C_AF_CHAOS      5
182#define GSS_C_AF_NS         6
183#define GSS_C_AF_NBS        7
184#define GSS_C_AF_ECMA       8
185#define GSS_C_AF_DATAKIT    9
186#define GSS_C_AF_CCITT      10
187#define GSS_C_AF_SNA        11
188#define GSS_C_AF_DECnet     12
189#define GSS_C_AF_DLI        13
190#define GSS_C_AF_LAT        14
191#define GSS_C_AF_HYLINK     15
192#define GSS_C_AF_APPLETALK  16
193#define GSS_C_AF_BSC        17
194#define GSS_C_AF_DSS        18
195#define GSS_C_AF_OSI        19
196#define GSS_C_AF_X25        21
197
198#define GSS_C_AF_NULLADDR   255
199
200/*
201 * Various Null values.
202 */
203#define GSS_C_NO_NAME ((gss_name_t) 0)
204#define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
205#define GSS_C_NO_OID ((gss_OID) 0)
206#define GSS_C_NO_OID_SET ((gss_OID_set) 0)
207#define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
208#define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
209#define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
210#define GSS_C_EMPTY_BUFFER {0, NULL}
211
212/*
213 * Some alternate names for a couple of the above values.  These are defined
214 * for V1 compatibility.
215 */
216#define GSS_C_NULL_OID          GSS_C_NO_OID
217#define GSS_C_NULL_OID_SET      GSS_C_NO_OID_SET
218
219/*
220 * Define the default Quality of Protection for per-message services.  Note
221 * that an implementation that offers multiple levels of QOP may either reserve
222 * a value (for example zero, as assumed here) to mean "default protection", or
223 * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit
224 * QOP value.  However a value of 0 should always be interpreted by a GSSAPI
225 * implementation as a request for the default protection level.
226 */
227#define GSS_C_QOP_DEFAULT 0
228
229/*
230 * Expiration time of 2^32-1 seconds means infinite lifetime for a
231 * credential or security context
232 */
233#define GSS_C_INDEFINITE ((OM_uint32) 0xfffffffful)
234
235
236/* Major status codes */
237
238#define GSS_S_COMPLETE 0
239
240/*
241 * Some "helper" definitions to make the status code macros obvious.
242 */
243#define GSS_C_CALLING_ERROR_OFFSET 24
244#define GSS_C_ROUTINE_ERROR_OFFSET 16
245#define GSS_C_SUPPLEMENTARY_OFFSET 0
246#define GSS_C_CALLING_ERROR_MASK ((OM_uint32) 0377ul)
247#define GSS_C_ROUTINE_ERROR_MASK ((OM_uint32) 0377ul)
248#define GSS_C_SUPPLEMENTARY_MASK ((OM_uint32) 0177777ul)
249
250/*
251 * The macros that test status codes for error conditions.  Note that the
252 * GSS_ERROR() macro has changed slightly from the V1 GSSAPI so that it now
253 * evaluates its argument only once.
254 */
255#define GSS_CALLING_ERROR(x) \
256  ((x) & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
257#define GSS_ROUTINE_ERROR(x) \
258  ((x) & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
259#define GSS_SUPPLEMENTARY_INFO(x) \
260  ((x) & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
261#define GSS_ERROR(x) \
262  ((x) & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
263          (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
264
265/*
266 * Now the actual status code definitions
267 */
268
269/*
270 * Calling errors:
271 */
272#define GSS_S_CALL_INACCESSIBLE_READ \
273                             (((OM_uint32) 1ul) << GSS_C_CALLING_ERROR_OFFSET)
274#define GSS_S_CALL_INACCESSIBLE_WRITE \
275                             (((OM_uint32) 2ul) << GSS_C_CALLING_ERROR_OFFSET)
276#define GSS_S_CALL_BAD_STRUCTURE \
277                             (((OM_uint32) 3ul) << GSS_C_CALLING_ERROR_OFFSET)
278
279/*
280 * Routine errors:
281 */
282#define GSS_S_BAD_MECH (((OM_uint32) 1ul) << GSS_C_ROUTINE_ERROR_OFFSET)
283#define GSS_S_BAD_NAME (((OM_uint32) 2ul) << GSS_C_ROUTINE_ERROR_OFFSET)
284#define GSS_S_BAD_NAMETYPE (((OM_uint32) 3ul) << GSS_C_ROUTINE_ERROR_OFFSET)
285#define GSS_S_BAD_BINDINGS (((OM_uint32) 4ul) << GSS_C_ROUTINE_ERROR_OFFSET)
286#define GSS_S_BAD_STATUS (((OM_uint32) 5ul) << GSS_C_ROUTINE_ERROR_OFFSET)
287#define GSS_S_BAD_SIG (((OM_uint32) 6ul) << GSS_C_ROUTINE_ERROR_OFFSET)
288#define GSS_S_NO_CRED (((OM_uint32) 7ul) << GSS_C_ROUTINE_ERROR_OFFSET)
289#define GSS_S_NO_CONTEXT (((OM_uint32) 8ul) << GSS_C_ROUTINE_ERROR_OFFSET)
290#define GSS_S_DEFECTIVE_TOKEN (((OM_uint32) 9ul) << GSS_C_ROUTINE_ERROR_OFFSET)
291#define GSS_S_DEFECTIVE_CREDENTIAL \
292     (((OM_uint32) 10ul) << GSS_C_ROUTINE_ERROR_OFFSET)
293#define GSS_S_CREDENTIALS_EXPIRED \
294     (((OM_uint32) 11ul) << GSS_C_ROUTINE_ERROR_OFFSET)
295#define GSS_S_CONTEXT_EXPIRED \
296     (((OM_uint32) 12ul) << GSS_C_ROUTINE_ERROR_OFFSET)
297#define GSS_S_FAILURE (((OM_uint32) 13ul) << GSS_C_ROUTINE_ERROR_OFFSET)
298#define GSS_S_BAD_QOP (((OM_uint32) 14ul) << GSS_C_ROUTINE_ERROR_OFFSET)
299#define GSS_S_UNAUTHORIZED (((OM_uint32) 15ul) << GSS_C_ROUTINE_ERROR_OFFSET)
300#define GSS_S_UNAVAILABLE (((OM_uint32) 16ul) << GSS_C_ROUTINE_ERROR_OFFSET)
301#define GSS_S_DUPLICATE_ELEMENT \
302     (((OM_uint32) 17ul) << GSS_C_ROUTINE_ERROR_OFFSET)
303#define GSS_S_NAME_NOT_MN \
304     (((OM_uint32) 18ul) << GSS_C_ROUTINE_ERROR_OFFSET)
305
306/*
307 * Supplementary info bits:
308 */
309#define GSS_S_CONTINUE_NEEDED (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
310#define GSS_S_DUPLICATE_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
311#define GSS_S_OLD_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
312#define GSS_S_UNSEQ_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
313#define GSS_S_GAP_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
314
315
316/*
317 * Finally, function prototypes for the GSSAPI routines.
318 */
319
320#if defined (_WIN32) && defined (_MSC_VER)
321# ifdef GSS_DLL_FILE
322#  define GSS_DLLIMP __declspec(dllexport)
323# else
324#  define GSS_DLLIMP __declspec(dllimport)
325# endif
326#else
327# define GSS_DLLIMP
328#endif
329
330/* Reserved static storage for GSS_oids.  Comments are quotes from RFC 2744.
331 *
332 * The implementation must reserve static storage for a
333 * gss_OID_desc object containing the value
334 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"},
335 * corresponding to an object-identifier value of
336 * {iso(1) member-body(2) United States(840) mit(113554)
337 * infosys(1) gssapi(2) generic(1) user_name(1)}.  The constant
338 * GSS_C_NT_USER_NAME should be initialized to point
339 * to that gss_OID_desc.
340 */
341GSS_DLLIMP extern gss_OID GSS_C_NT_USER_NAME;
342
343/*
344 * The implementation must reserve static storage for a
345 * gss_OID_desc object containing the value
346 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"},
347 * corresponding to an object-identifier value of
348 * {iso(1) member-body(2) United States(840) mit(113554)
349 * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
350 * The constant GSS_C_NT_MACHINE_UID_NAME should be
351 * initialized to point to that gss_OID_desc.
352 */
353GSS_DLLIMP extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
354
355/*
356 * The implementation must reserve static storage for a
357 * gss_OID_desc object containing the value
358 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"},
359 * corresponding to an object-identifier value of
360 * {iso(1) member-body(2) United States(840) mit(113554)
361 * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
362 * The constant GSS_C_NT_STRING_UID_NAME should be
363 * initialized to point to that gss_OID_desc.
364 */
365GSS_DLLIMP extern gss_OID GSS_C_NT_STRING_UID_NAME;
366
367/*
368 * The implementation must reserve static storage for a
369 * gss_OID_desc object containing the value
370 * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
371 * corresponding to an object-identifier value of
372 * {iso(1) org(3) dod(6) internet(1) security(5)
373 * nametypes(6) gss-host-based-services(2)).  The constant
374 * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
375 * to that gss_OID_desc.  This is a deprecated OID value, and
376 * implementations wishing to support hostbased-service names
377 * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
378 * defined below, to identify such names;
379 * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
380 * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
381 * parameter, but should not be emitted by GSS-API
382 * implementations
383 */
384GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
385
386/*
387 * The implementation must reserve static storage for a
388 * gss_OID_desc object containing the value
389 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
390 *              "\x01\x02\x01\x04"}, corresponding to an
391 * object-identifier value of {iso(1) member-body(2)
392 * Unites States(840) mit(113554) infosys(1) gssapi(2)
393 * generic(1) service_name(4)}.  The constant
394 * GSS_C_NT_HOSTBASED_SERVICE should be initialized
395 * to point to that gss_OID_desc.
396 */
397GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
398
399/*
400 * The implementation must reserve static storage for a
401 * gss_OID_desc object containing the value
402 * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
403 * corresponding to an object identifier value of
404 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
405 * 6(nametypes), 3(gss-anonymous-name)}.  The constant
406 * and GSS_C_NT_ANONYMOUS should be initialized to point
407 * to that gss_OID_desc.
408 */
409GSS_DLLIMP extern gss_OID GSS_C_NT_ANONYMOUS;
410
411
412/*
413 * The implementation must reserve static storage for a
414 * gss_OID_desc object containing the value
415 * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
416 * corresponding to an object-identifier value of
417 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
418 * 6(nametypes), 4(gss-api-exported-name)}.  The constant
419 * GSS_C_NT_EXPORT_NAME should be initialized to point
420 * to that gss_OID_desc.
421 */
422GSS_DLLIMP extern gss_OID GSS_C_NT_EXPORT_NAME;
423
424/* Function Prototypes */
425
426OM_uint32 KRB5_CALLCONV
427gss_acquire_cred(
428    OM_uint32 *,        /* minor_status */
429    gss_name_t,         /* desired_name */
430    OM_uint32,          /* time_req */
431    gss_OID_set,        /* desired_mechs */
432    gss_cred_usage_t,   /* cred_usage */
433    gss_cred_id_t *,    /* output_cred_handle */
434    gss_OID_set *,      /* actual_mechs */
435    OM_uint32 *);       /* time_rec */
436
437OM_uint32 KRB5_CALLCONV
438gss_release_cred(
439    OM_uint32 *,        /* minor_status */
440    gss_cred_id_t *);   /* cred_handle */
441
442OM_uint32 KRB5_CALLCONV
443gss_init_sec_context(
444    OM_uint32 *,        /* minor_status */
445    gss_cred_id_t,      /* claimant_cred_handle */
446    gss_ctx_id_t *,     /* context_handle */
447    gss_name_t,         /* target_name */
448    gss_OID,            /* mech_type (used to be const) */
449    OM_uint32,          /* req_flags */
450    OM_uint32,          /* time_req */
451    gss_channel_bindings_t,     /* input_chan_bindings */
452    gss_buffer_t,       /* input_token */
453    gss_OID *,          /* actual_mech_type */
454    gss_buffer_t,       /* output_token */
455    OM_uint32 *,        /* ret_flags */
456    OM_uint32 *);       /* time_rec */
457
458OM_uint32 KRB5_CALLCONV
459gss_accept_sec_context(
460    OM_uint32 *,                /* minor_status */
461    gss_ctx_id_t *,             /* context_handle */
462    gss_cred_id_t,              /* acceptor_cred_handle */
463    gss_buffer_t,               /* input_token_buffer */
464    gss_channel_bindings_t,     /* input_chan_bindings */
465    gss_name_t *,               /* src_name */
466    gss_OID *,                  /* mech_type */
467    gss_buffer_t,               /* output_token */
468    OM_uint32 *,                /* ret_flags */
469    OM_uint32 *,                /* time_rec */
470    gss_cred_id_t *);           /* delegated_cred_handle */
471
472OM_uint32 KRB5_CALLCONV
473gss_process_context_token(
474    OM_uint32 *,        /* minor_status */
475    gss_ctx_id_t,       /* context_handle */
476    gss_buffer_t);      /* token_buffer */
477
478
479OM_uint32 KRB5_CALLCONV
480gss_delete_sec_context(
481    OM_uint32 *,        /* minor_status */
482    gss_ctx_id_t *,     /* context_handle */
483    gss_buffer_t);      /* output_token */
484
485
486OM_uint32 KRB5_CALLCONV
487gss_context_time(
488    OM_uint32 *,        /* minor_status */
489    gss_ctx_id_t,       /* context_handle */
490    OM_uint32 *);       /* time_rec */
491
492
493/* New for V2 */
494OM_uint32 KRB5_CALLCONV
495gss_get_mic(
496    OM_uint32 *,        /* minor_status */
497    gss_ctx_id_t,       /* context_handle */
498    gss_qop_t,          /* qop_req */
499    gss_buffer_t,       /* message_buffer */
500    gss_buffer_t);      /* message_token */
501
502
503/* New for V2 */
504OM_uint32 KRB5_CALLCONV
505gss_verify_mic(OM_uint32 *,     /* minor_status */
506               gss_ctx_id_t,    /* context_handle */
507               gss_buffer_t,    /* message_buffer */
508               gss_buffer_t,    /* message_token */
509               gss_qop_t *      /* qop_state */
510);
511
512/* New for V2 */
513OM_uint32 KRB5_CALLCONV
514gss_wrap(
515    OM_uint32 *,        /* minor_status */
516    gss_ctx_id_t,       /* context_handle */
517    int,                /* conf_req_flag */
518    gss_qop_t,          /* qop_req */
519    gss_buffer_t,       /* input_message_buffer */
520    int *,              /* conf_state */
521    gss_buffer_t);      /* output_message_buffer */
522
523
524/* New for V2 */
525OM_uint32 KRB5_CALLCONV
526gss_unwrap(
527    OM_uint32 *,        /* minor_status */
528    gss_ctx_id_t,       /* context_handle */
529    gss_buffer_t,       /* input_message_buffer */
530    gss_buffer_t,       /* output_message_buffer */
531    int *,              /* conf_state */
532    gss_qop_t *);       /* qop_state */
533
534
535OM_uint32 KRB5_CALLCONV
536gss_display_status(
537    OM_uint32 *,        /* minor_status */
538    OM_uint32,          /* status_value */
539    int,                /* status_type */
540    gss_OID,            /* mech_type (used to be const) */
541    OM_uint32 *,        /* message_context */
542    gss_buffer_t);      /* status_string */
543
544
545OM_uint32 KRB5_CALLCONV
546gss_indicate_mechs(
547    OM_uint32 *,        /* minor_status */
548    gss_OID_set *);     /* mech_set */
549
550
551OM_uint32 KRB5_CALLCONV
552gss_compare_name(
553    OM_uint32 *,        /* minor_status */
554    gss_name_t,         /* name1 */
555    gss_name_t,         /* name2 */
556    int *);             /* name_equal */
557
558
559OM_uint32 KRB5_CALLCONV
560gss_display_name(
561    OM_uint32 *,        /* minor_status */
562    gss_name_t,         /* input_name */
563    gss_buffer_t,       /* output_name_buffer */
564    gss_OID *);         /* output_name_type */
565
566
567OM_uint32 KRB5_CALLCONV
568gss_import_name(
569    OM_uint32 *,        /* minor_status */
570    gss_buffer_t,       /* input_name_buffer */
571    gss_OID,            /* input_name_type(used to be const) */
572    gss_name_t *);      /* output_name */
573
574OM_uint32 KRB5_CALLCONV
575gss_release_name(
576    OM_uint32 *,        /* minor_status */
577    gss_name_t *);      /* input_name */
578
579OM_uint32 KRB5_CALLCONV
580gss_release_buffer(
581    OM_uint32 *,        /* minor_status */
582    gss_buffer_t);      /* buffer */
583
584OM_uint32 KRB5_CALLCONV
585gss_release_oid_set(
586    OM_uint32 *,        /* minor_status */
587    gss_OID_set *);     /* set */
588
589OM_uint32 KRB5_CALLCONV
590gss_inquire_cred(
591    OM_uint32 *,        /* minor_status */
592    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/* Last argument new for V2 */
599OM_uint32 KRB5_CALLCONV
600gss_inquire_context(
601    OM_uint32 *,        /* minor_status */
602    gss_ctx_id_t,       /* context_handle */
603    gss_name_t *,       /* src_name */
604    gss_name_t *,       /* targ_name */
605    OM_uint32 *,        /* lifetime_rec */
606    gss_OID *,          /* mech_type */
607    OM_uint32 *,        /* ctx_flags */
608    int *,              /* locally_initiated */
609    int *);             /* open */
610
611/* New for V2 */
612OM_uint32 KRB5_CALLCONV
613gss_wrap_size_limit(
614    OM_uint32 *,        /* minor_status */
615    gss_ctx_id_t,       /* context_handle */
616    int,                /* conf_req_flag */
617    gss_qop_t,          /* qop_req */
618    OM_uint32,          /* req_output_size */
619    OM_uint32 *);       /* max_input_size */
620
621/* New for V2 */
622OM_uint32 KRB5_CALLCONV
623gss_import_name_object(
624    OM_uint32 *,        /* minor_status */
625    void *,             /* input_name */
626    gss_OID,            /* input_name_type */
627    gss_name_t *);      /* output_name */
628
629/* New for V2 */
630OM_uint32 KRB5_CALLCONV
631gss_export_name_object(
632    OM_uint32 *,        /* minor_status */
633    gss_name_t,         /* input_name */
634    gss_OID,            /* desired_name_type */
635    void **);           /* output_name */
636
637/* New for V2 */
638OM_uint32 KRB5_CALLCONV
639gss_add_cred(
640    OM_uint32 *,        /* minor_status */
641    gss_cred_id_t,      /* input_cred_handle */
642    gss_name_t,         /* desired_name */
643    gss_OID,            /* desired_mech */
644    gss_cred_usage_t,   /* cred_usage */
645    OM_uint32,          /* initiator_time_req */
646    OM_uint32,          /* acceptor_time_req */
647    gss_cred_id_t *,    /* output_cred_handle */
648    gss_OID_set *,      /* actual_mechs */
649    OM_uint32 *,        /* initiator_time_rec */
650    OM_uint32 *);       /* acceptor_time_rec */
651
652/* New for V2 */
653OM_uint32 KRB5_CALLCONV
654gss_inquire_cred_by_mech(
655    OM_uint32 *,                /* minor_status */
656    gss_cred_id_t,              /* cred_handle */
657    gss_OID,                    /* mech_type */
658    gss_name_t *,               /* name */
659    OM_uint32 *,                /* initiator_lifetime */
660    OM_uint32 *,                /* acceptor_lifetime */
661    gss_cred_usage_t *);        /* cred_usage */
662
663/* New for V2 */
664OM_uint32 KRB5_CALLCONV
665gss_export_sec_context(
666    OM_uint32 *,        /* minor_status */
667    gss_ctx_id_t *,     /* context_handle */
668    gss_buffer_t);      /* interprocess_token */
669
670/* New for V2 */
671OM_uint32 KRB5_CALLCONV
672gss_import_sec_context(
673    OM_uint32 *,        /* minor_status */
674    gss_buffer_t,       /* interprocess_token */
675    gss_ctx_id_t *);    /* context_handle */
676
677/* New for V2 */
678OM_uint32 KRB5_CALLCONV
679gss_release_oid(
680    OM_uint32 *,        /* minor_status */
681    gss_OID *);         /* oid */
682
683/* New for V2 */
684OM_uint32 KRB5_CALLCONV
685gss_create_empty_oid_set(
686    OM_uint32 *,        /* minor_status */
687    gss_OID_set *);     /* oid_set */
688
689/* New for V2 */
690OM_uint32 KRB5_CALLCONV
691gss_add_oid_set_member(
692    OM_uint32 *,        /* minor_status */
693    gss_OID,            /* member_oid */
694    gss_OID_set *);     /* oid_set */
695
696/* New for V2 */
697OM_uint32 KRB5_CALLCONV
698gss_test_oid_set_member(
699    OM_uint32 *,        /* minor_status */
700    gss_OID,            /* member */
701    gss_OID_set,        /* set */
702    int *);             /* present */
703
704/* New for V2 */
705OM_uint32 KRB5_CALLCONV
706gss_str_to_oid(
707    OM_uint32 *,        /* minor_status */
708    gss_buffer_t,       /* oid_str */
709    gss_OID *);         /* oid */
710
711/* New for V2 */
712OM_uint32 KRB5_CALLCONV
713gss_oid_to_str(
714    OM_uint32 *,        /* minor_status */
715    gss_OID,            /* oid */
716    gss_buffer_t);      /* oid_str */
717
718/* New for V2 */
719OM_uint32 KRB5_CALLCONV
720gss_inquire_names_for_mech(
721    OM_uint32 *,        /* minor_status */
722    gss_OID,            /* mechanism */
723    gss_OID_set *);     /* name_types */
724
725/* New for V2 */
726OM_uint32 KRB5_CALLCONV
727gss_inquire_mechs_for_name(
728    OM_uint32 *,        /* minor_status */
729    const gss_name_t,   /* input_name */
730    gss_OID_set *);     /* mech_types */
731
732/*
733 * The following routines are obsolete variants of gss_get_mic, gss_wrap,
734 * gss_verify_mic and gss_unwrap.  They should be provided by GSSAPI V2
735 * implementations for backwards compatibility with V1 applications.  Distinct
736 * entrypoints (as opposed to #defines) should be provided, to allow GSSAPI
737 * V1 applications to link against GSSAPI V2 implementations.
738 */
739OM_uint32 KRB5_CALLCONV
740gss_sign(
741    OM_uint32 *,        /* minor_status */
742    gss_ctx_id_t,       /* context_handle */
743    int,                /* qop_req */
744    gss_buffer_t,       /* message_buffer */
745    gss_buffer_t);      /* message_token */
746
747OM_uint32 KRB5_CALLCONV
748gss_verify(
749    OM_uint32 *,        /* minor_status */
750    gss_ctx_id_t,       /* context_handle */
751    gss_buffer_t,       /* message_buffer */
752    gss_buffer_t,       /* token_buffer */
753    int *);             /* qop_state */
754
755OM_uint32 KRB5_CALLCONV
756gss_seal(
757    OM_uint32 *,        /* minor_status */
758    gss_ctx_id_t,       /* context_handle */
759    int,                /* conf_req_flag */
760    int,                /* qop_req */
761    gss_buffer_t,       /* input_message_buffer */
762    int *,              /* conf_state */
763    gss_buffer_t);      /* output_message_buffer */
764
765OM_uint32 KRB5_CALLCONV
766gss_unseal(
767    OM_uint32 *,        /* minor_status */
768    gss_ctx_id_t,       /* context_handle */
769    gss_buffer_t,       /* input_message_buffer */
770    gss_buffer_t,       /* output_message_buffer */
771    int *,              /* conf_state */
772    int *);             /* qop_state */
773
774/* New for V2 */
775OM_uint32 KRB5_CALLCONV
776gss_export_name(
777    OM_uint32  *,       /* minor_status */
778    const gss_name_t,   /* input_name */
779    gss_buffer_t);      /* exported_name */
780
781/* New for V2 */
782OM_uint32 KRB5_CALLCONV
783gss_duplicate_name(
784    OM_uint32  *,       /* minor_status */
785    const gss_name_t,   /* input_name */
786    gss_name_t *);      /* dest_name */
787
788/* New for V2 */
789OM_uint32 KRB5_CALLCONV
790gss_canonicalize_name(
791    OM_uint32  *,       /* minor_status */
792    const gss_name_t,   /* input_name */
793    const gss_OID,      /* mech_type */
794    gss_name_t *);      /* output_name */
795
796#if TARGET_OS_MAC
797#    pragma pack(pop)
798#endif
799
800#ifdef __cplusplus
801}
802#endif
803
804/* XXXX these are not part of the GSSAPI C bindings!  (but should be) */
805
806#define GSS_CALLING_ERROR_FIELD(x) \
807   (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK)
808#define GSS_ROUTINE_ERROR_FIELD(x) \
809   (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK)
810#define GSS_SUPPLEMENTARY_INFO_FIELD(x) \
811   (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK)
812
813/* XXXX This is a necessary evil until the spec is fixed */
814#define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
815
816#endif /* _GSSAPI_H_ */
817
818#endif /* __GSSAPI__ */
819