tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

gssapi.h (25131B)


      1 /* vim:set ts=4 sw=2 sts=2 et cindent: */
      2 /* ***** BEGIN LICENSE BLOCK *****
      3 * Copyright 1993 by OpenVision Technologies, Inc.
      4 *
      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.
     14 *
     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.
     22 ****** END LICENSE BLOCK ***** */
     23 
     24 #ifndef GSSAPI_H_
     25 #define GSSAPI_H_
     26 
     27 /*
     28 * Also define _GSSAPI_H_ as that is what the Kerberos 5 code defines and
     29 * what header files on some systems look for.
     30 */
     31 #define _GSSAPI_H_
     32 
     33 /*
     34 * On Mac OS X, Kerberos/Kerberos.h is used to gain access to certain
     35 * system-specific Kerberos functions, but on 10.4, that file also brings
     36 * in other headers that conflict with this one.
     37 */
     38 #define _GSSAPI_GENERIC_H_
     39 #define _GSSAPI_KRB5_H_
     40 
     41 /*
     42 * Define windows specific needed parameters.
     43 */
     44 
     45 #ifndef GSS_CALLCONV
     46 #  if defined(_WIN32)
     47 #    define GSS_CALLCONV __stdcall
     48 #    define GSS_CALLCONV_C __cdecl
     49 #  else
     50 #    define GSS_CALLCONV
     51 #    define GSS_CALLCONV_C
     52 #  endif
     53 #endif /* GSS_CALLCONV */
     54 
     55 #ifdef GSS_USE_FUNCTION_POINTERS
     56 #  ifdef _WIN32
     57 #    undef GSS_CALLCONV
     58 #    define GSS_CALLCONV
     59 #    define GSS_FUNC(f) (__stdcall * f##_type)
     60 #  else
     61 #    define GSS_FUNC(f) (*f##_type)
     62 #  endif
     63 #  define GSS_MAKE_TYPEDEF typedef
     64 #else
     65 #  define GSS_FUNC(f) f
     66 #  define GSS_MAKE_TYPEDEF
     67 #endif
     68 
     69 /*
     70 * First, include stddef.h to get size_t defined.
     71 */
     72 #include <stddef.h>
     73 
     74 /*
     75 * Configure set the following
     76 */
     77 
     78 #ifndef SIZEOF_LONG
     79 #  undef SIZEOF_LONG
     80 #endif
     81 #ifndef SIZEOF_SHORT
     82 #  undef SIZEOF_SHORT
     83 #endif
     84 
     85 #ifndef EXTERN_C_BEGIN
     86 #  ifdef __cplusplus
     87 #    define EXTERN_C_BEGIN extern "C" {
     88 #    define EXTERN_C_END }
     89 #  else
     90 #    define EXTERN_C_BEGIN
     91 #    define EXTERN_C_END
     92 #  endif
     93 #endif
     94 
     95 EXTERN_C_BEGIN
     96 
     97 #if defined(XP_MACOSX) && !defined(__aarch64__)
     98 #  pragma pack(push, 2)
     99 #endif
    100 
    101 /*
    102 * If the platform supports the xom.h header file, it should be
    103 * included here.
    104 */
    105 /* #include <xom.h> */
    106 
    107 /*
    108 * Now define the three implementation-dependent types.
    109 */
    110 
    111 typedef void* gss_name_t;
    112 typedef void* gss_ctx_id_t;
    113 typedef void* gss_cred_id_t;
    114 
    115 /*
    116 * The following type must be defined as the smallest natural
    117 * unsigned integer supported by the platform that has at least
    118 * 32 bits of precision.
    119 */
    120 
    121 #if SIZEOF_LONG == 4
    122 typedef unsigned long gss_uint32;
    123 #elif SIZEOF_SHORT == 4
    124 typedef unsigned short gss_uint32;
    125 #else
    126 typedef unsigned int gss_uint32;
    127 #endif
    128 
    129 #ifdef OM_STRING
    130 
    131 /*
    132 * We have included the xom.h header file.  Verify that OM_uint32
    133 * is defined correctly.
    134 */
    135 
    136 #  if sizeof(gss_uint32) != sizeof(OM_uint32)
    137 #    error Incompatible definition of OM_uint32 from xom.h
    138 #  endif
    139 
    140 typedef OM_object_identifier gss_OID_desc, *gss_OID;
    141 
    142 #else /* !OM_STRING */
    143 
    144 /*
    145 * We can't use X/Open definitions, so roll our own.
    146 */
    147 typedef gss_uint32 OM_uint32;
    148 typedef struct gss_OID_desc_struct {
    149  OM_uint32 length;
    150  void* elements;
    151 } gss_OID_desc, *gss_OID;
    152 
    153 #endif /* !OM_STRING */
    154 
    155 typedef struct gss_OID_set_desc_struct {
    156  size_t count;
    157  gss_OID elements;
    158 } gss_OID_set_desc, *gss_OID_set;
    159 
    160 /*
    161 * For now, define a QOP-type as an OM_uint32
    162 */
    163 typedef OM_uint32 gss_qop_t;
    164 
    165 typedef int gss_cred_usage_t;
    166 
    167 typedef struct gss_buffer_desc_struct {
    168  size_t length;
    169  void* value;
    170 } gss_buffer_desc, *gss_buffer_t;
    171 
    172 typedef struct gss_channel_bindings_struct {
    173  OM_uint32 initiator_addrtype;
    174  gss_buffer_desc initiator_address;
    175  OM_uint32 acceptor_addrtype;
    176  gss_buffer_desc acceptor_address;
    177  gss_buffer_desc application_data;
    178 }* gss_channel_bindings_t;
    179 
    180 /*
    181 * Flag bits for context-level services.
    182 */
    183 #define GSS_C_DELEG_FLAG 1
    184 #define GSS_C_MUTUAL_FLAG 2
    185 #define GSS_C_REPLAY_FLAG 4
    186 #define GSS_C_SEQUENCE_FLAG 8
    187 #define GSS_C_CONF_FLAG 16
    188 #define GSS_C_INTEG_FLAG 32
    189 #define GSS_C_ANON_FLAG 64
    190 #define GSS_C_PROT_READY_FLAG 128
    191 #define GSS_C_TRANS_FLAG 256
    192 
    193 /*
    194 * Credential usage options
    195 */
    196 #define GSS_C_BOTH 0
    197 #define GSS_C_INITIATE 1
    198 #define GSS_C_ACCEPT 2
    199 
    200 /*
    201 * Status code types for gss_display_status
    202 */
    203 #define GSS_C_GSS_CODE 1
    204 #define GSS_C_MECH_CODE 2
    205 
    206 /*
    207 * The constant definitions for channel-bindings address families
    208 */
    209 #define GSS_C_AF_UNSPEC 0
    210 #define GSS_C_AF_LOCAL 1
    211 #define GSS_C_AF_INET 2
    212 #define GSS_C_AF_IMPLINK 3
    213 #define GSS_C_AF_PUP 4
    214 #define GSS_C_AF_CHAOS 5
    215 #define GSS_C_AF_NS 6
    216 #define GSS_C_AF_NBS 7
    217 #define GSS_C_AF_ECMA 8
    218 #define GSS_C_AF_DATAKIT 9
    219 #define GSS_C_AF_CCITT 10
    220 #define GSS_C_AF_SNA 11
    221 #define GSS_C_AF_DECnet 12
    222 #define GSS_C_AF_DLI 13
    223 #define GSS_C_AF_LAT 14
    224 #define GSS_C_AF_HYLINK 15
    225 #define GSS_C_AF_APPLETALK 16
    226 #define GSS_C_AF_BSC 17
    227 #define GSS_C_AF_DSS 18
    228 #define GSS_C_AF_OSI 19
    229 #define GSS_C_AF_X25 21
    230 
    231 #define GSS_C_AF_NULLADDR 255
    232 
    233 /*
    234 * Various Null values
    235 */
    236 #define GSS_C_NO_NAME ((gss_name_t)0)
    237 #define GSS_C_NO_BUFFER ((gss_buffer_t)0)
    238 #define GSS_C_NO_OID ((gss_OID)0)
    239 #define GSS_C_NO_OID_SET ((gss_OID_set)0)
    240 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t)0)
    241 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t)0)
    242 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t)0)
    243 #define GSS_C_EMPTY_BUFFER {0, nullptr}
    244 
    245 /*
    246 * Some alternate names for a couple of the above
    247 * values.  These are defined for V1 compatibility.
    248 */
    249 #define GSS_C_NULL_OID GSS_C_NO_OID
    250 #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
    251 
    252 /*
    253 * Define the default Quality of Protection for per-message
    254 * services.  Note that an implementation that offers multiple
    255 * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
    256 * (as done here) to mean "default protection", or to a specific
    257 * explicit QOP value.  However, a value of 0 should always be
    258 * interpreted by a GSSAPI implementation as a request for the
    259 * default protection level.
    260 */
    261 #define GSS_C_QOP_DEFAULT 0
    262 
    263 /*
    264 * Expiration time of 2^32-1 seconds means infinite lifetime for a
    265 * credential or security context
    266 */
    267 #define GSS_C_INDEFINITE 0xfffffffful
    268 
    269 /*
    270 * The implementation must reserve static storage for a
    271 * gss_OID_desc object containing the value
    272 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    273 *              "\x01\x02\x01\x01"},
    274 * corresponding to an object-identifier value of
    275 * {iso(1) member-body(2) United States(840) mit(113554)
    276 *  infosys(1) gssapi(2) generic(1) user_name(1)}.  The constant
    277 * GSS_C_NT_USER_NAME should be initialized to point
    278 * to that gss_OID_desc.
    279 */
    280 extern gss_OID GSS_C_NT_USER_NAME;
    281 
    282 /*
    283 * The implementation must reserve static storage for a
    284 * gss_OID_desc object containing the value
    285 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    286 *              "\x01\x02\x01\x02"},
    287 * corresponding to an object-identifier value of
    288 * {iso(1) member-body(2) United States(840) mit(113554)
    289 *  infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
    290 * The constant GSS_C_NT_MACHINE_UID_NAME should be
    291 * initialized to point to that gss_OID_desc.
    292 */
    293 extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
    294 
    295 /*
    296 * The implementation must reserve static storage for a
    297 * gss_OID_desc object containing the value
    298 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    299 *              "\x01\x02\x01\x03"},
    300 * corresponding to an object-identifier value of
    301 * {iso(1) member-body(2) United States(840) mit(113554)
    302 *  infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
    303 * The constant GSS_C_NT_STRING_UID_NAME should be
    304 * initialized to point to that gss_OID_desc.
    305 */
    306 extern gss_OID GSS_C_NT_STRING_UID_NAME;
    307 
    308 /*
    309 * The implementation must reserve static storage for a
    310 * gss_OID_desc object containing the value
    311 * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
    312 * corresponding to an object-identifier value of
    313 * {iso(1) org(3) dod(6) internet(1) security(5)
    314 * nametypes(6) gss-host-based-services(2)).  The constant
    315 * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
    316 * to that gss_OID_desc.  This is a deprecated OID value, and
    317 * implementations wishing to support hostbased-service names
    318 * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
    319 * defined below, to identify such names;
    320 * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
    321 * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
    322 * parameter, but should not be emitted by GSSAPI
    323 * implementations
    324 */
    325 extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
    326 
    327 /*
    328 * The implementation must reserve static storage for a
    329 * gss_OID_desc object containing the value
    330 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    331 *              "\x01\x02\x01\x04"}, corresponding to an
    332 * object-identifier value of {iso(1) member-body(2)
    333 * Unites States(840) mit(113554) infosys(1) gssapi(2)
    334 * generic(1) service_name(4)}.  The constant
    335 * GSS_C_NT_HOSTBASED_SERVICE should be initialized
    336 * to point to that gss_OID_desc.
    337 */
    338 extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
    339 
    340 /*
    341 * The implementation must reserve static storage for a
    342 * gss_OID_desc object containing the value
    343 * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
    344 * corresponding to an object identifier value of
    345 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
    346 * 6(nametypes), 3(gss-anonymous-name)}.  The constant
    347 * and GSS_C_NT_ANONYMOUS should be initialized to point
    348 * to that gss_OID_desc.
    349 */
    350 extern gss_OID GSS_C_NT_ANONYMOUS;
    351 
    352 /*
    353 * The implementation must reserve static storage for a
    354 * gss_OID_desc object containing the value
    355 * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
    356 * corresponding to an object-identifier value of
    357 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
    358 * 6(nametypes), 4(gss-api-exported-name)}.  The constant
    359 * GSS_C_NT_EXPORT_NAME should be initialized to point
    360 * to that gss_OID_desc.
    361 */
    362 extern gss_OID GSS_C_NT_EXPORT_NAME;
    363 
    364 /* Major status codes */
    365 
    366 #define GSS_S_COMPLETE 0
    367 
    368 /*
    369 * Some "helper" definitions to make the status code macros obvious.
    370 */
    371 #define GSS_C_CALLING_ERROR_OFFSET 24
    372 #define GSS_C_ROUTINE_ERROR_OFFSET 16
    373 #define GSS_C_SUPPLEMENTARY_OFFSET 0
    374 #define GSS_C_CALLING_ERROR_MASK 0377ul
    375 #define GSS_C_ROUTINE_ERROR_MASK 0377ul
    376 #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
    377 
    378 /*
    379 * The macros that test status codes for error conditions.
    380 * Note that the GSS_ERROR() macro has changed slightly from
    381 * the V1 GSSAPI so that it now evaluates its argument
    382 * 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)))
    393 
    394 /*
    395 * Now the actual status code definitions
    396 */
    397 
    398 /*
    399 * Calling errors:
    400 */
    401 #define GSS_S_CALL_INACCESSIBLE_READ (1ul << GSS_C_CALLING_ERROR_OFFSET)
    402 #define GSS_S_CALL_INACCESSIBLE_WRITE (2ul << GSS_C_CALLING_ERROR_OFFSET)
    403 #define GSS_S_CALL_BAD_STRUCTURE (3ul << GSS_C_CALLING_ERROR_OFFSET)
    404 
    405 /*
    406 * Routine errors:
    407 */
    408 #define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
    409 #define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
    410 #define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
    411 #define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
    412 #define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
    413 #define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
    414 #define GSS_S_BAD_MIC GSS_S_BAD_SIG
    415 #define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
    416 #define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
    417 #define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
    418 #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
    419 #define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
    420 #define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
    421 #define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
    422 #define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
    423 #define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
    424 #define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
    425 #define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
    426 #define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
    427 
    428 /*
    429 * Supplementary info bits:
    430 */
    431 #define GSS_S_CONTINUE_NEEDED (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
    432 #define GSS_S_DUPLICATE_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
    433 #define GSS_S_OLD_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
    434 #define GSS_S_UNSEQ_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
    435 #define GSS_S_GAP_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
    436 
    437 /*
    438 * Finally, function prototypes for the GSS-API routines.
    439 */
    440 
    441 GSS_MAKE_TYPEDEF
    442 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_acquire_cred)(
    443    OM_uint32*,        /*  minor_status */
    444    const gss_name_t,  /* desired_name */
    445    OM_uint32,         /* time_req */
    446    const gss_OID_set, /* desired_mechs */
    447    gss_cred_usage_t,  /* cred_usage */
    448    gss_cred_id_t*,    /* output_cred_handle */
    449    gss_OID_set*,      /* actual_mechs */
    450    OM_uint32*         /* time_rec */
    451 );
    452 
    453 GSS_MAKE_TYPEDEF
    454 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_release_cred)(
    455    OM_uint32*,    /* minor_status */
    456    gss_cred_id_t* /* cred_handle */
    457 );
    458 
    459 GSS_MAKE_TYPEDEF
    460 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_init_sec_context)(
    461    OM_uint32*,                   /* minor_status */
    462    const gss_cred_id_t,          /* initiator_cred_handle */
    463    gss_ctx_id_t*,                /* context_handle */
    464    const gss_name_t,             /* target_name */
    465    const gss_OID,                /* mech_type */
    466    OM_uint32,                    /* req_flags */
    467    OM_uint32,                    /* time_req */
    468    const gss_channel_bindings_t, /* input_chan_bindings */
    469    const gss_buffer_t,           /* input_token */
    470    gss_OID*,                     /* actual_mech_type */
    471    gss_buffer_t,                 /* output_token */
    472    OM_uint32*,                   /* ret_flags */
    473    OM_uint32*                    /* time_rec */
    474 );
    475 
    476 GSS_MAKE_TYPEDEF
    477 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_accept_sec_context)(
    478    OM_uint32*,                   /* minor_status */
    479    gss_ctx_id_t*,                /* context_handle */
    480    const gss_cred_id_t,          /* acceptor_cred_handle */
    481    const gss_buffer_t,           /* input_token_buffer */
    482    const gss_channel_bindings_t, /* input_chan_bindings */
    483    gss_name_t*,                  /* src_name */
    484    gss_OID*,                     /* mech_type */
    485    gss_buffer_t,                 /* output_token */
    486    OM_uint32*,                   /* ret_flags */
    487    OM_uint32*,                   /* time_rec */
    488    gss_cred_id_t*                /* delegated_cred_handle */
    489 );
    490 
    491 GSS_MAKE_TYPEDEF
    492 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_process_context_token)(
    493    OM_uint32*,         /* minor_status */
    494    const gss_ctx_id_t, /* context_handle */
    495    const gss_buffer_t  /* token_buffer */
    496 );
    497 
    498 GSS_MAKE_TYPEDEF
    499 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_delete_sec_context)(
    500    OM_uint32*,    /* minor_status */
    501    gss_ctx_id_t*, /* context_handle */
    502    gss_buffer_t   /* output_token */
    503 );
    504 
    505 GSS_MAKE_TYPEDEF
    506 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_context_time)(
    507    OM_uint32*,         /* minor_status */
    508    const gss_ctx_id_t, /* context_handle */
    509    OM_uint32*          /* time_rec */
    510 );
    511 
    512 GSS_MAKE_TYPEDEF
    513 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_get_mic)(
    514    OM_uint32*,         /* minor_status */
    515    const gss_ctx_id_t, /* context_handle */
    516    gss_qop_t,          /* qop_req */
    517    const gss_buffer_t, /* message_buffer */
    518    gss_buffer_t        /* message_token */
    519 );
    520 
    521 GSS_MAKE_TYPEDEF
    522 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_verify_mic)(
    523    OM_uint32*,         /* minor_status */
    524    const gss_ctx_id_t, /* context_handle */
    525    const gss_buffer_t, /* message_buffer */
    526    const gss_buffer_t, /* token_buffer */
    527    gss_qop_t*          /* qop_state */
    528 );
    529 
    530 GSS_MAKE_TYPEDEF
    531 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_wrap)(
    532    OM_uint32*,         /* minor_status */
    533    const gss_ctx_id_t, /* context_handle */
    534    int,                /* conf_req_flag */
    535    gss_qop_t,          /* qop_req */
    536    const gss_buffer_t, /* input_message_buffer */
    537    int*,               /* conf_state */
    538    gss_buffer_t        /* output_message_buffer */
    539 );
    540 
    541 GSS_MAKE_TYPEDEF
    542 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_unwrap)(
    543    OM_uint32*,         /* minor_status */
    544    const gss_ctx_id_t, /* context_handle */
    545    const gss_buffer_t, /* input_message_buffer */
    546    gss_buffer_t,       /* output_message_buffer */
    547    int*,               /* conf_state */
    548    gss_qop_t*          /* qop_state */
    549 );
    550 
    551 GSS_MAKE_TYPEDEF
    552 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_display_status)(
    553    OM_uint32*,    /* minor_status */
    554    OM_uint32,     /* status_value */
    555    int,           /* status_type */
    556    const gss_OID, /* mech_type */
    557    OM_uint32*,    /* message_context */
    558    gss_buffer_t   /* status_string */
    559 );
    560 
    561 GSS_MAKE_TYPEDEF
    562 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_indicate_mechs)(
    563    OM_uint32*,  /* minor_status */
    564    gss_OID_set* /* mech_set */
    565 );
    566 
    567 GSS_MAKE_TYPEDEF
    568 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_compare_name)(OM_uint32*, /* minor_status */
    569                                                  const gss_name_t, /* name1 */
    570                                                  const gss_name_t, /* name2 */
    571                                                  int* /* name_equal */
    572 );
    573 
    574 GSS_MAKE_TYPEDEF
    575 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_display_name)(
    576    OM_uint32*,       /* minor_status */
    577    const gss_name_t, /* input_name */
    578    gss_buffer_t,     /* output_name_buffer */
    579    gss_OID*          /* output_name_type */
    580 );
    581 
    582 GSS_MAKE_TYPEDEF
    583 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_import_name)(
    584    OM_uint32*,         /* minor_status */
    585    const gss_buffer_t, /* input_name_buffer */
    586    const gss_OID,      /* input_name_type */
    587    gss_name_t*         /* output_name */
    588 );
    589 
    590 GSS_MAKE_TYPEDEF
    591 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_export_name)(
    592    OM_uint32*,       /* minor_status */
    593    const gss_name_t, /* input_name */
    594    gss_buffer_t      /* exported_name */
    595 );
    596 
    597 GSS_MAKE_TYPEDEF
    598 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_release_name)(OM_uint32*, /* minor_status */
    599                                                  gss_name_t* /* input_name */
    600 );
    601 
    602 GSS_MAKE_TYPEDEF
    603 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_release_buffer)(
    604    OM_uint32*,  /* minor_status */
    605    gss_buffer_t /* buffer */
    606 );
    607 
    608 GSS_MAKE_TYPEDEF
    609 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_release_oid_set)(
    610    OM_uint32*,  /* minor_status */
    611    gss_OID_set* /* set */
    612 );
    613 
    614 GSS_MAKE_TYPEDEF
    615 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_inquire_cred)(
    616    OM_uint32*,          /* minor_status */
    617    const gss_cred_id_t, /* cred_handle */
    618    gss_name_t*,         /* name */
    619    OM_uint32*,          /* lifetime */
    620    gss_cred_usage_t*,   /* cred_usage */
    621    gss_OID_set*         /* mechanisms */
    622 );
    623 
    624 GSS_MAKE_TYPEDEF
    625 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_inquire_context)(
    626    OM_uint32*,         /* minor_status */
    627    const gss_ctx_id_t, /* context_handle */
    628    gss_name_t*,        /* src_name */
    629    gss_name_t*,        /* targ_name */
    630    OM_uint32*,         /* lifetime_rec */
    631    gss_OID*,           /* mech_type */
    632    OM_uint32*,         /* ctx_flags */
    633    int*,               /* locally_initiated */
    634    int*                /* open */
    635 );
    636 
    637 GSS_MAKE_TYPEDEF
    638 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_wrap_size_limit)(
    639    OM_uint32*,         /* minor_status */
    640    const gss_ctx_id_t, /* context_handle */
    641    int,                /* conf_req_flag */
    642    gss_qop_t,          /* qop_req */
    643    OM_uint32,          /* req_output_size */
    644    OM_uint32*          /* max_input_size */
    645 );
    646 
    647 GSS_MAKE_TYPEDEF
    648 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_add_cred)(
    649    OM_uint32*,          /* minor_status */
    650    const gss_cred_id_t, /* input_cred_handle */
    651    const gss_name_t,    /* desired_name */
    652    const gss_OID,       /* desired_mech */
    653    gss_cred_usage_t,    /* cred_usage */
    654    OM_uint32,           /* initiator_time_req */
    655    OM_uint32,           /* acceptor_time_req */
    656    gss_cred_id_t*,      /* output_cred_handle */
    657    gss_OID_set*,        /* actual_mechs */
    658    OM_uint32*,          /* initiator_time_rec */
    659    OM_uint32*           /* acceptor_time_rec */
    660 );
    661 
    662 GSS_MAKE_TYPEDEF
    663 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_inquire_cred_by_mech)(
    664    OM_uint32*,          /* minor_status */
    665    const gss_cred_id_t, /* cred_handle */
    666    const gss_OID,       /* mech_type */
    667    gss_name_t*,         /* name */
    668    OM_uint32*,          /* initiator_lifetime */
    669    OM_uint32*,          /* acceptor_lifetime */
    670    gss_cred_usage_t*    /* cred_usage */
    671 );
    672 
    673 GSS_MAKE_TYPEDEF
    674 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_export_sec_context)(
    675    OM_uint32*,    /* minor_status */
    676    gss_ctx_id_t*, /* context_handle */
    677    gss_buffer_t   /* interprocess_token */
    678 );
    679 
    680 GSS_MAKE_TYPEDEF
    681 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_import_sec_context)(
    682    OM_uint32*,         /* minor_status */
    683    const gss_buffer_t, /* interprocess_token */
    684    gss_ctx_id_t*       /* context_handle */
    685 );
    686 
    687 GSS_MAKE_TYPEDEF
    688 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_create_empty_oid_set)(
    689    OM_uint32*,  /* minor_status */
    690    gss_OID_set* /* oid_set */
    691 );
    692 
    693 GSS_MAKE_TYPEDEF
    694 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_add_oid_set_member)(
    695    OM_uint32*,    /* minor_status */
    696    const gss_OID, /* member_oid */
    697    gss_OID_set*   /* oid_set */
    698 );
    699 
    700 GSS_MAKE_TYPEDEF
    701 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_test_oid_set_member)(
    702    OM_uint32*,        /* minor_status */
    703    const gss_OID,     /* member */
    704    const gss_OID_set, /* set */
    705    int*               /* present */
    706 );
    707 
    708 GSS_MAKE_TYPEDEF
    709 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_inquire_names_for_mech)(
    710    OM_uint32*,    /* minor_status */
    711    const gss_OID, /* mechanism */
    712    gss_OID_set*   /* name_types */
    713 );
    714 
    715 GSS_MAKE_TYPEDEF
    716 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_inquire_mechs_for_name)(
    717    OM_uint32*,       /* minor_status */
    718    const gss_name_t, /* input_name */
    719    gss_OID_set*      /* mech_types */
    720 );
    721 
    722 GSS_MAKE_TYPEDEF
    723 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_canonicalize_name)(
    724    OM_uint32*,       /* minor_status */
    725    const gss_name_t, /* input_name */
    726    const gss_OID,    /* mech_type */
    727    gss_name_t*       /* output_name */
    728 );
    729 
    730 GSS_MAKE_TYPEDEF
    731 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_duplicate_name)(
    732    OM_uint32*,       /* minor_status */
    733    const gss_name_t, /* src_name */
    734    gss_name_t*       /* dest_name */
    735 );
    736 
    737 /*
    738 * The following routines are obsolete variants of gss_get_mic,
    739 * gss_verify_mic, gss_wrap and gss_unwrap.  They should be
    740 * provided by GSSAPI V2 implementations for backwards
    741 * compatibility with V1 applications.  Distinct entrypoints
    742 * (as opposed to #defines) should be provided, both to allow
    743 * GSSAPI V1 applications to link against GSSAPI V2 implementations,
    744 * and to retain the slight parameter type differences between the
    745 * obsolete versions of these routines and their current forms.
    746 */
    747 
    748 GSS_MAKE_TYPEDEF
    749 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_sign)(OM_uint32*,   /* minor_status */
    750                                          gss_ctx_id_t, /* context_handle */
    751                                          int,          /* qop_req */
    752                                          gss_buffer_t, /* message_buffer */
    753                                          gss_buffer_t  /* message_token */
    754 );
    755 
    756 GSS_MAKE_TYPEDEF
    757 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_verify)(OM_uint32*,   /* minor_status */
    758                                            gss_ctx_id_t, /* context_handle */
    759                                            gss_buffer_t, /* message_buffer */
    760                                            gss_buffer_t, /* token_buffer */
    761                                            int*          /* qop_state */
    762 );
    763 
    764 GSS_MAKE_TYPEDEF
    765 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_seal)(
    766    OM_uint32*,   /* minor_status */
    767    gss_ctx_id_t, /* context_handle */
    768    int,          /* conf_req_flag */
    769    int,          /* qop_req */
    770    gss_buffer_t, /* input_message_buffer */
    771    int*,         /* conf_state */
    772    gss_buffer_t  /* output_message_buffer */
    773 );
    774 
    775 GSS_MAKE_TYPEDEF
    776 OM_uint32 GSS_CALLCONV GSS_FUNC(gss_unseal)(
    777    OM_uint32*,   /* minor_status */
    778    gss_ctx_id_t, /* context_handle */
    779    gss_buffer_t, /* input_message_buffer */
    780    gss_buffer_t, /* output_message_buffer */
    781    int*,         /* conf_state */
    782    int*          /* qop_state */
    783 );
    784 
    785 #if defined(XP_MACOSX) && !defined(__aarch64__)
    786 #  pragma pack(pop)
    787 #endif
    788 
    789 EXTERN_C_END
    790 
    791 #endif /* GSSAPI_H_ */