1.\" Copyright (c) 2003 Kungliga Tekniska H�gskolan 2.\" (Royal Institute of Technology, Stockholm, Sweden). 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 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. 15.\" 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. 19.\" 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 30.\" SUCH DAMAGE. 31.\" 32.\" $Id: gss_acquire_cred.3,v 1.8.2.1 2003/04/28 13:41:42 lha Exp $ 33.\" 34.Dd April 2, 2003 35.Dt GSS_ACQUIRE_CRED 3 36.Os HEIMDAL 37.Sh NAME 38.Nm gss_accept_sec_context , 39.Nm gss_acquire_cred , 40.Nm gss_add_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 , 50.Nm gss_export_name , 51.Nm gss_export_sec_context , 52.Nm gss_get_mic , 53.Nm gss_import_name , 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_copy_ccache , 63.Nm gss_krb5_compat_des3_mic , 64.Nm gss_process_context_token , 65.Nm gss_release_buffer , 66.Nm gss_release_cred , 67.Nm gss_release_name , 68.Nm gss_release_oid_set , 69.Nm gss_seal , 70.Nm gss_sign , 71.Nm gss_test_oid_set_member , 72.Nm gss_unseal , 73.Nm gss_unwrap , 74.Nm gss_verify , 75.Nm gss_verify_mic , 76.Nm gss_wrap , 77.Nm gss_wrap_size_limit 78.Nd Generic Security Service Application Program Interface library 79.Sh LIBRARY 80GSS-API library (libgssapi, -lgssapi) 81.Sh SYNOPSIS 82.In gssapi.h 83.Pp 84.Ft OM_uint32 85.Fo gss_accept_sec_context 86.Fa "OM_uint32 * minor_status" 87.Fa "gss_ctx_id_t * context_handle" 88.Fa "const gss_cred_id_t acceptor_cred_handle" 89.Fa "const gss_buffer_t input_token_buffer" 90.Fa "const gss_channel_bindings_t input_chan_bindings" 91.Fa "gss_name_t * src_name" 92.Fa "gss_OID * mech_type" 93.Fa "gss_buffer_t output_token" 94.Fa "OM_uint32 * ret_flags" 95.Fa "OM_uint32 * time_rec" 96.Fa "gss_cred_id_t * delegated_cred_handle" 97.Fc 98.Pp 99.Ft OM_uint32 100.Fo gss_acquire_cred 101.Fa "OM_uint32 * minor_status" 102.Fa "const gss_name_t desired_name" 103.Fa "OM_uint32 time_req" 104.Fa "const gss_OID_set desired_mechs" 105.Fa "gss_cred_usage_t cred_usage" 106.Fa "gss_cred_id_t * output_cred_handle" 107.Fa "gss_OID_set * actual_mechs" 108.Fa "OM_uint32 * time_rec" 109.Fc 110.\" .Fn gss_add_cred 111.Ft OM_uint32 112.Fo gss_add_oid_set_member 113.Fa "OM_uint32 * minor_status" 114.Fa "const gss_OID member_oid" 115.Fa "gss_OID_set * oid_set" 116.Fc 117.Ft OM_uint32 118.Fo gss_canonicalize_name 119.Fa "OM_uint32 * minor_status" 120.Fa "const gss_name_t input_name" 121.Fa "const gss_OID mech_type" 122.Fa "gss_name_t * output_name" 123.Fc 124.Ft OM_uint32 125.Fo gss_compare_name 126.Fa "OM_uint32 * minor_status" 127.Fa "const gss_name_t name1" 128.Fa "const gss_name_t name2" 129.Fa "int * name_equal" 130.Fc 131.Ft OM_uint32 132.Fo gss_context_time 133.Fa "OM_uint32 * minor_status" 134.Fa "const gss_ctx_id_t context_handle" 135.Fa "OM_uint32 * time_rec" 136.Fc 137.Ft OM_uint32 138.Fo gss_create_empty_oid_set 139.Fa "OM_uint32 * minor_status" 140.Fa "gss_OID_set * oid_set" 141.Fc 142.Ft OM_uint32 143.Fo gss_delete_sec_context 144.Fa "OM_uint32 * minor_status" 145.Fa "gss_ctx_id_t * context_handle" 146.Fa "gss_buffer_t output_token" 147.Fc 148.Ft OM_uint32 149.Fo gss_display_name 150.Fa "OM_uint32 * minor_status" 151.Fa "const gss_name_t input_name" 152.Fa "gss_buffer_t output_name_buffer" 153.Fa "gss_OID * output_name_type" 154.Fc 155.Ft OM_uint32 156.Fo gss_display_status 157.Fa "OM_uint32 *minor_status" 158.Fa "OM_uint32 status_value" 159.Fa "int status_type" 160.Fa "const gss_OID mech_type" 161.Fa "OM_uint32 *message_context" 162.Fa "gss_buffer_t status_string" 163.Fc 164.Ft OM_uint32 165.Fo gss_duplicate_name 166.Fa "OM_uint32 * minor_status" 167.Fa "const gss_name_t src_name" 168.Fa "gss_name_t * dest_name" 169.Fc 170.Ft OM_uint32 171.Fo gss_export_name 172.Fa "OM_uint32 * minor_status" 173.Fa "const gss_name_t input_name" 174.Fa "gss_buffer_t exported_name" 175.Fc 176.Ft OM_uint32 177.Fo gss_export_sec_context 178.Fa "OM_uint32 * minor_status" 179.Fa "gss_ctx_id_t * context_handle" 180.Fa "gss_buffer_t interprocess_token" 181.Fc 182.Ft OM_uint32 183.Fo gss_get_mic 184.Fa "OM_uint32 * minor_status" 185.Fa "const gss_ctx_id_t context_handle" 186.Fa "gss_qop_t qop_req" 187.Fa "const gss_buffer_t message_buffer" 188.Fa "gss_buffer_t message_token" 189.Fc 190.Ft OM_uint32 191.Fo gss_import_name 192.Fa "OM_uint32 * minor_status, 193.Fa "const gss_buffer_t input_name_buffer" 194.Fa "const gss_OID input_name_type" 195.Fa "gss_name_t * output_name" 196.Fc 197.Ft OM_uint32 198.Fo gss_import_sec_context 199.Fa "OM_uint32 * minor_status" 200.Fa "const gss_buffer_t interprocess_token" 201.Fa "gss_ctx_id_t * context_handle" 202.Fc 203.Ft OM_uint32 204.Fo gss_indicate_mechs 205.Fa "OM_uint32 * minor_status" 206.Fa "gss_OID_set * mech_set" 207.Fc 208.Ft OM_uint32 209.Fo gss_init_sec_context 210.Fa "OM_uint32 * minor_status" 211.Fa "const gss_cred_id_t initiator_cred_handle" 212.Fa "gss_ctx_id_t * context_handle" 213.Fa "const gss_name_t target_name" 214.Fa "const gss_OID mech_type" 215.Fa "OM_uint32 req_flags" 216.Fa "OM_uint32 time_req" 217.Fa "const gss_channel_bindings_t input_chan_bindings" 218.Fa "const gss_buffer_t input_token" 219.Fa "gss_OID * actual_mech_type" 220.Fa "gss_buffer_t output_token" 221.Fa "OM_uint32 * ret_flags" 222.Fa "OM_uint32 * time_rec" 223.Fc 224.Ft OM_uint32 225.Fo gss_inquire_context 226.Fa "OM_uint32 * minor_status" 227.Fa "const gss_ctx_id_t context_handle" 228.Fa "gss_name_t * src_name" 229.Fa "gss_name_t * targ_name" 230.Fa "OM_uint32 * lifetime_rec" 231.Fa "gss_OID * mech_type" 232.Fa "OM_uint32 * ctx_flags" 233.Fa "int * locally_initiated" 234.Fa "int * open_context" 235.Fc 236.Ft OM_uint32 237.Fo gss_inquire_cred 238.Fa "OM_uint32 * minor_status" 239.Fa "const gss_cred_id_t cred_handle" 240.Fa "gss_name_t * name" 241.Fa "OM_uint32 * lifetime" 242.Fa "gss_cred_usage_t * cred_usage" 243.Fa "gss_OID_set * mechanisms" 244.Fc 245.Ft OM_uint32 246.Fo gss_inquire_cred_by_mech 247.Fc 248.Ft OM_uint32 249.Fo gss_inquire_mechs_for_name 250.Fc 251.Ft OM_uint32 252.Fo gss_inquire_names_for_mech 253.Fc 254.Ft OM_uint32 255.Fo gss_krb5_copy_ccache 256.Fa "OM_uint32 *minor" 257.Fa "gss_cred_id_t cred" 258.Fa "krb5_ccache out" 259.Fc 260.Ft OM_uint32 261.Fo gss_krb5_compat_des3_mic 262.Fa "OM_uint32 * minor_status" 263.Fa "gss_ctx_id_t context_handle" 264.Fa "int onoff" 265.Fc 266.Ft OM_uint32 267.Fo gss_process_context_token 268.Fc 269.Ft OM_uint32 270.Fo gss_release_buffer 271.Fa "OM_uint32 * minor_status" 272.Fa "gss_buffer_t buffer" 273.Fc 274.Ft OM_uint32 275.Fo gss_release_cred 276.Fa "OM_uint32 * minor_status" 277.Fa "gss_cred_id_t * cred_handle" 278.Fc 279.Ft OM_uint32 280.Fo gss_release_name 281.Fa "OM_uint32 * minor_status" 282.Fa "gss_name_t * input_name" 283.Fc 284.Ft 285.Fo gss_release_oid_set 286.Fa "OM_uint32 * minor_status" 287.Fa "gss_OID_set * set" 288.Fc 289.Ft OM_uint32 290.Fo gss_seal 291.Fa "OM_uint32 * minor_status" 292.Fa "gss_ctx_id_t context_handle" 293.Fa "int conf_req_flag" 294.Fa "int qop_req" 295.Fa "gss_buffer_t input_message_buffer" 296.Fa "int * conf_state" 297.Fa "gss_buffer_t output_message_buffer" 298.Fc 299.Ft OM_uint32 300.Fo gss_sign 301.Fa "OM_uint32 * minor_status" 302.Fa "gss_ctx_id_t context_handle" 303.Fa "int qop_req" 304.Fa "gss_buffer_t message_buffer" 305.Fa "gss_buffer_t message_token" 306.Fc 307.Ft OM_uint32 308.Fo gss_test_oid_set_member 309.Fa "OM_uint32 * minor_status" 310.Fa "const gss_OID member" 311.Fa "const gss_OID_set set" 312.Fa "int * present" 313.Fc 314.Ft OM_uint32 315.Fo gss_unseal 316.Fa "OM_uint32 * minor_status" 317.Fa "gss_ctx_id_t context_handle" 318.Fa "gss_buffer_t input_message_buffer" 319.Fa "gss_buffer_t output_message_buffer" 320.Fa "int * conf_state" 321.Fa "int * qop_state" 322.Fc 323.Ft OM_uint32 324.Fo gss_unwrap 325.Fa "OM_uint32 * minor_status" 326.Fa "const gss_ctx_id_t context_handle" 327.Fa "const gss_buffer_t input_message_buffer" 328.Fa "gss_buffer_t output_message_buffer" 329.Fa "int * conf_state" 330.Fa "gss_qop_t * qop_state" 331.Fc 332.Ft OM_uint32 333.Fo gss_verify 334.Fa "OM_uint32 * minor_status" 335.Fa "gss_ctx_id_t context_handle" 336.Fa "gss_buffer_t message_buffer" 337.Fa "gss_buffer_t token_buffer" 338.Fa "int * qop_state" 339.Fc 340.Ft OM_uint32 341.Fo gss_verify_mic 342.Fa "OM_uint32 * minor_status" 343.Fa "const gss_ctx_id_t context_handle" 344.Fa "const gss_buffer_t message_buffer" 345.Fa "const gss_buffer_t token_buffer" 346.Fa "gss_qop_t * qop_state" 347.Fc 348.Ft 349.Fo gss_wrap 350.Fa "OM_uint32 * minor_status" 351.Fa "const gss_ctx_id_t context_handle" 352.Fa "int conf_req_flag" 353.Fa "gss_qop_t qop_req" 354.Fa "const gss_buffer_t input_message_buffer" 355.Fa "int * conf_state" 356.Fa "gss_buffer_t output_message_buffer" 357.Fc 358.Ft OM_uint32 359.Fo gss_wrap_size_limit 360.Fa "OM_uint32 * minor_status" 361.Fa "const gss_ctx_id_t context_handle" 362.Fa "int conf_req_flag" 363.Fa "gss_qop_t qop_req" 364.Fa "OM_uint32 req_output_size" 365.Fa "OM_uint32 * max_input_size" 366.Fc 367.Sh DESCRIPTION 368Generic Security Service API (GSS-API) version 2, and its C binding, 369is described in 370.Li RFC2743 371and 372.Li RFC2744 . 373Version 1 (deprecated) of the C binding is described in 374.Li RFC1509 . 375.Pp 376Heimdals GSS-API implementation supports the following mechanisms 377.Bl -bullet 378.It 379.Li GSS_KRB5_MECHANISM 380.El 381.Pp 382GSS-API have generic name types that all mechanism are supposed to 383implement (if possible) 384.Bl -bullet 385.It 386.Li GSS_C_NT_USER_NAME 387.It 388.Li GSS_C_NT_MACHINE_UID_NAME 389.It 390.Li GSS_C_NT_STRING_UID_NAME 391.It 392.Li GSS_C_NT_HOSTBASED_SERVICE 393.It 394.Li GSS_C_NT_ANONYMOUS 395.It 396.Li GSS_C_NT_EXPORT_NAME 397.El 398.Pp 399GSS-API implementations that supports Kerberos 5 have some additional 400name types 401.Bl -bullet 402.It 403.Li GSS_KRB5_NT_PRINCIPAL_NAME 404.It 405.Li GSS_KRB5_NT_USER_NAME 406.It 407.Li GSS_KRB5_NT_MACHINE_UID_NAME 408.It 409.Li GSS_KRB5_NT_STRING_UID_NAME 410.El 411.Pp 412.Fn gss_display_name 413takes the gss name in 414.Fa input_name 415and put a printable form in 416.Fa output_name_buffer . 417.Fa output_name_buffer 418should be freed when done using 419.Fn gss_release_buffer . 420.Fa output_name_type 421can either be 422.Dv NULL 423or a pointer to a 424.Li gss_OID 425and will in the later case contain the OID type of the name. 426The name should only be used for printing. 427Access control should be done with the result of 428.Fn gss_export_name . 429.Pp 430.Fn gss_sign , 431.Fn gss_verify , 432.Fn gss_seal , 433and 434.Fn gss_unseal 435are part of the GSS-API V1 interface and are obsolete. The functions 436should not be used for new applications. 437They are provided so that version 1 applications can link against the 438library. 439.Pp 440.Fn gss_krb5_copy_ccache 441is an extension to the GSS-API API. 442The function will extract the krb5 credential that are transfered from 443the initiator to the acceptor when using token delegation in the 444Kerberos mechanism. 445The acceptor receives the delegated token in the last argument to 446.Fn gss_accept_sec_context . 447.Pp 448.Nm gss_krb5_compat_des3_mic 449turns on or off the compatibly with older version of Heimdal using 450des3 get and verify mic, this is way to programmatically set the 451[gssapi]broken_des3_mic and [gssapi]correct_des3_mic flags (see 452COMPATIBILITY section in 453.Xr gssapi 3 ) . 454If the CPP symbol 455.Dv GSS_C_KRB5_COMPAT_DES3_MIC 456is present, 457.Nm gss_krb5_compat_des3_mic 458exists. 459.Nm gss_krb5_compat_des3_mic 460will be removed in a later version of the GSS-API library. 461.Sh SEE ALSO 462.Xr krb5 3 , 463.Xr krb5_ccache 3 , 464.Xr gssapi 3 , 465.Xr kerberos 8 466