2 * Copyright (C) The Internet Society (2000). All Rights Reserved.
4 * This document and translations of it may be copied and furnished to
5 * others, and derivative works that comment on or otherwise explain it
6 * or assist in its implementation may be prepared, copied, published
7 * and distributed, in whole or in part, without restriction of any
8 * kind, provided that the above copyright notice and this paragraph are
9 * included on all such copies and derivative works. However, this
10 * document itself may not be modified in any way, such as by removing
11 * the copyright notice or references to the Internet Society or other
12 * Internet organizations, except as needed for the purpose of
13 * developing Internet standards in which case the procedures for
14 * copyrights defined in the Internet Standards process must be
15 * followed, or as required to translate it into languages other than
18 * The limited permissions granted above are perpetual and will not be
19 * revoked by the Internet Society or its successors or assigns.
21 * This document and the information contained herein is provided on an
22 * "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
23 * TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
24 * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
25 * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
26 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
31 #ifndef _GSSAPI_GSSAPI_H_
32 #define _GSSAPI_GSSAPI_H_
35 * First, include stddef.h to get size_t defined.
40 * Include stdint.h to get explicitly sized data types.
44 #ifndef _SSIZE_T_DECLARED
45 typedef __ssize_t ssize_t;
46 #define _SSIZE_T_DECLARED
51 * If the platform supports the xom.h header file, it should be
59 * Now define the three implementation-dependent types.
61 typedef struct _gss_ctx_id_t *gss_ctx_id_t;
62 typedef struct _gss_cred_id_t *gss_cred_id_t;
63 typedef struct _gss_name_t *gss_name_t;
66 * The following type must be defined as the smallest natural
67 * unsigned integer supported by the platform that has at least
68 * 32 bits of precision.
70 typedef uint32_t gss_uint32;
75 * We have included the xom.h header file. Verify that OM_uint32
76 * is defined correctly.
79 #if sizeof(gss_uint32) != sizeof(OM_uint32)
80 #error Incompatible definition of OM_uint32 from xom.h
83 typedef OM_object_identifier gss_OID_desc, *gss_OID;
88 * We can't use X/Open definitions, so roll our own.
91 typedef gss_uint32 OM_uint32;
93 typedef struct gss_OID_desc_struct {
96 } gss_OID_desc, *gss_OID;
100 typedef struct gss_OID_set_desc_struct {
103 } gss_OID_set_desc, *gss_OID_set;
105 typedef struct gss_buffer_desc_struct {
108 } gss_buffer_desc, *gss_buffer_t;
110 typedef struct gss_channel_bindings_struct {
111 OM_uint32 initiator_addrtype;
112 gss_buffer_desc initiator_address;
113 OM_uint32 acceptor_addrtype;
114 gss_buffer_desc acceptor_address;
115 gss_buffer_desc application_data;
116 } *gss_channel_bindings_t;
119 * For now, define a QOP-type as an OM_uint32
121 typedef OM_uint32 gss_qop_t;
123 typedef int gss_cred_usage_t;
126 * Flag bits for context-level services.
128 #define GSS_C_DELEG_FLAG 1
129 #define GSS_C_MUTUAL_FLAG 2
130 #define GSS_C_REPLAY_FLAG 4
131 #define GSS_C_SEQUENCE_FLAG 8
132 #define GSS_C_CONF_FLAG 16
133 #define GSS_C_INTEG_FLAG 32
134 #define GSS_C_ANON_FLAG 64
135 #define GSS_C_PROT_READY_FLAG 128
136 #define GSS_C_TRANS_FLAG 256
139 * Credential usage options
142 #define GSS_C_INITIATE 1
143 #define GSS_C_ACCEPT 2
146 * Status code types for gss_display_status
148 #define GSS_C_GSS_CODE 1
149 #define GSS_C_MECH_CODE 2
152 * The constant definitions for channel-bindings address families
154 #define GSS_C_AF_UNSPEC 0
155 #define GSS_C_AF_LOCAL 1
156 #define GSS_C_AF_INET 2
157 #define GSS_C_AF_IMPLINK 3
158 #define GSS_C_AF_PUP 4
159 #define GSS_C_AF_CHAOS 5
160 #define GSS_C_AF_NS 6
161 #define GSS_C_AF_NBS 7
162 #define GSS_C_AF_ECMA 8
163 #define GSS_C_AF_DATAKIT 9
164 #define GSS_C_AF_CCITT 10
165 #define GSS_C_AF_SNA 11
166 #define GSS_C_AF_DECnet 12
167 #define GSS_C_AF_DLI 13
168 #define GSS_C_AF_LAT 14
169 #define GSS_C_AF_HYLINK 15
170 #define GSS_C_AF_APPLETALK 16
171 #define GSS_C_AF_BSC 17
172 #define GSS_C_AF_DSS 18
173 #define GSS_C_AF_OSI 19
174 #define GSS_C_AF_X25 21
175 #define GSS_C_AF_NULLADDR 255
178 * Various Null values
180 #define GSS_C_NO_NAME ((gss_name_t) 0)
181 #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
182 #define GSS_C_NO_OID ((gss_OID) 0)
183 #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
184 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
185 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
186 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
187 #define GSS_C_EMPTY_BUFFER {0, NULL}
190 * Some alternate names for a couple of the above
191 * values. These are defined for V1 compatibility.
193 #define GSS_C_NULL_OID GSS_C_NO_OID
194 #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
197 * Define the default Quality of Protection for per-message
198 * services. Note that an implementation that offers multiple
199 * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
200 * (as done here) to mean "default protection", or to a specific
201 * explicit QOP value. However, a value of 0 should always be
202 * interpreted by a GSS-API implementation as a request for the
203 * default protection level.
205 #define GSS_C_QOP_DEFAULT 0
208 * Expiration time of 2^32-1 seconds means infinite lifetime for a
209 * credential or security context
211 #define GSS_C_INDEFINITE 0xfffffffful
214 * The implementation must reserve static storage for a
215 * gss_OID_desc object containing the value
216 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
217 * "\x01\x02\x01\x01"},
218 * corresponding to an object-identifier value of
219 * {iso(1) member-body(2) United States(840) mit(113554)
220 * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
221 * GSS_C_NT_USER_NAME should be initialized to point
222 * to that gss_OID_desc.
224 extern gss_OID GSS_C_NT_USER_NAME;
227 * The implementation must reserve static storage for a
228 * gss_OID_desc object containing the value
229 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
230 * "\x01\x02\x01\x02"},
231 * corresponding to an object-identifier value of
232 * {iso(1) member-body(2) United States(840) mit(113554)
233 * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
234 * The constant GSS_C_NT_MACHINE_UID_NAME should be
235 * initialized to point to that gss_OID_desc.
237 extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
240 * The implementation must reserve static storage for a
241 * gss_OID_desc object containing the value
242 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
243 * "\x01\x02\x01\x03"},
244 * corresponding to an object-identifier value of
245 * {iso(1) member-body(2) United States(840) mit(113554)
246 * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
247 * The constant GSS_C_NT_STRING_UID_NAME should be
248 * initialized to point to that gss_OID_desc.
250 extern gss_OID GSS_C_NT_STRING_UID_NAME;
253 * The implementation must reserve static storage for a
254 * gss_OID_desc object containing the value
255 * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
256 * corresponding to an object-identifier value of
257 * {iso(1) org(3) dod(6) internet(1) security(5)
258 * nametypes(6) gss-host-based-services(2)). The constant
259 * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
260 * to that gss_OID_desc. This is a deprecated OID value, and
261 * implementations wishing to support hostbased-service names
262 * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
263 * defined below, to identify such names;
264 * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
265 * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
266 * parameter, but should not be emitted by GSS-API
269 extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
272 * The implementation must reserve static storage for a
273 * gss_OID_desc object containing the value
274 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
275 * "\x01\x02\x01\x04"}, corresponding to an
276 * object-identifier value of {iso(1) member-body(2)
277 * Unites States(840) mit(113554) infosys(1) gssapi(2)
278 * generic(1) service_name(4)}. The constant
279 * GSS_C_NT_HOSTBASED_SERVICE should be initialized
280 * to point to that gss_OID_desc.
282 extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
285 * The implementation must reserve static storage for a
286 * gss_OID_desc object containing the value
287 * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
288 * corresponding to an object identifier value of
289 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
290 * 6(nametypes), 3(gss-anonymous-name)}. The constant
291 * and GSS_C_NT_ANONYMOUS should be initialized to point
292 * to that gss_OID_desc.
294 extern gss_OID GSS_C_NT_ANONYMOUS;
298 * The implementation must reserve static storage for a
299 * gss_OID_desc object containing the value
300 * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
301 * corresponding to an object-identifier value of
302 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
303 * 6(nametypes), 4(gss-api-exported-name)}. The constant
304 * GSS_C_NT_EXPORT_NAME should be initialized to point
305 * to that gss_OID_desc.
307 extern gss_OID GSS_C_NT_EXPORT_NAME;
310 * This name form shall be represented by the Object Identifier {iso(1)
311 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
312 * krb5(2) krb5_name(1)}. The recommended symbolic name for this type
313 * is "GSS_KRB5_NT_PRINCIPAL_NAME".
315 extern gss_OID GSS_KRB5_NT_PRINCIPAL_NAME;
318 * This name form shall be represented by the Object Identifier {iso(1)
319 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
320 * generic(1) user_name(1)}. The recommended symbolic name for this
321 * type is "GSS_KRB5_NT_USER_NAME".
323 extern gss_OID GSS_KRB5_NT_USER_NAME;
326 * This name form shall be represented by the Object Identifier {iso(1)
327 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
328 * generic(1) machine_uid_name(2)}. The recommended symbolic name for
329 * this type is "GSS_KRB5_NT_MACHINE_UID_NAME".
331 extern gss_OID GSS_KRB5_NT_MACHINE_UID_NAME;
334 * This name form shall be represented by the Object Identifier {iso(1)
335 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
336 * generic(1) string_uid_name(3)}. The recommended symbolic name for
337 * this type is "GSS_KRB5_NT_STRING_UID_NAME".
339 extern gss_OID GSS_KRB5_NT_STRING_UID_NAME;
341 /* Major status codes */
343 #define GSS_S_COMPLETE 0
346 * Some "helper" definitions to make the status code macros obvious.
348 #define GSS_C_CALLING_ERROR_OFFSET 24
349 #define GSS_C_ROUTINE_ERROR_OFFSET 16
350 #define GSS_C_SUPPLEMENTARY_OFFSET 0
351 #define GSS_C_CALLING_ERROR_MASK 0377ul
352 #define GSS_C_ROUTINE_ERROR_MASK 0377ul
353 #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
356 * The macros that test status codes for error conditions.
357 * Note that the GSS_ERROR() macro has changed slightly from
358 * the V1 GSS-API so that it now evaluates its argument
361 #define GSS_CALLING_ERROR(x) \
362 (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
363 #define GSS_ROUTINE_ERROR(x) \
364 (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
365 #define GSS_SUPPLEMENTARY_INFO(x) \
366 (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
367 #define GSS_ERROR(x) \
368 (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
369 (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
372 * Now the actual status code definitions
378 #define GSS_S_CALL_INACCESSIBLE_READ \
379 (1ul << GSS_C_CALLING_ERROR_OFFSET)
380 #define GSS_S_CALL_INACCESSIBLE_WRITE \
381 (2ul << GSS_C_CALLING_ERROR_OFFSET)
382 #define GSS_S_CALL_BAD_STRUCTURE \
383 (3ul << GSS_C_CALLING_ERROR_OFFSET)
388 #define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
389 #define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
390 #define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
391 #define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
392 #define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
393 #define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
394 #define GSS_S_BAD_MIC GSS_S_BAD_SIG
395 #define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
396 #define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
397 #define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
398 #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
399 #define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
400 #define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
401 #define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
402 #define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
403 #define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
404 #define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
405 #define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
406 #define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
409 * Supplementary info bits:
411 #define GSS_S_CONTINUE_NEEDED \
412 (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
413 #define GSS_S_DUPLICATE_TOKEN \
414 (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
415 #define GSS_S_OLD_TOKEN \
416 (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
417 #define GSS_S_UNSEQ_TOKEN \
418 (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
419 #define GSS_S_GAP_TOKEN \
420 (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
423 * Finally, function prototypes for the GSS-API routines.
425 OM_uint32 gss_acquire_cred
426 (OM_uint32 *, /* minor_status */
427 const gss_name_t, /* desired_name */
428 OM_uint32, /* time_req */
429 const gss_OID_set, /* desired_mechs */
430 gss_cred_usage_t, /* cred_usage */
431 gss_cred_id_t *, /* output_cred_handle */
432 gss_OID_set *, /* actual_mechs */
433 OM_uint32 * /* time_rec */
436 OM_uint32 gss_release_cred
437 (OM_uint32 *, /* minor_status */
438 gss_cred_id_t * /* cred_handle */
441 OM_uint32 gss_init_sec_context
442 (OM_uint32 *, /* minor_status */
443 const gss_cred_id_t, /* initiator_cred_handle */
444 gss_ctx_id_t *, /* context_handle */
445 const gss_name_t, /* target_name */
446 const gss_OID, /* mech_type */
447 OM_uint32, /* req_flags */
448 OM_uint32, /* time_req */
449 const gss_channel_bindings_t,
450 /* input_chan_bindings */
451 const gss_buffer_t, /* input_token */
452 gss_OID *, /* actual_mech_type */
453 gss_buffer_t, /* output_token */
454 OM_uint32 *, /* ret_flags */
455 OM_uint32 * /* time_rec */
458 OM_uint32 gss_accept_sec_context
459 (OM_uint32 *, /* minor_status */
460 gss_ctx_id_t *, /* context_handle */
461 const gss_cred_id_t, /* acceptor_cred_handle */
462 const gss_buffer_t, /* input_token_buffer */
463 const gss_channel_bindings_t,
464 /* 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 */
473 OM_uint32 gss_process_context_token
474 (OM_uint32 *, /* minor_status */
475 const gss_ctx_id_t, /* context_handle */
476 const gss_buffer_t /* token_buffer */
479 OM_uint32 gss_delete_sec_context
480 (OM_uint32 *, /* minor_status */
481 gss_ctx_id_t *, /* context_handle */
482 gss_buffer_t /* output_token */
485 OM_uint32 gss_context_time
486 (OM_uint32 *, /* minor_status */
487 const gss_ctx_id_t, /* context_handle */
488 OM_uint32 * /* time_rec */
491 OM_uint32 gss_get_mic
492 (OM_uint32 *, /* minor_status */
493 const gss_ctx_id_t, /* context_handle */
494 gss_qop_t, /* qop_req */
495 const gss_buffer_t, /* message_buffer */
496 gss_buffer_t /* message_token */
499 OM_uint32 gss_verify_mic
500 (OM_uint32 *, /* minor_status */
501 const gss_ctx_id_t, /* context_handle */
502 const gss_buffer_t, /* message_buffer */
503 const gss_buffer_t, /* token_buffer */
504 gss_qop_t * /* qop_state */
508 (OM_uint32 *, /* minor_status */
509 const gss_ctx_id_t, /* context_handle */
510 int, /* conf_req_flag */
511 gss_qop_t, /* qop_req */
512 const gss_buffer_t, /* input_message_buffer */
513 int *, /* conf_state */
514 gss_buffer_t /* output_message_buffer */
518 (OM_uint32 *, /* minor_status */
519 const gss_ctx_id_t, /* context_handle */
520 const gss_buffer_t, /* input_message_buffer */
521 gss_buffer_t, /* output_message_buffer */
522 int *, /* conf_state */
523 gss_qop_t * /* qop_state */
526 OM_uint32 gss_display_status
527 (OM_uint32 *, /* minor_status */
528 OM_uint32, /* status_value */
529 int, /* status_type */
530 const gss_OID, /* mech_type */
531 OM_uint32 *, /* message_context */
532 gss_buffer_t /* status_string */
535 OM_uint32 gss_indicate_mechs
536 (OM_uint32 *, /* minor_status */
537 gss_OID_set * /* mech_set */
540 OM_uint32 gss_compare_name
541 (OM_uint32 *, /* minor_status */
542 const gss_name_t, /* name1 */
543 const gss_name_t, /* name2 */
544 int * /* name_equal */
547 OM_uint32 gss_display_name
548 (OM_uint32 *, /* minor_status */
549 const gss_name_t, /* input_name */
550 gss_buffer_t, /* output_name_buffer */
551 gss_OID * /* output_name_type */
554 OM_uint32 gss_import_name
555 (OM_uint32 *, /* minor_status */
556 const gss_buffer_t, /* input_name_buffer */
557 const gss_OID, /* input_name_type */
558 gss_name_t * /* output_name */
561 OM_uint32 gss_export_name
562 (OM_uint32 *, /* minor_status */
563 const gss_name_t, /* input_name */
564 gss_buffer_t /* exported_name */
567 OM_uint32 gss_release_name
568 (OM_uint32 *, /* minor_status */
569 gss_name_t * /* input_name */
572 OM_uint32 gss_release_buffer
573 (OM_uint32 *, /* minor_status */
574 gss_buffer_t /* buffer */
577 OM_uint32 gss_release_oid_set
578 (OM_uint32 *, /* minor_status */
579 gss_OID_set * /* set */
582 OM_uint32 gss_inquire_cred
583 (OM_uint32 *, /* minor_status */
584 const 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 */
591 OM_uint32 gss_inquire_context (
592 OM_uint32 *, /* minor_status */
593 const gss_ctx_id_t, /* context_handle */
594 gss_name_t *, /* src_name */
595 gss_name_t *, /* targ_name */
596 OM_uint32 *, /* lifetime_rec */
597 gss_OID *, /* mech_type */
598 OM_uint32 *, /* ctx_flags */
599 int *, /* locally_initiated */
603 OM_uint32 gss_wrap_size_limit (
604 OM_uint32 *, /* minor_status */
605 const gss_ctx_id_t, /* context_handle */
606 int, /* conf_req_flag */
607 gss_qop_t, /* qop_req */
608 OM_uint32, /* req_output_size */
609 OM_uint32 * /* max_input_size */
612 OM_uint32 gss_add_cred (
613 OM_uint32 *, /* minor_status */
614 const gss_cred_id_t, /* input_cred_handle */
615 const gss_name_t, /* desired_name */
616 const gss_OID, /* desired_mech */
617 gss_cred_usage_t, /* cred_usage */
618 OM_uint32, /* initiator_time_req */
619 OM_uint32, /* acceptor_time_req */
620 gss_cred_id_t *, /* output_cred_handle */
621 gss_OID_set *, /* actual_mechs */
622 OM_uint32 *, /* initiator_time_rec */
623 OM_uint32 * /* acceptor_time_rec */
626 OM_uint32 gss_inquire_cred_by_mech (
627 OM_uint32 *, /* minor_status */
628 const gss_cred_id_t, /* cred_handle */
629 const gss_OID, /* mech_type */
630 gss_name_t *, /* name */
631 OM_uint32 *, /* initiator_lifetime */
632 OM_uint32 *, /* acceptor_lifetime */
633 gss_cred_usage_t * /* cred_usage */
636 OM_uint32 gss_export_sec_context (
637 OM_uint32 *, /* minor_status */
638 gss_ctx_id_t *, /* context_handle */
639 gss_buffer_t /* interprocess_token */
642 OM_uint32 gss_import_sec_context (
643 OM_uint32 *, /* minor_status */
644 const gss_buffer_t, /* interprocess_token */
645 gss_ctx_id_t * /* context_handle */
648 OM_uint32 gss_create_empty_oid_set (
649 OM_uint32 *, /* minor_status */
650 gss_OID_set * /* oid_set */
653 OM_uint32 gss_add_oid_set_member (
654 OM_uint32 *, /* minor_status */
655 const gss_OID, /* member_oid */
656 gss_OID_set * /* oid_set */
659 OM_uint32 gss_test_oid_set_member (
660 OM_uint32 *, /* minor_status */
661 const gss_OID, /* member */
662 const gss_OID_set, /* set */
666 OM_uint32 gss_inquire_names_for_mech (
667 OM_uint32 *, /* minor_status */
668 const gss_OID, /* mechanism */
669 gss_OID_set * /* name_types */
672 OM_uint32 gss_inquire_mechs_for_name (
673 OM_uint32 *, /* minor_status */
674 const gss_name_t, /* input_name */
675 gss_OID_set * /* mech_types */
678 OM_uint32 gss_canonicalize_name (
679 OM_uint32 *, /* minor_status */
680 const gss_name_t, /* input_name */
681 const gss_OID, /* mech_type */
682 gss_name_t * /* output_name */
685 OM_uint32 gss_duplicate_name (
686 OM_uint32 *, /* minor_status */
687 const gss_name_t, /* src_name */
688 gss_name_t * /* dest_name */
692 * The following routines are obsolete variants of gss_get_mic,
693 * gss_verify_mic, gss_wrap and gss_unwrap. They should be
694 * provided by GSS-API V2 implementations for backwards
695 * compatibility with V1 applications. Distinct entrypoints
696 * (as opposed to #defines) should be provided, both to allow
697 * GSS-API V1 applications to link against GSS-API V2 implementations,
698 * and to retain the slight parameter type differences between the
699 * obsolete versions of these routines and their current forms.
703 (OM_uint32 *, /* minor_status */
704 gss_ctx_id_t, /* context_handle */
706 gss_buffer_t, /* message_buffer */
707 gss_buffer_t /* message_token */
712 (OM_uint32 *, /* minor_status */
713 gss_ctx_id_t, /* context_handle */
714 gss_buffer_t, /* message_buffer */
715 gss_buffer_t, /* token_buffer */
716 int * /* qop_state */
720 (OM_uint32 *, /* minor_status */
721 gss_ctx_id_t, /* context_handle */
722 int, /* conf_req_flag */
724 gss_buffer_t, /* input_message_buffer */
725 int *, /* conf_state */
726 gss_buffer_t /* output_message_buffer */
731 (OM_uint32 *, /* minor_status */
732 gss_ctx_id_t, /* context_handle */
733 gss_buffer_t, /* input_message_buffer */
734 gss_buffer_t, /* output_message_buffer */
735 int *, /* conf_state */
736 int * /* qop_state */
740 * Other extensions and helper functions.
744 (const gss_OID, /* first OID to compare */
745 const gss_OID /* second OID to compare */
748 OM_uint32 gss_release_oid
749 (OM_uint32 *, /* minor status */
750 gss_OID * /* oid to free */
753 OM_uint32 gss_decapsulate_token
754 (const gss_buffer_t, /* mechanism independent token */
755 gss_OID, /* desired mechanism */
756 gss_buffer_t /* decapsulated mechanism dependant token */
759 OM_uint32 gss_encapsulate_token
760 (const gss_buffer_t, /* mechanism dependant token */
761 gss_OID, /* desired mechanism */
762 gss_buffer_t /* encapsulated mechanism independent token */
765 OM_uint32 gss_duplicate_oid
766 (OM_uint32 *, /* minor status */
767 const gss_OID, /* oid to copy */
768 gss_OID * /* result */
771 OM_uint32 gss_oid_to_str
772 (OM_uint32 *, /* minor status */
773 gss_OID, /* oid to convert */
774 gss_buffer_t /* buffer to contain string */
777 typedef struct gss_buffer_set_desc_struct {
779 gss_buffer_desc *elements;
780 } gss_buffer_set_desc, *gss_buffer_set_t;
782 #define GSS_C_NO_BUFFER_SET ((gss_buffer_set_t) 0)
784 OM_uint32 gss_create_empty_buffer_set
785 (OM_uint32 *, /* minor status */
786 gss_buffer_set_t * /* location for new buffer set */
789 OM_uint32 gss_add_buffer_set_member
790 (OM_uint32 *, /* minor status */
791 gss_buffer_t, /* buffer to add */
792 gss_buffer_set_t * /* set to add to */
795 OM_uint32 gss_release_buffer_set
796 (OM_uint32 *, /* minor status */
797 gss_buffer_set_t * /* set to release */
800 OM_uint32 gss_inquire_sec_context_by_oid
801 (OM_uint32 *, /* minor_status */
802 const gss_ctx_id_t, /* context_handle */
803 const gss_OID, /* desired_object */
804 gss_buffer_set_t * /* result */
807 OM_uint32 gss_inquire_cred_by_oid
808 (OM_uint32 *, /* minor_status */
809 const gss_cred_id_t, /* cred_handle */
810 const gss_OID, /* desired_object */
811 gss_buffer_set_t * /* result */
814 OM_uint32 gss_set_sec_context_option
815 (OM_uint32 *, /* minor status */
816 gss_ctx_id_t *, /* context */
817 const gss_OID, /* option to set */
818 const gss_buffer_t /* option value */
821 OM_uint32 gss_set_cred_option
822 (OM_uint32 *, /* minor status */
823 gss_cred_id_t *, /* cred */
824 const gss_OID, /* option to set */
825 const gss_buffer_t /* option value */
828 OM_uint32 gss_pseudo_random
829 (OM_uint32 *, /* minor status */
830 gss_ctx_id_t, /* context handle */
831 int prf_key, /* XXX */
832 const gss_buffer_t, /* data to seed generator */
833 ssize_t, /* amount of data required */
834 gss_buffer_t /* buffer for result */
837 #endif /* _GSSAPI_GSSAPI_H_ */