freebsd-skq/crypto/heimdal/lib/krb5/krb5_init_context.3
stas e7e0b34988 - Update FreeBSD Heimdal distribution to version 1.5.1. This also brings
several new kerberos related libraries and applications to FreeBSD:
  o kgetcred(1) allows one to manually get a ticket for a particular service.
  o kf(1) securily forwards ticket to another host through an authenticated
    and encrypted stream.
  o kcc(1) is an umbrella program around klist(1), kswitch(1), kgetcred(1)
    and other user kerberos operations. klist and kswitch are just symlinks
    to kcc(1) now.
  o kswitch(1) allows you to easily switch between kerberos credentials if
    you're running KCM.
  o hxtool(1) is a certificate management tool to use with PKINIT.
  o string2key(1) maps a password into key.
  o kdigest(8) is a userland tool to access the KDC's digest interface.
  o kimpersonate(8) creates a "fake" ticket for a service.

  We also now install manpages for some lirbaries that were not installed
  before, libheimntlm and libhx509.

- The new HEIMDAL version no longer supports Kerberos 4.  All users are
  recommended to switch to Kerberos 5.

- Weak ciphers are now disabled by default.  To enable DES support (used
  by telnet(8)), use "allow_weak_crypto" option in krb5.conf.

- libtelnet, pam_ksu and pam_krb5 are now compiled with error on warnings
  disabled due to the function they use (krb5_get_err_text(3)) being
  deprecated.  I plan to work on this next.

- Heimdal's KDC now require sqlite to operate.  We use the bundled version
  and install it as libheimsqlite.  If some other FreeBSD components will
  require it in the future we can rename it to libbsdsqlite and use for these
  components as well.

- This is not a latest Heimdal version, the new one was released while I was
  working on the update.  I will update it to 1.5.2 soon, as it fixes some
  important bugs and security issues.
2012-03-22 08:48:42 +00:00

309 lines
7.9 KiB
Groff

.\" Copyright (c) 2001 - 2004 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" 3. Neither the name of the Institute nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd December 8, 2004
.Dt KRB5_CONTEXT 3
.Os HEIMDAL
.Sh NAME
.Nm krb5_add_et_list ,
.Nm krb5_add_extra_addresses ,
.Nm krb5_add_ignore_addresses ,
.Nm krb5_context ,
.Nm krb5_free_config_files ,
.Nm krb5_free_context ,
.Nm krb5_get_default_config_files ,
.Nm krb5_get_dns_canonize_hostname ,
.Nm krb5_get_extra_addresses ,
.Nm krb5_get_fcache_version ,
.Nm krb5_get_ignore_addresses ,
.Nm krb5_get_kdc_sec_offset ,
.Nm krb5_get_max_time_skew ,
.Nm krb5_get_use_admin_kdc
.Nm krb5_init_context ,
.Nm krb5_init_ets ,
.Nm krb5_prepend_config_files ,
.Nm krb5_prepend_config_files_default ,
.Nm krb5_set_config_files ,
.Nm krb5_set_dns_canonize_hostname ,
.Nm krb5_set_extra_addresses ,
.Nm krb5_set_fcache_version ,
.Nm krb5_set_ignore_addresses ,
.Nm krb5_set_max_time_skew ,
.Nm krb5_set_use_admin_kdc ,
.Nd create, modify and delete krb5_context structures
.Sh LIBRARY
Kerberos 5 Library (libkrb5, -lkrb5)
.Sh SYNOPSIS
.In krb5.h
.Pp
.Li "struct krb5_context;"
.Pp
.Ft krb5_error_code
.Fo krb5_init_context
.Fa "krb5_context *context"
.Fc
.Ft void
.Fo krb5_free_context
.Fa "krb5_context context"
.Fc
.Ft void
.Fo krb5_init_ets
.Fa "krb5_context context"
.Fc
.Ft krb5_error_code
.Fo krb5_add_et_list
.Fa "krb5_context context"
.Fa "void (*func)(struct et_list **)"
.Fc
.Ft krb5_error_code
.Fo krb5_add_extra_addresses
.Fa "krb5_context context"
.Fa "krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_set_extra_addresses
.Fa "krb5_context context"
.Fa "const krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_get_extra_addresses
.Fa "krb5_context context"
.Fa "krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_add_ignore_addresses
.Fa "krb5_context context"
.Fa "krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_set_ignore_addresses
.Fa "krb5_context context"
.Fa "const krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_get_ignore_addresses
.Fa "krb5_context context"
.Fa "krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_set_fcache_version
.Fa "krb5_context context"
.Fa "int version"
.Fc
.Ft krb5_error_code
.Fo krb5_get_fcache_version
.Fa "krb5_context context"
.Fa "int *version"
.Fc
.Ft void
.Fo krb5_set_dns_canonize_hostname
.Fa "krb5_context context"
.Fa "krb5_boolean flag"
.Fc
.Ft krb5_boolean
.Fo krb5_get_dns_canonize_hostname
.Fa "krb5_context context"
.Fc
.Ft krb5_error_code
.Fo krb5_get_kdc_sec_offset
.Fa "krb5_context context"
.Fa "int32_t *sec"
.Fa "int32_t *usec"
.Fc
.Ft krb5_error_code
.Fo krb5_set_config_files
.Fa "krb5_context context"
.Fa "char **filenames"
.Fc
.Ft krb5_error_code
.Fo krb5_prepend_config_files
.Fa "const char *filelist"
.Fa "char **pq"
.Fa "char ***ret_pp"
.Fc
.Ft krb5_error_code
.Fo krb5_prepend_config_files_default
.Fa "const char *filelist"
.Fa "char ***pfilenames"
.Fc
.Ft krb5_error_code
.Fo krb5_get_default_config_files
.Fa "char ***pfilenames"
.Fc
.Ft void
.Fo krb5_free_config_files
.Fa "char **filenames"
.Fc
.Ft void
.Fo krb5_set_use_admin_kdc
.Fa "krb5_context context"
.Fa "krb5_boolean flag"
.Fc
.Ft krb5_boolean
.Fo krb5_get_use_admin_kdc
.Fa "krb5_context context"
.Fc
.Ft time_t
.Fo krb5_get_max_time_skew
.Fa "krb5_context context"
.Fc
.Ft krb5_error_code
.Fo krb5_set_max_time_skew
.Fa "krb5_context context"
.Fa "time_t time"
.Fc
.Sh DESCRIPTION
The
.Fn krb5_init_context
function initializes the
.Fa context
structure and reads the configuration file
.Pa /etc/krb5.conf .
.Pp
The structure should be freed by calling
.Fn krb5_free_context
when it is no longer being used.
.Pp
.Fn krb5_init_context
returns 0 to indicate success.
Otherwise an errno code is returned.
Failure means either that something bad happened during initialization
(typically
.Bq ENOMEM )
or that Kerberos should not be used
.Bq ENXIO .
.Pp
.Fn krb5_init_ets
adds all
.Xr com_err 3
libs to
.Fa context .
This is done by
.Fn krb5_init_context .
.Pp
.Fn krb5_add_et_list
adds a
.Xr com_err 3
error-code handler
.Fa func
to the specified
.Fa context .
The error handler must generated by the the re-rentrant version of the
.Xr compile_et 1
program.
.Fn krb5_add_extra_addresses
add a list of addresses that should be added when requesting tickets.
.Pp
.Fn krb5_add_ignore_addresses
add a list of addresses that should be ignored when requesting tickets.
.Pp
.Fn krb5_get_extra_addresses
get the list of addresses that should be added when requesting tickets.
.Pp
.Fn krb5_get_ignore_addresses
get the list of addresses that should be ignored when requesting tickets.
.Pp
.Fn krb5_set_ignore_addresses
set the list of addresses that should be ignored when requesting tickets.
.Pp
.Fn krb5_set_extra_addresses
set the list of addresses that should be added when requesting tickets.
.Pp
.Fn krb5_set_fcache_version
sets the version of file credentials caches that should be used.
.Pp
.Fn krb5_get_fcache_version
gets the version of file credentials caches that should be used.
.Pp
.Fn krb5_set_dns_canonize_hostname
sets if the context is configured to canonicalize hostnames using DNS.
.Pp
.Fn krb5_get_dns_canonize_hostname
returns if the context is configured to canonicalize hostnames using DNS.
.Pp
.Fn krb5_get_kdc_sec_offset
returns the offset between the localtime and the KDC's time.
.Fa sec
and
.Fa usec
are both optional argument and
.Dv NULL
can be passed in.
.Pp
.Fn krb5_set_config_files
set the list of configuration files to use and re-initialize the
configuration from the files.
.Pp
.Fn krb5_prepend_config_files
parse the
.Fa filelist
and prepend the result to the already existing list
.Fa pq
The result is returned in
.Fa ret_pp
and should be freed with
.Fn krb5_free_config_files .
.Pp
.Fn krb5_prepend_config_files_default
parse the
.Fa filelist
and append that to the default
list of configuration files.
.Pp
.Fn krb5_get_default_config_files
get a list of default configuration files.
.Pp
.Fn krb5_free_config_files
free a list of configuration files returned by
.Fn krb5_get_default_config_files ,
.Fn krb5_prepend_config_files_default ,
or
.Fn krb5_prepend_config_files .
.Pp
.Fn krb5_set_use_admin_kdc
sets if all KDC requests should go admin KDC.
.Pp
.Fn krb5_get_use_admin_kdc
gets if all KDC requests should go admin KDC.
.Pp
.Fn krb5_get_max_time_skew
and
.Fn krb5_set_max_time_skew
get and sets the maximum allowed time skew between client and server.
.Sh SEE ALSO
.Xr errno 2 ,
.Xr krb5 3 ,
.Xr krb5_config 3 ,
.Xr krb5_context 3 ,
.Xr kerberos 8