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
58 * First, include stddef.h to get size_t defined.
63 * POSIX says that sys/types.h is where size_t is defined.
65 #include <sys/types.h>
72 * First, define the three platform-dependent pointer types.
75 struct gss_name_struct;
76 typedef struct gss_name_struct * gss_name_t;
78 struct gss_cred_id_struct;
79 typedef struct gss_cred_id_struct * gss_cred_id_t;
81 struct gss_ctx_id_struct;
82 typedef struct gss_ctx_id_struct * gss_ctx_id_t;
85 * The following type must be defined as the smallest natural unsigned integer
86 * supported by the platform that has at least 32 bits of precision.
88 typedef uint32_t gss_uint32;
89 typedef int32_t gss_int32;
93 * We have included the xom.h header file. Use the definition for
94 * OM_object identifier.
96 typedef OM_object_identifier gss_OID_desc, *gss_OID;
99 * We can't use X/Open definitions, so roll our own.
101 typedef gss_uint32 OM_uint32;
103 typedef struct gss_OID_desc_struct {
106 } gss_OID_desc, *gss_OID;
107 #endif /* OM_STRING */
109 typedef struct gss_OID_set_desc_struct {
112 } gss_OID_set_desc, *gss_OID_set;
114 typedef struct gss_buffer_desc_struct {
117 } gss_buffer_desc, *gss_buffer_t;
119 typedef struct gss_channel_bindings_struct {
120 OM_uint32 initiator_addrtype;
121 gss_buffer_desc initiator_address;
122 OM_uint32 acceptor_addrtype;
123 gss_buffer_desc acceptor_address;
124 gss_buffer_desc application_data;
125 } *gss_channel_bindings_t;
128 * For now, define a QOP-type as an OM_uint32 (pending resolution of ongoing
131 typedef OM_uint32 gss_qop_t;
132 typedef int gss_cred_usage_t;
135 * Flag bits for context-level services.
137 #define GSS_C_DELEG_FLAG 1
138 #define GSS_C_MUTUAL_FLAG 2
139 #define GSS_C_REPLAY_FLAG 4
140 #define GSS_C_SEQUENCE_FLAG 8
141 #define GSS_C_CONF_FLAG 16
142 #define GSS_C_INTEG_FLAG 32
143 #define GSS_C_ANON_FLAG 64
144 #define GSS_C_PROT_READY_FLAG 128
145 #define GSS_C_TRANS_FLAG 256
146 #define GSS_C_DELEG_POLICY_FLAG 32768
149 * Credential usage options
152 #define GSS_C_INITIATE 1
153 #define GSS_C_ACCEPT 2
156 * Status code types for gss_display_status
158 #define GSS_C_GSS_CODE 1
159 #define GSS_C_MECH_CODE 2
162 * The constant definitions for channel-bindings address families
164 #define GSS_C_AF_UNSPEC 0
165 #define GSS_C_AF_LOCAL 1
166 #define GSS_C_AF_INET 2
167 #define GSS_C_AF_IMPLINK 3
168 #define GSS_C_AF_PUP 4
169 #define GSS_C_AF_CHAOS 5
170 #define GSS_C_AF_NS 6
171 #define GSS_C_AF_NBS 7
172 #define GSS_C_AF_ECMA 8
173 #define GSS_C_AF_DATAKIT 9
174 #define GSS_C_AF_CCITT 10
175 #define GSS_C_AF_SNA 11
176 #define GSS_C_AF_DECnet 12
177 #define GSS_C_AF_DLI 13
178 #define GSS_C_AF_LAT 14
179 #define GSS_C_AF_HYLINK 15
180 #define GSS_C_AF_APPLETALK 16
181 #define GSS_C_AF_BSC 17
182 #define GSS_C_AF_DSS 18
183 #define GSS_C_AF_OSI 19
184 #define GSS_C_AF_NETBIOS 20
185 #define GSS_C_AF_X25 21
187 #define GSS_C_AF_NULLADDR 255
190 * Various Null values.
192 #define GSS_C_NO_NAME ((gss_name_t) 0)
193 #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
194 #define GSS_C_NO_OID ((gss_OID) 0)
195 #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
196 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
197 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
198 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
199 #define GSS_C_EMPTY_BUFFER {0, NULL}
202 * Some alternate names for a couple of the above values. These are defined
203 * for V1 compatibility.
205 #define GSS_C_NULL_OID GSS_C_NO_OID
206 #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
209 * Define the default Quality of Protection for per-message services. Note
210 * that an implementation that offers multiple levels of QOP may either reserve
211 * a value (for example zero, as assumed here) to mean "default protection", or
212 * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit
213 * QOP value. However a value of 0 should always be interpreted by a GSSAPI
214 * implementation as a request for the default protection level.
216 #define GSS_C_QOP_DEFAULT 0
219 * Expiration time of 2^32-1 seconds means infinite lifetime for a
220 * credential or security context
222 #define GSS_C_INDEFINITE ((OM_uint32) 0xfffffffful)
225 /* Major status codes */
227 #define GSS_S_COMPLETE 0
230 * Some "helper" definitions to make the status code macros obvious.
232 #define GSS_C_CALLING_ERROR_OFFSET 24
233 #define GSS_C_ROUTINE_ERROR_OFFSET 16
234 #define GSS_C_SUPPLEMENTARY_OFFSET 0
235 #define GSS_C_CALLING_ERROR_MASK ((OM_uint32) 0377ul)
236 #define GSS_C_ROUTINE_ERROR_MASK ((OM_uint32) 0377ul)
237 #define GSS_C_SUPPLEMENTARY_MASK ((OM_uint32) 0177777ul)
240 * The macros that test status codes for error conditions. Note that the
241 * GSS_ERROR() macro has changed slightly from the V1 GSSAPI so that it now
242 * evaluates its argument only once.
244 #define GSS_CALLING_ERROR(x) \
245 ((x) & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
246 #define GSS_ROUTINE_ERROR(x) \
247 ((x) & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
248 #define GSS_SUPPLEMENTARY_INFO(x) \
249 ((x) & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
250 #define GSS_ERROR(x) \
251 ((x) & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
252 (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
255 * Now the actual status code definitions
261 #define GSS_S_CALL_INACCESSIBLE_READ \
262 (((OM_uint32) 1ul) << GSS_C_CALLING_ERROR_OFFSET)
263 #define GSS_S_CALL_INACCESSIBLE_WRITE \
264 (((OM_uint32) 2ul) << GSS_C_CALLING_ERROR_OFFSET)
265 #define GSS_S_CALL_BAD_STRUCTURE \
266 (((OM_uint32) 3ul) << GSS_C_CALLING_ERROR_OFFSET)
271 #define GSS_S_BAD_MECH (((OM_uint32) 1ul) << GSS_C_ROUTINE_ERROR_OFFSET)
272 #define GSS_S_BAD_NAME (((OM_uint32) 2ul) << GSS_C_ROUTINE_ERROR_OFFSET)
273 #define GSS_S_BAD_NAMETYPE (((OM_uint32) 3ul) << GSS_C_ROUTINE_ERROR_OFFSET)
274 #define GSS_S_BAD_BINDINGS (((OM_uint32) 4ul) << GSS_C_ROUTINE_ERROR_OFFSET)
275 #define GSS_S_BAD_STATUS (((OM_uint32) 5ul) << GSS_C_ROUTINE_ERROR_OFFSET)
276 #define GSS_S_BAD_SIG (((OM_uint32) 6ul) << GSS_C_ROUTINE_ERROR_OFFSET)
277 #define GSS_S_BAD_MIC GSS_S_BAD_SIG
278 #define GSS_S_NO_CRED (((OM_uint32) 7ul) << GSS_C_ROUTINE_ERROR_OFFSET)
279 #define GSS_S_NO_CONTEXT (((OM_uint32) 8ul) << GSS_C_ROUTINE_ERROR_OFFSET)
280 #define GSS_S_DEFECTIVE_TOKEN (((OM_uint32) 9ul) << GSS_C_ROUTINE_ERROR_OFFSET)
281 #define GSS_S_DEFECTIVE_CREDENTIAL \
282 (((OM_uint32) 10ul) << GSS_C_ROUTINE_ERROR_OFFSET)
283 #define GSS_S_CREDENTIALS_EXPIRED \
284 (((OM_uint32) 11ul) << GSS_C_ROUTINE_ERROR_OFFSET)
285 #define GSS_S_CONTEXT_EXPIRED \
286 (((OM_uint32) 12ul) << GSS_C_ROUTINE_ERROR_OFFSET)
287 #define GSS_S_FAILURE (((OM_uint32) 13ul) << GSS_C_ROUTINE_ERROR_OFFSET)
288 #define GSS_S_BAD_QOP (((OM_uint32) 14ul) << GSS_C_ROUTINE_ERROR_OFFSET)
289 #define GSS_S_UNAUTHORIZED (((OM_uint32) 15ul) << GSS_C_ROUTINE_ERROR_OFFSET)
290 #define GSS_S_UNAVAILABLE (((OM_uint32) 16ul) << GSS_C_ROUTINE_ERROR_OFFSET)
291 #define GSS_S_DUPLICATE_ELEMENT \
292 (((OM_uint32) 17ul) << GSS_C_ROUTINE_ERROR_OFFSET)
293 #define GSS_S_NAME_NOT_MN \
294 (((OM_uint32) 18ul) << GSS_C_ROUTINE_ERROR_OFFSET)
295 #define GSS_S_BAD_MECH_ATTR \
296 (((OM_uint32) 19ul) << GSS_C_ROUTINE_ERROR_OFFSET)
299 * Supplementary info bits:
301 #define GSS_S_CONTINUE_NEEDED (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
302 #define GSS_S_DUPLICATE_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
303 #define GSS_S_OLD_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
304 #define GSS_S_UNSEQ_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
305 #define GSS_S_GAP_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
309 * Finally, function prototypes for the GSSAPI routines.
312 #if defined (_WIN32) && defined (_MSC_VER)
314 # define GSS_DLLIMP __declspec(dllexport)
316 # define GSS_DLLIMP __declspec(dllimport)
322 /* Reserved static storage for GSS_oids. Comments are quotes from RFC 2744.
324 * The implementation must reserve static storage for a
325 * gss_OID_desc object containing the value
326 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"},
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) user_name(1)}. The constant
330 * GSS_C_NT_USER_NAME should be initialized to point
331 * to that gss_OID_desc.
333 GSS_DLLIMP extern gss_OID GSS_C_NT_USER_NAME;
336 * The implementation must reserve static storage for a
337 * gss_OID_desc object containing the value
338 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"},
339 * corresponding to an object-identifier value of
340 * {iso(1) member-body(2) United States(840) mit(113554)
341 * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
342 * The constant GSS_C_NT_MACHINE_UID_NAME should be
343 * initialized to point to that gss_OID_desc.
345 GSS_DLLIMP extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
348 * The implementation must reserve static storage for a
349 * gss_OID_desc object containing the value
350 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"},
351 * corresponding to an object-identifier value of
352 * {iso(1) member-body(2) United States(840) mit(113554)
353 * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
354 * The constant GSS_C_NT_STRING_UID_NAME should be
355 * initialized to point to that gss_OID_desc.
357 GSS_DLLIMP extern gss_OID GSS_C_NT_STRING_UID_NAME;
360 * The implementation must reserve static storage for a
361 * gss_OID_desc object containing the value
362 * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
363 * corresponding to an object-identifier value of
364 * {iso(1) org(3) dod(6) internet(1) security(5)
365 * nametypes(6) gss-host-based-services(2)). The constant
366 * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
367 * to that gss_OID_desc. This is a deprecated OID value, and
368 * implementations wishing to support hostbased-service names
369 * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
370 * defined below, to identify such names;
371 * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
372 * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
373 * parameter, but should not be emitted by GSS-API
376 GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
379 * The implementation must reserve static storage for a
380 * gss_OID_desc object containing the value
381 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
382 * "\x01\x02\x01\x04"}, corresponding to an
383 * object-identifier value of {iso(1) member-body(2)
384 * Unites States(840) mit(113554) infosys(1) gssapi(2)
385 * generic(1) service_name(4)}. The constant
386 * GSS_C_NT_HOSTBASED_SERVICE should be initialized
387 * to point to that gss_OID_desc.
389 GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
392 * The implementation must reserve static storage for a
393 * gss_OID_desc object containing the value
394 * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
395 * corresponding to an object identifier value of
396 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
397 * 6(nametypes), 3(gss-anonymous-name)}. The constant
398 * and GSS_C_NT_ANONYMOUS should be initialized to point
399 * to that gss_OID_desc.
401 GSS_DLLIMP extern gss_OID GSS_C_NT_ANONYMOUS;
405 * The implementation must reserve static storage for a
406 * gss_OID_desc object containing the value
407 * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
408 * corresponding to an object-identifier value of
409 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
410 * 6(nametypes), 4(gss-api-exported-name)}. The constant
411 * GSS_C_NT_EXPORT_NAME should be initialized to point
412 * to that gss_OID_desc.
414 GSS_DLLIMP extern gss_OID GSS_C_NT_EXPORT_NAME;
416 /* Function Prototypes */
418 OM_uint32 KRB5_CALLCONV
420 OM_uint32 *, /* minor_status */
421 gss_name_t, /* desired_name */
422 OM_uint32, /* time_req */
423 gss_OID_set, /* desired_mechs */
424 gss_cred_usage_t, /* cred_usage */
425 gss_cred_id_t *, /* output_cred_handle */
426 gss_OID_set *, /* actual_mechs */
427 OM_uint32 *); /* time_rec */
429 OM_uint32 KRB5_CALLCONV
431 OM_uint32 *, /* minor_status */
432 gss_cred_id_t *); /* cred_handle */
434 OM_uint32 KRB5_CALLCONV
435 gss_init_sec_context(
436 OM_uint32 *, /* minor_status */
437 gss_cred_id_t, /* claimant_cred_handle */
438 gss_ctx_id_t *, /* context_handle */
439 gss_name_t, /* target_name */
440 gss_OID, /* mech_type (used to be const) */
441 OM_uint32, /* req_flags */
442 OM_uint32, /* time_req */
443 gss_channel_bindings_t, /* input_chan_bindings */
444 gss_buffer_t, /* input_token */
445 gss_OID *, /* actual_mech_type */
446 gss_buffer_t, /* output_token */
447 OM_uint32 *, /* ret_flags */
448 OM_uint32 *); /* time_rec */
450 OM_uint32 KRB5_CALLCONV
451 gss_accept_sec_context(
452 OM_uint32 *, /* minor_status */
453 gss_ctx_id_t *, /* context_handle */
454 gss_cred_id_t, /* acceptor_cred_handle */
455 gss_buffer_t, /* input_token_buffer */
456 gss_channel_bindings_t, /* input_chan_bindings */
457 gss_name_t *, /* src_name */
458 gss_OID *, /* mech_type */
459 gss_buffer_t, /* output_token */
460 OM_uint32 *, /* ret_flags */
461 OM_uint32 *, /* time_rec */
462 gss_cred_id_t *); /* delegated_cred_handle */
464 OM_uint32 KRB5_CALLCONV
465 gss_process_context_token(
466 OM_uint32 *, /* minor_status */
467 gss_ctx_id_t, /* context_handle */
468 gss_buffer_t); /* token_buffer */
471 OM_uint32 KRB5_CALLCONV
472 gss_delete_sec_context(
473 OM_uint32 *, /* minor_status */
474 gss_ctx_id_t *, /* context_handle */
475 gss_buffer_t); /* output_token */
478 OM_uint32 KRB5_CALLCONV
480 OM_uint32 *, /* minor_status */
481 gss_ctx_id_t, /* context_handle */
482 OM_uint32 *); /* time_rec */
486 OM_uint32 KRB5_CALLCONV
488 OM_uint32 *, /* minor_status */
489 gss_ctx_id_t, /* context_handle */
490 gss_qop_t, /* qop_req */
491 gss_buffer_t, /* message_buffer */
492 gss_buffer_t); /* message_token */
496 OM_uint32 KRB5_CALLCONV
497 gss_verify_mic(OM_uint32 *, /* minor_status */
498 gss_ctx_id_t, /* context_handle */
499 gss_buffer_t, /* message_buffer */
500 gss_buffer_t, /* message_token */
501 gss_qop_t * /* qop_state */
505 OM_uint32 KRB5_CALLCONV
507 OM_uint32 *, /* minor_status */
508 gss_ctx_id_t, /* context_handle */
509 int, /* conf_req_flag */
510 gss_qop_t, /* qop_req */
511 gss_buffer_t, /* input_message_buffer */
512 int *, /* conf_state */
513 gss_buffer_t); /* output_message_buffer */
517 OM_uint32 KRB5_CALLCONV
519 OM_uint32 *, /* minor_status */
520 gss_ctx_id_t, /* context_handle */
521 gss_buffer_t, /* input_message_buffer */
522 gss_buffer_t, /* output_message_buffer */
523 int *, /* conf_state */
524 gss_qop_t *); /* qop_state */
527 OM_uint32 KRB5_CALLCONV
529 OM_uint32 *, /* minor_status */
530 OM_uint32, /* status_value */
531 int, /* status_type */
532 gss_OID, /* mech_type (used to be const) */
533 OM_uint32 *, /* message_context */
534 gss_buffer_t); /* status_string */
537 OM_uint32 KRB5_CALLCONV
539 OM_uint32 *, /* minor_status */
540 gss_OID_set *); /* mech_set */
543 OM_uint32 KRB5_CALLCONV
545 OM_uint32 *, /* minor_status */
546 gss_name_t, /* name1 */
547 gss_name_t, /* name2 */
548 int *); /* name_equal */
551 OM_uint32 KRB5_CALLCONV
553 OM_uint32 *, /* minor_status */
554 gss_name_t, /* input_name */
555 gss_buffer_t, /* output_name_buffer */
556 gss_OID *); /* output_name_type */
559 OM_uint32 KRB5_CALLCONV
561 OM_uint32 *, /* minor_status */
562 gss_buffer_t, /* input_name_buffer */
563 gss_OID, /* input_name_type(used to be const) */
564 gss_name_t *); /* output_name */
566 OM_uint32 KRB5_CALLCONV
568 OM_uint32 *, /* minor_status */
569 gss_name_t *); /* input_name */
571 OM_uint32 KRB5_CALLCONV
573 OM_uint32 *, /* minor_status */
574 gss_buffer_t); /* buffer */
576 OM_uint32 KRB5_CALLCONV
578 OM_uint32 *, /* minor_status */
579 gss_OID_set *); /* set */
581 OM_uint32 KRB5_CALLCONV
583 OM_uint32 *, /* minor_status */
584 gss_cred_id_t, /* cred_handle */
585 gss_name_t *, /* name */
586 OM_uint32 *, /* lifetime */
587 gss_cred_usage_t *, /* cred_usage */
588 gss_OID_set *); /* mechanisms */
590 /* Last argument new for V2 */
591 OM_uint32 KRB5_CALLCONV
593 OM_uint32 *, /* minor_status */
594 gss_ctx_id_t, /* context_handle */
595 gss_name_t *, /* src_name */
596 gss_name_t *, /* targ_name */
597 OM_uint32 *, /* lifetime_rec */
598 gss_OID *, /* mech_type */
599 OM_uint32 *, /* ctx_flags */
600 int *, /* locally_initiated */
604 OM_uint32 KRB5_CALLCONV
606 OM_uint32 *, /* minor_status */
607 gss_ctx_id_t, /* context_handle */
608 int, /* conf_req_flag */
609 gss_qop_t, /* qop_req */
610 OM_uint32, /* req_output_size */
611 OM_uint32 *); /* max_input_size */
614 OM_uint32 KRB5_CALLCONV
615 gss_import_name_object(
616 OM_uint32 *, /* minor_status */
617 void *, /* input_name */
618 gss_OID, /* input_name_type */
619 gss_name_t *); /* output_name */
622 OM_uint32 KRB5_CALLCONV
623 gss_export_name_object(
624 OM_uint32 *, /* minor_status */
625 gss_name_t, /* input_name */
626 gss_OID, /* desired_name_type */
627 void **); /* output_name */
630 OM_uint32 KRB5_CALLCONV
632 OM_uint32 *, /* minor_status */
633 gss_cred_id_t, /* input_cred_handle */
634 gss_name_t, /* desired_name */
635 gss_OID, /* desired_mech */
636 gss_cred_usage_t, /* cred_usage */
637 OM_uint32, /* initiator_time_req */
638 OM_uint32, /* acceptor_time_req */
639 gss_cred_id_t *, /* output_cred_handle */
640 gss_OID_set *, /* actual_mechs */
641 OM_uint32 *, /* initiator_time_rec */
642 OM_uint32 *); /* acceptor_time_rec */
645 OM_uint32 KRB5_CALLCONV
646 gss_inquire_cred_by_mech(
647 OM_uint32 *, /* minor_status */
648 gss_cred_id_t, /* cred_handle */
649 gss_OID, /* mech_type */
650 gss_name_t *, /* name */
651 OM_uint32 *, /* initiator_lifetime */
652 OM_uint32 *, /* acceptor_lifetime */
653 gss_cred_usage_t *); /* cred_usage */
656 OM_uint32 KRB5_CALLCONV
657 gss_export_sec_context(
658 OM_uint32 *, /* minor_status */
659 gss_ctx_id_t *, /* context_handle */
660 gss_buffer_t); /* interprocess_token */
663 OM_uint32 KRB5_CALLCONV
664 gss_import_sec_context(
665 OM_uint32 *, /* minor_status */
666 gss_buffer_t, /* interprocess_token */
667 gss_ctx_id_t *); /* context_handle */
670 OM_uint32 KRB5_CALLCONV
672 OM_uint32 *, /* minor_status */
673 gss_OID *); /* oid */
676 OM_uint32 KRB5_CALLCONV
677 gss_create_empty_oid_set(
678 OM_uint32 *, /* minor_status */
679 gss_OID_set *); /* oid_set */
682 OM_uint32 KRB5_CALLCONV
683 gss_add_oid_set_member(
684 OM_uint32 *, /* minor_status */
685 gss_OID, /* member_oid */
686 gss_OID_set *); /* oid_set */
689 OM_uint32 KRB5_CALLCONV
690 gss_test_oid_set_member(
691 OM_uint32 *, /* minor_status */
692 gss_OID, /* member */
693 gss_OID_set, /* set */
694 int *); /* present */
697 OM_uint32 KRB5_CALLCONV
699 OM_uint32 *, /* minor_status */
700 gss_buffer_t, /* oid_str */
701 gss_OID *); /* oid */
704 OM_uint32 KRB5_CALLCONV
706 OM_uint32 *, /* minor_status */
708 gss_buffer_t); /* oid_str */
711 OM_uint32 KRB5_CALLCONV
712 gss_inquire_names_for_mech(
713 OM_uint32 *, /* minor_status */
714 gss_OID, /* mechanism */
715 gss_OID_set *); /* name_types */
718 OM_uint32 KRB5_CALLCONV
719 gss_inquire_mechs_for_name(
720 OM_uint32 *, /* minor_status */
721 const gss_name_t, /* input_name */
722 gss_OID_set *); /* mech_types */
725 * The following routines are obsolete variants of gss_get_mic, gss_wrap,
726 * gss_verify_mic and gss_unwrap. They should be provided by GSSAPI V2
727 * implementations for backwards compatibility with V1 applications. Distinct
728 * entrypoints (as opposed to #defines) should be provided, to allow GSSAPI
729 * V1 applications to link against GSSAPI V2 implementations.
731 OM_uint32 KRB5_CALLCONV
733 OM_uint32 *, /* minor_status */
734 gss_ctx_id_t, /* context_handle */
736 gss_buffer_t, /* message_buffer */
737 gss_buffer_t); /* message_token */
739 OM_uint32 KRB5_CALLCONV
741 OM_uint32 *, /* minor_status */
742 gss_ctx_id_t, /* context_handle */
743 gss_buffer_t, /* message_buffer */
744 gss_buffer_t, /* token_buffer */
745 int *); /* qop_state */
747 OM_uint32 KRB5_CALLCONV
749 OM_uint32 *, /* minor_status */
750 gss_ctx_id_t, /* context_handle */
751 int, /* conf_req_flag */
753 gss_buffer_t, /* input_message_buffer */
754 int *, /* conf_state */
755 gss_buffer_t); /* output_message_buffer */
757 OM_uint32 KRB5_CALLCONV
759 OM_uint32 *, /* minor_status */
760 gss_ctx_id_t, /* context_handle */
761 gss_buffer_t, /* input_message_buffer */
762 gss_buffer_t, /* output_message_buffer */
763 int *, /* conf_state */
764 int *); /* qop_state */
767 OM_uint32 KRB5_CALLCONV
769 OM_uint32 *, /* minor_status */
770 const gss_name_t, /* input_name */
771 gss_buffer_t); /* exported_name */
774 OM_uint32 KRB5_CALLCONV
776 OM_uint32 *, /* minor_status */
777 const gss_name_t, /* input_name */
778 gss_name_t *); /* dest_name */
781 OM_uint32 KRB5_CALLCONV
782 gss_canonicalize_name(
783 OM_uint32 *, /* minor_status */
784 const gss_name_t, /* input_name */
785 const gss_OID, /* mech_type */
786 gss_name_t *); /* output_name */
790 #define GSS_C_PRF_KEY_FULL 0
791 #define GSS_C_PRF_KEY_PARTIAL 1
793 OM_uint32 KRB5_CALLCONV
795 OM_uint32 *, /* minor_status */
796 gss_ctx_id_t, /* context */
798 const gss_buffer_t, /* prf_in */
799 ssize_t, /* desired_output_len */
800 gss_buffer_t); /* prf_out */
802 OM_uint32 KRB5_CALLCONV
804 OM_uint32 *, /* minor_status */
805 const gss_cred_id_t,/* input_cred_handle */
806 gss_cred_usage_t, /* input_usage */
807 const gss_OID, /* desired_mech */
808 OM_uint32, /* overwrite_cred */
809 OM_uint32, /* default_cred */
810 gss_OID_set *, /* elements_stored */
811 gss_cred_usage_t *);/* cred_usage_stored */
813 OM_uint32 KRB5_CALLCONV
815 OM_uint32 *, /* minor_status */
816 gss_cred_id_t, /* cred_handle */
817 const gss_OID_set); /* mech_set */
827 /* XXXX these are not part of the GSSAPI C bindings! (but should be) */
829 #define GSS_CALLING_ERROR_FIELD(x) \
830 (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK)
831 #define GSS_ROUTINE_ERROR_FIELD(x) \
832 (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK)
833 #define GSS_SUPPLEMENTARY_INFO_FIELD(x) \
834 (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK)
836 /* XXXX This is a necessary evil until the spec is fixed */
837 #define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
842 typedef const gss_buffer_desc *gss_const_buffer_t;
843 typedef const struct gss_channel_bindings_struct *gss_const_channel_bindings_t;
844 typedef const struct gss_ctx_id_struct *gss_const_ctx_id_t;
845 typedef const struct gss_cred_id_struct *gss_const_cred_id_t;
846 typedef const struct gss_name_struct *gss_const_name_t;
847 typedef const gss_OID_desc *gss_const_OID;
848 typedef const gss_OID_set_desc *gss_const_OID_set;
850 OM_uint32 KRB5_CALLCONV
851 gss_indicate_mechs_by_attrs(
852 OM_uint32 *, /* minor_status */
853 gss_const_OID_set, /* desired_mech_attrs */
854 gss_const_OID_set, /* except_mech_attrs */
855 gss_const_OID_set, /* critical_mech_attrs */
856 gss_OID_set *); /* mechs */
858 OM_uint32 KRB5_CALLCONV
859 gss_inquire_attrs_for_mech(
860 OM_uint32 *, /* minor_status */
861 gss_const_OID, /* mech */
862 gss_OID_set *, /* mech_attrs */
863 gss_OID_set *); /* known_mech_attrs */
865 OM_uint32 KRB5_CALLCONV
866 gss_display_mech_attr(
867 OM_uint32 *, /* minor_status */
868 gss_const_OID, /* mech_attr */
869 gss_buffer_t, /* name */
870 gss_buffer_t, /* short_desc */
871 gss_buffer_t); /* long_desc */
873 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_CONCRETE;
874 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_PSEUDO;
875 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_COMPOSITE;
876 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_NEGO;
877 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_GLUE;
878 GSS_DLLIMP extern gss_const_OID GSS_C_MA_NOT_MECH;
879 GSS_DLLIMP extern gss_const_OID GSS_C_MA_DEPRECATED;
880 GSS_DLLIMP extern gss_const_OID GSS_C_MA_NOT_DFLT_MECH;
881 GSS_DLLIMP extern gss_const_OID GSS_C_MA_ITOK_FRAMED;
882 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT;
883 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG;
884 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT_INIT;
885 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG_INIT;
886 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT_ANON;
887 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG_ANON;
888 GSS_DLLIMP extern gss_const_OID GSS_C_MA_DELEG_CRED;
889 GSS_DLLIMP extern gss_const_OID GSS_C_MA_INTEG_PROT;
890 GSS_DLLIMP extern gss_const_OID GSS_C_MA_CONF_PROT;
891 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MIC;
892 GSS_DLLIMP extern gss_const_OID GSS_C_MA_WRAP;
893 GSS_DLLIMP extern gss_const_OID GSS_C_MA_PROT_READY;
894 GSS_DLLIMP extern gss_const_OID GSS_C_MA_REPLAY_DET;
895 GSS_DLLIMP extern gss_const_OID GSS_C_MA_OOS_DET;
896 GSS_DLLIMP extern gss_const_OID GSS_C_MA_CBINDINGS;
897 GSS_DLLIMP extern gss_const_OID GSS_C_MA_PFS;
898 GSS_DLLIMP extern gss_const_OID GSS_C_MA_COMPRESS;
899 GSS_DLLIMP extern gss_const_OID GSS_C_MA_CTX_TRANS;
904 OM_uint32 KRB5_CALLCONV
905 gss_inquire_saslname_for_mech(
906 OM_uint32 *, /* minor_status */
907 const gss_OID, /* desired_mech */
908 gss_buffer_t, /* sasl_mech_name */
909 gss_buffer_t, /* mech_name */
910 gss_buffer_t /* mech_description */
913 OM_uint32 KRB5_CALLCONV
914 gss_inquire_mech_for_saslname(
915 OM_uint32 *, /* minor_status */
916 const gss_buffer_t, /* sasl_mech_name */
917 gss_OID * /* mech_type */
920 #endif /* _GSSAPI_H_ */