1 .\" Copyright (c) 2003 - 2007 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .Dt GSS_ACQUIRE_CRED 3
38 .Nm gss_accept_sec_context ,
39 .Nm gss_acquire_cred ,
41 .Nm gss_add_oid_set_member ,
42 .Nm gss_canonicalize_name ,
43 .Nm gss_compare_name ,
44 .Nm gss_context_time ,
45 .Nm gss_create_empty_oid_set ,
46 .Nm gss_delete_sec_context ,
47 .Nm gss_display_name ,
48 .Nm gss_display_status ,
49 .Nm gss_duplicate_name ,
51 .Nm gss_export_sec_context ,
54 .Nm gss_import_sec_context ,
55 .Nm gss_indicate_mechs ,
56 .Nm gss_init_sec_context ,
57 .Nm gss_inquire_context ,
58 .Nm gss_inquire_cred ,
59 .Nm gss_inquire_cred_by_mech ,
60 .Nm gss_inquire_mechs_for_name ,
61 .Nm gss_inquire_names_for_mech ,
62 .Nm gss_krb5_ccache_name ,
63 .Nm gss_krb5_compat_des3_mic ,
64 .Nm gss_krb5_copy_ccache ,
65 .Nm gss_krb5_import_cred
66 .Nm gsskrb5_extract_authz_data_from_sec_context ,
67 .Nm gsskrb5_register_acceptor_identity ,
68 .Nm gss_krb5_import_ccache ,
69 .Nm gss_krb5_get_tkt_flags ,
70 .Nm gss_process_context_token ,
71 .Nm gss_release_buffer ,
72 .Nm gss_release_cred ,
73 .Nm gss_release_name ,
74 .Nm gss_release_oid_set ,
77 .Nm gss_test_oid_set_member ,
83 .Nm gss_wrap_size_limit
84 .Nd Generic Security Service Application Program Interface library
86 GSS-API library (libgssapi, -lgssapi)
91 .Fo gss_accept_sec_context
92 .Fa "OM_uint32 * minor_status"
93 .Fa "gss_ctx_id_t * context_handle"
94 .Fa "const gss_cred_id_t acceptor_cred_handle"
95 .Fa "const gss_buffer_t input_token_buffer"
96 .Fa "const gss_channel_bindings_t input_chan_bindings"
97 .Fa "gss_name_t * src_name"
98 .Fa "gss_OID * mech_type"
99 .Fa "gss_buffer_t output_token"
100 .Fa "OM_uint32 * ret_flags"
101 .Fa "OM_uint32 * time_rec"
102 .Fa "gss_cred_id_t * delegated_cred_handle"
107 .Fa "OM_uint32 * minor_status"
108 .Fa "const gss_name_t desired_name"
109 .Fa "OM_uint32 time_req"
110 .Fa "const gss_OID_set desired_mechs"
111 .Fa "gss_cred_usage_t cred_usage"
112 .Fa "gss_cred_id_t * output_cred_handle"
113 .Fa "gss_OID_set * actual_mechs"
114 .Fa "OM_uint32 * time_rec"
118 .Fa "OM_uint32 *minor_status"
119 .Fa "const gss_cred_id_t input_cred_handle"
120 .Fa "const gss_name_t desired_name"
121 .Fa "const gss_OID desired_mech"
122 .Fa "gss_cred_usage_t cred_usage"
123 .Fa "OM_uint32 initiator_time_req"
124 .Fa "OM_uint32 acceptor_time_req"
125 .Fa "gss_cred_id_t *output_cred_handle"
126 .Fa "gss_OID_set *actual_mechs"
127 .Fa "OM_uint32 *initiator_time_rec"
128 .Fa "OM_uint32 *acceptor_time_rec"
131 .Fo gss_add_oid_set_member
132 .Fa "OM_uint32 * minor_status"
133 .Fa "const gss_OID member_oid"
134 .Fa "gss_OID_set * oid_set"
137 .Fo gss_canonicalize_name
138 .Fa "OM_uint32 * minor_status"
139 .Fa "const gss_name_t input_name"
140 .Fa "const gss_OID mech_type"
141 .Fa "gss_name_t * output_name"
145 .Fa "OM_uint32 * minor_status"
146 .Fa "const gss_name_t name1"
147 .Fa "const gss_name_t name2"
148 .Fa "int * name_equal"
152 .Fa "OM_uint32 * minor_status"
153 .Fa "const gss_ctx_id_t context_handle"
154 .Fa "OM_uint32 * time_rec"
157 .Fo gss_create_empty_oid_set
158 .Fa "OM_uint32 * minor_status"
159 .Fa "gss_OID_set * oid_set"
162 .Fo gss_delete_sec_context
163 .Fa "OM_uint32 * minor_status"
164 .Fa "gss_ctx_id_t * context_handle"
165 .Fa "gss_buffer_t output_token"
169 .Fa "OM_uint32 * minor_status"
170 .Fa "const gss_name_t input_name"
171 .Fa "gss_buffer_t output_name_buffer"
172 .Fa "gss_OID * output_name_type"
175 .Fo gss_display_status
176 .Fa "OM_uint32 *minor_status"
177 .Fa "OM_uint32 status_value"
178 .Fa "int status_type"
179 .Fa "const gss_OID mech_type"
180 .Fa "OM_uint32 *message_context"
181 .Fa "gss_buffer_t status_string"
184 .Fo gss_duplicate_name
185 .Fa "OM_uint32 * minor_status"
186 .Fa "const gss_name_t src_name"
187 .Fa "gss_name_t * dest_name"
191 .Fa "OM_uint32 * minor_status"
192 .Fa "const gss_name_t input_name"
193 .Fa "gss_buffer_t exported_name"
196 .Fo gss_export_sec_context
197 .Fa "OM_uint32 * minor_status"
198 .Fa "gss_ctx_id_t * context_handle"
199 .Fa "gss_buffer_t interprocess_token"
203 .Fa "OM_uint32 * minor_status"
204 .Fa "const gss_ctx_id_t context_handle"
205 .Fa "gss_qop_t qop_req"
206 .Fa "const gss_buffer_t message_buffer"
207 .Fa "gss_buffer_t message_token"
211 .Fa "OM_uint32 * minor_status"
212 .Fa "const gss_buffer_t input_name_buffer"
213 .Fa "const gss_OID input_name_type"
214 .Fa "gss_name_t * output_name"
217 .Fo gss_import_sec_context
218 .Fa "OM_uint32 * minor_status"
219 .Fa "const gss_buffer_t interprocess_token"
220 .Fa "gss_ctx_id_t * context_handle"
223 .Fo gss_indicate_mechs
224 .Fa "OM_uint32 * minor_status"
225 .Fa "gss_OID_set * mech_set"
228 .Fo gss_init_sec_context
229 .Fa "OM_uint32 * minor_status"
230 .Fa "const gss_cred_id_t initiator_cred_handle"
231 .Fa "gss_ctx_id_t * context_handle"
232 .Fa "const gss_name_t target_name"
233 .Fa "const gss_OID mech_type"
234 .Fa "OM_uint32 req_flags"
235 .Fa "OM_uint32 time_req"
236 .Fa "const gss_channel_bindings_t input_chan_bindings"
237 .Fa "const gss_buffer_t input_token"
238 .Fa "gss_OID * actual_mech_type"
239 .Fa "gss_buffer_t output_token"
240 .Fa "OM_uint32 * ret_flags"
241 .Fa "OM_uint32 * time_rec"
244 .Fo gss_inquire_context
245 .Fa "OM_uint32 * minor_status"
246 .Fa "const gss_ctx_id_t context_handle"
247 .Fa "gss_name_t * src_name"
248 .Fa "gss_name_t * targ_name"
249 .Fa "OM_uint32 * lifetime_rec"
250 .Fa "gss_OID * mech_type"
251 .Fa "OM_uint32 * ctx_flags"
252 .Fa "int * locally_initiated"
253 .Fa "int * open_context"
257 .Fa "OM_uint32 * minor_status"
258 .Fa "const gss_cred_id_t cred_handle"
259 .Fa "gss_name_t * name"
260 .Fa "OM_uint32 * lifetime"
261 .Fa "gss_cred_usage_t * cred_usage"
262 .Fa "gss_OID_set * mechanisms"
265 .Fo gss_inquire_cred_by_mech
266 .Fa "OM_uint32 * minor_status"
267 .Fa "const gss_cred_id_t cred_handle"
268 .Fa "const gss_OID mech_type"
269 .Fa "gss_name_t * name"
270 .Fa "OM_uint32 * initiator_lifetime"
271 .Fa "OM_uint32 * acceptor_lifetime"
272 .Fa "gss_cred_usage_t * cred_usage"
275 .Fo gss_inquire_mechs_for_name
276 .Fa "OM_uint32 * minor_status"
277 .Fa "const gss_name_t input_name"
278 .Fa "gss_OID_set * mech_types"
281 .Fo gss_inquire_names_for_mech
282 .Fa "OM_uint32 * minor_status"
283 .Fa "const gss_OID mechanism"
284 .Fa "gss_OID_set * name_types"
287 .Fo gss_krb5_ccache_name
288 .Fa "OM_uint32 *minor"
289 .Fa "const char *name"
290 .Fa "const char **old_name"
293 .Fo gss_krb5_copy_ccache
294 .Fa "OM_uint32 *minor"
295 .Fa "gss_cred_id_t cred"
296 .Fa "krb5_ccache out"
299 .Fo gss_krb5_import_cred
300 .Fa "OM_uint32 *minor_status"
302 .Fa "krb5_principal keytab_principal"
303 .Fa "krb5_keytab keytab"
304 .Fa "gss_cred_id_t *cred"
307 .Fo gss_krb5_compat_des3_mic
308 .Fa "OM_uint32 * minor_status"
309 .Fa "gss_ctx_id_t context_handle"
313 .Fo gsskrb5_extract_authz_data_from_sec_context
314 .Fa "OM_uint32 *minor_status"
315 .Fa "gss_ctx_id_t context_handle"
317 .Fa "gss_buffer_t ad_data"
320 .Fo gsskrb5_register_acceptor_identity
321 .Fa "const char *identity"
324 .Fo gss_krb5_import_cache
325 .Fa "OM_uint32 *minor"
327 .Fa "krb5_keytab keytab"
328 .Fa "gss_cred_id_t *cred"
331 .Fo gss_krb5_get_tkt_flags
332 .Fa "OM_uint32 *minor_status"
333 .Fa "gss_ctx_id_t context_handle"
334 .Fa "OM_uint32 *tkt_flags"
337 .Fo gss_process_context_token
338 .Fa "OM_uint32 * minor_status"
339 .Fa "const gss_ctx_id_t context_handle"
340 .Fa "const gss_buffer_t token_buffer"
343 .Fo gss_release_buffer
344 .Fa "OM_uint32 * minor_status"
345 .Fa "gss_buffer_t buffer"
349 .Fa "OM_uint32 * minor_status"
350 .Fa "gss_cred_id_t * cred_handle"
354 .Fa "OM_uint32 * minor_status"
355 .Fa "gss_name_t * input_name"
358 .Fo gss_release_oid_set
359 .Fa "OM_uint32 * minor_status"
360 .Fa "gss_OID_set * set"
364 .Fa "OM_uint32 * minor_status"
365 .Fa "gss_ctx_id_t context_handle"
366 .Fa "int conf_req_flag"
368 .Fa "gss_buffer_t input_message_buffer"
369 .Fa "int * conf_state"
370 .Fa "gss_buffer_t output_message_buffer"
374 .Fa "OM_uint32 * minor_status"
375 .Fa "gss_ctx_id_t context_handle"
377 .Fa "gss_buffer_t message_buffer"
378 .Fa "gss_buffer_t message_token"
381 .Fo gss_test_oid_set_member
382 .Fa "OM_uint32 * minor_status"
383 .Fa "const gss_OID member"
384 .Fa "const gss_OID_set set"
389 .Fa "OM_uint32 * minor_status"
390 .Fa "gss_ctx_id_t context_handle"
391 .Fa "gss_buffer_t input_message_buffer"
392 .Fa "gss_buffer_t output_message_buffer"
393 .Fa "int * conf_state"
394 .Fa "int * qop_state"
398 .Fa "OM_uint32 * minor_status"
399 .Fa "const gss_ctx_id_t context_handle"
400 .Fa "const gss_buffer_t input_message_buffer"
401 .Fa "gss_buffer_t output_message_buffer"
402 .Fa "int * conf_state"
403 .Fa "gss_qop_t * qop_state"
407 .Fa "OM_uint32 * minor_status"
408 .Fa "gss_ctx_id_t context_handle"
409 .Fa "gss_buffer_t message_buffer"
410 .Fa "gss_buffer_t token_buffer"
411 .Fa "int * qop_state"
415 .Fa "OM_uint32 * minor_status"
416 .Fa "const gss_ctx_id_t context_handle"
417 .Fa "const gss_buffer_t message_buffer"
418 .Fa "const gss_buffer_t token_buffer"
419 .Fa "gss_qop_t * qop_state"
423 .Fa "OM_uint32 * minor_status"
424 .Fa "const gss_ctx_id_t context_handle"
425 .Fa "int conf_req_flag"
426 .Fa "gss_qop_t qop_req"
427 .Fa "const gss_buffer_t input_message_buffer"
428 .Fa "int * conf_state"
429 .Fa "gss_buffer_t output_message_buffer"
432 .Fo gss_wrap_size_limit
433 .Fa "OM_uint32 * minor_status"
434 .Fa "const gss_ctx_id_t context_handle"
435 .Fa "int conf_req_flag"
436 .Fa "gss_qop_t qop_req"
437 .Fa "OM_uint32 req_output_size"
438 .Fa "OM_uint32 * max_input_size"
441 Generic Security Service API (GSS-API) version 2, and its C binding,
446 Version 1 (deprecated) of the C binding is described in
449 Heimdals GSS-API implementation supports the following mechanisms
452 .Li GSS_KRB5_MECHANISM
454 .Li GSS_SPNEGO_MECHANISM
457 GSS-API have generic name types that all mechanism are supposed to
458 implement (if possible):
461 .Li GSS_C_NT_USER_NAME
463 .Li GSS_C_NT_MACHINE_UID_NAME
465 .Li GSS_C_NT_STRING_UID_NAME
467 .Li GSS_C_NT_HOSTBASED_SERVICE
469 .Li GSS_C_NT_ANONYMOUS
471 .Li GSS_C_NT_EXPORT_NAME
474 GSS-API implementations that supports Kerberos 5 have some additional
478 .Li GSS_KRB5_NT_PRINCIPAL_NAME
480 .Li GSS_KRB5_NT_USER_NAME
482 .Li GSS_KRB5_NT_MACHINE_UID_NAME
484 .Li GSS_KRB5_NT_STRING_UID_NAME
487 In GSS-API, names have two forms, internal names and contiguous string
491 .Li Internal name and mechanism name
493 Internal names are implementation specific representation of
496 special form of internal names corresponds to one and only one mechanism.
498 In GSS-API an internal name is stored in a
501 .Li Contiguous string name and exported name
503 Contiguous string names are gssapi names stored in a
505 that together with a name type identifier (OID) uniquely specifies a
507 A special form of the contiguous string name is the exported name that
508 have a OID embedded in the string to make it unique.
509 Exported name have the nametype
510 .Dv GSS_C_NT_EXPORT_NAME .
512 In GSS-API an contiguous string name is stored in a
515 Exported names also have the property that they are specified by the
516 mechanism itself and compatible between different GSS-API
520 There are two ways of comparing GSS-API names, either comparing two
521 internal names with each other or two contiguous string names with
524 To compare two internal names with each other, import (if needed) the
527 into the GSS-API implementation and the compare the imported name with
528 .Fn gss_compare_name .
530 Importing names can be slow, so when its possible to store exported
531 names in the access control list, comparing contiguous string name
534 when comparing contiguous string name, first export them into a
535 .Dv GSS_C_NT_EXPORT_NAME
538 and then compare with
541 Note that there are might be a difference between the two methods of
544 .Fn gss_compare_name )
545 will compare to (unauthenticated) names are the same.
546 The second will compare if a mechanism will authenticate them as the
553 the default syntax is used for all mechanism the GSS-API
554 implementation supports.
555 When compare the imported name of
557 it may match serveral mechanism names (MN).
559 The resulting name from
561 must not be used for acccess control.
564 takes the gss name in
566 and puts a printable form in
567 .Fa output_name_buffer .
568 .Fa output_name_buffer
569 should be freed when done using
570 .Fn gss_release_buffer .
576 and will in the latter case contain the OID type of the name.
577 The name must only be used for printing.
578 If access control is needed, see section
581 .Fn gss_inquire_context
582 returns information about the context.
583 Information is available even after the context have expired.
587 (dont expire) or the number of seconds that the context is still valid.
588 A value of 0 means that the context is expired.
590 argument should be considered readonly and must not be released.
594 are both mechanims names and must be released with
599 will return the amount of time (in seconds) of the context is still
604 .Dv GSS_S_CONTEXT_EXPIRED
612 are part of the GSS-API V1 interface and are obsolete.
613 The functions should not be used for new applications.
614 They are provided so that version 1 applications can link against the
617 .Fn gss_krb5_ccache_name
618 sets the internal kerberos 5 credential cache name to
620 The old name is returned in
622 and must not be freed.
623 The data allocated for
625 is free upon next call to
626 .Fn gss_krb5_ccache_name .
627 This function is not threadsafe if
631 .Fn gss_krb5_copy_ccache
632 will extract the krb5 credentials that are transferred from the
633 initiator to the acceptor when using token delegation in the Kerberos
635 The acceptor receives the delegated token in the last argument to
636 .Fn gss_accept_sec_context .
638 .Fn gss_krb5_import_cred
639 will import the krb5 credentials (both keytab and/or credential cache)
640 into gss credential so it can be used withing GSS-API.
643 is copied by reference and thus shared, so if the credential is destroyed
645 .Fa krb5_cc_destroy ,
649 .Fn gss_krb5_import_ccache
652 .Fn gsskrb5_register_acceptor_identity
653 sets the Kerberos 5 filebased keytab that the acceptor will use. The
657 .Fn gsskrb5_extract_authz_data_from_sec_context
658 extracts the Kerberos authorizationdata that may be stored within the
660 Tha caller must free the returned buffer
663 .Fn gss_release_buffer
666 .Fn gss_krb5_get_tkt_flags
667 return the ticket flags for the kerberos ticket receive when
668 authenticating the initiator.
669 Only valid on the acceptor context.
671 .Fn gss_krb5_compat_des3_mic
672 turns on or off the compatibility with older version of Heimdal using
673 des3 get and verify mic, this is way to programmatically set the
674 [gssapi]broken_des3_mic and [gssapi]correct_des3_mic flags (see
675 COMPATIBILITY section in
678 .Dv GSS_C_KRB5_COMPAT_DES3_MIC
680 .Fn gss_krb5_compat_des3_mic
682 .Fn gss_krb5_compat_des3_mic
683 will be removed in a later version of the GSS-API library.