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