/*1* Copyright (C) The Internet Society (2000). All Rights Reserved.2*3* This document and translations of it may be copied and furnished to4* others, and derivative works that comment on or otherwise explain it5* or assist in its implementation may be prepared, copied, published6* and distributed, in whole or in part, without restriction of any7* kind, provided that the above copyright notice and this paragraph are8* included on all such copies and derivative works. However, this9* document itself may not be modified in any way, such as by removing10* the copyright notice or references to the Internet Society or other11* Internet organizations, except as needed for the purpose of12* developing Internet standards in which case the procedures for13* copyrights defined in the Internet Standards process must be14* followed, or as required to translate it into languages other than15* English.16*17* The limited permissions granted above are perpetual and will not be18* revoked by the Internet Society or its successors or assigns.19*20* This document and the information contained herein is provided on an21* "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING22* TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING23* BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION24* HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF25* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.26*/2728#ifndef _GSSAPI_GSSAPI_H_29#define _GSSAPI_GSSAPI_H_3031#include <sys/cdefs.h>32#include <sys/_types.h>3334#ifndef _SIZE_T_DECLARED35typedef __size_t size_t;36#define _SIZE_T_DECLARED37#endif3839#ifndef _SSIZE_T_DECLARED40typedef __ssize_t ssize_t;41#define _SSIZE_T_DECLARED42#endif4344/* Compatibility with Heimdal 1.5.1 */45#ifndef GSSAPI_CPP_START46#ifdef __cplusplus47#define GSSAPI_CPP_START extern "C" {48#define GSSAPI_CPP_END }49#else50#define GSSAPI_CPP_START51#define GSSAPI_CPP_END52#endif53#endif5455/* Compatibility with Heimdal 1.5.1 */56#ifndef BUILD_GSSAPI_LIB57#define GSSAPI_LIB_FUNCTION58#define GSSAPI_LIB_CALL59#define GSSAPI_LIB_VARIABLE60#endif6162/* Compatibility with Heimdal 1.5.1 */63#ifndef GSSAPI_DEPRECATED_FUNCTION64#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 )))65#define GSSAPI_DEPRECATED_FUNCTION(X) __attribute__((deprecated))66#else67#define GSSAPI_DEPRECATED_FUNCTION(X)68#endif69#endif7071#if 072/*73* If the platform supports the xom.h header file, it should be74* included here.75*/76#include <xom.h>77#endif787980/*81* Now define the three implementation-dependent types.82*/83typedef struct _gss_ctx_id_t *gss_ctx_id_t;84typedef struct _gss_cred_id_t *gss_cred_id_t;85typedef struct _gss_name_t *gss_name_t;8687/*88* The following type must be defined as the smallest natural89* unsigned integer supported by the platform that has at least90* 32 bits of precision.91*/92typedef __uint32_t gss_uint32;939495#ifdef OM_STRING96/*97* We have included the xom.h header file. Verify that OM_uint3298* is defined correctly.99*/100101#if sizeof(gss_uint32) != sizeof(OM_uint32)102#error Incompatible definition of OM_uint32 from xom.h103#endif104105typedef OM_object_identifier gss_OID_desc, *gss_OID;106107#else108109/*110* We can't use X/Open definitions, so roll our own.111*/112113typedef gss_uint32 OM_uint32;114typedef __uint64_t OM_uint64;115116typedef struct gss_OID_desc_struct {117OM_uint32 length;118void *elements;119} gss_OID_desc, *gss_OID;120121#endif122123typedef struct gss_OID_set_desc_struct {124size_t count;125gss_OID elements;126} gss_OID_set_desc, *gss_OID_set;127128typedef struct gss_buffer_desc_struct {129size_t length;130void *value;131} gss_buffer_desc, *gss_buffer_t;132133typedef struct gss_channel_bindings_struct {134OM_uint32 initiator_addrtype;135gss_buffer_desc initiator_address;136OM_uint32 acceptor_addrtype;137gss_buffer_desc acceptor_address;138gss_buffer_desc application_data;139} *gss_channel_bindings_t;140141/*142* For now, define a QOP-type as an OM_uint32143*/144typedef OM_uint32 gss_qop_t;145146typedef int gss_cred_usage_t;147148/*149* Flag bits for context-level services.150*/151#define GSS_C_DELEG_FLAG 1152#define GSS_C_MUTUAL_FLAG 2153#define GSS_C_REPLAY_FLAG 4154#define GSS_C_SEQUENCE_FLAG 8155#define GSS_C_CONF_FLAG 16156#define GSS_C_INTEG_FLAG 32157#define GSS_C_ANON_FLAG 64158#define GSS_C_PROT_READY_FLAG 128159#define GSS_C_TRANS_FLAG 256160161/*162* Credential usage options163*/164#define GSS_C_BOTH 0165#define GSS_C_INITIATE 1166#define GSS_C_ACCEPT 2167168/*169* Status code types for gss_display_status170*/171#define GSS_C_GSS_CODE 1172#define GSS_C_MECH_CODE 2173174/*175* The constant definitions for channel-bindings address families176*/177#define GSS_C_AF_UNSPEC 0178#define GSS_C_AF_LOCAL 1179#define GSS_C_AF_INET 2180#define GSS_C_AF_IMPLINK 3181#define GSS_C_AF_PUP 4182#define GSS_C_AF_CHAOS 5183#define GSS_C_AF_NS 6184#define GSS_C_AF_NBS 7185#define GSS_C_AF_ECMA 8186#define GSS_C_AF_DATAKIT 9187#define GSS_C_AF_CCITT 10188#define GSS_C_AF_SNA 11189#define GSS_C_AF_DECnet 12190#define GSS_C_AF_DLI 13191#define GSS_C_AF_LAT 14192#define GSS_C_AF_HYLINK 15193#define GSS_C_AF_APPLETALK 16194#define GSS_C_AF_BSC 17195#define GSS_C_AF_DSS 18196#define GSS_C_AF_OSI 19197#define GSS_C_AF_X25 21198#define GSS_C_AF_NULLADDR 255199200/*201* Various Null values202*/203#define GSS_C_NO_NAME ((gss_name_t) 0)204#define GSS_C_NO_BUFFER ((gss_buffer_t) 0)205#define GSS_C_NO_OID ((gss_OID) 0)206#define GSS_C_NO_OID_SET ((gss_OID_set) 0)207#define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)208#define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)209#define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)210#define GSS_C_EMPTY_BUFFER {0, NULL}211212/*213* Some alternate names for a couple of the above214* values. These are defined for V1 compatibility.215*/216#define GSS_C_NULL_OID GSS_C_NO_OID217#define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET218219/*220* Define the default Quality of Protection for per-message221* services. Note that an implementation that offers multiple222* levels of QOP may define GSS_C_QOP_DEFAULT to be either zero223* (as done here) to mean "default protection", or to a specific224* explicit QOP value. However, a value of 0 should always be225* interpreted by a GSS-API implementation as a request for the226* default protection level.227*/228#define GSS_C_QOP_DEFAULT 0229230/*231* Expiration time of 2^32-1 seconds means infinite lifetime for a232* credential or security context233*/234#define GSS_C_INDEFINITE 0xfffffffful235236/*237* The implementation must reserve static storage for a238* gss_OID_desc object containing the value239* {10, (void *)"\x2a\x86\x48\x86\xf7\x12"240* "\x01\x02\x01\x01"},241* corresponding to an object-identifier value of242* {iso(1) member-body(2) United States(840) mit(113554)243* infosys(1) gssapi(2) generic(1) user_name(1)}. The constant244* GSS_C_NT_USER_NAME should be initialized to point245* to that gss_OID_desc.246*/247extern gss_OID GSS_C_NT_USER_NAME;248249/*250* The implementation must reserve static storage for a251* gss_OID_desc object containing the value252* {10, (void *)"\x2a\x86\x48\x86\xf7\x12"253* "\x01\x02\x01\x02"},254* corresponding to an object-identifier value of255* {iso(1) member-body(2) United States(840) mit(113554)256* infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.257* The constant GSS_C_NT_MACHINE_UID_NAME should be258* initialized to point to that gss_OID_desc.259*/260extern gss_OID GSS_C_NT_MACHINE_UID_NAME;261262/*263* The implementation must reserve static storage for a264* gss_OID_desc object containing the value265* {10, (void *)"\x2a\x86\x48\x86\xf7\x12"266* "\x01\x02\x01\x03"},267* corresponding to an object-identifier value of268* {iso(1) member-body(2) United States(840) mit(113554)269* infosys(1) gssapi(2) generic(1) string_uid_name(3)}.270* The constant GSS_C_NT_STRING_UID_NAME should be271* initialized to point to that gss_OID_desc.272*/273extern gss_OID GSS_C_NT_STRING_UID_NAME;274275/*276* The implementation must reserve static storage for a277* gss_OID_desc object containing the value278* {6, (void *)"\x2b\x06\x01\x05\x06\x02"},279* corresponding to an object-identifier value of280* {iso(1) org(3) dod(6) internet(1) security(5)281* nametypes(6) gss-host-based-services(2)). The constant282* GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point283* to that gss_OID_desc. This is a deprecated OID value, and284* implementations wishing to support hostbased-service names285* should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,286* defined below, to identify such names;287* GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym288* for GSS_C_NT_HOSTBASED_SERVICE when presented as an input289* parameter, but should not be emitted by GSS-API290* implementations291*/292extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;293294/*295* The implementation must reserve static storage for a296* gss_OID_desc object containing the value297* {10, (void *)"\x2a\x86\x48\x86\xf7\x12"298* "\x01\x02\x01\x04"}, corresponding to an299* object-identifier value of {iso(1) member-body(2)300* Unites States(840) mit(113554) infosys(1) gssapi(2)301* generic(1) service_name(4)}. The constant302* GSS_C_NT_HOSTBASED_SERVICE should be initialized303* to point to that gss_OID_desc.304*/305extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;306307/*308* The implementation must reserve static storage for a309* gss_OID_desc object containing the value310* {6, (void *)"\x2b\x06\01\x05\x06\x03"},311* corresponding to an object identifier value of312* {1(iso), 3(org), 6(dod), 1(internet), 5(security),313* 6(nametypes), 3(gss-anonymous-name)}. The constant314* and GSS_C_NT_ANONYMOUS should be initialized to point315* to that gss_OID_desc.316*/317extern gss_OID GSS_C_NT_ANONYMOUS;318319320/*321* The implementation must reserve static storage for a322* gss_OID_desc object containing the value323* {6, (void *)"\x2b\x06\x01\x05\x06\x04"},324* corresponding to an object-identifier value of325* {1(iso), 3(org), 6(dod), 1(internet), 5(security),326* 6(nametypes), 4(gss-api-exported-name)}. The constant327* GSS_C_NT_EXPORT_NAME should be initialized to point328* to that gss_OID_desc.329*/330extern gss_OID GSS_C_NT_EXPORT_NAME;331332/*333* This name form shall be represented by the Object Identifier {iso(1)334* member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)335* krb5(2) krb5_name(1)}. The recommended symbolic name for this type336* is "GSS_KRB5_NT_PRINCIPAL_NAME".337*/338extern gss_OID GSS_KRB5_NT_PRINCIPAL_NAME;339340/*341* This name form shall be represented by the Object Identifier {iso(1)342* member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)343* generic(1) user_name(1)}. The recommended symbolic name for this344* type is "GSS_KRB5_NT_USER_NAME".345*/346extern gss_OID GSS_KRB5_NT_USER_NAME;347348/*349* This name form shall be represented by the Object Identifier {iso(1)350* member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)351* generic(1) machine_uid_name(2)}. The recommended symbolic name for352* this type is "GSS_KRB5_NT_MACHINE_UID_NAME".353*/354extern gss_OID GSS_KRB5_NT_MACHINE_UID_NAME;355356/*357* This name form shall be represented by the Object Identifier {iso(1)358* member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)359* generic(1) string_uid_name(3)}. The recommended symbolic name for360* this type is "GSS_KRB5_NT_STRING_UID_NAME".361*/362extern gss_OID GSS_KRB5_NT_STRING_UID_NAME;363364/* Major status codes */365366#define GSS_S_COMPLETE 0367368/*369* Some "helper" definitions to make the status code macros obvious.370*/371#define GSS_C_CALLING_ERROR_OFFSET 24372#define GSS_C_ROUTINE_ERROR_OFFSET 16373#define GSS_C_SUPPLEMENTARY_OFFSET 0374#define GSS_C_CALLING_ERROR_MASK 0377ul375#define GSS_C_ROUTINE_ERROR_MASK 0377ul376#define GSS_C_SUPPLEMENTARY_MASK 0177777ul377378/*379* The macros that test status codes for error conditions.380* Note that the GSS_ERROR() macro has changed slightly from381* the V1 GSS-API so that it now evaluates its argument382* only once.383*/384#define GSS_CALLING_ERROR(x) \385(x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))386#define GSS_ROUTINE_ERROR(x) \387(x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))388#define GSS_SUPPLEMENTARY_INFO(x) \389(x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))390#define GSS_ERROR(x) \391(x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \392(GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))393394/*395* Now the actual status code definitions396*/397398/*399* Calling errors:400*/401#define GSS_S_CALL_INACCESSIBLE_READ \402(1ul << GSS_C_CALLING_ERROR_OFFSET)403#define GSS_S_CALL_INACCESSIBLE_WRITE \404(2ul << GSS_C_CALLING_ERROR_OFFSET)405#define GSS_S_CALL_BAD_STRUCTURE \406(3ul << GSS_C_CALLING_ERROR_OFFSET)407408/*409* Routine errors:410*/411#define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)412#define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)413#define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)414#define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)415#define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)416#define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)417#define GSS_S_BAD_MIC GSS_S_BAD_SIG418#define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)419#define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)420#define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)421#define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)422#define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)423#define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)424#define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)425#define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)426#define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)427#define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)428#define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)429#define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)430431/*432* Supplementary info bits:433*/434#define GSS_S_CONTINUE_NEEDED \435(1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))436#define GSS_S_DUPLICATE_TOKEN \437(1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))438#define GSS_S_OLD_TOKEN \439(1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))440#define GSS_S_UNSEQ_TOKEN \441(1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))442#define GSS_S_GAP_TOKEN \443(1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))444445__BEGIN_DECLS446447/*448* Finally, function prototypes for the GSS-API routines.449*/450OM_uint32 gss_acquire_cred451(OM_uint32 *, /* minor_status */452const gss_name_t, /* desired_name */453OM_uint32, /* time_req */454const gss_OID_set, /* desired_mechs */455gss_cred_usage_t, /* cred_usage */456gss_cred_id_t *, /* output_cred_handle */457gss_OID_set *, /* actual_mechs */458OM_uint32 * /* time_rec */459);460461OM_uint32 gss_release_cred462(OM_uint32 *, /* minor_status */463gss_cred_id_t * /* cred_handle */464);465466OM_uint32 gss_init_sec_context467(OM_uint32 *, /* minor_status */468const gss_cred_id_t, /* initiator_cred_handle */469gss_ctx_id_t *, /* context_handle */470const gss_name_t, /* target_name */471const gss_OID, /* mech_type */472OM_uint32, /* req_flags */473OM_uint32, /* time_req */474const gss_channel_bindings_t,475/* input_chan_bindings */476const gss_buffer_t, /* input_token */477gss_OID *, /* actual_mech_type */478gss_buffer_t, /* output_token */479OM_uint32 *, /* ret_flags */480OM_uint32 * /* time_rec */481);482483OM_uint32 gss_accept_sec_context484(OM_uint32 *, /* minor_status */485gss_ctx_id_t *, /* context_handle */486const gss_cred_id_t, /* acceptor_cred_handle */487const gss_buffer_t, /* input_token_buffer */488const gss_channel_bindings_t,489/* input_chan_bindings */490gss_name_t *, /* src_name */491gss_OID *, /* mech_type */492gss_buffer_t, /* output_token */493OM_uint32 *, /* ret_flags */494OM_uint32 *, /* time_rec */495gss_cred_id_t * /* delegated_cred_handle */496);497498OM_uint32 gss_process_context_token499(OM_uint32 *, /* minor_status */500const gss_ctx_id_t, /* context_handle */501const gss_buffer_t /* token_buffer */502);503504OM_uint32 gss_delete_sec_context505(OM_uint32 *, /* minor_status */506gss_ctx_id_t *, /* context_handle */507gss_buffer_t /* output_token */508);509510OM_uint32 gss_context_time511(OM_uint32 *, /* minor_status */512const gss_ctx_id_t, /* context_handle */513OM_uint32 * /* time_rec */514);515516OM_uint32 gss_get_mic517(OM_uint32 *, /* minor_status */518const gss_ctx_id_t, /* context_handle */519gss_qop_t, /* qop_req */520const gss_buffer_t, /* message_buffer */521gss_buffer_t /* message_token */522);523524OM_uint32 gss_verify_mic525(OM_uint32 *, /* minor_status */526const gss_ctx_id_t, /* context_handle */527const gss_buffer_t, /* message_buffer */528const gss_buffer_t, /* token_buffer */529gss_qop_t * /* qop_state */530);531532OM_uint32 gss_wrap533(OM_uint32 *, /* minor_status */534const gss_ctx_id_t, /* context_handle */535int, /* conf_req_flag */536gss_qop_t, /* qop_req */537const gss_buffer_t, /* input_message_buffer */538int *, /* conf_state */539gss_buffer_t /* output_message_buffer */540);541542OM_uint32 gss_unwrap543(OM_uint32 *, /* minor_status */544const gss_ctx_id_t, /* context_handle */545const gss_buffer_t, /* input_message_buffer */546gss_buffer_t, /* output_message_buffer */547int *, /* conf_state */548gss_qop_t * /* qop_state */549);550551OM_uint32 gss_display_status552(OM_uint32 *, /* minor_status */553OM_uint32, /* status_value */554int, /* status_type */555const gss_OID, /* mech_type */556OM_uint32 *, /* message_context */557gss_buffer_t /* status_string */558);559560OM_uint32 gss_indicate_mechs561(OM_uint32 *, /* minor_status */562gss_OID_set * /* mech_set */563);564565OM_uint32 gss_compare_name566(OM_uint32 *, /* minor_status */567const gss_name_t, /* name1 */568const gss_name_t, /* name2 */569int * /* name_equal */570);571572OM_uint32 gss_display_name573(OM_uint32 *, /* minor_status */574const gss_name_t, /* input_name */575gss_buffer_t, /* output_name_buffer */576gss_OID * /* output_name_type */577);578579OM_uint32 gss_import_name580(OM_uint32 *, /* minor_status */581const gss_buffer_t, /* input_name_buffer */582const gss_OID, /* input_name_type */583gss_name_t * /* output_name */584);585586OM_uint32 gss_export_name587(OM_uint32 *, /* minor_status */588const gss_name_t, /* input_name */589gss_buffer_t /* exported_name */590);591592OM_uint32 gss_release_name593(OM_uint32 *, /* minor_status */594gss_name_t * /* input_name */595);596597OM_uint32 gss_release_buffer598(OM_uint32 *, /* minor_status */599gss_buffer_t /* buffer */600);601602OM_uint32 gss_release_oid_set603(OM_uint32 *, /* minor_status */604gss_OID_set * /* set */605);606607OM_uint32 gss_inquire_cred608(OM_uint32 *, /* minor_status */609const gss_cred_id_t, /* cred_handle */610gss_name_t *, /* name */611OM_uint32 *, /* lifetime */612gss_cred_usage_t *, /* cred_usage */613gss_OID_set * /* mechanisms */614);615616OM_uint32 gss_inquire_context (617OM_uint32 *, /* minor_status */618const gss_ctx_id_t, /* context_handle */619gss_name_t *, /* src_name */620gss_name_t *, /* targ_name */621OM_uint32 *, /* lifetime_rec */622gss_OID *, /* mech_type */623OM_uint32 *, /* ctx_flags */624int *, /* locally_initiated */625int * /* open */626);627628OM_uint32 gss_wrap_size_limit (629OM_uint32 *, /* minor_status */630const gss_ctx_id_t, /* context_handle */631int, /* conf_req_flag */632gss_qop_t, /* qop_req */633OM_uint32, /* req_output_size */634OM_uint32 * /* max_input_size */635);636637OM_uint32 gss_add_cred (638OM_uint32 *, /* minor_status */639const gss_cred_id_t, /* input_cred_handle */640const gss_name_t, /* desired_name */641const gss_OID, /* desired_mech */642gss_cred_usage_t, /* cred_usage */643OM_uint32, /* initiator_time_req */644OM_uint32, /* acceptor_time_req */645gss_cred_id_t *, /* output_cred_handle */646gss_OID_set *, /* actual_mechs */647OM_uint32 *, /* initiator_time_rec */648OM_uint32 * /* acceptor_time_rec */649);650651OM_uint32 gss_inquire_cred_by_mech (652OM_uint32 *, /* minor_status */653const gss_cred_id_t, /* cred_handle */654const gss_OID, /* mech_type */655gss_name_t *, /* name */656OM_uint32 *, /* initiator_lifetime */657OM_uint32 *, /* acceptor_lifetime */658gss_cred_usage_t * /* cred_usage */659);660661OM_uint32 gss_export_sec_context (662OM_uint32 *, /* minor_status */663gss_ctx_id_t *, /* context_handle */664gss_buffer_t /* interprocess_token */665);666667OM_uint32 gss_import_sec_context (668OM_uint32 *, /* minor_status */669const gss_buffer_t, /* interprocess_token */670gss_ctx_id_t * /* context_handle */671);672673OM_uint32 gss_create_empty_oid_set (674OM_uint32 *, /* minor_status */675gss_OID_set * /* oid_set */676);677678OM_uint32 gss_add_oid_set_member (679OM_uint32 *, /* minor_status */680const gss_OID, /* member_oid */681gss_OID_set * /* oid_set */682);683684OM_uint32 gss_test_oid_set_member (685OM_uint32 *, /* minor_status */686const gss_OID, /* member */687const gss_OID_set, /* set */688int * /* present */689);690691OM_uint32 gss_inquire_names_for_mech (692OM_uint32 *, /* minor_status */693const gss_OID, /* mechanism */694gss_OID_set * /* name_types */695);696697OM_uint32 gss_inquire_mechs_for_name (698OM_uint32 *, /* minor_status */699const gss_name_t, /* input_name */700gss_OID_set * /* mech_types */701);702703OM_uint32 gss_canonicalize_name (704OM_uint32 *, /* minor_status */705const gss_name_t, /* input_name */706const gss_OID, /* mech_type */707gss_name_t * /* output_name */708);709710OM_uint32 gss_duplicate_name (711OM_uint32 *, /* minor_status */712const gss_name_t, /* src_name */713gss_name_t * /* dest_name */714);715716/*717* The following routines are obsolete variants of gss_get_mic,718* gss_verify_mic, gss_wrap and gss_unwrap. They should be719* provided by GSS-API V2 implementations for backwards720* compatibility with V1 applications. Distinct entrypoints721* (as opposed to #defines) should be provided, both to allow722* GSS-API V1 applications to link against GSS-API V2 implementations,723* and to retain the slight parameter type differences between the724* obsolete versions of these routines and their current forms.725*/726727OM_uint32 gss_sign728(OM_uint32 *, /* minor_status */729gss_ctx_id_t, /* context_handle */730int, /* qop_req */731gss_buffer_t, /* message_buffer */732gss_buffer_t /* message_token */733);734735736OM_uint32 gss_verify737(OM_uint32 *, /* minor_status */738gss_ctx_id_t, /* context_handle */739gss_buffer_t, /* message_buffer */740gss_buffer_t, /* token_buffer */741int * /* qop_state */742);743744OM_uint32 gss_seal745(OM_uint32 *, /* minor_status */746gss_ctx_id_t, /* context_handle */747int, /* conf_req_flag */748int, /* qop_req */749gss_buffer_t, /* input_message_buffer */750int *, /* conf_state */751gss_buffer_t /* output_message_buffer */752);753754755OM_uint32 gss_unseal756(OM_uint32 *, /* minor_status */757gss_ctx_id_t, /* context_handle */758gss_buffer_t, /* input_message_buffer */759gss_buffer_t, /* output_message_buffer */760int *, /* conf_state */761int * /* qop_state */762);763764/*765* Other extensions and helper functions.766*/767768int gss_oid_equal769(const gss_OID, /* first OID to compare */770const gss_OID /* second OID to compare */771);772773OM_uint32 gss_release_oid774(OM_uint32 *, /* minor status */775gss_OID * /* oid to free */776);777778OM_uint32 gss_decapsulate_token779(const gss_buffer_t, /* mechanism independent token */780gss_OID, /* desired mechanism */781gss_buffer_t /* decapsulated mechanism dependent token */782);783784OM_uint32 gss_encapsulate_token785(const gss_buffer_t, /* mechanism dependent token */786gss_OID, /* desired mechanism */787gss_buffer_t /* encapsulated mechanism independent token */788);789790OM_uint32 gss_duplicate_oid791(OM_uint32 *, /* minor status */792const gss_OID, /* oid to copy */793gss_OID * /* result */794);795796OM_uint32 gss_oid_to_str797(OM_uint32 *, /* minor status */798gss_OID, /* oid to convert */799gss_buffer_t /* buffer to contain string */800);801802typedef struct gss_buffer_set_desc_struct {803size_t count;804gss_buffer_desc *elements;805} gss_buffer_set_desc, *gss_buffer_set_t;806807#define GSS_C_NO_BUFFER_SET ((gss_buffer_set_t) 0)808809OM_uint32 gss_create_empty_buffer_set810(OM_uint32 *, /* minor status */811gss_buffer_set_t * /* location for new buffer set */812);813814OM_uint32 gss_add_buffer_set_member815(OM_uint32 *, /* minor status */816gss_buffer_t, /* buffer to add */817gss_buffer_set_t * /* set to add to */818);819820OM_uint32 gss_release_buffer_set821(OM_uint32 *, /* minor status */822gss_buffer_set_t * /* set to release */823);824825OM_uint32 gss_inquire_sec_context_by_oid826(OM_uint32 *, /* minor_status */827const gss_ctx_id_t, /* context_handle */828const gss_OID, /* desired_object */829gss_buffer_set_t * /* result */830);831832OM_uint32 gss_inquire_cred_by_oid833(OM_uint32 *, /* minor_status */834const gss_cred_id_t, /* cred_handle */835const gss_OID, /* desired_object */836gss_buffer_set_t * /* result */837);838839OM_uint32 gss_set_sec_context_option840(OM_uint32 *, /* minor status */841gss_ctx_id_t *, /* context */842const gss_OID, /* option to set */843const gss_buffer_t /* option value */844);845846OM_uint32 gss_set_cred_option847(OM_uint32 *, /* minor status */848gss_cred_id_t *, /* cred */849const gss_OID, /* option to set */850const gss_buffer_t /* option value */851);852853OM_uint32 gss_pseudo_random854(OM_uint32 *, /* minor status */855gss_ctx_id_t, /* context handle */856int prf_key, /* XXX */857const gss_buffer_t, /* data to seed generator */858ssize_t, /* amount of data required */859gss_buffer_t /* buffer for result */860);861862#ifdef _UID_T_DECLARED863OM_uint32 gss_pname_to_uid864(OM_uint32 *, /* minor status */865const gss_name_t pname, /* principal name */866const gss_OID mech, /* mechanism to query */867uid_t *uidp /* pointer to UID for result */868);869#endif870871__END_DECLS872873#endif /* _GSSAPI_GSSAPI_H_ */874875876