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