xref: /minix3/crypto/external/bsd/heimdal/dist/lib/krb5/krb5_init_context.3 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\"	$NetBSD: krb5_init_context.3,v 1.3 2014/04/24 13:45:34 pettai Exp $
2ebfedea0SLionel Sambuc.\"
3ebfedea0SLionel Sambuc.\" Copyright (c) 2001 - 2004 Kungliga Tekniska Högskolan
4ebfedea0SLionel Sambuc.\" (Royal Institute of Technology, Stockholm, Sweden).
5ebfedea0SLionel Sambuc.\" All rights reserved.
6ebfedea0SLionel Sambuc.\"
7ebfedea0SLionel Sambuc.\" Redistribution and use in source and binary forms, with or without
8ebfedea0SLionel Sambuc.\" modification, are permitted provided that the following conditions
9ebfedea0SLionel Sambuc.\" are met:
10ebfedea0SLionel Sambuc.\"
11ebfedea0SLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright
12ebfedea0SLionel Sambuc.\"    notice, this list of conditions and the following disclaimer.
13ebfedea0SLionel Sambuc.\"
14ebfedea0SLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright
15ebfedea0SLionel Sambuc.\"    notice, this list of conditions and the following disclaimer in the
16ebfedea0SLionel Sambuc.\"    documentation and/or other materials provided with the distribution.
17ebfedea0SLionel Sambuc.\"
18ebfedea0SLionel Sambuc.\" 3. Neither the name of the Institute nor the names of its contributors
19ebfedea0SLionel Sambuc.\"    may be used to endorse or promote products derived from this software
20ebfedea0SLionel Sambuc.\"    without specific prior written permission.
21ebfedea0SLionel Sambuc.\"
22ebfedea0SLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
23ebfedea0SLionel Sambuc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24ebfedea0SLionel Sambuc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25ebfedea0SLionel Sambuc.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
26ebfedea0SLionel Sambuc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27ebfedea0SLionel Sambuc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28ebfedea0SLionel Sambuc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29ebfedea0SLionel Sambuc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30ebfedea0SLionel Sambuc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31ebfedea0SLionel Sambuc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32ebfedea0SLionel Sambuc.\" SUCH DAMAGE.
33ebfedea0SLionel Sambuc.\"
34ebfedea0SLionel Sambuc.\" Id
35ebfedea0SLionel Sambuc.\"
36ebfedea0SLionel Sambuc.Dd December  8, 2004
37ebfedea0SLionel Sambuc.Dt KRB5_CONTEXT 3
38ebfedea0SLionel Sambuc.Os
39ebfedea0SLionel Sambuc.Sh NAME
40ebfedea0SLionel Sambuc.Nm krb5_add_et_list ,
41ebfedea0SLionel Sambuc.Nm krb5_add_extra_addresses ,
42ebfedea0SLionel Sambuc.Nm krb5_add_ignore_addresses ,
43ebfedea0SLionel Sambuc.Nm krb5_context ,
44ebfedea0SLionel Sambuc.Nm krb5_free_config_files ,
45ebfedea0SLionel Sambuc.Nm krb5_free_context ,
46ebfedea0SLionel Sambuc.Nm krb5_get_default_config_files ,
47ebfedea0SLionel Sambuc.Nm krb5_get_dns_canonize_hostname ,
48ebfedea0SLionel Sambuc.Nm krb5_get_extra_addresses ,
49ebfedea0SLionel Sambuc.Nm krb5_get_fcache_version ,
50ebfedea0SLionel Sambuc.Nm krb5_get_ignore_addresses ,
51ebfedea0SLionel Sambuc.Nm krb5_get_kdc_sec_offset ,
52ebfedea0SLionel Sambuc.Nm krb5_get_max_time_skew ,
53ebfedea0SLionel Sambuc.Nm krb5_get_use_admin_kdc
54ebfedea0SLionel Sambuc.Nm krb5_init_context ,
55ebfedea0SLionel Sambuc.Nm krb5_init_ets ,
56ebfedea0SLionel Sambuc.Nm krb5_prepend_config_files ,
57ebfedea0SLionel Sambuc.Nm krb5_prepend_config_files_default ,
58ebfedea0SLionel Sambuc.Nm krb5_set_config_files ,
59ebfedea0SLionel Sambuc.Nm krb5_set_dns_canonize_hostname ,
60ebfedea0SLionel Sambuc.Nm krb5_set_extra_addresses ,
61ebfedea0SLionel Sambuc.Nm krb5_set_fcache_version ,
62ebfedea0SLionel Sambuc.Nm krb5_set_ignore_addresses ,
63ebfedea0SLionel Sambuc.Nm krb5_set_max_time_skew ,
64ebfedea0SLionel Sambuc.Nm krb5_set_use_admin_kdc ,
65ebfedea0SLionel Sambuc.Nd create, modify and delete krb5_context structures
66ebfedea0SLionel Sambuc.Sh LIBRARY
67ebfedea0SLionel SambucKerberos 5 Library (libkrb5, -lkrb5)
68ebfedea0SLionel Sambuc.Sh SYNOPSIS
69ebfedea0SLionel Sambuc.In krb5/krb5.h
70ebfedea0SLionel Sambuc.Pp
71ebfedea0SLionel Sambuc.Li "struct krb5_context;"
72ebfedea0SLionel Sambuc.Pp
73ebfedea0SLionel Sambuc.Ft krb5_error_code
74ebfedea0SLionel Sambuc.Fo krb5_init_context
75ebfedea0SLionel Sambuc.Fa "krb5_context *context"
76ebfedea0SLionel Sambuc.Fc
77ebfedea0SLionel Sambuc.Ft void
78ebfedea0SLionel Sambuc.Fo krb5_free_context
79ebfedea0SLionel Sambuc.Fa "krb5_context context"
80ebfedea0SLionel Sambuc.Fc
81ebfedea0SLionel Sambuc.Ft void
82ebfedea0SLionel Sambuc.Fo krb5_init_ets
83ebfedea0SLionel Sambuc.Fa "krb5_context context"
84ebfedea0SLionel Sambuc.Fc
85ebfedea0SLionel Sambuc.Ft krb5_error_code
86ebfedea0SLionel Sambuc.Fo krb5_add_et_list
87ebfedea0SLionel Sambuc.Fa "krb5_context context"
88ebfedea0SLionel Sambuc.Fa "void (*func)(struct et_list **)"
89ebfedea0SLionel Sambuc.Fc
90ebfedea0SLionel Sambuc.Ft krb5_error_code
91ebfedea0SLionel Sambuc.Fo krb5_add_extra_addresses
92ebfedea0SLionel Sambuc.Fa "krb5_context context"
93ebfedea0SLionel Sambuc.Fa "krb5_addresses *addresses"
94ebfedea0SLionel Sambuc.Fc
95ebfedea0SLionel Sambuc.Ft krb5_error_code
96ebfedea0SLionel Sambuc.Fo krb5_set_extra_addresses
97ebfedea0SLionel Sambuc.Fa "krb5_context context"
98ebfedea0SLionel Sambuc.Fa "const krb5_addresses *addresses"
99ebfedea0SLionel Sambuc.Fc
100ebfedea0SLionel Sambuc.Ft krb5_error_code
101ebfedea0SLionel Sambuc.Fo krb5_get_extra_addresses
102ebfedea0SLionel Sambuc.Fa "krb5_context context"
103ebfedea0SLionel Sambuc.Fa "krb5_addresses *addresses"
104ebfedea0SLionel Sambuc.Fc
105ebfedea0SLionel Sambuc.Ft krb5_error_code
106ebfedea0SLionel Sambuc.Fo krb5_add_ignore_addresses
107ebfedea0SLionel Sambuc.Fa "krb5_context context"
108ebfedea0SLionel Sambuc.Fa "krb5_addresses *addresses"
109ebfedea0SLionel Sambuc.Fc
110ebfedea0SLionel Sambuc.Ft krb5_error_code
111ebfedea0SLionel Sambuc.Fo krb5_set_ignore_addresses
112ebfedea0SLionel Sambuc.Fa "krb5_context context"
113ebfedea0SLionel Sambuc.Fa "const krb5_addresses *addresses"
114ebfedea0SLionel Sambuc.Fc
115ebfedea0SLionel Sambuc.Ft krb5_error_code
116ebfedea0SLionel Sambuc.Fo krb5_get_ignore_addresses
117ebfedea0SLionel Sambuc.Fa "krb5_context context"
118ebfedea0SLionel Sambuc.Fa "krb5_addresses *addresses"
119ebfedea0SLionel Sambuc.Fc
120ebfedea0SLionel Sambuc.Ft krb5_error_code
121ebfedea0SLionel Sambuc.Fo krb5_set_fcache_version
122ebfedea0SLionel Sambuc.Fa "krb5_context context"
123ebfedea0SLionel Sambuc.Fa "int version"
124ebfedea0SLionel Sambuc.Fc
125ebfedea0SLionel Sambuc.Ft krb5_error_code
126ebfedea0SLionel Sambuc.Fo krb5_get_fcache_version
127ebfedea0SLionel Sambuc.Fa "krb5_context context"
128ebfedea0SLionel Sambuc.Fa "int *version"
129ebfedea0SLionel Sambuc.Fc
130ebfedea0SLionel Sambuc.Ft void
131ebfedea0SLionel Sambuc.Fo krb5_set_dns_canonize_hostname
132ebfedea0SLionel Sambuc.Fa "krb5_context context"
133ebfedea0SLionel Sambuc.Fa "krb5_boolean flag"
134ebfedea0SLionel Sambuc.Fc
135ebfedea0SLionel Sambuc.Ft krb5_boolean
136ebfedea0SLionel Sambuc.Fo krb5_get_dns_canonize_hostname
137ebfedea0SLionel Sambuc.Fa "krb5_context context"
138ebfedea0SLionel Sambuc.Fc
139ebfedea0SLionel Sambuc.Ft krb5_error_code
140ebfedea0SLionel Sambuc.Fo krb5_get_kdc_sec_offset
141ebfedea0SLionel Sambuc.Fa "krb5_context context"
142ebfedea0SLionel Sambuc.Fa "int32_t *sec"
143ebfedea0SLionel Sambuc.Fa "int32_t *usec"
144ebfedea0SLionel Sambuc.Fc
145ebfedea0SLionel Sambuc.Ft krb5_error_code
146ebfedea0SLionel Sambuc.Fo krb5_set_config_files
147ebfedea0SLionel Sambuc.Fa "krb5_context context"
148ebfedea0SLionel Sambuc.Fa "char **filenames"
149ebfedea0SLionel Sambuc.Fc
150ebfedea0SLionel Sambuc.Ft krb5_error_code
151ebfedea0SLionel Sambuc.Fo krb5_prepend_config_files
152ebfedea0SLionel Sambuc.Fa "const char *filelist"
153ebfedea0SLionel Sambuc.Fa "char **pq"
154ebfedea0SLionel Sambuc.Fa "char ***ret_pp"
155ebfedea0SLionel Sambuc.Fc
156ebfedea0SLionel Sambuc.Ft krb5_error_code
157ebfedea0SLionel Sambuc.Fo krb5_prepend_config_files_default
158ebfedea0SLionel Sambuc.Fa "const char *filelist"
159ebfedea0SLionel Sambuc.Fa "char ***pfilenames"
160ebfedea0SLionel Sambuc.Fc
161ebfedea0SLionel Sambuc.Ft krb5_error_code
162ebfedea0SLionel Sambuc.Fo krb5_get_default_config_files
163ebfedea0SLionel Sambuc.Fa "char ***pfilenames"
164ebfedea0SLionel Sambuc.Fc
165ebfedea0SLionel Sambuc.Ft void
166ebfedea0SLionel Sambuc.Fo krb5_free_config_files
167ebfedea0SLionel Sambuc.Fa "char **filenames"
168ebfedea0SLionel Sambuc.Fc
169ebfedea0SLionel Sambuc.Ft void
170ebfedea0SLionel Sambuc.Fo krb5_set_use_admin_kdc
171ebfedea0SLionel Sambuc.Fa "krb5_context context"
172ebfedea0SLionel Sambuc.Fa "krb5_boolean flag"
173ebfedea0SLionel Sambuc.Fc
174ebfedea0SLionel Sambuc.Ft krb5_boolean
175ebfedea0SLionel Sambuc.Fo krb5_get_use_admin_kdc
176ebfedea0SLionel Sambuc.Fa "krb5_context context"
177ebfedea0SLionel Sambuc.Fc
178ebfedea0SLionel Sambuc.Ft time_t
179ebfedea0SLionel Sambuc.Fo krb5_get_max_time_skew
180ebfedea0SLionel Sambuc.Fa "krb5_context context"
181ebfedea0SLionel Sambuc.Fc
182ebfedea0SLionel Sambuc.Ft krb5_error_code
183ebfedea0SLionel Sambuc.Fo krb5_set_max_time_skew
184ebfedea0SLionel Sambuc.Fa "krb5_context context"
185ebfedea0SLionel Sambuc.Fa "time_t time"
186ebfedea0SLionel Sambuc.Fc
187ebfedea0SLionel Sambuc.Sh DESCRIPTION
188ebfedea0SLionel SambucThe
189ebfedea0SLionel Sambuc.Fn krb5_init_context
190ebfedea0SLionel Sambucfunction initializes the
191ebfedea0SLionel Sambuc.Fa context
192ebfedea0SLionel Sambucstructure and reads the configuration file
193ebfedea0SLionel Sambuc.Pa /etc/krb5.conf .
194ebfedea0SLionel Sambuc.Pp
195ebfedea0SLionel SambucThe structure should be freed by calling
196ebfedea0SLionel Sambuc.Fn krb5_free_context
197ebfedea0SLionel Sambucwhen it is no longer being used.
198ebfedea0SLionel Sambuc.Pp
199ebfedea0SLionel Sambuc.Fn krb5_init_context
200ebfedea0SLionel Sambucreturns 0 to indicate success.
201ebfedea0SLionel SambucOtherwise an errno code is returned.
202ebfedea0SLionel SambucFailure means either that something bad happened during initialization
203ebfedea0SLionel Sambuc(typically
204ebfedea0SLionel Sambuc.Bq ENOMEM )
205ebfedea0SLionel Sambucor that Kerberos should not be used
206ebfedea0SLionel Sambuc.Bq ENXIO .
207ebfedea0SLionel Sambuc.Pp
208ebfedea0SLionel Sambuc.Fn krb5_init_ets
209ebfedea0SLionel Sambucadds all
210ebfedea0SLionel Sambuc.Xr com_err 3
211ebfedea0SLionel Sambuclibs to
212ebfedea0SLionel Sambuc.Fa context .
213ebfedea0SLionel SambucThis is done by
214ebfedea0SLionel Sambuc.Fn krb5_init_context .
215ebfedea0SLionel Sambuc.Pp
216ebfedea0SLionel Sambuc.Fn krb5_add_et_list
217ebfedea0SLionel Sambucadds a
218ebfedea0SLionel Sambuc.Xr com_err 3
219ebfedea0SLionel Sambucerror-code handler
220ebfedea0SLionel Sambuc.Fa func
221ebfedea0SLionel Sambucto the specified
222ebfedea0SLionel Sambuc.Fa context .
223ebfedea0SLionel SambucThe error handler must generated by the the re-rentrant version of the
224ebfedea0SLionel Sambuc.Xr compile_et 1
225ebfedea0SLionel Sambucprogram.
226ebfedea0SLionel Sambuc.Fn krb5_add_extra_addresses
227ebfedea0SLionel Sambucadd a list of addresses that should be added when requesting tickets.
228ebfedea0SLionel Sambuc.Pp
229ebfedea0SLionel Sambuc.Fn krb5_add_ignore_addresses
230ebfedea0SLionel Sambucadd a list of addresses that should be ignored when requesting tickets.
231ebfedea0SLionel Sambuc.Pp
232ebfedea0SLionel Sambuc.Fn krb5_get_extra_addresses
233ebfedea0SLionel Sambucget the list of addresses that should be added when requesting tickets.
234ebfedea0SLionel Sambuc.Pp
235ebfedea0SLionel Sambuc.Fn krb5_get_ignore_addresses
236ebfedea0SLionel Sambucget the list of addresses that should be ignored when requesting tickets.
237ebfedea0SLionel Sambuc.Pp
238ebfedea0SLionel Sambuc.Fn krb5_set_ignore_addresses
239ebfedea0SLionel Sambucset the list of addresses that should be ignored when requesting tickets.
240ebfedea0SLionel Sambuc.Pp
241ebfedea0SLionel Sambuc.Fn krb5_set_extra_addresses
242ebfedea0SLionel Sambucset the list of addresses that should be added when requesting tickets.
243ebfedea0SLionel Sambuc.Pp
244ebfedea0SLionel Sambuc.Fn krb5_set_fcache_version
245ebfedea0SLionel Sambucsets the version of file credentials caches that should be used.
246ebfedea0SLionel Sambuc.Pp
247ebfedea0SLionel Sambuc.Fn krb5_get_fcache_version
248ebfedea0SLionel Sambucgets the version of file credentials caches that should be used.
249ebfedea0SLionel Sambuc.Pp
250ebfedea0SLionel Sambuc.Fn krb5_set_dns_canonize_hostname
251ebfedea0SLionel Sambucsets if the context is configured to canonicalize hostnames using DNS.
252ebfedea0SLionel Sambuc.Pp
253ebfedea0SLionel Sambuc.Fn krb5_get_dns_canonize_hostname
254ebfedea0SLionel Sambucreturns if the context is configured to canonicalize hostnames using DNS.
255ebfedea0SLionel Sambuc.Pp
256ebfedea0SLionel Sambuc.Fn krb5_get_kdc_sec_offset
257ebfedea0SLionel Sambucreturns the offset between the localtime and the KDC's time.
258ebfedea0SLionel Sambuc.Fa sec
259ebfedea0SLionel Sambucand
260ebfedea0SLionel Sambuc.Fa usec
261ebfedea0SLionel Sambucare both optional argument and
262ebfedea0SLionel Sambuc.Dv NULL
263ebfedea0SLionel Sambuccan be passed in.
264ebfedea0SLionel Sambuc.Pp
265ebfedea0SLionel Sambuc.Fn krb5_set_config_files
266ebfedea0SLionel Sambucset the list of configuration files to use and re-initialize the
267ebfedea0SLionel Sambucconfiguration from the files.
268ebfedea0SLionel Sambuc.Pp
269ebfedea0SLionel Sambuc.Fn krb5_prepend_config_files
270ebfedea0SLionel Sambucparse the
271ebfedea0SLionel Sambuc.Fa filelist
272ebfedea0SLionel Sambucand prepend the result to the already existing list
273ebfedea0SLionel Sambuc.Fa pq
274ebfedea0SLionel SambucThe result is returned in
275ebfedea0SLionel Sambuc.Fa ret_pp
276ebfedea0SLionel Sambucand should be freed with
277ebfedea0SLionel Sambuc.Fn krb5_free_config_files .
278ebfedea0SLionel Sambuc.Pp
279ebfedea0SLionel Sambuc.Fn krb5_prepend_config_files_default
280ebfedea0SLionel Sambucparse the
281ebfedea0SLionel Sambuc.Fa filelist
282ebfedea0SLionel Sambucand append that to the default
283ebfedea0SLionel Sambuclist of configuration files.
284ebfedea0SLionel Sambuc.Pp
285ebfedea0SLionel Sambuc.Fn krb5_get_default_config_files
286ebfedea0SLionel Sambucget a list of default configuration files.
287ebfedea0SLionel Sambuc.Pp
288ebfedea0SLionel Sambuc.Fn krb5_free_config_files
289ebfedea0SLionel Sambucfree a list of configuration files returned by
290ebfedea0SLionel Sambuc.Fn krb5_get_default_config_files ,
291ebfedea0SLionel Sambuc.Fn krb5_prepend_config_files_default ,
292ebfedea0SLionel Sambucor
293ebfedea0SLionel Sambuc.Fn krb5_prepend_config_files .
294ebfedea0SLionel Sambuc.Pp
295ebfedea0SLionel Sambuc.Fn krb5_set_use_admin_kdc
296ebfedea0SLionel Sambucsets if all KDC requests should go admin KDC.
297ebfedea0SLionel Sambuc.Pp
298ebfedea0SLionel Sambuc.Fn krb5_get_use_admin_kdc
299ebfedea0SLionel Sambucgets if all KDC requests should go admin KDC.
300ebfedea0SLionel Sambuc.Pp
301ebfedea0SLionel Sambuc.Fn krb5_get_max_time_skew
302ebfedea0SLionel Sambucand
303ebfedea0SLionel Sambuc.Fn krb5_set_max_time_skew
304ebfedea0SLionel Sambucget and sets the maximum allowed time skew between client and server.
305ebfedea0SLionel Sambuc.Sh SEE ALSO
306ebfedea0SLionel Sambuc.Xr errno 2 ,
307ebfedea0SLionel Sambuc.Xr krb5 3 ,
308ebfedea0SLionel Sambuc.Xr krb5_config 3 ,
309ebfedea0SLionel Sambuc.Xr krb5_context 3 ,
310ebfedea0SLionel Sambuc.Xr kerberos 8
311