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