2 * Copyright (c) 1997 - 2007 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 #ifndef GSSAPI_GSSAPI_H_
37 #define GSSAPI_GSSAPI_H_
40 * First, include stddef.h to get size_t defined.
44 #include <krb5-types.h>
46 #ifndef BUILD_GSSAPI_LIB
48 #define GSSAPI_LIB_FUNCTION __declspec(dllimport)
49 #define GSSAPI_LIB_CALL __stdcall
50 #define GSSAPI_LIB_VARIABLE __declspec(dllimport)
52 #define GSSAPI_LIB_FUNCTION
53 #define GSSAPI_LIB_CALL
54 #define GSSAPI_LIB_VARIABLE
58 #ifndef GSSAPI_DEPRECATED
59 #if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 )))
60 #define GSSAPI_DEPRECATED __attribute__((deprecated))
61 #elif defined(_MSC_VER)
62 #define GSSAPI_DEPRECATED __declspec(deprecated)
64 #define GSSAPI_DEPRECATED
69 #define GSSAPI_CPP_START extern "C" {
70 #define GSSAPI_CPP_END }
72 #define GSSAPI_CPP_START
73 #define GSSAPI_CPP_END
77 #define GSSAPI_CALLCONV __stdcall
79 #define GSSAPI_CALLCONV
83 * Now define the three implementation-dependent types.
86 typedef uint32_t OM_uint32
;
87 typedef uint64_t OM_uint64
;
89 typedef uint32_t gss_uint32
;
91 struct gss_name_t_desc_struct
;
92 typedef struct gss_name_t_desc_struct
*gss_name_t
;
93 typedef const struct gss_name_t_desc_struct
*gss_const_name_t
;
95 struct gss_ctx_id_t_desc_struct
;
96 typedef struct gss_ctx_id_t_desc_struct
*gss_ctx_id_t
;
97 typedef const struct gss_ctx_id_t_desc_struct gss_const_ctx_id_t
;
99 typedef struct gss_OID_desc_struct
{
102 } gss_OID_desc
, *gss_OID
;
103 typedef const gss_OID_desc
* gss_const_OID
;
105 typedef struct gss_OID_set_desc_struct
{
108 } gss_OID_set_desc
, *gss_OID_set
;
109 typedef const gss_OID_set_desc
* gss_const_OID_set
;
111 typedef int gss_cred_usage_t
;
113 struct gss_cred_id_t_desc_struct
;
114 typedef struct gss_cred_id_t_desc_struct
*gss_cred_id_t
;
115 typedef const struct gss_cred_id_t_desc_struct
*gss_const_cred_id_t
;
117 typedef struct gss_buffer_desc_struct
{
120 } gss_buffer_desc
, *gss_buffer_t
;
121 typedef const gss_buffer_desc
* gss_const_buffer_t
;
123 typedef struct gss_channel_bindings_struct
{
124 OM_uint32 initiator_addrtype
;
125 gss_buffer_desc initiator_address
;
126 OM_uint32 acceptor_addrtype
;
127 gss_buffer_desc acceptor_address
;
128 gss_buffer_desc application_data
;
129 } *gss_channel_bindings_t
;
130 typedef const struct gss_channel_bindings_struct
*gss_const_channel_bindings_t
;
132 /* GGF extension data types */
133 typedef struct gss_buffer_set_desc_struct
{
135 gss_buffer_desc
*elements
;
136 } gss_buffer_set_desc
, *gss_buffer_set_t
;
138 typedef struct gss_iov_buffer_desc_struct
{
140 gss_buffer_desc buffer
;
141 } gss_iov_buffer_desc
, *gss_iov_buffer_t
;
144 * For now, define a QOP-type as an OM_uint32
146 typedef OM_uint32 gss_qop_t
;
151 * Flag bits for context-level services.
153 #define GSS_C_DELEG_FLAG 1
154 #define GSS_C_MUTUAL_FLAG 2
155 #define GSS_C_REPLAY_FLAG 4
156 #define GSS_C_SEQUENCE_FLAG 8
157 #define GSS_C_CONF_FLAG 16
158 #define GSS_C_INTEG_FLAG 32
159 #define GSS_C_ANON_FLAG 64
160 #define GSS_C_PROT_READY_FLAG 128
161 #define GSS_C_TRANS_FLAG 256
163 #define GSS_C_DCE_STYLE 4096
164 #define GSS_C_IDENTIFY_FLAG 8192
165 #define GSS_C_EXTENDED_ERROR_FLAG 16384
166 #define GSS_C_DELEG_POLICY_FLAG 32768
169 * Credential usage options
172 #define GSS_C_INITIATE 1
173 #define GSS_C_ACCEPT 2
176 * Status code types for gss_display_status
178 #define GSS_C_GSS_CODE 1
179 #define GSS_C_MECH_CODE 2
182 * The constant definitions for channel-bindings address families
184 #define GSS_C_AF_UNSPEC 0
185 #define GSS_C_AF_LOCAL 1
186 #define GSS_C_AF_INET 2
187 #define GSS_C_AF_IMPLINK 3
188 #define GSS_C_AF_PUP 4
189 #define GSS_C_AF_CHAOS 5
190 #define GSS_C_AF_NS 6
191 #define GSS_C_AF_NBS 7
192 #define GSS_C_AF_ECMA 8
193 #define GSS_C_AF_DATAKIT 9
194 #define GSS_C_AF_CCITT 10
195 #define GSS_C_AF_SNA 11
196 #define GSS_C_AF_DECnet 12
197 #define GSS_C_AF_DLI 13
198 #define GSS_C_AF_LAT 14
199 #define GSS_C_AF_HYLINK 15
200 #define GSS_C_AF_APPLETALK 16
201 #define GSS_C_AF_BSC 17
202 #define GSS_C_AF_DSS 18
203 #define GSS_C_AF_OSI 19
204 #define GSS_C_AF_X25 21
205 #define GSS_C_AF_INET6 24
207 #define GSS_C_AF_NULLADDR 255
210 * Various Null values
212 #define GSS_C_NO_NAME ((gss_name_t) 0)
213 #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
214 #define GSS_C_NO_BUFFER_SET ((gss_buffer_set_t) 0)
215 #define GSS_C_NO_OID ((gss_OID) 0)
216 #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
217 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
218 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
219 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
220 #define GSS_C_EMPTY_BUFFER {0, NULL}
221 #define GSS_C_NO_IOV_BUFFER ((gss_iov_buffer_t)0)
224 * Some alternate names for a couple of the above
225 * values. These are defined for V1 compatibility.
227 #define GSS_C_NULL_OID GSS_C_NO_OID
228 #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
231 * Define the default Quality of Protection for per-message
232 * services. Note that an implementation that offers multiple
233 * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
234 * (as done here) to mean "default protection", or to a specific
235 * explicit QOP value. However, a value of 0 should always be
236 * interpreted by a GSSAPI implementation as a request for the
237 * default protection level.
239 #define GSS_C_QOP_DEFAULT 0
241 #define GSS_KRB5_CONF_C_QOP_DES 0x0100
242 #define GSS_KRB5_CONF_C_QOP_DES3_KD 0x0200
245 * Expiration time of 2^32-1 seconds means infinite lifetime for a
246 * credential or security context
248 #define GSS_C_INDEFINITE 0xfffffffful
251 * Type of gss_wrap_iov()/gss_unwrap_iov().
254 #define GSS_IOV_BUFFER_TYPE_EMPTY 0
255 #define GSS_IOV_BUFFER_TYPE_DATA 1
256 #define GSS_IOV_BUFFER_TYPE_HEADER 2
257 #define GSS_IOV_BUFFER_TYPE_MECH_PARAMS 3
259 #define GSS_IOV_BUFFER_TYPE_TRAILER 7
260 #define GSS_IOV_BUFFER_TYPE_PADDING 9
261 #define GSS_IOV_BUFFER_TYPE_STREAM 10
262 #define GSS_IOV_BUFFER_TYPE_SIGN_ONLY 11
264 #define GSS_IOV_BUFFER_TYPE_FLAG_MASK 0xffff0000
265 #define GSS_IOV_BUFFER_FLAG_ALLOCATE 0x00010000
266 #define GSS_IOV_BUFFER_FLAG_ALLOCATED 0x00020000
268 #define GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATE 0x00010000 /* old name */
269 #define GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATED 0x00020000 /* old name */
271 #define GSS_IOV_BUFFER_TYPE(_t) ((_t) & ~GSS_IOV_BUFFER_TYPE_FLAG_MASK)
272 #define GSS_IOV_BUFFER_FLAGS(_t) ((_t) & GSS_IOV_BUFFER_TYPE_FLAG_MASK)
276 #include <gssapi/gssapi_oid.h>
279 * The implementation must reserve static storage for a
280 * gss_OID_desc object containing the value
281 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
282 * "\x01\x02\x01\x01"},
283 * corresponding to an object-identifier value of
284 * {iso(1) member-body(2) United States(840) mit(113554)
285 * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
286 * GSS_C_NT_USER_NAME should be initialized to point
287 * to that gss_OID_desc.
289 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_user_name_oid_desc
;
290 #define GSS_C_NT_USER_NAME (&__gss_c_nt_user_name_oid_desc)
293 * The implementation must reserve static storage for a
294 * gss_OID_desc object containing the value
295 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
296 * "\x01\x02\x01\x02"},
297 * corresponding to an object-identifier value of
298 * {iso(1) member-body(2) United States(840) mit(113554)
299 * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
300 * The constant GSS_C_NT_MACHINE_UID_NAME should be
301 * initialized to point to that gss_OID_desc.
303 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_machine_uid_name_oid_desc
;
304 #define GSS_C_NT_MACHINE_UID_NAME (&__gss_c_nt_machine_uid_name_oid_desc)
307 * The implementation must reserve static storage for a
308 * gss_OID_desc object containing the value
309 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
310 * "\x01\x02\x01\x03"},
311 * corresponding to an object-identifier value of
312 * {iso(1) member-body(2) United States(840) mit(113554)
313 * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
314 * The constant GSS_C_NT_STRING_UID_NAME should be
315 * initialized to point to that gss_OID_desc.
317 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_string_uid_name_oid_desc
;
318 #define GSS_C_NT_STRING_UID_NAME (&__gss_c_nt_string_uid_name_oid_desc)
321 * The implementation must reserve static storage for a
322 * gss_OID_desc object containing the value
323 * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
324 * corresponding to an object-identifier value of
325 * {iso(1) org(3) dod(6) internet(1) security(5)
326 * nametypes(6) gss-host-based-services(2)). The constant
327 * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
328 * to that gss_OID_desc. This is a deprecated OID value, and
329 * implementations wishing to support hostbased-service names
330 * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
331 * defined below, to identify such names;
332 * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
333 * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
334 * parameter, but should not be emitted by GSS-API
337 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_hostbased_service_x_oid_desc
;
338 #define GSS_C_NT_HOSTBASED_SERVICE_X (&__gss_c_nt_hostbased_service_x_oid_desc)
341 * The implementation must reserve static storage for a
342 * gss_OID_desc object containing the value
343 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
344 * "\x01\x02\x01\x04"}, corresponding to an
345 * object-identifier value of {iso(1) member-body(2)
346 * Unites States(840) mit(113554) infosys(1) gssapi(2)
347 * generic(1) service_name(4)}. The constant
348 * GSS_C_NT_HOSTBASED_SERVICE should be initialized
349 * to point to that gss_OID_desc.
351 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_hostbased_service_oid_desc
;
352 #define GSS_C_NT_HOSTBASED_SERVICE (&__gss_c_nt_hostbased_service_oid_desc)
355 * The implementation must reserve static storage for a
356 * gss_OID_desc object containing the value
357 * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
358 * corresponding to an object identifier value of
359 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
360 * 6(nametypes), 3(gss-anonymous-name)}. The constant
361 * and GSS_C_NT_ANONYMOUS should be initialized to point
362 * to that gss_OID_desc.
364 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_anonymous_oid_desc
;
365 #define GSS_C_NT_ANONYMOUS (&__gss_c_nt_anonymous_oid_desc)
368 * The implementation must reserve static storage for a
369 * gss_OID_desc object containing the value
370 * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
371 * corresponding to an object-identifier value of
372 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
373 * 6(nametypes), 4(gss-api-exported-name)}. The constant
374 * GSS_C_NT_EXPORT_NAME should be initialized to point
375 * to that gss_OID_desc.
377 extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_export_name_oid_desc
;
378 #define GSS_C_NT_EXPORT_NAME (&__gss_c_nt_export_name_oid_desc)
380 /* Major status codes */
382 #define GSS_S_COMPLETE 0
385 * Some "helper" definitions to make the status code macros obvious.
387 #define GSS_C_CALLING_ERROR_OFFSET 24
388 #define GSS_C_ROUTINE_ERROR_OFFSET 16
389 #define GSS_C_SUPPLEMENTARY_OFFSET 0
390 #define GSS_C_CALLING_ERROR_MASK 0377ul
391 #define GSS_C_ROUTINE_ERROR_MASK 0377ul
392 #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
395 * The macros that test status codes for error conditions.
396 * Note that the GSS_ERROR() macro has changed slightly from
397 * the V1 GSSAPI so that it now evaluates its argument
400 #define GSS_CALLING_ERROR(x) \
401 (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
402 #define GSS_ROUTINE_ERROR(x) \
403 (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
404 #define GSS_SUPPLEMENTARY_INFO(x) \
405 (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
406 #define GSS_ERROR(x) \
407 (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
408 (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
411 * Now the actual status code definitions
417 #define GSS_S_CALL_INACCESSIBLE_READ \
418 (1ul << GSS_C_CALLING_ERROR_OFFSET)
419 #define GSS_S_CALL_INACCESSIBLE_WRITE \
420 (2ul << GSS_C_CALLING_ERROR_OFFSET)
421 #define GSS_S_CALL_BAD_STRUCTURE \
422 (3ul << GSS_C_CALLING_ERROR_OFFSET)
427 #define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
428 #define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
429 #define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
431 #define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
432 #define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
433 #define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
434 #define GSS_S_BAD_MIC GSS_S_BAD_SIG
435 #define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
436 #define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
437 #define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
438 #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
439 #define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
440 #define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
441 #define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
442 #define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
443 #define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
444 #define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
445 #define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
446 #define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
447 #define GSS_S_BAD_MECH_ATTR (19ul << GSS_C_ROUTINE_ERROR_OFFSET)
450 * Supplementary info bits:
452 #define GSS_S_CONTINUE_NEEDED (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
453 #define GSS_S_DUPLICATE_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
454 #define GSS_S_OLD_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
455 #define GSS_S_UNSEQ_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
456 #define GSS_S_GAP_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
459 * Finally, function prototypes for the GSS-API routines.
462 #define GSS_C_OPTION_MASK 0xffff
463 #define GSS_C_CRED_NO_UI 0x10000
465 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_acquire_cred
466 (OM_uint32
* /*minor_status*/,
467 const gss_name_t
/*desired_name*/,
468 OM_uint32
/*time_req*/,
469 const gss_OID_set
/*desired_mechs*/,
470 gss_cred_usage_t
/*cred_usage*/,
471 gss_cred_id_t
* /*output_cred_handle*/,
472 gss_OID_set
* /*actual_mechs*/,
473 OM_uint32
* /*time_rec*/
476 extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_cred_password_oid_desc
;
477 #define GSS_C_CRED_PASSWORD (&__gss_c_cred_password_oid_desc)
479 extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_cred_certificate_oid_desc
;
480 #define GSS_C_CRED_CERTIFICATE (&__gss_c_cred_certificate_oid_desc)
482 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_acquire_cred_ex
483 (OM_uint32
* /*minor_status*/,
484 const gss_name_t
/*desired_name*/,
485 const gss_OID
/*credential_type*/,
486 const void * /*credential_data*/,
487 OM_uint32
/*time_req*/,
488 const gss_OID
/*desired_mech*/,
489 gss_cred_usage_t
/*cred_usage*/,
490 gss_cred_id_t
* /*output_cred_handle*/
493 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_acquire_cred_with_password
494 (OM_uint32
* /*minor_status*/,
495 const gss_name_t
/*desired_name*/,
496 const gss_buffer_t
/*password*/,
497 OM_uint32
/*time_req*/,
498 const gss_OID_set
/*desired_mechs*/,
499 gss_cred_usage_t
/*cred_usage*/,
500 gss_cred_id_t
* /*output_cred_handle*/,
501 gss_OID_set
* /*actual_mechs*/,
502 OM_uint32
* /*time_rec*/
505 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_cred
506 (OM_uint32
* /*minor_status*/,
507 gss_cred_id_t
* /*cred_handle*/
510 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_init_sec_context
511 (OM_uint32
* /*minor_status*/,
512 const gss_cred_id_t
/*initiator_cred_handle*/,
513 gss_ctx_id_t
* /*context_handle*/,
514 const gss_name_t
/*target_name*/,
515 const gss_OID
/*mech_type*/,
516 OM_uint32
/*req_flags*/,
517 OM_uint32
/*time_req*/,
518 const gss_channel_bindings_t
/*input_chan_bindings*/,
519 const gss_buffer_t
/*input_token*/,
520 gss_OID
* /*actual_mech_type*/,
521 gss_buffer_t
/*output_token*/,
522 OM_uint32
* /*ret_flags*/,
523 OM_uint32
* /*time_rec*/
526 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_accept_sec_context
527 (OM_uint32
* /*minor_status*/,
528 gss_ctx_id_t
* /*context_handle*/,
529 const gss_cred_id_t
/*acceptor_cred_handle*/,
530 const gss_buffer_t
/*input_token_buffer*/,
531 const gss_channel_bindings_t
/*input_chan_bindings*/,
532 gss_name_t
* /*src_name*/,
533 gss_OID
* /*mech_type*/,
534 gss_buffer_t
/*output_token*/,
535 OM_uint32
* /*ret_flags*/,
536 OM_uint32
* /*time_rec*/,
537 gss_cred_id_t
* /*delegated_cred_handle*/
540 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_process_context_token
541 (OM_uint32
* /*minor_status*/,
542 const gss_ctx_id_t
/*context_handle*/,
543 const gss_buffer_t
/*token_buffer*/
546 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_delete_sec_context
547 (OM_uint32
* /*minor_status*/,
548 gss_ctx_id_t
* /*context_handle*/,
549 gss_buffer_t
/*output_token*/
552 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_context_time
553 (OM_uint32
* /*minor_status*/,
554 const gss_ctx_id_t
/*context_handle*/,
555 OM_uint32
* /*time_rec*/
558 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_get_mic
559 (OM_uint32
* /*minor_status*/,
560 const gss_ctx_id_t
/*context_handle*/,
561 gss_qop_t
/*qop_req*/,
562 const gss_buffer_t
/*message_buffer*/,
563 gss_buffer_t
/*message_token*/
566 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_verify_mic
567 (OM_uint32
* /*minor_status*/,
568 const gss_ctx_id_t
/*context_handle*/,
569 const gss_buffer_t
/*message_buffer*/,
570 const gss_buffer_t
/*token_buffer*/,
571 gss_qop_t
* /*qop_state*/
574 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_wrap
575 (OM_uint32
* /*minor_status*/,
576 const gss_ctx_id_t
/*context_handle*/,
577 int /*conf_req_flag*/,
578 gss_qop_t
/*qop_req*/,
579 const gss_buffer_t
/*input_message_buffer*/,
580 int * /*conf_state*/,
581 gss_buffer_t
/*output_message_buffer*/
584 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_unwrap
585 (OM_uint32
* /*minor_status*/,
586 const gss_ctx_id_t
/*context_handle*/,
587 const gss_buffer_t
/*input_message_buffer*/,
588 gss_buffer_t
/*output_message_buffer*/,
589 int * /*conf_state*/,
590 gss_qop_t
* /*qop_state*/
593 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_display_status
594 (OM_uint32
* /*minor_status*/,
595 OM_uint32
/*status_value*/,
597 const gss_OID
/*mech_type*/,
598 OM_uint32
* /*message_context*/,
599 gss_buffer_t
/*status_string*/
602 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_indicate_mechs
603 (OM_uint32
* /*minor_status*/,
604 gss_OID_set
* /*mech_set*/
607 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_compare_name
608 (OM_uint32
* /*minor_status*/,
609 const gss_name_t
/*name1*/,
610 const gss_name_t
/*name2*/,
614 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_display_name
615 (OM_uint32
* /*minor_status*/,
616 const gss_name_t
/*input_name*/,
617 gss_buffer_t
/*output_name_buffer*/,
618 gss_OID
* /*output_name_type*/
621 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_import_name
622 (OM_uint32
* /*minor_status*/,
623 const gss_buffer_t
/*input_name_buffer*/,
624 const gss_OID
/*input_name_type*/,
625 gss_name_t
* /*output_name*/
628 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_export_name
629 (OM_uint32
* /*minor_status*/,
630 const gss_name_t
/*input_name*/,
631 gss_buffer_t
/*exported_name*/
634 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_name
635 (OM_uint32
* /*minor_status*/,
636 gss_name_t
* /*input_name*/
639 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_buffer
640 (OM_uint32
* /*minor_status*/,
641 gss_buffer_t
/*buffer*/
644 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_oid_set
645 (OM_uint32
* /*minor_status*/,
646 gss_OID_set
* /*set*/
649 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_cred
650 (OM_uint32
* /*minor_status*/,
651 const gss_cred_id_t
/*cred_handle*/,
652 gss_name_t
* /*name*/,
653 OM_uint32
* /*lifetime*/,
654 gss_cred_usage_t
* /*cred_usage*/,
655 gss_OID_set
* /*mechanisms*/
658 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_inquire_context (
659 OM_uint32
* /*minor_status*/,
660 const gss_ctx_id_t
/*context_handle*/,
661 gss_name_t
* /*src_name*/,
662 gss_name_t
* /*targ_name*/,
663 OM_uint32
* /*lifetime_rec*/,
664 gss_OID
* /*mech_type*/,
665 OM_uint32
* /*ctx_flags*/,
666 int * /*locally_initiated*/,
667 int * /*open_context*/
670 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_wrap_size_limit (
671 OM_uint32
* /*minor_status*/,
672 const gss_ctx_id_t
/*context_handle*/,
673 int /*conf_req_flag*/,
674 gss_qop_t
/*qop_req*/,
675 OM_uint32
/*req_output_size*/,
676 OM_uint32
* /*max_input_size*/
679 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_add_cred (
680 OM_uint32
* /*minor_status*/,
681 const gss_cred_id_t
/*input_cred_handle*/,
682 const gss_name_t
/*desired_name*/,
683 const gss_OID
/*desired_mech*/,
684 gss_cred_usage_t
/*cred_usage*/,
685 OM_uint32
/*initiator_time_req*/,
686 OM_uint32
/*acceptor_time_req*/,
687 gss_cred_id_t
* /*output_cred_handle*/,
688 gss_OID_set
* /*actual_mechs*/,
689 OM_uint32
* /*initiator_time_rec*/,
690 OM_uint32
* /*acceptor_time_rec*/
693 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_inquire_cred_by_mech (
694 OM_uint32
* /*minor_status*/,
695 const gss_cred_id_t
/*cred_handle*/,
696 const gss_OID
/*mech_type*/,
697 gss_name_t
* /*name*/,
698 OM_uint32
* /*initiator_lifetime*/,
699 OM_uint32
* /*acceptor_lifetime*/,
700 gss_cred_usage_t
* /*cred_usage*/
703 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_export_sec_context (
704 OM_uint32
* /*minor_status*/,
705 gss_ctx_id_t
* /*context_handle*/,
706 gss_buffer_t
/*interprocess_token*/
709 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_import_sec_context (
710 OM_uint32
* /*minor_status*/,
711 const gss_buffer_t
/*interprocess_token*/,
712 gss_ctx_id_t
* /*context_handle*/
715 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_create_empty_oid_set (
716 OM_uint32
* /*minor_status*/,
717 gss_OID_set
* /*oid_set*/
720 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_add_oid_set_member (
721 OM_uint32
* /*minor_status*/,
722 const gss_OID
/*member_oid*/,
723 gss_OID_set
* /*oid_set*/
726 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_test_oid_set_member (
727 OM_uint32
* /*minor_status*/,
728 const gss_OID
/*member*/,
729 const gss_OID_set
/*set*/,
733 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_inquire_names_for_mech (
734 OM_uint32
* /*minor_status*/,
735 const gss_OID
/*mechanism*/,
736 gss_OID_set
* /*name_types*/
739 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_inquire_mechs_for_name (
740 OM_uint32
* /*minor_status*/,
741 const gss_name_t
/*input_name*/,
742 gss_OID_set
* /*mech_types*/
745 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_canonicalize_name (
746 OM_uint32
* /*minor_status*/,
747 const gss_name_t
/*input_name*/,
748 const gss_OID
/*mech_type*/,
749 gss_name_t
* /*output_name*/
752 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_duplicate_name (
753 OM_uint32
* /*minor_status*/,
754 const gss_name_t
/*src_name*/,
755 gss_name_t
* /*dest_name*/
758 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_duplicate_oid (
759 OM_uint32
* /* minor_status */,
760 gss_OID
/* src_oid */,
761 gss_OID
* /* dest_oid */
764 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
766 (OM_uint32
* /*minor_status*/,
770 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
772 OM_uint32
* /*minor_status*/,
774 gss_buffer_t
/* str */
777 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
778 gss_inquire_sec_context_by_oid(
779 OM_uint32
* minor_status
,
780 const gss_ctx_id_t context_handle
,
781 const gss_OID desired_object
,
782 gss_buffer_set_t
*data_set
785 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
786 gss_set_sec_context_option (OM_uint32
*minor_status
,
787 gss_ctx_id_t
*context_handle
,
788 const gss_OID desired_object
,
789 const gss_buffer_t value
);
791 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
792 gss_set_cred_option (OM_uint32
*minor_status
,
793 gss_cred_id_t
*cred_handle
,
794 const gss_OID object
,
795 const gss_buffer_t value
);
797 GSSAPI_LIB_FUNCTION
int GSSAPI_LIB_CALL
798 gss_oid_equal(gss_const_OID a
, gss_const_OID b
);
800 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
801 gss_create_empty_buffer_set
802 (OM_uint32
* minor_status
,
803 gss_buffer_set_t
*buffer_set
);
805 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
806 gss_add_buffer_set_member
807 (OM_uint32
* minor_status
,
808 const gss_buffer_t member_buffer
,
809 gss_buffer_set_t
*buffer_set
);
811 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
812 gss_release_buffer_set
813 (OM_uint32
* minor_status
,
814 gss_buffer_set_t
*buffer_set
);
816 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
817 gss_inquire_cred_by_oid(OM_uint32
*minor_status
,
818 const gss_cred_id_t cred_handle
,
819 const gss_OID desired_object
,
820 gss_buffer_set_t
*data_set
);
826 #define GSS_C_PRF_KEY_FULL 0
827 #define GSS_C_PRF_KEY_PARTIAL 1
829 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
831 (OM_uint32
*minor_status
,
832 gss_ctx_id_t context
,
834 const gss_buffer_t prf_in
,
835 ssize_t desired_output_len
,
839 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
840 gss_store_cred(OM_uint32
* /* minor_status */,
841 gss_cred_id_t
/* input_cred_handle */,
842 gss_cred_usage_t
/* cred_usage */,
843 const gss_OID
/* desired_mech */,
844 OM_uint32
/* overwrite_cred */,
845 OM_uint32
/* default_cred */,
846 gss_OID_set
* /* elements_stored */,
847 gss_cred_usage_t
* /* cred_usage_stored */);
855 size_t header
; /**< size of header */
856 size_t trailer
; /**< size of trailer */
857 size_t max_msg_size
; /**< maximum message size */
858 size_t buffers
; /**< extra GSS_IOV_BUFFER_TYPE_EMPTY buffer to pass */
859 size_t blocksize
; /**< Specificed optimal size of messages, also
860 is the maximum padding size
861 (GSS_IOV_BUFFER_TYPE_PADDING) */
862 } gss_context_stream_sizes
;
864 extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_attr_stream_sizes_oid_desc
;
865 #define GSS_C_ATTR_STREAM_SIZES (&__gss_c_attr_stream_sizes_oid_desc)
868 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
869 gss_context_query_attributes(OM_uint32
* /* minor_status */,
870 const gss_ctx_id_t
/* context_handle */,
871 const gss_OID
/* attribute */,
875 * The following routines are obsolete variants of gss_get_mic,
876 * gss_verify_mic, gss_wrap and gss_unwrap. They should be
877 * provided by GSSAPI V2 implementations for backwards
878 * compatibility with V1 applications. Distinct entrypoints
879 * (as opposed to #defines) should be provided, both to allow
880 * GSSAPI V1 applications to link against GSSAPI V2 implementations,
881 * and to retain the slight parameter type differences between the
882 * obsolete versions of these routines and their current forms.
885 GSSAPI_DEPRECATED GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_sign
886 (OM_uint32
* /*minor_status*/,
887 gss_ctx_id_t
/*context_handle*/,
889 gss_buffer_t
/*message_buffer*/,
890 gss_buffer_t
/*message_token*/
893 GSSAPI_DEPRECATED GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_verify
894 (OM_uint32
* /*minor_status*/,
895 gss_ctx_id_t
/*context_handle*/,
896 gss_buffer_t
/*message_buffer*/,
897 gss_buffer_t
/*token_buffer*/,
901 GSSAPI_DEPRECATED GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_seal
902 (OM_uint32
* /*minor_status*/,
903 gss_ctx_id_t
/*context_handle*/,
904 int /*conf_req_flag*/,
906 gss_buffer_t
/*input_message_buffer*/,
907 int * /*conf_state*/,
908 gss_buffer_t
/*output_message_buffer*/
911 GSSAPI_DEPRECATED GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_unseal
912 (OM_uint32
* /*minor_status*/,
913 gss_ctx_id_t
/*context_handle*/,
914 gss_buffer_t
/*input_message_buffer*/,
915 gss_buffer_t
/*output_message_buffer*/,
916 int * /*conf_state*/,
924 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
925 gss_encapsulate_token(gss_const_buffer_t
/* input_token */,
926 gss_const_OID
/* oid */,
927 gss_buffer_t
/* output_token */);
929 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
930 gss_decapsulate_token(gss_const_buffer_t
/* input_token */,
931 gss_const_OID
/* oid */,
932 gss_buffer_t
/* output_token */);
944 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
945 gss_wrap_iov(OM_uint32
*, gss_ctx_id_t
, int, gss_qop_t
, int *,
946 gss_iov_buffer_desc
*, int);
949 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
950 gss_unwrap_iov(OM_uint32
*, gss_ctx_id_t
, int *, gss_qop_t
*,
951 gss_iov_buffer_desc
*, int);
953 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
954 gss_wrap_iov_length(OM_uint32
*, gss_ctx_id_t
, int, gss_qop_t
, int *,
955 gss_iov_buffer_desc
*, int);
957 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
958 gss_release_iov_buffer(OM_uint32
*, gss_iov_buffer_desc
*, int);
961 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
962 gss_export_cred(OM_uint32
* /* minor_status */,
963 gss_cred_id_t
/* cred_handle */,
964 gss_buffer_t
/* cred_token */);
966 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
967 gss_import_cred(OM_uint32
* /* minor_status */,
968 gss_buffer_t
/* cred_token */,
969 gss_cred_id_t
* /* cred_handle */);
975 GSSAPI_LIB_FUNCTION
int GSSAPI_LIB_CALL
976 gss_mo_set(gss_const_OID mech
, gss_const_OID option
,
977 int enable
, gss_buffer_t value
);
979 GSSAPI_LIB_FUNCTION
int GSSAPI_LIB_CALL
980 gss_mo_get(gss_const_OID mech
, gss_const_OID option
, gss_buffer_t value
);
982 GSSAPI_LIB_FUNCTION
void GSSAPI_LIB_CALL
983 gss_mo_list(gss_const_OID mech
, gss_OID_set
*options
);
985 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
986 gss_mo_name(gss_const_OID mech
, gss_const_OID options
, gss_buffer_t name
);
989 * SASL glue functions and mech inquire
992 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
993 gss_inquire_saslname_for_mech(OM_uint32
*minor_status
,
994 const gss_OID desired_mech
,
995 gss_buffer_t sasl_mech_name
,
996 gss_buffer_t mech_name
,
997 gss_buffer_t mech_description
);
999 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1000 gss_inquire_mech_for_saslname(OM_uint32
*minor_status
,
1001 const gss_buffer_t sasl_mech_name
,
1002 gss_OID
*mech_type
);
1004 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1005 gss_indicate_mechs_by_attrs(OM_uint32
* minor_status
,
1006 gss_const_OID_set desired_mech_attrs
,
1007 gss_const_OID_set except_mech_attrs
,
1008 gss_const_OID_set critical_mech_attrs
,
1009 gss_OID_set
*mechs
);
1011 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1012 gss_inquire_attrs_for_mech(OM_uint32
* minor_status
,
1014 gss_OID_set
*mech_attr
,
1015 gss_OID_set
*known_mech_attrs
);
1017 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
1018 gss_display_mech_attr(OM_uint32
* minor_status
,
1019 gss_const_OID mech_attr
,
1021 gss_buffer_t short_desc
,
1022 gss_buffer_t long_desc
);
1028 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_display_name_ext (
1029 OM_uint32
*, /* minor_status */
1030 gss_name_t
, /* name */
1031 gss_OID
, /* display_as_name_type */
1032 gss_buffer_t
/* display_name */
1035 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_inquire_name (
1036 OM_uint32
*, /* minor_status */
1037 gss_name_t
, /* name */
1038 int *, /* name_is_MN */
1039 gss_OID
*, /* MN_mech */
1040 gss_buffer_set_t
* /* attrs */
1043 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_get_name_attribute (
1044 OM_uint32
*, /* minor_status */
1045 gss_name_t
, /* name */
1046 gss_buffer_t
, /* attr */
1047 int *, /* authenticated */
1048 int *, /* complete */
1049 gss_buffer_t
, /* value */
1050 gss_buffer_t
, /* display_value */
1054 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_set_name_attribute (
1055 OM_uint32
*, /* minor_status */
1056 gss_name_t
, /* name */
1058 gss_buffer_t
, /* attr */
1059 gss_buffer_t
/* value */
1062 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_delete_name_attribute (
1063 OM_uint32
*, /* minor_status */
1064 gss_name_t
, /* name */
1065 gss_buffer_t
/* attr */
1068 GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_export_name_composite (
1069 OM_uint32
*, /* minor_status */
1070 gss_name_t
, /* name */
1071 gss_buffer_t
/* exp_composite_name */
1078 GSSAPI_LIB_FUNCTION
const char * GSSAPI_LIB_CALL
1079 gss_oid_to_name(gss_const_OID oid
);
1081 GSSAPI_LIB_FUNCTION gss_OID GSSAPI_LIB_CALL
1082 gss_name_to_oid(const char *name
);
1086 #endif /* GSSAPI_GSSAPI_H_ */