Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:18:33

0001 /* This is the gssapi.h prologue. */
0002 /* no xom.h */
0003 /* End of gssapi.h prologue. */
0004 /* -*- mode: c; indent-tabs-mode: nil -*- */
0005 /*
0006  * Copyright 1993 by OpenVision Technologies, Inc.
0007  *
0008  * Permission to use, copy, modify, distribute, and sell this software
0009  * and its documentation for any purpose is hereby granted without fee,
0010  * provided that the above copyright notice appears in all copies and
0011  * that both that copyright notice and this permission notice appear in
0012  * supporting documentation, and that the name of OpenVision not be used
0013  * in advertising or publicity pertaining to distribution of the software
0014  * without specific, written prior permission. OpenVision makes no
0015  * representations about the suitability of this software for any
0016  * purpose.  It is provided "as is" without express or implied warranty.
0017  *
0018  * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
0019  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
0020  * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
0021  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
0022  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
0023  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
0024  * PERFORMANCE OF THIS SOFTWARE.
0025  */
0026 
0027 #ifndef _GSSAPI_H_
0028 #define _GSSAPI_H_
0029 
0030 /*
0031  * Determine platform-dependent configuration.
0032  */
0033 
0034 #if defined(__MACH__) && defined(__APPLE__)
0035 #       include <TargetConditionals.h>
0036 #       if TARGET_RT_MAC_CFM
0037 #               error "Use KfM 4.0 SDK headers for CFM compilation."
0038 #       endif
0039 #endif
0040 
0041 #ifdef __cplusplus
0042 extern "C" {
0043 #endif /* __cplusplus */
0044 
0045 #if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
0046 #pragma pack(push,2)
0047 #endif
0048 
0049 #if defined(_MSDOS) || defined(_WIN32)
0050 #include <win-mac.h>
0051 #endif
0052 
0053 #ifndef KRB5_CALLCONV
0054 #define KRB5_CALLCONV
0055 #define KRB5_CALLCONV_C
0056 #endif
0057 
0058 #include <stdint.h>
0059 
0060 /*
0061  * First, include stddef.h to get size_t defined.
0062  */
0063 #include <stddef.h>
0064 
0065 /*
0066  * POSIX says that sys/types.h is where size_t is defined.
0067  */
0068 #include <sys/types.h>
0069 
0070 /*
0071  * $Id$
0072  */
0073 
0074 /*
0075  * First, define the three platform-dependent pointer types.
0076  */
0077 
0078 struct gss_name_struct;
0079 typedef struct gss_name_struct * gss_name_t;
0080 
0081 struct gss_cred_id_struct;
0082 typedef struct gss_cred_id_struct * gss_cred_id_t;
0083 
0084 struct gss_ctx_id_struct;
0085 typedef struct gss_ctx_id_struct * gss_ctx_id_t;
0086 
0087 /*
0088  * The following type must be defined as the smallest natural unsigned integer
0089  * supported by the platform that has at least 32 bits of precision.
0090  */
0091 typedef uint32_t gss_uint32;
0092 typedef int32_t gss_int32;
0093 
0094 #ifdef  OM_STRING
0095 /*
0096  * We have included the xom.h header file.  Use the definition for
0097  * OM_object identifier.
0098  */
0099 typedef OM_object_identifier    gss_OID_desc, *gss_OID;
0100 #else   /* OM_STRING */
0101 /*
0102  * We can't use X/Open definitions, so roll our own.
0103  */
0104 typedef gss_uint32      OM_uint32;
0105 
0106 typedef struct gss_OID_desc_struct {
0107     OM_uint32 length;
0108     void *elements;
0109 } gss_OID_desc, *gss_OID;
0110 #endif  /* OM_STRING */
0111 
0112 typedef struct gss_OID_set_desc_struct  {
0113     size_t  count;
0114     gss_OID elements;
0115 } gss_OID_set_desc, *gss_OID_set;
0116 
0117 typedef struct gss_buffer_desc_struct {
0118     size_t length;
0119     void *value;
0120 } gss_buffer_desc, *gss_buffer_t;
0121 
0122 typedef struct gss_channel_bindings_struct {
0123     OM_uint32 initiator_addrtype;
0124     gss_buffer_desc initiator_address;
0125     OM_uint32 acceptor_addrtype;
0126     gss_buffer_desc acceptor_address;
0127     gss_buffer_desc application_data;
0128 } *gss_channel_bindings_t;
0129 
0130 /*
0131  * For now, define a QOP-type as an OM_uint32 (pending resolution of ongoing
0132  * discussions).
0133  */
0134 typedef OM_uint32       gss_qop_t;
0135 typedef int             gss_cred_usage_t;
0136 
0137 /*
0138  * Flag bits for context-level services.
0139  */
0140 #define GSS_C_DELEG_FLAG        1
0141 #define GSS_C_MUTUAL_FLAG       2
0142 #define GSS_C_REPLAY_FLAG       4
0143 #define GSS_C_SEQUENCE_FLAG     8
0144 #define GSS_C_CONF_FLAG         16
0145 #define GSS_C_INTEG_FLAG        32
0146 #define GSS_C_ANON_FLAG         64
0147 #define GSS_C_PROT_READY_FLAG   128
0148 #define GSS_C_TRANS_FLAG        256
0149 #define GSS_C_DELEG_POLICY_FLAG 32768
0150 
0151 /*
0152  * Credential usage options
0153  */
0154 #define GSS_C_BOTH      0
0155 #define GSS_C_INITIATE  1
0156 #define GSS_C_ACCEPT    2
0157 
0158 /*
0159  * Status code types for gss_display_status
0160  */
0161 #define GSS_C_GSS_CODE  1
0162 #define GSS_C_MECH_CODE 2
0163 
0164 /*
0165  * The constant definitions for channel-bindings address families
0166  */
0167 #define GSS_C_AF_UNSPEC     0
0168 #define GSS_C_AF_LOCAL      1
0169 #define GSS_C_AF_INET       2
0170 #define GSS_C_AF_IMPLINK    3
0171 #define GSS_C_AF_PUP        4
0172 #define GSS_C_AF_CHAOS      5
0173 #define GSS_C_AF_NS         6
0174 #define GSS_C_AF_NBS        7
0175 #define GSS_C_AF_ECMA       8
0176 #define GSS_C_AF_DATAKIT    9
0177 #define GSS_C_AF_CCITT      10
0178 #define GSS_C_AF_SNA        11
0179 #define GSS_C_AF_DECnet     12
0180 #define GSS_C_AF_DLI        13
0181 #define GSS_C_AF_LAT        14
0182 #define GSS_C_AF_HYLINK     15
0183 #define GSS_C_AF_APPLETALK  16
0184 #define GSS_C_AF_BSC        17
0185 #define GSS_C_AF_DSS        18
0186 #define GSS_C_AF_OSI        19
0187 #define GSS_C_AF_NETBIOS    20
0188 #define GSS_C_AF_X25        21
0189 
0190 #define GSS_C_AF_NULLADDR   255
0191 
0192 /*
0193  * Various Null values.
0194  */
0195 #define GSS_C_NO_NAME ((gss_name_t) 0)
0196 #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
0197 #define GSS_C_NO_OID ((gss_OID) 0)
0198 #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
0199 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
0200 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
0201 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
0202 #define GSS_C_EMPTY_BUFFER {0, NULL}
0203 
0204 /*
0205  * Some alternate names for a couple of the above values.  These are defined
0206  * for V1 compatibility.
0207  */
0208 #define GSS_C_NULL_OID          GSS_C_NO_OID
0209 #define GSS_C_NULL_OID_SET      GSS_C_NO_OID_SET
0210 
0211 /*
0212  * Define the default Quality of Protection for per-message services.  Note
0213  * that an implementation that offers multiple levels of QOP may either reserve
0214  * a value (for example zero, as assumed here) to mean "default protection", or
0215  * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit
0216  * QOP value.  However a value of 0 should always be interpreted by a GSSAPI
0217  * implementation as a request for the default protection level.
0218  */
0219 #define GSS_C_QOP_DEFAULT 0
0220 
0221 /*
0222  * Expiration time of 2^32-1 seconds means infinite lifetime for a
0223  * credential or security context
0224  */
0225 #define GSS_C_INDEFINITE ((OM_uint32) 0xfffffffful)
0226 
0227 
0228 /* Major status codes */
0229 
0230 #define GSS_S_COMPLETE 0
0231 
0232 /*
0233  * Some "helper" definitions to make the status code macros obvious.
0234  */
0235 #define GSS_C_CALLING_ERROR_OFFSET 24
0236 #define GSS_C_ROUTINE_ERROR_OFFSET 16
0237 #define GSS_C_SUPPLEMENTARY_OFFSET 0
0238 #define GSS_C_CALLING_ERROR_MASK ((OM_uint32) 0377ul)
0239 #define GSS_C_ROUTINE_ERROR_MASK ((OM_uint32) 0377ul)
0240 #define GSS_C_SUPPLEMENTARY_MASK ((OM_uint32) 0177777ul)
0241 
0242 /*
0243  * The macros that test status codes for error conditions.  Note that the
0244  * GSS_ERROR() macro has changed slightly from the V1 GSSAPI so that it now
0245  * evaluates its argument only once.
0246  */
0247 #define GSS_CALLING_ERROR(x) \
0248   ((x) & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
0249 #define GSS_ROUTINE_ERROR(x) \
0250   ((x) & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
0251 #define GSS_SUPPLEMENTARY_INFO(x) \
0252   ((x) & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
0253 #define GSS_ERROR(x) \
0254   ((x) & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
0255           (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
0256 
0257 /*
0258  * Now the actual status code definitions
0259  */
0260 
0261 /*
0262  * Calling errors:
0263  */
0264 #define GSS_S_CALL_INACCESSIBLE_READ \
0265                              (((OM_uint32) 1ul) << GSS_C_CALLING_ERROR_OFFSET)
0266 #define GSS_S_CALL_INACCESSIBLE_WRITE \
0267                              (((OM_uint32) 2ul) << GSS_C_CALLING_ERROR_OFFSET)
0268 #define GSS_S_CALL_BAD_STRUCTURE \
0269                              (((OM_uint32) 3ul) << GSS_C_CALLING_ERROR_OFFSET)
0270 
0271 /*
0272  * Routine errors:
0273  */
0274 #define GSS_S_BAD_MECH (((OM_uint32) 1ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0275 #define GSS_S_BAD_NAME (((OM_uint32) 2ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0276 #define GSS_S_BAD_NAMETYPE (((OM_uint32) 3ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0277 #define GSS_S_BAD_BINDINGS (((OM_uint32) 4ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0278 #define GSS_S_BAD_STATUS (((OM_uint32) 5ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0279 #define GSS_S_BAD_SIG (((OM_uint32) 6ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0280 #define GSS_S_BAD_MIC GSS_S_BAD_SIG
0281 #define GSS_S_NO_CRED (((OM_uint32) 7ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0282 #define GSS_S_NO_CONTEXT (((OM_uint32) 8ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0283 #define GSS_S_DEFECTIVE_TOKEN (((OM_uint32) 9ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0284 #define GSS_S_DEFECTIVE_CREDENTIAL \
0285      (((OM_uint32) 10ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0286 #define GSS_S_CREDENTIALS_EXPIRED \
0287      (((OM_uint32) 11ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0288 #define GSS_S_CONTEXT_EXPIRED \
0289      (((OM_uint32) 12ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0290 #define GSS_S_FAILURE (((OM_uint32) 13ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0291 #define GSS_S_BAD_QOP (((OM_uint32) 14ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0292 #define GSS_S_UNAUTHORIZED (((OM_uint32) 15ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0293 #define GSS_S_UNAVAILABLE (((OM_uint32) 16ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0294 #define GSS_S_DUPLICATE_ELEMENT \
0295      (((OM_uint32) 17ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0296 #define GSS_S_NAME_NOT_MN \
0297      (((OM_uint32) 18ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0298 #define GSS_S_BAD_MECH_ATTR \
0299      (((OM_uint32) 19ul) << GSS_C_ROUTINE_ERROR_OFFSET)
0300 
0301 /*
0302  * Supplementary info bits:
0303  */
0304 #define GSS_S_CONTINUE_NEEDED (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
0305 #define GSS_S_DUPLICATE_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
0306 #define GSS_S_OLD_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
0307 #define GSS_S_UNSEQ_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
0308 #define GSS_S_GAP_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
0309 
0310 
0311 /*
0312  * Finally, function prototypes for the GSSAPI routines.
0313  */
0314 
0315 #if defined (_WIN32) && defined (_MSC_VER)
0316 # ifdef GSS_DLL_FILE
0317 #  define GSS_DLLIMP __declspec(dllexport)
0318 # else
0319 #  define GSS_DLLIMP __declspec(dllimport)
0320 # endif
0321 #else
0322 # define GSS_DLLIMP
0323 #endif
0324 
0325 /* Reserved static storage for GSS_oids.  Comments are quotes from RFC 2744.
0326  *
0327  * The implementation must reserve static storage for a
0328  * gss_OID_desc object containing the value
0329  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"},
0330  * corresponding to an object-identifier value of
0331  * {iso(1) member-body(2) United States(840) mit(113554)
0332  * infosys(1) gssapi(2) generic(1) user_name(1)}.  The constant
0333  * GSS_C_NT_USER_NAME should be initialized to point
0334  * to that gss_OID_desc.
0335  */
0336 GSS_DLLIMP extern gss_OID GSS_C_NT_USER_NAME;
0337 
0338 /*
0339  * The implementation must reserve static storage for a
0340  * gss_OID_desc object containing the value
0341  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"},
0342  * corresponding to an object-identifier value of
0343  * {iso(1) member-body(2) United States(840) mit(113554)
0344  * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
0345  * The constant GSS_C_NT_MACHINE_UID_NAME should be
0346  * initialized to point to that gss_OID_desc.
0347  */
0348 GSS_DLLIMP extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
0349 
0350 /*
0351  * The implementation must reserve static storage for a
0352  * gss_OID_desc object containing the value
0353  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"},
0354  * corresponding to an object-identifier value of
0355  * {iso(1) member-body(2) United States(840) mit(113554)
0356  * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
0357  * The constant GSS_C_NT_STRING_UID_NAME should be
0358  * initialized to point to that gss_OID_desc.
0359  */
0360 GSS_DLLIMP extern gss_OID GSS_C_NT_STRING_UID_NAME;
0361 
0362 /*
0363  * The implementation must reserve static storage for a
0364  * gss_OID_desc object containing the value
0365  * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
0366  * corresponding to an object-identifier value of
0367  * {iso(1) org(3) dod(6) internet(1) security(5)
0368  * nametypes(6) gss-host-based-services(2)).  The constant
0369  * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
0370  * to that gss_OID_desc.  This is a deprecated OID value, and
0371  * implementations wishing to support hostbased-service names
0372  * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
0373  * defined below, to identify such names;
0374  * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
0375  * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
0376  * parameter, but should not be emitted by GSS-API
0377  * implementations
0378  */
0379 GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
0380 
0381 /*
0382  * The implementation must reserve static storage for a
0383  * gss_OID_desc object containing the value
0384  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
0385  *              "\x01\x02\x01\x04"}, corresponding to an
0386  * object-identifier value of {iso(1) member-body(2)
0387  * Unites States(840) mit(113554) infosys(1) gssapi(2)
0388  * generic(1) service_name(4)}.  The constant
0389  * GSS_C_NT_HOSTBASED_SERVICE should be initialized
0390  * to point to that gss_OID_desc.
0391  */
0392 GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
0393 
0394 /*
0395  * The implementation must reserve static storage for a
0396  * gss_OID_desc object containing the value
0397  * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
0398  * corresponding to an object identifier value of
0399  * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
0400  * 6(nametypes), 3(gss-anonymous-name)}.  The constant
0401  * and GSS_C_NT_ANONYMOUS should be initialized to point
0402  * to that gss_OID_desc.
0403  */
0404 GSS_DLLIMP extern gss_OID GSS_C_NT_ANONYMOUS;
0405 
0406 
0407 /*
0408  * The implementation must reserve static storage for a
0409  * gss_OID_desc object containing the value
0410  * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
0411  * corresponding to an object-identifier value of
0412  * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
0413  * 6(nametypes), 4(gss-api-exported-name)}.  The constant
0414  * GSS_C_NT_EXPORT_NAME should be initialized to point
0415  * to that gss_OID_desc.
0416  */
0417 GSS_DLLIMP extern gss_OID GSS_C_NT_EXPORT_NAME;
0418 
0419 /* Function Prototypes */
0420 
0421 OM_uint32 KRB5_CALLCONV
0422 gss_acquire_cred(
0423     OM_uint32 *,        /* minor_status */
0424     gss_name_t,         /* desired_name */
0425     OM_uint32,          /* time_req */
0426     gss_OID_set,        /* desired_mechs */
0427     gss_cred_usage_t,   /* cred_usage */
0428     gss_cred_id_t *,    /* output_cred_handle */
0429     gss_OID_set *,      /* actual_mechs */
0430     OM_uint32 *);       /* time_rec */
0431 
0432 OM_uint32 KRB5_CALLCONV
0433 gss_release_cred(
0434     OM_uint32 *,        /* minor_status */
0435     gss_cred_id_t *);   /* cred_handle */
0436 
0437 OM_uint32 KRB5_CALLCONV
0438 gss_init_sec_context(
0439     OM_uint32 *,        /* minor_status */
0440     gss_cred_id_t,      /* claimant_cred_handle */
0441     gss_ctx_id_t *,     /* context_handle */
0442     gss_name_t,         /* target_name */
0443     gss_OID,            /* mech_type (used to be const) */
0444     OM_uint32,          /* req_flags */
0445     OM_uint32,          /* time_req */
0446     gss_channel_bindings_t,     /* input_chan_bindings */
0447     gss_buffer_t,       /* input_token */
0448     gss_OID *,          /* actual_mech_type */
0449     gss_buffer_t,       /* output_token */
0450     OM_uint32 *,        /* ret_flags */
0451     OM_uint32 *);       /* time_rec */
0452 
0453 OM_uint32 KRB5_CALLCONV
0454 gss_accept_sec_context(
0455     OM_uint32 *,                /* minor_status */
0456     gss_ctx_id_t *,             /* context_handle */
0457     gss_cred_id_t,              /* acceptor_cred_handle */
0458     gss_buffer_t,               /* input_token_buffer */
0459     gss_channel_bindings_t,     /* input_chan_bindings */
0460     gss_name_t *,               /* src_name */
0461     gss_OID *,                  /* mech_type */
0462     gss_buffer_t,               /* output_token */
0463     OM_uint32 *,                /* ret_flags */
0464     OM_uint32 *,                /* time_rec */
0465     gss_cred_id_t *);           /* delegated_cred_handle */
0466 
0467 OM_uint32 KRB5_CALLCONV
0468 gss_process_context_token(
0469     OM_uint32 *,        /* minor_status */
0470     gss_ctx_id_t,       /* context_handle */
0471     gss_buffer_t);      /* token_buffer */
0472 
0473 
0474 OM_uint32 KRB5_CALLCONV
0475 gss_delete_sec_context(
0476     OM_uint32 *,        /* minor_status */
0477     gss_ctx_id_t *,     /* context_handle */
0478     gss_buffer_t);      /* output_token */
0479 
0480 
0481 OM_uint32 KRB5_CALLCONV
0482 gss_context_time(
0483     OM_uint32 *,        /* minor_status */
0484     gss_ctx_id_t,       /* context_handle */
0485     OM_uint32 *);       /* time_rec */
0486 
0487 
0488 /* New for V2 */
0489 OM_uint32 KRB5_CALLCONV
0490 gss_get_mic(
0491     OM_uint32 *,        /* minor_status */
0492     gss_ctx_id_t,       /* context_handle */
0493     gss_qop_t,          /* qop_req */
0494     gss_buffer_t,       /* message_buffer */
0495     gss_buffer_t);      /* message_token */
0496 
0497 
0498 /* New for V2 */
0499 OM_uint32 KRB5_CALLCONV
0500 gss_verify_mic(OM_uint32 *,     /* minor_status */
0501                gss_ctx_id_t,    /* context_handle */
0502                gss_buffer_t,    /* message_buffer */
0503                gss_buffer_t,    /* message_token */
0504                gss_qop_t *      /* qop_state */
0505 );
0506 
0507 /* New for V2 */
0508 OM_uint32 KRB5_CALLCONV
0509 gss_wrap(
0510     OM_uint32 *,        /* minor_status */
0511     gss_ctx_id_t,       /* context_handle */
0512     int,                /* conf_req_flag */
0513     gss_qop_t,          /* qop_req */
0514     gss_buffer_t,       /* input_message_buffer */
0515     int *,              /* conf_state */
0516     gss_buffer_t);      /* output_message_buffer */
0517 
0518 
0519 /* New for V2 */
0520 OM_uint32 KRB5_CALLCONV
0521 gss_unwrap(
0522     OM_uint32 *,        /* minor_status */
0523     gss_ctx_id_t,       /* context_handle */
0524     gss_buffer_t,       /* input_message_buffer */
0525     gss_buffer_t,       /* output_message_buffer */
0526     int *,              /* conf_state */
0527     gss_qop_t *);       /* qop_state */
0528 
0529 
0530 OM_uint32 KRB5_CALLCONV
0531 gss_display_status(
0532     OM_uint32 *,        /* minor_status */
0533     OM_uint32,          /* status_value */
0534     int,                /* status_type */
0535     gss_OID,            /* mech_type (used to be const) */
0536     OM_uint32 *,        /* message_context */
0537     gss_buffer_t);      /* status_string */
0538 
0539 
0540 OM_uint32 KRB5_CALLCONV
0541 gss_indicate_mechs(
0542     OM_uint32 *,        /* minor_status */
0543     gss_OID_set *);     /* mech_set */
0544 
0545 
0546 OM_uint32 KRB5_CALLCONV
0547 gss_compare_name(
0548     OM_uint32 *,        /* minor_status */
0549     gss_name_t,         /* name1 */
0550     gss_name_t,         /* name2 */
0551     int *);             /* name_equal */
0552 
0553 
0554 OM_uint32 KRB5_CALLCONV
0555 gss_display_name(
0556     OM_uint32 *,        /* minor_status */
0557     gss_name_t,         /* input_name */
0558     gss_buffer_t,       /* output_name_buffer */
0559     gss_OID *);         /* output_name_type */
0560 
0561 
0562 OM_uint32 KRB5_CALLCONV
0563 gss_import_name(
0564     OM_uint32 *,        /* minor_status */
0565     gss_buffer_t,       /* input_name_buffer */
0566     gss_OID,            /* input_name_type(used to be const) */
0567     gss_name_t *);      /* output_name */
0568 
0569 OM_uint32 KRB5_CALLCONV
0570 gss_release_name(
0571     OM_uint32 *,        /* minor_status */
0572     gss_name_t *);      /* input_name */
0573 
0574 OM_uint32 KRB5_CALLCONV
0575 gss_release_buffer(
0576     OM_uint32 *,        /* minor_status */
0577     gss_buffer_t);      /* buffer */
0578 
0579 OM_uint32 KRB5_CALLCONV
0580 gss_release_oid_set(
0581     OM_uint32 *,        /* minor_status */
0582     gss_OID_set *);     /* set */
0583 
0584 OM_uint32 KRB5_CALLCONV
0585 gss_inquire_cred(
0586     OM_uint32 *,        /* minor_status */
0587     gss_cred_id_t,      /* cred_handle */
0588     gss_name_t *,       /* name */
0589     OM_uint32 *,        /* lifetime */
0590     gss_cred_usage_t *, /* cred_usage */
0591     gss_OID_set *);     /* mechanisms */
0592 
0593 /* Last argument new for V2 */
0594 OM_uint32 KRB5_CALLCONV
0595 gss_inquire_context(
0596     OM_uint32 *,        /* minor_status */
0597     gss_ctx_id_t,       /* context_handle */
0598     gss_name_t *,       /* src_name */
0599     gss_name_t *,       /* targ_name */
0600     OM_uint32 *,        /* lifetime_rec */
0601     gss_OID *,          /* mech_type */
0602     OM_uint32 *,        /* ctx_flags */
0603     int *,              /* locally_initiated */
0604     int *);             /* open */
0605 
0606 /* New for V2 */
0607 OM_uint32 KRB5_CALLCONV
0608 gss_wrap_size_limit(
0609     OM_uint32 *,        /* minor_status */
0610     gss_ctx_id_t,       /* context_handle */
0611     int,                /* conf_req_flag */
0612     gss_qop_t,          /* qop_req */
0613     OM_uint32,          /* req_output_size */
0614     OM_uint32 *);       /* max_input_size */
0615 
0616 /* New for V2 */
0617 OM_uint32 KRB5_CALLCONV
0618 gss_import_name_object(
0619     OM_uint32 *,        /* minor_status */
0620     void *,             /* input_name */
0621     gss_OID,            /* input_name_type */
0622     gss_name_t *);      /* output_name */
0623 
0624 /* New for V2 */
0625 OM_uint32 KRB5_CALLCONV
0626 gss_export_name_object(
0627     OM_uint32 *,        /* minor_status */
0628     gss_name_t,         /* input_name */
0629     gss_OID,            /* desired_name_type */
0630     void **);           /* output_name */
0631 
0632 /* New for V2 */
0633 OM_uint32 KRB5_CALLCONV
0634 gss_add_cred(
0635     OM_uint32 *,        /* minor_status */
0636     gss_cred_id_t,      /* input_cred_handle */
0637     gss_name_t,         /* desired_name */
0638     gss_OID,            /* desired_mech */
0639     gss_cred_usage_t,   /* cred_usage */
0640     OM_uint32,          /* initiator_time_req */
0641     OM_uint32,          /* acceptor_time_req */
0642     gss_cred_id_t *,    /* output_cred_handle */
0643     gss_OID_set *,      /* actual_mechs */
0644     OM_uint32 *,        /* initiator_time_rec */
0645     OM_uint32 *);       /* acceptor_time_rec */
0646 
0647 /* New for V2 */
0648 OM_uint32 KRB5_CALLCONV
0649 gss_inquire_cred_by_mech(
0650     OM_uint32 *,                /* minor_status */
0651     gss_cred_id_t,              /* cred_handle */
0652     gss_OID,                    /* mech_type */
0653     gss_name_t *,               /* name */
0654     OM_uint32 *,                /* initiator_lifetime */
0655     OM_uint32 *,                /* acceptor_lifetime */
0656     gss_cred_usage_t *);        /* cred_usage */
0657 
0658 /* New for V2 */
0659 OM_uint32 KRB5_CALLCONV
0660 gss_export_sec_context(
0661     OM_uint32 *,        /* minor_status */
0662     gss_ctx_id_t *,     /* context_handle */
0663     gss_buffer_t);      /* interprocess_token */
0664 
0665 /* New for V2 */
0666 OM_uint32 KRB5_CALLCONV
0667 gss_import_sec_context(
0668     OM_uint32 *,        /* minor_status */
0669     gss_buffer_t,       /* interprocess_token */
0670     gss_ctx_id_t *);    /* context_handle */
0671 
0672 /* New for V2 */
0673 OM_uint32 KRB5_CALLCONV
0674 gss_release_oid(
0675     OM_uint32 *,        /* minor_status */
0676     gss_OID *);         /* oid */
0677 
0678 /* New for V2 */
0679 OM_uint32 KRB5_CALLCONV
0680 gss_create_empty_oid_set(
0681     OM_uint32 *,        /* minor_status */
0682     gss_OID_set *);     /* oid_set */
0683 
0684 /* New for V2 */
0685 OM_uint32 KRB5_CALLCONV
0686 gss_add_oid_set_member(
0687     OM_uint32 *,        /* minor_status */
0688     gss_OID,            /* member_oid */
0689     gss_OID_set *);     /* oid_set */
0690 
0691 /* New for V2 */
0692 OM_uint32 KRB5_CALLCONV
0693 gss_test_oid_set_member(
0694     OM_uint32 *,        /* minor_status */
0695     gss_OID,            /* member */
0696     gss_OID_set,        /* set */
0697     int *);             /* present */
0698 
0699 /* New for V2 */
0700 OM_uint32 KRB5_CALLCONV
0701 gss_str_to_oid(
0702     OM_uint32 *,        /* minor_status */
0703     gss_buffer_t,       /* oid_str */
0704     gss_OID *);         /* oid */
0705 
0706 /* New for V2 */
0707 OM_uint32 KRB5_CALLCONV
0708 gss_oid_to_str(
0709     OM_uint32 *,        /* minor_status */
0710     gss_OID,            /* oid */
0711     gss_buffer_t);      /* oid_str */
0712 
0713 /* New for V2 */
0714 OM_uint32 KRB5_CALLCONV
0715 gss_inquire_names_for_mech(
0716     OM_uint32 *,        /* minor_status */
0717     gss_OID,            /* mechanism */
0718     gss_OID_set *);     /* name_types */
0719 
0720 /* New for V2 */
0721 OM_uint32 KRB5_CALLCONV
0722 gss_inquire_mechs_for_name(
0723     OM_uint32 *,        /* minor_status */
0724     const gss_name_t,   /* input_name */
0725     gss_OID_set *);     /* mech_types */
0726 
0727 /*
0728  * The following routines are obsolete variants of gss_get_mic, gss_wrap,
0729  * gss_verify_mic and gss_unwrap.  They should be provided by GSSAPI V2
0730  * implementations for backwards compatibility with V1 applications.  Distinct
0731  * entrypoints (as opposed to #defines) should be provided, to allow GSSAPI
0732  * V1 applications to link against GSSAPI V2 implementations.
0733  */
0734 OM_uint32 KRB5_CALLCONV
0735 gss_sign(
0736     OM_uint32 *,        /* minor_status */
0737     gss_ctx_id_t,       /* context_handle */
0738     int,                /* qop_req */
0739     gss_buffer_t,       /* message_buffer */
0740     gss_buffer_t);      /* message_token */
0741 
0742 OM_uint32 KRB5_CALLCONV
0743 gss_verify(
0744     OM_uint32 *,        /* minor_status */
0745     gss_ctx_id_t,       /* context_handle */
0746     gss_buffer_t,       /* message_buffer */
0747     gss_buffer_t,       /* token_buffer */
0748     int *);             /* qop_state */
0749 
0750 OM_uint32 KRB5_CALLCONV
0751 gss_seal(
0752     OM_uint32 *,        /* minor_status */
0753     gss_ctx_id_t,       /* context_handle */
0754     int,                /* conf_req_flag */
0755     int,                /* qop_req */
0756     gss_buffer_t,       /* input_message_buffer */
0757     int *,              /* conf_state */
0758     gss_buffer_t);      /* output_message_buffer */
0759 
0760 OM_uint32 KRB5_CALLCONV
0761 gss_unseal(
0762     OM_uint32 *,        /* minor_status */
0763     gss_ctx_id_t,       /* context_handle */
0764     gss_buffer_t,       /* input_message_buffer */
0765     gss_buffer_t,       /* output_message_buffer */
0766     int *,              /* conf_state */
0767     int *);             /* qop_state */
0768 
0769 /* New for V2 */
0770 OM_uint32 KRB5_CALLCONV
0771 gss_export_name(
0772     OM_uint32  *,       /* minor_status */
0773     const gss_name_t,   /* input_name */
0774     gss_buffer_t);      /* exported_name */
0775 
0776 /* New for V2 */
0777 OM_uint32 KRB5_CALLCONV
0778 gss_duplicate_name(
0779     OM_uint32  *,       /* minor_status */
0780     const gss_name_t,   /* input_name */
0781     gss_name_t *);      /* dest_name */
0782 
0783 /* New for V2 */
0784 OM_uint32 KRB5_CALLCONV
0785 gss_canonicalize_name(
0786     OM_uint32  *,       /* minor_status */
0787     const gss_name_t,   /* input_name */
0788     const gss_OID,      /* mech_type */
0789     gss_name_t *);      /* output_name */
0790 
0791 /* RFC 4401 */
0792 
0793 #define GSS_C_PRF_KEY_FULL      0
0794 #define GSS_C_PRF_KEY_PARTIAL   1
0795 
0796 OM_uint32 KRB5_CALLCONV
0797 gss_pseudo_random(
0798     OM_uint32 *,        /* minor_status */
0799     gss_ctx_id_t,       /* context */
0800     int,                /* prf_key */
0801     const gss_buffer_t, /* prf_in */
0802     ssize_t,            /* desired_output_len */
0803     gss_buffer_t);      /* prf_out */
0804 
0805 OM_uint32 KRB5_CALLCONV
0806 gss_store_cred(
0807     OM_uint32 *,        /* minor_status */
0808     const gss_cred_id_t,/* input_cred_handle */
0809     gss_cred_usage_t,   /* input_usage */
0810     const gss_OID,      /* desired_mech */
0811     OM_uint32,          /* overwrite_cred */
0812     OM_uint32,          /* default_cred */
0813     gss_OID_set *,      /* elements_stored */
0814     gss_cred_usage_t *);/* cred_usage_stored */
0815 
0816 OM_uint32 KRB5_CALLCONV
0817 gss_set_neg_mechs(
0818     OM_uint32 *,        /* minor_status */
0819     gss_cred_id_t,      /* cred_handle */
0820     const gss_OID_set); /* mech_set */
0821 
0822 #if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
0823 #pragma pack(pop)
0824 #endif
0825 
0826 #ifdef __cplusplus
0827 }
0828 #endif
0829 
0830 /* XXXX these are not part of the GSSAPI C bindings!  (but should be) */
0831 
0832 #define GSS_CALLING_ERROR_FIELD(x) \
0833    (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK)
0834 #define GSS_ROUTINE_ERROR_FIELD(x) \
0835    (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK)
0836 #define GSS_SUPPLEMENTARY_INFO_FIELD(x) \
0837    (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK)
0838 
0839 /* XXXX This is a necessary evil until the spec is fixed */
0840 #define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
0841 
0842 /*
0843  * RFC 5587
0844  */
0845 typedef const gss_buffer_desc *gss_const_buffer_t;
0846 typedef const struct gss_channel_bindings_struct *gss_const_channel_bindings_t;
0847 typedef const struct gss_ctx_id_struct *gss_const_ctx_id_t;
0848 typedef const struct gss_cred_id_struct *gss_const_cred_id_t;
0849 typedef const struct gss_name_struct *gss_const_name_t;
0850 typedef const gss_OID_desc *gss_const_OID;
0851 typedef const gss_OID_set_desc *gss_const_OID_set;
0852 
0853 OM_uint32 KRB5_CALLCONV
0854 gss_indicate_mechs_by_attrs(
0855     OM_uint32 *,        /* minor_status */
0856     gss_const_OID_set,  /* desired_mech_attrs */
0857     gss_const_OID_set,  /* except_mech_attrs */
0858     gss_const_OID_set,  /* critical_mech_attrs */
0859     gss_OID_set *);     /* mechs */
0860 
0861 OM_uint32 KRB5_CALLCONV
0862 gss_inquire_attrs_for_mech(
0863     OM_uint32 *,        /* minor_status */
0864     gss_const_OID,      /* mech */
0865     gss_OID_set *,      /* mech_attrs */
0866     gss_OID_set *);     /* known_mech_attrs */
0867 
0868 OM_uint32 KRB5_CALLCONV
0869 gss_display_mech_attr(
0870     OM_uint32 *,        /* minor_status */
0871     gss_const_OID,      /* mech_attr */
0872     gss_buffer_t,       /* name */
0873     gss_buffer_t,       /* short_desc */
0874     gss_buffer_t);      /* long_desc */
0875 
0876 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_CONCRETE;
0877 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_PSEUDO;
0878 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_COMPOSITE;
0879 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_NEGO;
0880 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_GLUE;
0881 GSS_DLLIMP extern gss_const_OID GSS_C_MA_NOT_MECH;
0882 GSS_DLLIMP extern gss_const_OID GSS_C_MA_DEPRECATED;
0883 GSS_DLLIMP extern gss_const_OID GSS_C_MA_NOT_DFLT_MECH;
0884 GSS_DLLIMP extern gss_const_OID GSS_C_MA_ITOK_FRAMED;
0885 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT;
0886 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG;
0887 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT_INIT;
0888 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG_INIT;
0889 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT_ANON;
0890 GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG_ANON;
0891 GSS_DLLIMP extern gss_const_OID GSS_C_MA_DELEG_CRED;
0892 GSS_DLLIMP extern gss_const_OID GSS_C_MA_INTEG_PROT;
0893 GSS_DLLIMP extern gss_const_OID GSS_C_MA_CONF_PROT;
0894 GSS_DLLIMP extern gss_const_OID GSS_C_MA_MIC;
0895 GSS_DLLIMP extern gss_const_OID GSS_C_MA_WRAP;
0896 GSS_DLLIMP extern gss_const_OID GSS_C_MA_PROT_READY;
0897 GSS_DLLIMP extern gss_const_OID GSS_C_MA_REPLAY_DET;
0898 GSS_DLLIMP extern gss_const_OID GSS_C_MA_OOS_DET;
0899 GSS_DLLIMP extern gss_const_OID GSS_C_MA_CBINDINGS;
0900 GSS_DLLIMP extern gss_const_OID GSS_C_MA_PFS;
0901 GSS_DLLIMP extern gss_const_OID GSS_C_MA_COMPRESS;
0902 GSS_DLLIMP extern gss_const_OID GSS_C_MA_CTX_TRANS;
0903 
0904 /*
0905  * RFC 5801
0906  */
0907 OM_uint32 KRB5_CALLCONV
0908 gss_inquire_saslname_for_mech(
0909     OM_uint32 *,        /* minor_status */
0910     const gss_OID,      /* desired_mech */
0911     gss_buffer_t,       /* sasl_mech_name */
0912     gss_buffer_t,       /* mech_name */
0913     gss_buffer_t        /* mech_description */
0914 );
0915 
0916 OM_uint32 KRB5_CALLCONV
0917 gss_inquire_mech_for_saslname(
0918     OM_uint32 *,        /* minor_status */
0919     const gss_buffer_t, /* sasl_mech_name */
0920     gss_OID *           /* mech_type */
0921 );
0922 
0923 #endif /* _GSSAPI_H_ */