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