Add declspec for Windows
[heimdal.git] / lib / gssapi / gssapi / gssapi.h
bloba1fad27088ecba520486d1e3650dde13a04b2686
1 /*
2 * Copyright (c) 1997 - 2007 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
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
31 * SUCH DAMAGE.
34 /* $Id$ */
36 #ifndef GSSAPI_GSSAPI_H_
37 #define GSSAPI_GSSAPI_H_
40 * First, include stddef.h to get size_t defined.
42 #include <stddef.h>
44 #include <krb5-types.h>
46 #ifndef BUILD_GSSAPI_LIB
47 #if defined(_WIN32)
48 #define GSSAPI_LIB_FUNCTION _stdcall __declspec(dllimport)
49 #define GSSAPI_LIB_VARIABLE __declspec(dllimport)
50 #else
51 #define GSSAPI_LIB_FUNCTION
52 #define GSSAPI_LIB_VARIABLE
53 #endif
54 #endif
57 * Now define the three implementation-dependent types.
60 typedef uint32_t OM_uint32;
61 typedef uint64_t OM_uint64;
63 typedef uint32_t gss_uint32;
65 struct gss_name_t_desc_struct;
66 typedef struct gss_name_t_desc_struct *gss_name_t;
68 struct gss_ctx_id_t_desc_struct;
69 typedef struct gss_ctx_id_t_desc_struct *gss_ctx_id_t;
71 typedef struct gss_OID_desc_struct {
72 OM_uint32 length;
73 void *elements;
74 } gss_OID_desc, *gss_OID;
76 typedef struct gss_OID_set_desc_struct {
77 size_t count;
78 gss_OID elements;
79 } gss_OID_set_desc, *gss_OID_set;
81 typedef int gss_cred_usage_t;
83 struct gss_cred_id_t_desc_struct;
84 typedef struct gss_cred_id_t_desc_struct *gss_cred_id_t;
86 typedef struct gss_buffer_desc_struct {
87 size_t length;
88 void *value;
89 } gss_buffer_desc, *gss_buffer_t;
91 typedef struct gss_channel_bindings_struct {
92 OM_uint32 initiator_addrtype;
93 gss_buffer_desc initiator_address;
94 OM_uint32 acceptor_addrtype;
95 gss_buffer_desc acceptor_address;
96 gss_buffer_desc application_data;
97 } *gss_channel_bindings_t;
99 /* GGF extension data types */
100 typedef struct gss_buffer_set_desc_struct {
101 size_t count;
102 gss_buffer_desc *elements;
103 } gss_buffer_set_desc, *gss_buffer_set_t;
106 * For now, define a QOP-type as an OM_uint32
108 typedef OM_uint32 gss_qop_t;
111 * Flag bits for context-level services.
113 #define GSS_C_DELEG_FLAG 1
114 #define GSS_C_MUTUAL_FLAG 2
115 #define GSS_C_REPLAY_FLAG 4
116 #define GSS_C_SEQUENCE_FLAG 8
117 #define GSS_C_CONF_FLAG 16
118 #define GSS_C_INTEG_FLAG 32
119 #define GSS_C_ANON_FLAG 64
120 #define GSS_C_PROT_READY_FLAG 128
121 #define GSS_C_TRANS_FLAG 256
123 #define GSS_C_DCE_STYLE 4096
124 #define GSS_C_IDENTIFY_FLAG 8192
125 #define GSS_C_EXTENDED_ERROR_FLAG 16384
128 * Credential usage options
130 #define GSS_C_BOTH 0
131 #define GSS_C_INITIATE 1
132 #define GSS_C_ACCEPT 2
135 * Status code types for gss_display_status
137 #define GSS_C_GSS_CODE 1
138 #define GSS_C_MECH_CODE 2
141 * The constant definitions for channel-bindings address families
143 #define GSS_C_AF_UNSPEC 0
144 #define GSS_C_AF_LOCAL 1
145 #define GSS_C_AF_INET 2
146 #define GSS_C_AF_IMPLINK 3
147 #define GSS_C_AF_PUP 4
148 #define GSS_C_AF_CHAOS 5
149 #define GSS_C_AF_NS 6
150 #define GSS_C_AF_NBS 7
151 #define GSS_C_AF_ECMA 8
152 #define GSS_C_AF_DATAKIT 9
153 #define GSS_C_AF_CCITT 10
154 #define GSS_C_AF_SNA 11
155 #define GSS_C_AF_DECnet 12
156 #define GSS_C_AF_DLI 13
157 #define GSS_C_AF_LAT 14
158 #define GSS_C_AF_HYLINK 15
159 #define GSS_C_AF_APPLETALK 16
160 #define GSS_C_AF_BSC 17
161 #define GSS_C_AF_DSS 18
162 #define GSS_C_AF_OSI 19
163 #define GSS_C_AF_X25 21
164 #define GSS_C_AF_INET6 24
166 #define GSS_C_AF_NULLADDR 255
169 * Various Null values
171 #define GSS_C_NO_NAME ((gss_name_t) 0)
172 #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
173 #define GSS_C_NO_BUFFER_SET ((gss_buffer_set_t) 0)
174 #define GSS_C_NO_OID ((gss_OID) 0)
175 #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
176 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
177 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
178 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
179 #define GSS_C_EMPTY_BUFFER {0, NULL}
182 * Some alternate names for a couple of the above
183 * values. These are defined for V1 compatibility.
185 #define GSS_C_NULL_OID GSS_C_NO_OID
186 #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
189 * Define the default Quality of Protection for per-message
190 * services. Note that an implementation that offers multiple
191 * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
192 * (as done here) to mean "default protection", or to a specific
193 * explicit QOP value. However, a value of 0 should always be
194 * interpreted by a GSSAPI implementation as a request for the
195 * default protection level.
197 #define GSS_C_QOP_DEFAULT 0
199 #define GSS_KRB5_CONF_C_QOP_DES 0x0100
200 #define GSS_KRB5_CONF_C_QOP_DES3_KD 0x0200
203 * Expiration time of 2^32-1 seconds means infinite lifetime for a
204 * credential or security context
206 #define GSS_C_INDEFINITE 0xfffffffful
208 #ifdef __cplusplus
209 extern "C" {
210 #endif
213 * The implementation must reserve static storage for a
214 * gss_OID_desc object containing the value
215 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
216 * "\x01\x02\x01\x01"},
217 * corresponding to an object-identifier value of
218 * {iso(1) member-body(2) United States(840) mit(113554)
219 * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
220 * GSS_C_NT_USER_NAME should be initialized to point
221 * to that gss_OID_desc.
223 extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_USER_NAME;
226 * The implementation must reserve static storage for a
227 * gss_OID_desc object containing the value
228 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
229 * "\x01\x02\x01\x02"},
230 * corresponding to an object-identifier value of
231 * {iso(1) member-body(2) United States(840) mit(113554)
232 * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
233 * The constant GSS_C_NT_MACHINE_UID_NAME should be
234 * initialized to point to that gss_OID_desc.
236 extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_MACHINE_UID_NAME;
239 * The implementation must reserve static storage for a
240 * gss_OID_desc object containing the value
241 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
242 * "\x01\x02\x01\x03"},
243 * corresponding to an object-identifier value of
244 * {iso(1) member-body(2) United States(840) mit(113554)
245 * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
246 * The constant GSS_C_NT_STRING_UID_NAME should be
247 * initialized to point to that gss_OID_desc.
249 extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_STRING_UID_NAME;
252 * The implementation must reserve static storage for a
253 * gss_OID_desc object containing the value
254 * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
255 * corresponding to an object-identifier value of
256 * {iso(1) org(3) dod(6) internet(1) security(5)
257 * nametypes(6) gss-host-based-services(2)). The constant
258 * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
259 * to that gss_OID_desc. This is a deprecated OID value, and
260 * implementations wishing to support hostbased-service names
261 * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
262 * defined below, to identify such names;
263 * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
264 * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
265 * parameter, but should not be emitted by GSS-API
266 * implementations
268 extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
271 * The implementation must reserve static storage for a
272 * gss_OID_desc object containing the value
273 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
274 * "\x01\x02\x01\x04"}, corresponding to an
275 * object-identifier value of {iso(1) member-body(2)
276 * Unites States(840) mit(113554) infosys(1) gssapi(2)
277 * generic(1) service_name(4)}. The constant
278 * GSS_C_NT_HOSTBASED_SERVICE should be initialized
279 * to point to that gss_OID_desc.
281 extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_HOSTBASED_SERVICE;
284 * The implementation must reserve static storage for a
285 * gss_OID_desc object containing the value
286 * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
287 * corresponding to an object identifier value of
288 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
289 * 6(nametypes), 3(gss-anonymous-name)}. The constant
290 * and GSS_C_NT_ANONYMOUS should be initialized to point
291 * to that gss_OID_desc.
293 extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_ANONYMOUS;
296 * The implementation must reserve static storage for a
297 * gss_OID_desc object containing the value
298 * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
299 * corresponding to an object-identifier value of
300 * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
301 * 6(nametypes), 4(gss-api-exported-name)}. The constant
302 * GSS_C_NT_EXPORT_NAME should be initialized to point
303 * to that gss_OID_desc.
305 extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_EXPORT_NAME;
308 * Digest mechanism
311 extern GSSAPI_LIB_VARIABLE gss_OID GSS_SASL_DIGEST_MD5_MECHANISM;
314 * NTLM mechanism
317 extern GSSAPI_LIB_VARIABLE gss_OID GSS_NTLM_MECHANISM;
319 /* Major status codes */
321 #define GSS_S_COMPLETE 0
324 * Some "helper" definitions to make the status code macros obvious.
326 #define GSS_C_CALLING_ERROR_OFFSET 24
327 #define GSS_C_ROUTINE_ERROR_OFFSET 16
328 #define GSS_C_SUPPLEMENTARY_OFFSET 0
329 #define GSS_C_CALLING_ERROR_MASK 0377ul
330 #define GSS_C_ROUTINE_ERROR_MASK 0377ul
331 #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
334 * The macros that test status codes for error conditions.
335 * Note that the GSS_ERROR() macro has changed slightly from
336 * the V1 GSSAPI so that it now evaluates its argument
337 * only once.
339 #define GSS_CALLING_ERROR(x) \
340 (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
341 #define GSS_ROUTINE_ERROR(x) \
342 (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
343 #define GSS_SUPPLEMENTARY_INFO(x) \
344 (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
345 #define GSS_ERROR(x) \
346 (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
347 (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
350 * Now the actual status code definitions
354 * Calling errors:
356 #define GSS_S_CALL_INACCESSIBLE_READ \
357 (1ul << GSS_C_CALLING_ERROR_OFFSET)
358 #define GSS_S_CALL_INACCESSIBLE_WRITE \
359 (2ul << GSS_C_CALLING_ERROR_OFFSET)
360 #define GSS_S_CALL_BAD_STRUCTURE \
361 (3ul << GSS_C_CALLING_ERROR_OFFSET)
364 * Routine errors:
366 #define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
367 #define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
368 #define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
370 #define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
371 #define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
372 #define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
373 #define GSS_S_BAD_MIC GSS_S_BAD_SIG
374 #define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
375 #define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
376 #define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
377 #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
378 #define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
379 #define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
380 #define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
381 #define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
382 #define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
383 #define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
384 #define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
385 #define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
388 * Supplementary info bits:
390 #define GSS_S_CONTINUE_NEEDED (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
391 #define GSS_S_DUPLICATE_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
392 #define GSS_S_OLD_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
393 #define GSS_S_UNSEQ_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
394 #define GSS_S_GAP_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
397 * Finally, function prototypes for the GSS-API routines.
400 OM_uint32 GSSAPI_LIB_FUNCTION gss_acquire_cred
401 (OM_uint32 * /*minor_status*/,
402 const gss_name_t /*desired_name*/,
403 OM_uint32 /*time_req*/,
404 const gss_OID_set /*desired_mechs*/,
405 gss_cred_usage_t /*cred_usage*/,
406 gss_cred_id_t * /*output_cred_handle*/,
407 gss_OID_set * /*actual_mechs*/,
408 OM_uint32 * /*time_rec*/
411 OM_uint32 GSSAPI_LIB_FUNCTION gss_release_cred
412 (OM_uint32 * /*minor_status*/,
413 gss_cred_id_t * /*cred_handle*/
416 OM_uint32 GSSAPI_LIB_FUNCTION gss_init_sec_context
417 (OM_uint32 * /*minor_status*/,
418 const gss_cred_id_t /*initiator_cred_handle*/,
419 gss_ctx_id_t * /*context_handle*/,
420 const gss_name_t /*target_name*/,
421 const gss_OID /*mech_type*/,
422 OM_uint32 /*req_flags*/,
423 OM_uint32 /*time_req*/,
424 const gss_channel_bindings_t /*input_chan_bindings*/,
425 const gss_buffer_t /*input_token*/,
426 gss_OID * /*actual_mech_type*/,
427 gss_buffer_t /*output_token*/,
428 OM_uint32 * /*ret_flags*/,
429 OM_uint32 * /*time_rec*/
432 OM_uint32 GSSAPI_LIB_FUNCTION gss_accept_sec_context
433 (OM_uint32 * /*minor_status*/,
434 gss_ctx_id_t * /*context_handle*/,
435 const gss_cred_id_t /*acceptor_cred_handle*/,
436 const gss_buffer_t /*input_token_buffer*/,
437 const gss_channel_bindings_t /*input_chan_bindings*/,
438 gss_name_t * /*src_name*/,
439 gss_OID * /*mech_type*/,
440 gss_buffer_t /*output_token*/,
441 OM_uint32 * /*ret_flags*/,
442 OM_uint32 * /*time_rec*/,
443 gss_cred_id_t * /*delegated_cred_handle*/
446 OM_uint32 GSSAPI_LIB_FUNCTION gss_process_context_token
447 (OM_uint32 * /*minor_status*/,
448 const gss_ctx_id_t /*context_handle*/,
449 const gss_buffer_t /*token_buffer*/
452 OM_uint32 GSSAPI_LIB_FUNCTION gss_delete_sec_context
453 (OM_uint32 * /*minor_status*/,
454 gss_ctx_id_t * /*context_handle*/,
455 gss_buffer_t /*output_token*/
458 OM_uint32 GSSAPI_LIB_FUNCTION gss_context_time
459 (OM_uint32 * /*minor_status*/,
460 const gss_ctx_id_t /*context_handle*/,
461 OM_uint32 * /*time_rec*/
464 OM_uint32 GSSAPI_LIB_FUNCTION gss_get_mic
465 (OM_uint32 * /*minor_status*/,
466 const gss_ctx_id_t /*context_handle*/,
467 gss_qop_t /*qop_req*/,
468 const gss_buffer_t /*message_buffer*/,
469 gss_buffer_t /*message_token*/
472 OM_uint32 GSSAPI_LIB_FUNCTION gss_verify_mic
473 (OM_uint32 * /*minor_status*/,
474 const gss_ctx_id_t /*context_handle*/,
475 const gss_buffer_t /*message_buffer*/,
476 const gss_buffer_t /*token_buffer*/,
477 gss_qop_t * /*qop_state*/
480 OM_uint32 GSSAPI_LIB_FUNCTION gss_wrap
481 (OM_uint32 * /*minor_status*/,
482 const gss_ctx_id_t /*context_handle*/,
483 int /*conf_req_flag*/,
484 gss_qop_t /*qop_req*/,
485 const gss_buffer_t /*input_message_buffer*/,
486 int * /*conf_state*/,
487 gss_buffer_t /*output_message_buffer*/
490 OM_uint32 GSSAPI_LIB_FUNCTION gss_unwrap
491 (OM_uint32 * /*minor_status*/,
492 const gss_ctx_id_t /*context_handle*/,
493 const gss_buffer_t /*input_message_buffer*/,
494 gss_buffer_t /*output_message_buffer*/,
495 int * /*conf_state*/,
496 gss_qop_t * /*qop_state*/
499 OM_uint32 GSSAPI_LIB_FUNCTION gss_display_status
500 (OM_uint32 * /*minor_status*/,
501 OM_uint32 /*status_value*/,
502 int /*status_type*/,
503 const gss_OID /*mech_type*/,
504 OM_uint32 * /*message_context*/,
505 gss_buffer_t /*status_string*/
508 OM_uint32 GSSAPI_LIB_FUNCTION gss_indicate_mechs
509 (OM_uint32 * /*minor_status*/,
510 gss_OID_set * /*mech_set*/
513 OM_uint32 GSSAPI_LIB_FUNCTION gss_compare_name
514 (OM_uint32 * /*minor_status*/,
515 const gss_name_t /*name1*/,
516 const gss_name_t /*name2*/,
517 int * /*name_equal*/
520 OM_uint32 GSSAPI_LIB_FUNCTION gss_display_name
521 (OM_uint32 * /*minor_status*/,
522 const gss_name_t /*input_name*/,
523 gss_buffer_t /*output_name_buffer*/,
524 gss_OID * /*output_name_type*/
527 OM_uint32 GSSAPI_LIB_FUNCTION gss_import_name
528 (OM_uint32 * /*minor_status*/,
529 const gss_buffer_t /*input_name_buffer*/,
530 const gss_OID /*input_name_type*/,
531 gss_name_t * /*output_name*/
534 OM_uint32 GSSAPI_LIB_FUNCTION gss_export_name
535 (OM_uint32 * /*minor_status*/,
536 const gss_name_t /*input_name*/,
537 gss_buffer_t /*exported_name*/
540 OM_uint32 GSSAPI_LIB_FUNCTION gss_release_name
541 (OM_uint32 * /*minor_status*/,
542 gss_name_t * /*input_name*/
545 OM_uint32 GSSAPI_LIB_FUNCTION gss_release_buffer
546 (OM_uint32 * /*minor_status*/,
547 gss_buffer_t /*buffer*/
550 OM_uint32 GSSAPI_LIB_FUNCTION gss_release_oid_set
551 (OM_uint32 * /*minor_status*/,
552 gss_OID_set * /*set*/
555 OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_cred
556 (OM_uint32 * /*minor_status*/,
557 const gss_cred_id_t /*cred_handle*/,
558 gss_name_t * /*name*/,
559 OM_uint32 * /*lifetime*/,
560 gss_cred_usage_t * /*cred_usage*/,
561 gss_OID_set * /*mechanisms*/
564 OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_context (
565 OM_uint32 * /*minor_status*/,
566 const gss_ctx_id_t /*context_handle*/,
567 gss_name_t * /*src_name*/,
568 gss_name_t * /*targ_name*/,
569 OM_uint32 * /*lifetime_rec*/,
570 gss_OID * /*mech_type*/,
571 OM_uint32 * /*ctx_flags*/,
572 int * /*locally_initiated*/,
573 int * /*open_context*/
576 OM_uint32 GSSAPI_LIB_FUNCTION gss_wrap_size_limit (
577 OM_uint32 * /*minor_status*/,
578 const gss_ctx_id_t /*context_handle*/,
579 int /*conf_req_flag*/,
580 gss_qop_t /*qop_req*/,
581 OM_uint32 /*req_output_size*/,
582 OM_uint32 * /*max_input_size*/
585 OM_uint32 GSSAPI_LIB_FUNCTION gss_add_cred (
586 OM_uint32 * /*minor_status*/,
587 const gss_cred_id_t /*input_cred_handle*/,
588 const gss_name_t /*desired_name*/,
589 const gss_OID /*desired_mech*/,
590 gss_cred_usage_t /*cred_usage*/,
591 OM_uint32 /*initiator_time_req*/,
592 OM_uint32 /*acceptor_time_req*/,
593 gss_cred_id_t * /*output_cred_handle*/,
594 gss_OID_set * /*actual_mechs*/,
595 OM_uint32 * /*initiator_time_rec*/,
596 OM_uint32 * /*acceptor_time_rec*/
599 OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_cred_by_mech (
600 OM_uint32 * /*minor_status*/,
601 const gss_cred_id_t /*cred_handle*/,
602 const gss_OID /*mech_type*/,
603 gss_name_t * /*name*/,
604 OM_uint32 * /*initiator_lifetime*/,
605 OM_uint32 * /*acceptor_lifetime*/,
606 gss_cred_usage_t * /*cred_usage*/
609 OM_uint32 GSSAPI_LIB_FUNCTION gss_export_sec_context (
610 OM_uint32 * /*minor_status*/,
611 gss_ctx_id_t * /*context_handle*/,
612 gss_buffer_t /*interprocess_token*/
615 OM_uint32 GSSAPI_LIB_FUNCTION gss_import_sec_context (
616 OM_uint32 * /*minor_status*/,
617 const gss_buffer_t /*interprocess_token*/,
618 gss_ctx_id_t * /*context_handle*/
621 OM_uint32 GSSAPI_LIB_FUNCTION gss_create_empty_oid_set (
622 OM_uint32 * /*minor_status*/,
623 gss_OID_set * /*oid_set*/
626 OM_uint32 GSSAPI_LIB_FUNCTION gss_add_oid_set_member (
627 OM_uint32 * /*minor_status*/,
628 const gss_OID /*member_oid*/,
629 gss_OID_set * /*oid_set*/
632 OM_uint32 GSSAPI_LIB_FUNCTION gss_test_oid_set_member (
633 OM_uint32 * /*minor_status*/,
634 const gss_OID /*member*/,
635 const gss_OID_set /*set*/,
636 int * /*present*/
639 OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_names_for_mech (
640 OM_uint32 * /*minor_status*/,
641 const gss_OID /*mechanism*/,
642 gss_OID_set * /*name_types*/
645 OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_mechs_for_name (
646 OM_uint32 * /*minor_status*/,
647 const gss_name_t /*input_name*/,
648 gss_OID_set * /*mech_types*/
651 OM_uint32 GSSAPI_LIB_FUNCTION gss_canonicalize_name (
652 OM_uint32 * /*minor_status*/,
653 const gss_name_t /*input_name*/,
654 const gss_OID /*mech_type*/,
655 gss_name_t * /*output_name*/
658 OM_uint32 GSSAPI_LIB_FUNCTION gss_duplicate_name (
659 OM_uint32 * /*minor_status*/,
660 const gss_name_t /*src_name*/,
661 gss_name_t * /*dest_name*/
664 OM_uint32 GSSAPI_LIB_FUNCTION gss_duplicate_oid (
665 OM_uint32 * /* minor_status */,
666 gss_OID /* src_oid */,
667 gss_OID * /* dest_oid */
670 OM_uint32 GSSAPI_LIB_FUNCTION
671 gss_release_oid
672 (OM_uint32 * /*minor_status*/,
673 gss_OID * /* oid */
676 OM_uint32 GSSAPI_LIB_FUNCTION
677 gss_oid_to_str(
678 OM_uint32 * /*minor_status*/,
679 gss_OID /* oid */,
680 gss_buffer_t /* str */
683 OM_uint32 GSSAPI_LIB_FUNCTION
684 gss_inquire_sec_context_by_oid(
685 OM_uint32 * minor_status,
686 const gss_ctx_id_t context_handle,
687 const gss_OID desired_object,
688 gss_buffer_set_t *data_set
691 OM_uint32 GSSAPI_LIB_FUNCTION
692 gss_set_sec_context_option (OM_uint32 *minor_status,
693 gss_ctx_id_t *context_handle,
694 const gss_OID desired_object,
695 const gss_buffer_t value);
697 OM_uint32 GSSAPI_LIB_FUNCTION
698 gss_set_cred_option (OM_uint32 *minor_status,
699 gss_cred_id_t *cred_handle,
700 const gss_OID object,
701 const gss_buffer_t value);
703 int GSSAPI_LIB_FUNCTION
704 gss_oid_equal(const gss_OID a, const gss_OID b);
706 OM_uint32 GSSAPI_LIB_FUNCTION
707 gss_create_empty_buffer_set
708 (OM_uint32 * minor_status,
709 gss_buffer_set_t *buffer_set);
711 OM_uint32 GSSAPI_LIB_FUNCTION
712 gss_add_buffer_set_member
713 (OM_uint32 * minor_status,
714 const gss_buffer_t member_buffer,
715 gss_buffer_set_t *buffer_set);
717 OM_uint32 GSSAPI_LIB_FUNCTION
718 gss_release_buffer_set
719 (OM_uint32 * minor_status,
720 gss_buffer_set_t *buffer_set);
722 OM_uint32 GSSAPI_LIB_FUNCTION
723 gss_inquire_cred_by_oid(OM_uint32 *minor_status,
724 const gss_cred_id_t cred_handle,
725 const gss_OID desired_object,
726 gss_buffer_set_t *data_set);
729 * RFC 4401
732 #define GSS_C_PRF_KEY_FULL 0
733 #define GSS_C_PRF_KEY_PARTIAL 1
735 OM_uint32 GSSAPI_LIB_FUNCTION
736 gss_pseudo_random
737 (OM_uint32 *minor_status,
738 gss_ctx_id_t context,
739 int prf_key,
740 const gss_buffer_t prf_in,
741 ssize_t desired_output_len,
742 gss_buffer_t prf_out
746 * The following routines are obsolete variants of gss_get_mic,
747 * gss_verify_mic, gss_wrap and gss_unwrap. They should be
748 * provided by GSSAPI V2 implementations for backwards
749 * compatibility with V1 applications. Distinct entrypoints
750 * (as opposed to #defines) should be provided, both to allow
751 * GSSAPI V1 applications to link against GSSAPI V2 implementations,
752 * and to retain the slight parameter type differences between the
753 * obsolete versions of these routines and their current forms.
756 OM_uint32 GSSAPI_LIB_FUNCTION gss_sign
757 (OM_uint32 * /*minor_status*/,
758 gss_ctx_id_t /*context_handle*/,
759 int /*qop_req*/,
760 gss_buffer_t /*message_buffer*/,
761 gss_buffer_t /*message_token*/
764 OM_uint32 GSSAPI_LIB_FUNCTION gss_verify
765 (OM_uint32 * /*minor_status*/,
766 gss_ctx_id_t /*context_handle*/,
767 gss_buffer_t /*message_buffer*/,
768 gss_buffer_t /*token_buffer*/,
769 int * /*qop_state*/
772 OM_uint32 GSSAPI_LIB_FUNCTION gss_seal
773 (OM_uint32 * /*minor_status*/,
774 gss_ctx_id_t /*context_handle*/,
775 int /*conf_req_flag*/,
776 int /*qop_req*/,
777 gss_buffer_t /*input_message_buffer*/,
778 int * /*conf_state*/,
779 gss_buffer_t /*output_message_buffer*/
782 OM_uint32 GSSAPI_LIB_FUNCTION gss_unseal
783 (OM_uint32 * /*minor_status*/,
784 gss_ctx_id_t /*context_handle*/,
785 gss_buffer_t /*input_message_buffer*/,
786 gss_buffer_t /*output_message_buffer*/,
787 int * /*conf_state*/,
788 int * /*qop_state*/
795 OM_uint32 GSSAPI_LIB_FUNCTION
796 gss_inquire_sec_context_by_oid (OM_uint32 *minor_status,
797 const gss_ctx_id_t context_handle,
798 const gss_OID desired_object,
799 gss_buffer_set_t *data_set);
801 OM_uint32 GSSAPI_LIB_FUNCTION
802 gss_encapsulate_token(gss_buffer_t /* input_token */,
803 gss_OID /* oid */,
804 gss_buffer_t /* output_token */);
806 OM_uint32 GSSAPI_LIB_FUNCTION
807 gss_decapsulate_token(gss_buffer_t /* input_token */,
808 gss_OID /* oid */,
809 gss_buffer_t /* output_token */);
813 #ifdef __cplusplus
815 #endif
817 #include <gssapi/gssapi_krb5.h>
818 #include <gssapi/gssapi_spnego.h>
820 #endif /* GSSAPI_GSSAPI_H_ */