1 /* -*- mode: c; indent-tabs-mode: nil -*- */
3 * Copyright 1993 by OpenVision Technologies, Inc.
5 * Permission to use, copy, modify, distribute, and sell this software
6 * and its documentation for any purpose is hereby granted without fee,
7 * provided that the above copyright notice appears in all copies and
8 * that both that copyright notice and this permission notice appear in
9 * supporting documentation, and that the name of OpenVision not be used
10 * in advertising or publicity pertaining to distribution of the software
11 * without specific, written prior permission. OpenVision makes no
12 * representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied warranty.
15 * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
17 * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
19 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21 * PERFORMANCE OF THIS SOFTWARE.
28 * Determine platform-dependent configuration.
31 #if defined(__MACH__) && defined(__APPLE__)
32 # include <TargetConditionals.h>
33 # if TARGET_RT_MAC_CFM
34 # error "Use KfM 4.0 SDK headers for CFM compilation."
40 #endif /* __cplusplus */
46 #if defined(_MSDOS) || defined(_WIN32)
52 #define KRB5_CALLCONV_C
56 * First, include stddef.h to get size_t defined.
61 * POSIX says that sys/types.h is where size_t is defined.
63 #include <sys/types.h>
70 * First, define the three platform-dependent pointer types.
73 struct gss_name_struct;
74 typedef struct gss_name_struct * gss_name_t;
76 struct gss_cred_id_struct;
77 typedef struct gss_cred_id_struct * gss_cred_id_t;
79 struct gss_ctx_id_struct;
80 typedef struct gss_ctx_id_struct * gss_ctx_id_t;
83 * The following type must be defined as the smallest natural unsigned integer
84 * supported by the platform that has at least 32 bits of precision.
86 typedef uint32_t gss_uint32;
87 typedef int32_t gss_int32;
91 * We have included the xom.h header file. Use the definition for
92 * OM_object identifier.
94 typedef OM_object_identifier gss_OID_desc, *gss_OID;
97 * We can't use X/Open definitions, so roll our own.
99 typedef gss_uint32 OM_uint32;
101 typedef struct gss_OID_desc_struct {
104 } gss_OID_desc, *gss_OID;
105 #endif /* OM_STRING */
107 typedef struct gss_OID_set_desc_struct {
110 } gss_OID_set_desc, *gss_OID_set;
112 typedef struct gss_buffer_desc_struct {
115 } gss_buffer_desc, *gss_buffer_t;
117 typedef struct gss_channel_bindings_struct {
118 OM_uint32 initiator_addrtype;
119 gss_buffer_desc initiator_address;
120 OM_uint32 acceptor_addrtype;
121 gss_buffer_desc acceptor_address;
122 gss_buffer_desc application_data;
123 } *gss_channel_bindings_t;
126 * For now, define a QOP-type as an OM_uint32 (pending resolution of ongoing
129 typedef OM_uint32 gss_qop_t;
130 typedef int gss_cred_usage_t;
133 * Flag bits for context-level services.
135 #define GSS_C_DELEG_FLAG 1
136 #define GSS_C_MUTUAL_FLAG 2
137 #define GSS_C_REPLAY_FLAG 4
138 #define GSS_C_SEQUENCE_FLAG 8
139 #define GSS_C_CONF_FLAG 16
140 #define GSS_C_INTEG_FLAG 32
141 #define GSS_C_ANON_FLAG 64
142 #define GSS_C_PROT_READY_FLAG 128
143 #define GSS_C_TRANS_FLAG 256
144 #define GSS_C_DELEG_POLICY_FLAG 32768
147 * Credential usage options
150 #define GSS_C_INITIATE 1
151 #define GSS_C_ACCEPT 2
154 * Status code types for gss_display_status
156 #define GSS_C_GSS_CODE 1
157 #define GSS_C_MECH_CODE 2
160 * The constant definitions for channel-bindings address families
162 #define GSS_C_AF_UNSPEC 0
163 #define GSS_C_AF_LOCAL 1
164 #define GSS_C_AF_INET 2
165 #define GSS_C_AF_IMPLINK 3
166 #define GSS_C_AF_PUP 4
167 #define GSS_C_AF_CHAOS 5
168 #define GSS_C_AF_NS 6
169 #define GSS_C_AF_NBS 7
170 #define GSS_C_AF_ECMA 8
171 #define GSS_C_AF_DATAKIT 9
172 #define GSS_C_AF_CCITT 10
173 #define GSS_C_AF_SNA 11
174 #define GSS_C_AF_DECnet 12
175 #define GSS_C_AF_DLI 13
176 #define GSS_C_AF_LAT 14
177 #define GSS_C_AF_HYLINK 15
178 #define GSS_C_AF_APPLETALK 16
179 #define GSS_C_AF_BSC 17
180 #define GSS_C_AF_DSS 18
181 #define GSS_C_AF_OSI 19
182 #define GSS_C_AF_NETBIOS 20
183 #define GSS_C_AF_X25 21
185 #define GSS_C_AF_NULLADDR 255
188 * Various Null values.
190 #define GSS_C_NO_NAME ((gss_name_t) 0)
191 #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
192 #define GSS_C_NO_OID ((gss_OID) 0)
193 #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
194 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
195 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
196 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
197 #define GSS_C_EMPTY_BUFFER {0, NULL}
200 * Some alternate names for a couple of the above values. These are defined
201 * for V1 compatibility.
203 #define GSS_C_NULL_OID GSS_C_NO_OID
204 #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
207 * Define the default Quality of Protection for per-message services. Note
208 * that an implementation that offers multiple levels of QOP may either reserve
209 * a value (for example zero, as assumed here) to mean "default protection", or
210 * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit
211 * QOP value. However a value of 0 should always be interpreted by a GSSAPI
212 * implementation as a request for the default protection level.
214 #define GSS_C_QOP_DEFAULT 0
217 * Expiration time of 2^32-1 seconds means infinite lifetime for a
218 * credential or security context
220 #define GSS_C_INDEFINITE ((OM_uint32) 0xfffffffful)
223 /* Major status codes */
225 #define GSS_S_COMPLETE 0
228 * Some "helper" definitions to make the status code macros obvious.
230 #define GSS_C_CALLING_ERROR_OFFSET 24
231 #define GSS_C_ROUTINE_ERROR_OFFSET 16
232 #define GSS_C_SUPPLEMENTARY_OFFSET 0
233 #define GSS_C_CALLING_ERROR_MASK ((OM_uint32) 0377ul)
234 #define GSS_C_ROUTINE_ERROR_MASK ((OM_uint32) 0377ul)
235 #define GSS_C_SUPPLEMENTARY_MASK ((OM_uint32) 0177777ul)
238 * The macros that test status codes for error conditions. Note that the
239 * GSS_ERROR() macro has changed slightly from the V1 GSSAPI so that it now
240 * evaluates its argument only once.
242 #define GSS_CALLING_ERROR(x) \
243 ((x) & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
244 #define GSS_ROUTINE_ERROR(x) \
245 ((x) & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
246 #define GSS_SUPPLEMENTARY_INFO(x) \
247 ((x) & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
248 #define GSS_ERROR(x) \
249 ((x) & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
250 (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
253 * Now the actual status code definitions
259 #define GSS_S_CALL_INACCESSIBLE_READ \
260 (((OM_uint32) 1ul) << GSS_C_CALLING_ERROR_OFFSET)
261 #define GSS_S_CALL_INACCESSIBLE_WRITE \
262 (((OM_uint32) 2ul) << GSS_C_CALLING_ERROR_OFFSET)
263 #define GSS_S_CALL_BAD_STRUCTURE \
264 (((OM_uint32) 3ul) << GSS_C_CALLING_ERROR_OFFSET)
269 #define GSS_S_BAD_MECH (((OM_uint32) 1ul) << GSS_C_ROUTINE_ERROR_OFFSET)
270 #define GSS_S_BAD_NAME (((OM_uint32) 2ul) << GSS_C_ROUTINE_ERROR_OFFSET)
271 #define GSS_S_BAD_NAMETYPE (((OM_uint32) 3ul) << GSS_C_ROUTINE_ERROR_OFFSET)
272 #define GSS_S_BAD_BINDINGS (((OM_uint32) 4ul) << GSS_C_ROUTINE_ERROR_OFFSET)
273 #define GSS_S_BAD_STATUS (((OM_uint32) 5ul) << GSS_C_ROUTINE_ERROR_OFFSET)
274 #define GSS_S_BAD_SIG (((OM_uint32) 6ul) << GSS_C_ROUTINE_ERROR_OFFSET)
275 #define GSS_S_NO_CRED (((OM_uint32) 7ul) << GSS_C_ROUTINE_ERROR_OFFSET)
276 #define GSS_S_NO_CONTEXT (((OM_uint32) 8ul) << GSS_C_ROUTINE_ERROR_OFFSET)
277 #define GSS_S_DEFECTIVE_TOKEN (((OM_uint32) 9ul) << GSS_C_ROUTINE_ERROR_OFFSET)
278 #define GSS_S_DEFECTIVE_CREDENTIAL \
279 (((OM_uint32) 10ul) << GSS_C_ROUTINE_ERROR_OFFSET)
280 #define GSS_S_CREDENTIALS_EXPIRED \
281 (((OM_uint32) 11ul) << GSS_C_ROUTINE_ERROR_OFFSET)
282 #define GSS_S_CONTEXT_EXPIRED \
283 (((OM_uint32) 12ul) << GSS_C_ROUTINE_ERROR_OFFSET)
284 #define GSS_S_FAILURE (((OM_uint32) 13ul) << GSS_C_ROUTINE_ERROR_OFFSET)
285 #define GSS_S_BAD_QOP (((OM_uint32) 14ul) << GSS_C_ROUTINE_ERROR_OFFSET)
286 #define GSS_S_UNAUTHORIZED (((OM_uint32) 15ul) << GSS_C_ROUTINE_ERROR_OFFSET)
287 #define GSS_S_UNAVAILABLE (((OM_uint32) 16ul) << GSS_C_ROUTINE_ERROR_OFFSET)
288 #define GSS_S_DUPLICATE_ELEMENT \
289 (((OM_uint32) 17ul) << GSS_C_ROUTINE_ERROR_OFFSET)
290 #define GSS_S_NAME_NOT_MN \
291 (((OM_uint32) 18ul) << GSS_C_ROUTINE_ERROR_OFFSET)
292 #define GSS_S_BAD_MECH_ATTR \
293 (((OM_uint32) 19ul) << GSS_C_ROUTINE_ERROR_OFFSET)
296 * Supplementary info bits:
298 #define GSS_S_CONTINUE_NEEDED (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
299 #define GSS_S_DUPLICATE_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
300 #define GSS_S_OLD_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
301 #define GSS_S_UNSEQ_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
302 #define GSS_S_GAP_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
306 * Finally, function prototypes for the GSSAPI routines.
309 #if defined (_WIN32) && defined (_MSC_VER)
311 # define GSS_DLLIMP __declspec(dllexport)
313 # define GSS_DLLIMP __declspec(dllimport)
319 /* Reserved static storage for GSS_oids. Comments are quotes from RFC 2744.
321 * The implementation must reserve static storage for a
322 * gss_OID_desc object containing the value
323 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"},
324 * corresponding to an object-identifier value of
325 * {iso(1) member-body(2) United States(840) mit(113554)
326 * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
327 * GSS_C_NT_USER_NAME should be initialized to point
328 * to that gss_OID_desc.
330 GSS_DLLIMP extern gss_OID GSS_C_NT_USER_NAME;
333 * The implementation must reserve static storage for a
334 * gss_OID_desc object containing the value
335 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"},
336 * corresponding to an object-identifier value of
337 * {iso(1) member-body(2) United States(840) mit(113554)
338 * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
339 * The constant GSS_C_NT_MACHINE_UID_NAME should be
340 * initialized to point to that gss_OID_desc.
342 GSS_DLLIMP extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
345 * The implementation must reserve static storage for a
346 * gss_OID_desc object containing the value
347 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"},
348 * corresponding to an object-identifier value of
349 * {iso(1) member-body(2) United States(840) mit(113554)
350 * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
351 * The constant GSS_C_NT_STRING_UID_NAME should be
352 * initialized to point to that gss_OID_desc.
354 GSS_DLLIMP extern gss_OID GSS_C_NT_STRING_UID_NAME;
357 * The implementation must reserve static storage for a
358 * gss_OID_desc object containing the value
359 * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
360 * corresponding to an object-identifier value of
361 * {iso(1) org(3) dod(6) internet(1) security(5)
362 * nametypes(6) gss-host-based-services(2)). The constant
363 * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
364 * to that gss_OID_desc. This is a deprecated OID value, and
365 * implementations wishing to support hostbased-service names
366 * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
367 * defined below, to identify such names;
368 * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
369 * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
370 * parameter, but should not be emitted by GSS-API
373 GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
376 * The implementation must reserve static storage for a
377 * gss_OID_desc object containing the value
378 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
379 * "\x01\x02\x01\x04"}, corresponding to an
380 * object-identifier value of {iso(1) member-body(2)
381 * Unites States(840) mit(113554) infosys(1) gssapi(2)
382 * generic(1) service_name(4)}. The constant
383 * GSS_C_NT_HOSTBASED_SERVICE should be initialized
384 * to point to that gss_OID_desc.
386 GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
389 * The implementation must reserve static storage for a
390 * gss_OID_desc object containing the value
391 * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
392 * corresponding to an object identifier value of
393 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
394 * 6(nametypes), 3(gss-anonymous-name)}. The constant
395 * and GSS_C_NT_ANONYMOUS should be initialized to point
396 * to that gss_OID_desc.
398 GSS_DLLIMP extern gss_OID GSS_C_NT_ANONYMOUS;
402 * The implementation must reserve static storage for a
403 * gss_OID_desc object containing the value
404 * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
405 * corresponding to an object-identifier value of
406 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
407 * 6(nametypes), 4(gss-api-exported-name)}. The constant
408 * GSS_C_NT_EXPORT_NAME should be initialized to point
409 * to that gss_OID_desc.
411 GSS_DLLIMP extern gss_OID GSS_C_NT_EXPORT_NAME;
413 /* Function Prototypes */
415 OM_uint32 KRB5_CALLCONV
417 OM_uint32 *, /* minor_status */
418 gss_name_t, /* desired_name */
419 OM_uint32, /* time_req */
420 gss_OID_set, /* desired_mechs */
421 gss_cred_usage_t, /* cred_usage */
422 gss_cred_id_t *, /* output_cred_handle */
423 gss_OID_set *, /* actual_mechs */
424 OM_uint32 *); /* time_rec */
426 OM_uint32 KRB5_CALLCONV
428 OM_uint32 *, /* minor_status */
429 gss_cred_id_t *); /* cred_handle */
431 OM_uint32 KRB5_CALLCONV
432 gss_init_sec_context(
433 OM_uint32 *, /* minor_status */
434 gss_cred_id_t, /* claimant_cred_handle */
435 gss_ctx_id_t *, /* context_handle */
436 gss_name_t, /* target_name */
437 gss_OID, /* mech_type (used to be const) */
438 OM_uint32, /* req_flags */
439 OM_uint32, /* time_req */
440 gss_channel_bindings_t, /* input_chan_bindings */
441 gss_buffer_t, /* input_token */
442 gss_OID *, /* actual_mech_type */
443 gss_buffer_t, /* output_token */
444 OM_uint32 *, /* ret_flags */
445 OM_uint32 *); /* time_rec */
447 OM_uint32 KRB5_CALLCONV
448 gss_accept_sec_context(
449 OM_uint32 *, /* minor_status */
450 gss_ctx_id_t *, /* context_handle */
451 gss_cred_id_t, /* acceptor_cred_handle */
452 gss_buffer_t, /* input_token_buffer */
453 gss_channel_bindings_t, /* input_chan_bindings */
454 gss_name_t *, /* src_name */
455 gss_OID *, /* mech_type */
456 gss_buffer_t, /* output_token */
457 OM_uint32 *, /* ret_flags */
458 OM_uint32 *, /* time_rec */
459 gss_cred_id_t *); /* delegated_cred_handle */
461 OM_uint32 KRB5_CALLCONV
462 gss_process_context_token(
463 OM_uint32 *, /* minor_status */
464 gss_ctx_id_t, /* context_handle */
465 gss_buffer_t); /* token_buffer */
468 OM_uint32 KRB5_CALLCONV
469 gss_delete_sec_context(
470 OM_uint32 *, /* minor_status */
471 gss_ctx_id_t *, /* context_handle */
472 gss_buffer_t); /* output_token */
475 OM_uint32 KRB5_CALLCONV
477 OM_uint32 *, /* minor_status */
478 gss_ctx_id_t, /* context_handle */
479 OM_uint32 *); /* time_rec */
483 OM_uint32 KRB5_CALLCONV
485 OM_uint32 *, /* minor_status */
486 gss_ctx_id_t, /* context_handle */
487 gss_qop_t, /* qop_req */
488 gss_buffer_t, /* message_buffer */
489 gss_buffer_t); /* message_token */
493 OM_uint32 KRB5_CALLCONV
494 gss_verify_mic(OM_uint32 *, /* minor_status */
495 gss_ctx_id_t, /* context_handle */
496 gss_buffer_t, /* message_buffer */
497 gss_buffer_t, /* message_token */
498 gss_qop_t * /* qop_state */
502 OM_uint32 KRB5_CALLCONV
504 OM_uint32 *, /* minor_status */
505 gss_ctx_id_t, /* context_handle */
506 int, /* conf_req_flag */
507 gss_qop_t, /* qop_req */
508 gss_buffer_t, /* input_message_buffer */
509 int *, /* conf_state */
510 gss_buffer_t); /* output_message_buffer */
514 OM_uint32 KRB5_CALLCONV
516 OM_uint32 *, /* minor_status */
517 gss_ctx_id_t, /* context_handle */
518 gss_buffer_t, /* input_message_buffer */
519 gss_buffer_t, /* output_message_buffer */
520 int *, /* conf_state */
521 gss_qop_t *); /* qop_state */
524 OM_uint32 KRB5_CALLCONV
526 OM_uint32 *, /* minor_status */
527 OM_uint32, /* status_value */
528 int, /* status_type */
529 gss_OID, /* mech_type (used to be const) */
530 OM_uint32 *, /* message_context */
531 gss_buffer_t); /* status_string */
534 OM_uint32 KRB5_CALLCONV
536 OM_uint32 *, /* minor_status */
537 gss_OID_set *); /* mech_set */
540 OM_uint32 KRB5_CALLCONV
542 OM_uint32 *, /* minor_status */
543 gss_name_t, /* name1 */
544 gss_name_t, /* name2 */
545 int *); /* name_equal */
548 OM_uint32 KRB5_CALLCONV
550 OM_uint32 *, /* minor_status */
551 gss_name_t, /* input_name */
552 gss_buffer_t, /* output_name_buffer */
553 gss_OID *); /* output_name_type */
556 OM_uint32 KRB5_CALLCONV
558 OM_uint32 *, /* minor_status */
559 gss_buffer_t, /* input_name_buffer */
560 gss_OID, /* input_name_type(used to be const) */
561 gss_name_t *); /* output_name */
563 OM_uint32 KRB5_CALLCONV
565 OM_uint32 *, /* minor_status */
566 gss_name_t *); /* input_name */
568 OM_uint32 KRB5_CALLCONV
570 OM_uint32 *, /* minor_status */
571 gss_buffer_t); /* buffer */
573 OM_uint32 KRB5_CALLCONV
575 OM_uint32 *, /* minor_status */
576 gss_OID_set *); /* set */
578 OM_uint32 KRB5_CALLCONV
580 OM_uint32 *, /* minor_status */
581 gss_cred_id_t, /* cred_handle */
582 gss_name_t *, /* name */
583 OM_uint32 *, /* lifetime */
584 gss_cred_usage_t *, /* cred_usage */
585 gss_OID_set *); /* mechanisms */
587 /* Last argument new for V2 */
588 OM_uint32 KRB5_CALLCONV
590 OM_uint32 *, /* minor_status */
591 gss_ctx_id_t, /* context_handle */
592 gss_name_t *, /* src_name */
593 gss_name_t *, /* targ_name */
594 OM_uint32 *, /* lifetime_rec */
595 gss_OID *, /* mech_type */
596 OM_uint32 *, /* ctx_flags */
597 int *, /* locally_initiated */
601 OM_uint32 KRB5_CALLCONV
603 OM_uint32 *, /* minor_status */
604 gss_ctx_id_t, /* context_handle */
605 int, /* conf_req_flag */
606 gss_qop_t, /* qop_req */
607 OM_uint32, /* req_output_size */
608 OM_uint32 *); /* max_input_size */
611 OM_uint32 KRB5_CALLCONV
612 gss_import_name_object(
613 OM_uint32 *, /* minor_status */
614 void *, /* input_name */
615 gss_OID, /* input_name_type */
616 gss_name_t *); /* output_name */
619 OM_uint32 KRB5_CALLCONV
620 gss_export_name_object(
621 OM_uint32 *, /* minor_status */
622 gss_name_t, /* input_name */
623 gss_OID, /* desired_name_type */
624 void **); /* output_name */
627 OM_uint32 KRB5_CALLCONV
629 OM_uint32 *, /* minor_status */
630 gss_cred_id_t, /* input_cred_handle */
631 gss_name_t, /* desired_name */
632 gss_OID, /* desired_mech */
633 gss_cred_usage_t, /* cred_usage */
634 OM_uint32, /* initiator_time_req */
635 OM_uint32, /* acceptor_time_req */
636 gss_cred_id_t *, /* output_cred_handle */
637 gss_OID_set *, /* actual_mechs */
638 OM_uint32 *, /* initiator_time_rec */
639 OM_uint32 *); /* acceptor_time_rec */
642 OM_uint32 KRB5_CALLCONV
643 gss_inquire_cred_by_mech(
644 OM_uint32 *, /* minor_status */
645 gss_cred_id_t, /* cred_handle */
646 gss_OID, /* mech_type */
647 gss_name_t *, /* name */
648 OM_uint32 *, /* initiator_lifetime */
649 OM_uint32 *, /* acceptor_lifetime */
650 gss_cred_usage_t *); /* cred_usage */
653 OM_uint32 KRB5_CALLCONV
654 gss_export_sec_context(
655 OM_uint32 *, /* minor_status */
656 gss_ctx_id_t *, /* context_handle */
657 gss_buffer_t); /* interprocess_token */
660 OM_uint32 KRB5_CALLCONV
661 gss_import_sec_context(
662 OM_uint32 *, /* minor_status */
663 gss_buffer_t, /* interprocess_token */
664 gss_ctx_id_t *); /* context_handle */
667 OM_uint32 KRB5_CALLCONV
669 OM_uint32 *, /* minor_status */
670 gss_OID *); /* oid */
673 OM_uint32 KRB5_CALLCONV
674 gss_create_empty_oid_set(
675 OM_uint32 *, /* minor_status */
676 gss_OID_set *); /* oid_set */
679 OM_uint32 KRB5_CALLCONV
680 gss_add_oid_set_member(
681 OM_uint32 *, /* minor_status */
682 gss_OID, /* member_oid */
683 gss_OID_set *); /* oid_set */
686 OM_uint32 KRB5_CALLCONV
687 gss_test_oid_set_member(
688 OM_uint32 *, /* minor_status */
689 gss_OID, /* member */
690 gss_OID_set, /* set */
691 int *); /* present */
694 OM_uint32 KRB5_CALLCONV
696 OM_uint32 *, /* minor_status */
697 gss_buffer_t, /* oid_str */
698 gss_OID *); /* oid */
701 OM_uint32 KRB5_CALLCONV
703 OM_uint32 *, /* minor_status */
705 gss_buffer_t); /* oid_str */
708 OM_uint32 KRB5_CALLCONV
709 gss_inquire_names_for_mech(
710 OM_uint32 *, /* minor_status */
711 gss_OID, /* mechanism */
712 gss_OID_set *); /* name_types */
715 OM_uint32 KRB5_CALLCONV
716 gss_inquire_mechs_for_name(
717 OM_uint32 *, /* minor_status */
718 const gss_name_t, /* input_name */
719 gss_OID_set *); /* mech_types */
722 * The following routines are obsolete variants of gss_get_mic, gss_wrap,
723 * gss_verify_mic and gss_unwrap. They should be provided by GSSAPI V2
724 * implementations for backwards compatibility with V1 applications. Distinct
725 * entrypoints (as opposed to #defines) should be provided, to allow GSSAPI
726 * V1 applications to link against GSSAPI V2 implementations.
728 OM_uint32 KRB5_CALLCONV
730 OM_uint32 *, /* minor_status */
731 gss_ctx_id_t, /* context_handle */
733 gss_buffer_t, /* message_buffer */
734 gss_buffer_t); /* message_token */
736 OM_uint32 KRB5_CALLCONV
738 OM_uint32 *, /* minor_status */
739 gss_ctx_id_t, /* context_handle */
740 gss_buffer_t, /* message_buffer */
741 gss_buffer_t, /* token_buffer */
742 int *); /* qop_state */
744 OM_uint32 KRB5_CALLCONV
746 OM_uint32 *, /* minor_status */
747 gss_ctx_id_t, /* context_handle */
748 int, /* conf_req_flag */
750 gss_buffer_t, /* input_message_buffer */
751 int *, /* conf_state */
752 gss_buffer_t); /* output_message_buffer */
754 OM_uint32 KRB5_CALLCONV
756 OM_uint32 *, /* minor_status */
757 gss_ctx_id_t, /* context_handle */
758 gss_buffer_t, /* input_message_buffer */
759 gss_buffer_t, /* output_message_buffer */
760 int *, /* conf_state */
761 int *); /* qop_state */
764 OM_uint32 KRB5_CALLCONV
766 OM_uint32 *, /* minor_status */
767 const gss_name_t, /* input_name */
768 gss_buffer_t); /* exported_name */
771 OM_uint32 KRB5_CALLCONV
773 OM_uint32 *, /* minor_status */
774 const gss_name_t, /* input_name */
775 gss_name_t *); /* dest_name */
778 OM_uint32 KRB5_CALLCONV
779 gss_canonicalize_name(
780 OM_uint32 *, /* minor_status */
781 const gss_name_t, /* input_name */
782 const gss_OID, /* mech_type */
783 gss_name_t *); /* output_name */
787 #define GSS_C_PRF_KEY_FULL 0
788 #define GSS_C_PRF_KEY_PARTIAL 1
790 OM_uint32 KRB5_CALLCONV
792 OM_uint32 *, /* minor_status */
793 gss_ctx_id_t, /* context */
795 const gss_buffer_t, /* prf_in */
796 ssize_t, /* desired_output_len */
797 gss_buffer_t); /* prf_out */
799 OM_uint32 KRB5_CALLCONV
801 OM_uint32 *, /* minor_status */
802 const gss_cred_id_t,/* input_cred_handle */
803 gss_cred_usage_t, /* input_usage */
804 const gss_OID, /* desired_mech */
805 OM_uint32, /* overwrite_cred */
806 OM_uint32, /* default_cred */
807 gss_OID_set *, /* elements_stored */
808 gss_cred_usage_t *);/* cred_usage_stored */
810 OM_uint32 KRB5_CALLCONV
812 OM_uint32 *, /* minor_status */
813 gss_cred_id_t, /* cred_handle */
814 const gss_OID_set); /* mech_set */
824 /* XXXX these are not part of the GSSAPI C bindings! (but should be) */
826 #define GSS_CALLING_ERROR_FIELD(x) \
827 (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK)
828 #define GSS_ROUTINE_ERROR_FIELD(x) \
829 (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK)
830 #define GSS_SUPPLEMENTARY_INFO_FIELD(x) \
831 (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK)
833 /* XXXX This is a necessary evil until the spec is fixed */
834 #define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
839 typedef const gss_buffer_desc *gss_const_buffer_t;
840 typedef const struct gss_channel_bindings_struct *gss_const_channel_bindings_t;
841 typedef const struct gss_ctx_id_struct gss_const_ctx_id_t;
842 typedef const struct gss_cred_id_struct gss_const_cred_id_t;
843 typedef const struct gss_name_struct gss_const_name_t;
844 typedef const gss_OID_desc *gss_const_OID;
845 typedef const gss_OID_set_desc *gss_const_OID_set;
847 OM_uint32 KRB5_CALLCONV
848 gss_indicate_mechs_by_attrs(
849 OM_uint32 *, /* minor_status */
850 gss_const_OID_set, /* desired_mech_attrs */
851 gss_const_OID_set, /* except_mech_attrs */
852 gss_const_OID_set, /* critical_mech_attrs */
853 gss_OID_set *); /* mechs */
855 OM_uint32 KRB5_CALLCONV
856 gss_inquire_attrs_for_mech(
857 OM_uint32 *, /* minor_status */
858 gss_const_OID, /* mech */
859 gss_OID_set *, /* mech_attrs */
860 gss_OID_set *); /* known_mech_attrs */
862 OM_uint32 KRB5_CALLCONV
863 gss_display_mech_attr(
864 OM_uint32 *, /* minor_status */
865 gss_const_OID, /* mech_attr */
866 gss_buffer_t, /* name */
867 gss_buffer_t, /* short_desc */
868 gss_buffer_t); /* long_desc */
870 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_CONCRETE;
871 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_PSEUDO;
872 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_COMPOSITE;
873 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_NEGO;
874 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_GLUE;
875 GSS_DLLIMP extern gss_const_OID GSS_C_MA_NOT_MECH;
876 GSS_DLLIMP extern gss_const_OID GSS_C_MA_DEPRECATED;
877 GSS_DLLIMP extern gss_const_OID GSS_C_MA_NOT_DFLT_MECH;
878 GSS_DLLIMP extern gss_const_OID GSS_C_MA_ITOK_FRAMED;
879 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT;
880 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG;
881 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT_INIT;
882 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG_INIT;
883 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT_ANON;
884 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG_ANON;
885 GSS_DLLIMP extern gss_const_OID GSS_C_MA_DELEG_CRED;
886 GSS_DLLIMP extern gss_const_OID GSS_C_MA_INTEG_PROT;
887 GSS_DLLIMP extern gss_const_OID GSS_C_MA_CONF_PROT;
888 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MIC;
889 GSS_DLLIMP extern gss_const_OID GSS_C_MA_WRAP;
890 GSS_DLLIMP extern gss_const_OID GSS_C_MA_PROT_READY;
891 GSS_DLLIMP extern gss_const_OID GSS_C_MA_REPLAY_DET;
892 GSS_DLLIMP extern gss_const_OID GSS_C_MA_OOS_DET;
893 GSS_DLLIMP extern gss_const_OID GSS_C_MA_CBINDINGS;
894 GSS_DLLIMP extern gss_const_OID GSS_C_MA_PFS;
895 GSS_DLLIMP extern gss_const_OID GSS_C_MA_COMPRESS;
896 GSS_DLLIMP extern gss_const_OID GSS_C_MA_CTX_TRANS;
901 OM_uint32 KRB5_CALLCONV
902 gss_inquire_saslname_for_mech(
903 OM_uint32 *, /* minor_status */
904 const gss_OID, /* desired_mech */
905 gss_buffer_t, /* sasl_mech_name */
906 gss_buffer_t, /* mech_name */
907 gss_buffer_t /* mech_description */
910 OM_uint32 KRB5_CALLCONV
911 gss_inquire_mech_for_saslname(
912 OM_uint32 *, /* minor_status */
913 const gss_buffer_t, /* sasl_mech_name */
914 gss_OID * /* mech_type */
917 #endif /* _GSSAPI_H_ */