xref: /freebsd/lib/libgssapi/gss_init_sec_context.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1c0b9f4feSDoug Rabson.\" -*- nroff -*-
2c0b9f4feSDoug Rabson.\"
3c0b9f4feSDoug Rabson.\" Copyright (c) 2005 Doug Rabson
4c0b9f4feSDoug Rabson.\" All rights reserved.
5c0b9f4feSDoug Rabson.\"
6c0b9f4feSDoug Rabson.\" Redistribution and use in source and binary forms, with or without
7c0b9f4feSDoug Rabson.\" modification, are permitted provided that the following conditions
8c0b9f4feSDoug Rabson.\" are met:
9c0b9f4feSDoug Rabson.\" 1. Redistributions of source code must retain the above copyright
10c0b9f4feSDoug Rabson.\"    notice, this list of conditions and the following disclaimer.
11c0b9f4feSDoug Rabson.\" 2. Redistributions in binary form must reproduce the above copyright
12c0b9f4feSDoug Rabson.\"    notice, this list of conditions and the following disclaimer in the
13c0b9f4feSDoug Rabson.\"    documentation and/or other materials provided with the distribution.
14c0b9f4feSDoug Rabson.\"
15c0b9f4feSDoug Rabson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16c0b9f4feSDoug Rabson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17c0b9f4feSDoug Rabson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18c0b9f4feSDoug Rabson.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19c0b9f4feSDoug Rabson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20c0b9f4feSDoug Rabson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21c0b9f4feSDoug Rabson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22c0b9f4feSDoug Rabson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23c0b9f4feSDoug Rabson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24c0b9f4feSDoug Rabson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25c0b9f4feSDoug Rabson.\" SUCH DAMAGE.
26c0b9f4feSDoug Rabson.\"
27c0b9f4feSDoug Rabson.\" The following commands are required for all man pages.
28d76ba3efSGavin Atkinson.Dd January 26, 2010
29c0b9f4feSDoug Rabson.Dt GSS_INIT_SEC_CONTEXT 3 PRM
30aa12cea2SUlrich Spörlein.Os
31c0b9f4feSDoug Rabson.Sh NAME
32c0b9f4feSDoug Rabson.Nm gss_init_sec_context
33c0b9f4feSDoug Rabson.Nd Initiate a security context with a peer application
34c0b9f4feSDoug Rabson.\" This next command is for sections 2 and 3 only.
35c0b9f4feSDoug Rabson.\" .Sh LIBRARY
36c0b9f4feSDoug Rabson.Sh SYNOPSIS
37c0b9f4feSDoug Rabson.In "gssapi/gssapi.h"
38c0b9f4feSDoug Rabson.Ft OM_uint32
39c0b9f4feSDoug Rabson.Fo gss_init_sec_context
40c0b9f4feSDoug Rabson.Fa "OM_uint32 *minor_status"
41c0b9f4feSDoug Rabson.Fa "const gss_cred_id_t initiator_cred_handle"
42c0b9f4feSDoug Rabson.Fa "gss_ctx_id_t *context_handle"
43c0b9f4feSDoug Rabson.Fa "const gss_name_t target_name"
44c0b9f4feSDoug Rabson.Fa "const gss_OID mech_type"
45c0b9f4feSDoug Rabson.Fa "OM_uint32 req_flags"
46c0b9f4feSDoug Rabson.Fa "OM_uint32 time_req"
47c0b9f4feSDoug Rabson.Fa "const gss_channel_bindings_t input_chan_bindings"
48c0b9f4feSDoug Rabson.Fa "const gss_buffer_t input_token"
49c0b9f4feSDoug Rabson.Fa "gss_OID *actual_mech_type"
50c0b9f4feSDoug Rabson.Fa "gss_buffer_t output_token"
51c0b9f4feSDoug Rabson.Fa "OM_uint32 *ret_flags"
52c0b9f4feSDoug Rabson.Fa "OM_uint32 *time_rec"
53c0b9f4feSDoug Rabson.Fc
54c0b9f4feSDoug Rabson.Sh DESCRIPTION
55c0b9f4feSDoug RabsonInitiates the establishment of a security context between the
56c0b9f4feSDoug Rabsonapplication and a remote peer.
57c0b9f4feSDoug RabsonInitially, the input_token parameter should be specified either as
58c0b9f4feSDoug Rabson.Dv GSS_C_NO_BUFFER, or as a pointer to a
59c0b9f4feSDoug Rabsongss_buffer_desc object whose length field contains the value zero.
60c0b9f4feSDoug RabsonThe routine may return a output_token which should be transferred to
61c0b9f4feSDoug Rabsonthe peer application, where the peer application will present it to
62c0b9f4feSDoug Rabson.Xr gss_accept_sec_context 3 . If no token need be sent,
63c0b9f4feSDoug Rabson.Fn gss_init_sec_context
64c0b9f4feSDoug Rabsonwill indicate this by setting the
65c0b9f4feSDoug Rabson.Dv length field
66c0b9f4feSDoug Rabsonof the output_token argument to zero. To complete the context
67c0b9f4feSDoug Rabsonestablishment, one or more reply tokens may be required from the peer
68c0b9f4feSDoug Rabsonapplication; if so,
69c0b9f4feSDoug Rabson.Fn gss_init_sec_context
70c0b9f4feSDoug Rabsonwill return a status
71c0b9f4feSDoug Rabsoncontaining the supplementary information bit
72c0b9f4feSDoug Rabson.Dv GSS_S_CONTINUE_NEEDED.
73c0b9f4feSDoug RabsonIn this case,
74c0b9f4feSDoug Rabson.Fn gss_init_sec_context
75c0b9f4feSDoug Rabsonshould be called again when the reply token is received from the peer
76c0b9f4feSDoug Rabsonapplication, passing the reply token to
77c0b9f4feSDoug Rabson.Fn gss_init_sec_context
78c0b9f4feSDoug Rabsonvia the input_token parameters.
79c0b9f4feSDoug Rabson.Pp
80c0b9f4feSDoug RabsonPortable applications should be constructed to use the token length
81c0b9f4feSDoug Rabsonand return status to determine whether a token needs to be sent or
82c0b9f4feSDoug Rabsonwaited for.  Thus a typical portable caller should always invoke
83c0b9f4feSDoug Rabson.Fn gss_init_sec_context
84c0b9f4feSDoug Rabsonwithin a loop:
85c0b9f4feSDoug Rabson.Bd -literal
86c0b9f4feSDoug Rabsonint context_established = 0;
87c0b9f4feSDoug Rabsongss_ctx_id_t context_hdl = GSS_C_NO_CONTEXT;
88c0b9f4feSDoug Rabson       ...
89c0b9f4feSDoug Rabsoninput_token->length = 0;
90c0b9f4feSDoug Rabson
91c0b9f4feSDoug Rabsonwhile (!context_established) {
92c0b9f4feSDoug Rabson  maj_stat = gss_init_sec_context(&min_stat,
93c0b9f4feSDoug Rabson				  cred_hdl,
94c0b9f4feSDoug Rabson				  &context_hdl,
95c0b9f4feSDoug Rabson				  target_name,
96c0b9f4feSDoug Rabson				  desired_mech,
97c0b9f4feSDoug Rabson				  desired_services,
98c0b9f4feSDoug Rabson				  desired_time,
99c0b9f4feSDoug Rabson				  input_bindings,
100c0b9f4feSDoug Rabson				  input_token,
101c0b9f4feSDoug Rabson				  &actual_mech,
102c0b9f4feSDoug Rabson				  output_token,
103c0b9f4feSDoug Rabson				  &actual_services,
104c0b9f4feSDoug Rabson				  &actual_time);
105c0b9f4feSDoug Rabson  if (GSS_ERROR(maj_stat)) {
106c0b9f4feSDoug Rabson    report_error(maj_stat, min_stat);
107c0b9f4feSDoug Rabson  };
108c0b9f4feSDoug Rabson
109c0b9f4feSDoug Rabson  if (output_token->length != 0) {
110c0b9f4feSDoug Rabson    send_token_to_peer(output_token);
111c0b9f4feSDoug Rabson    gss_release_buffer(&min_stat, output_token)
112c0b9f4feSDoug Rabson  };
113c0b9f4feSDoug Rabson  if (GSS_ERROR(maj_stat)) {
114c0b9f4feSDoug Rabson
115c0b9f4feSDoug Rabson    if (context_hdl != GSS_C_NO_CONTEXT)
116c0b9f4feSDoug Rabson      gss_delete_sec_context(&min_stat,
117c0b9f4feSDoug Rabson			     &context_hdl,
118c0b9f4feSDoug Rabson			     GSS_C_NO_BUFFER);
119c0b9f4feSDoug Rabson    break;
120c0b9f4feSDoug Rabson  };
121c0b9f4feSDoug Rabson
122c0b9f4feSDoug Rabson  if (maj_stat & GSS_S_CONTINUE_NEEDED) {
123c0b9f4feSDoug Rabson    receive_token_from_peer(input_token);
124c0b9f4feSDoug Rabson  } else {
125c0b9f4feSDoug Rabson    context_established = 1;
126c0b9f4feSDoug Rabson  };
127c0b9f4feSDoug Rabson};
128c0b9f4feSDoug Rabson.Ed
129c0b9f4feSDoug Rabson.Pp
130c0b9f4feSDoug RabsonWhenever the routine returns a major status that includes the value
131c0b9f4feSDoug Rabson.Dv GSS_S_CONTINUE_NEEDED, the context is not fully established and the
132c0b9f4feSDoug Rabsonfollowing restrictions apply to the output parameters:
133c0b9f4feSDoug Rabson.Bl -bullet
134c0b9f4feSDoug Rabson.It
135c0b9f4feSDoug RabsonThe value returned via the
136c0b9f4feSDoug Rabson.Fa time_rec
137c0b9f4feSDoug Rabsonparameter is undefined Unless
138c0b9f4feSDoug Rabsonthe accompanying
139c0b9f4feSDoug Rabson.Fa ret_flags
140c0b9f4feSDoug Rabsonparameter contains the bit
141c0b9f4feSDoug Rabson.Dv GSS_C_PROT_READY_FLAG, indicating that per-message services may be
142c0b9f4feSDoug Rabsonapplied in advance of a successful completion status, the value
143c0b9f4feSDoug Rabsonreturned via the
144c0b9f4feSDoug Rabson.Fa actual_mech_type
145c0b9f4feSDoug Rabsonparameter is undefined until the
146c0b9f4feSDoug Rabsonroutine returns a major status value of
147c0b9f4feSDoug Rabson.Dv GSS_S_COMPLETE.
148c0b9f4feSDoug Rabson.It
149c0b9f4feSDoug RabsonThe values of the
150c0b9f4feSDoug Rabson.Dv GSS_C_DELEG_FLAG ,
151c0b9f4feSDoug Rabson.Dv GSS_C_MUTUAL_FLAG ,
152c0b9f4feSDoug Rabson.Dv GSS_C_REPLAY_FLAG ,
153c0b9f4feSDoug Rabson.Dv GSS_C_SEQUENCE_FLAG ,
15463d46d1dSUlrich Spörlein.Dv GSS_C_CONF_FLAG ,
155c0b9f4feSDoug Rabson.Dv GSS_C_INTEG_FLAG and
156c0b9f4feSDoug Rabson.Dv GSS_C_ANON_FLAG bits returned via the
157c0b9f4feSDoug Rabson.Fa ret_flags
158c0b9f4feSDoug Rabsonparameter should contain the values that the
159c0b9f4feSDoug Rabsonimplementation expects would be valid if context establishment
160c0b9f4feSDoug Rabsonwere to succeed.  In particular, if the application has requested
161c0b9f4feSDoug Rabsona service such as delegation or anonymous authentication via the
162c0b9f4feSDoug Rabson.Fa req_flags
163c0b9f4feSDoug Rabsonargument, and such a service is unavailable from the
164c0b9f4feSDoug Rabsonunderlying mechanism,
165c0b9f4feSDoug Rabson.Fn gss_init_sec_context
166c0b9f4feSDoug Rabsonshould generate a token
167c0b9f4feSDoug Rabsonthat will not provide the service, and indicate via the
168c0b9f4feSDoug Rabson.Fa ret_flags
169c0b9f4feSDoug Rabsonargument that the service will not be supported.  The application
170c0b9f4feSDoug Rabsonmay choose to abort the context establishment by calling
171c0b9f4feSDoug Rabson.Xr gss_delete_sec_context 3
172c0b9f4feSDoug Rabson(if it cannot continue in the absence of
173c0b9f4feSDoug Rabsonthe service), or it may choose to transmit the token and continue
174c0b9f4feSDoug Rabsoncontext establishment (if the service was merely desired but not
175c0b9f4feSDoug Rabsonmandatory).
176c0b9f4feSDoug Rabson.It
177c0b9f4feSDoug RabsonThe values of the
178c0b9f4feSDoug Rabson.Dv GSS_C_PROT_READY_FLAG and
179c0b9f4feSDoug Rabson.Dv GSS_C_TRANS_FLAG bits
180c0b9f4feSDoug Rabsonwithin
181c0b9f4feSDoug Rabson.Fa ret_flags
182c0b9f4feSDoug Rabsonshould indicate the actual state at the time
183c0b9f4feSDoug Rabson.Fn gss_init_sec_context
184c0b9f4feSDoug Rabsonreturns, whether or not the context is fully established.
185c0b9f4feSDoug Rabson.It
186c0b9f4feSDoug RabsonGSS-API implementations that support per-message protection are
187c0b9f4feSDoug Rabsonencouraged to set the
188c0b9f4feSDoug Rabson.Dv GSS_C_PROT_READY_FLAG in the final
189c0b9f4feSDoug Rabson.Fa ret_flags
190c0b9f4feSDoug Rabsonreturned to a caller (i.e. when accompanied by a
191c0b9f4feSDoug Rabson.Dv GSS_S_COMPLETE
192c0b9f4feSDoug Rabsonstatus code).  However, applications should not rely on this
193c0b9f4feSDoug Rabsonbehavior as the flag was not defined in Version 1 of the GSS-API.
194c0b9f4feSDoug RabsonInstead, applications should determine what per-message services
195c0b9f4feSDoug Rabsonare available after a successful context establishment according
196c0b9f4feSDoug Rabsonto the
197c0b9f4feSDoug Rabson.Dv GSS_C_INTEG_FLAG and
198c0b9f4feSDoug Rabson.Dv GSS_C_CONF_FLAG values.
199c0b9f4feSDoug Rabson.It
200c0b9f4feSDoug RabsonAll other bits within the
201c0b9f4feSDoug Rabson.Fa ret_flags
202c0b9f4feSDoug Rabsonargument should be set to
203c0b9f4feSDoug Rabsonzero.
204c0b9f4feSDoug Rabson.El
205c0b9f4feSDoug Rabson.Pp
206c0b9f4feSDoug RabsonIf the initial call of
207c0b9f4feSDoug Rabson.Fn gss_init_sec_context
208c0b9f4feSDoug Rabsonfails, the
209c0b9f4feSDoug Rabsonimplementation should not create a context object, and should leave
210c0b9f4feSDoug Rabsonthe value of the
211c0b9f4feSDoug Rabson.Fa context_handle
212c0b9f4feSDoug Rabsonparameter set to
213c0b9f4feSDoug Rabson.Dv GSS_C_NO_CONTEXT to
214c0b9f4feSDoug Rabsonindicate this.  In the event of a failure on a subsequent call, the
215c0b9f4feSDoug Rabsonimplementation is permitted to delete the "half-built" security
216c0b9f4feSDoug Rabsoncontext (in which case it should set the
217c0b9f4feSDoug Rabson.Fa context_handle
218c0b9f4feSDoug Rabsonparameter to
219c0b9f4feSDoug Rabson.Dv GSS_C_NO_CONTEXT ), but the preferred behavior is to leave the
220c0b9f4feSDoug Rabsonsecurity context untouched for the application to delete (using
221c0b9f4feSDoug Rabson.Xr gss_delete_sec_context 3 ).
222c0b9f4feSDoug Rabson.Pp
223c0b9f4feSDoug RabsonDuring context establishment, the informational status bits
224c0b9f4feSDoug Rabson.Dv GSS_S_OLD_TOKEN and
225c0b9f4feSDoug Rabson.Dv GSS_S_DUPLICATE_TOKEN indicate fatal errors, and
226c0b9f4feSDoug RabsonGSS-API mechanisms should always return them in association with a
227c0b9f4feSDoug Rabsonroutine error of
228c0b9f4feSDoug Rabson.Dv GSS_S_FAILURE .
229c0b9f4feSDoug RabsonThis requirement for pairing did not
230c0b9f4feSDoug Rabsonexist in version 1 of the GSS-API specification, so applications that
231c0b9f4feSDoug Rabsonwish to run over version 1 implementations must special-case these
232c0b9f4feSDoug Rabsoncodes.
233c0b9f4feSDoug Rabson.Sh PARAMETERS
234*6a557179SJoel Dahl.Bl -tag -width ".It initiator_cred_handle"
235c0b9f4feSDoug Rabson.It minor_status
236c0b9f4feSDoug RabsonMechanism specific status code.
237c0b9f4feSDoug Rabson.It initiator_cred_handle
238c0b9f4feSDoug Rabsonhandle for credentials claimed. Supply
239c0b9f4feSDoug Rabson.Dv GSS_C_NO_CREDENTIAL to act as a default
240c0b9f4feSDoug Rabsoninitiator principal.  If no default
241c0b9f4feSDoug Rabsoninitiator is defined, the function will
242c0b9f4feSDoug Rabsonreturn
243c0b9f4feSDoug Rabson.Dv GSS_S_NO_CRED.
244c0b9f4feSDoug Rabson.It context_handle
245c0b9f4feSDoug Rabsoncontext handle for new context.  Supply
246c0b9f4feSDoug Rabson.Dv GSS_C_NO_CONTEXT for first call; use value
247c0b9f4feSDoug Rabsonreturned by first call in continuation calls.
248c0b9f4feSDoug RabsonResources associated with this context-handle
249c0b9f4feSDoug Rabsonmust be released by the application after use
250c0b9f4feSDoug Rabsonwith a call to
251c0b9f4feSDoug Rabson.Fn gss_delete_sec_context .
252c0b9f4feSDoug Rabson.It target_name
253c0b9f4feSDoug RabsonName of target
254c0b9f4feSDoug Rabson.It mech_type
255c0b9f4feSDoug RabsonObject ID of desired mechanism. Supply
256c0b9f4feSDoug Rabson.Dv GSS_C_NO_OID to obtain an implementation
257c0b9f4feSDoug Rabsonspecific default
258c0b9f4feSDoug Rabson.It req_flags
259c0b9f4feSDoug RabsonContains various independent flags, each of
260c0b9f4feSDoug Rabsonwhich requests that the context support a
261c0b9f4feSDoug Rabsonspecific service option.  Symbolic
262c0b9f4feSDoug Rabsonnames are provided for each flag, and the
263c0b9f4feSDoug Rabsonsymbolic names corresponding to the required
264c0b9f4feSDoug Rabsonflags should be logically-ORed
265c0b9f4feSDoug Rabsontogether to form the bit-mask value.  The
266c0b9f4feSDoug Rabsonflags are:
267c0b9f4feSDoug Rabson.Bl -tag -width "WW"
268c0b9f4feSDoug Rabson.It GSS_C_DELEG_FLAG
269c0b9f4feSDoug Rabson.Bl -tag -width "False"
270c0b9f4feSDoug Rabson.It True
271c0b9f4feSDoug RabsonDelegate credentials to remote peer
272c0b9f4feSDoug Rabson.It False
273c0b9f4feSDoug RabsonDon't delegate
274c0b9f4feSDoug Rabson.El
275c0b9f4feSDoug Rabson.It GSS_C_MUTUAL_FLAG
276c0b9f4feSDoug Rabson.Bl -tag -width "False"
277c0b9f4feSDoug Rabson.It True
278c0b9f4feSDoug RabsonRequest that remote peer authenticate itself
279c0b9f4feSDoug Rabson.It False
280c0b9f4feSDoug RabsonAuthenticate self to remote peer only
281c0b9f4feSDoug Rabson.El
282c0b9f4feSDoug Rabson.It GSS_C_REPLAY_FLAG
283c0b9f4feSDoug Rabson.Bl -tag -width "False"
284c0b9f4feSDoug Rabson.It True
285c0b9f4feSDoug RabsonEnable replay detection for messages protected with
286c0b9f4feSDoug Rabson.Xr gss_wrap 3
287c0b9f4feSDoug Rabsonor
288c0b9f4feSDoug Rabson.Xr gss_get_mic 3
289c0b9f4feSDoug Rabson.It False
290c0b9f4feSDoug RabsonDon't attempt to detect replayed messages
291c0b9f4feSDoug Rabson.El
292c0b9f4feSDoug Rabson.It GSS_C_SEQUENCE_FLAG
293c0b9f4feSDoug Rabson.Bl -tag -width "False"
294c0b9f4feSDoug Rabson.It True
295c0b9f4feSDoug RabsonEnable detection of out-of-sequence protected messages
296c0b9f4feSDoug Rabson.It False
297c0b9f4feSDoug RabsonDon't attempt to detect out-of-sequence messages
298c0b9f4feSDoug Rabson.El
299c0b9f4feSDoug Rabson.It GSS_C_CONF_FLAG
300c0b9f4feSDoug Rabson.Bl -tag -width "False"
301c0b9f4feSDoug Rabson.It True
302c0b9f4feSDoug RabsonRequest that confidentiality service be made available (via
303c0b9f4feSDoug Rabson.Xr gss_wrap 3 )
304c0b9f4feSDoug Rabson.It False
305c0b9f4feSDoug RabsonNo per-message confidentiality service is required.
306c0b9f4feSDoug Rabson.El
307c0b9f4feSDoug Rabson.It GSS_C_INTEG_FLAG
308c0b9f4feSDoug Rabson.Bl -tag -width "False"
309c0b9f4feSDoug Rabson.It True
310c0b9f4feSDoug RabsonRequest that integrity service be made available (via
311c0b9f4feSDoug Rabson.Xr gss_wrap 3
312c0b9f4feSDoug Rabsonor
313c0b9f4feSDoug Rabson.Xr gss_get_mic 3 )
314c0b9f4feSDoug Rabson.It False
315c0b9f4feSDoug RabsonNo per-message integrity service is required.
316c0b9f4feSDoug Rabson.El
317c0b9f4feSDoug Rabson.It GSS_C_ANON_FLAG
318c0b9f4feSDoug Rabson.Bl -tag -width "False"
319c0b9f4feSDoug Rabson.It True
320c0b9f4feSDoug RabsonDo not reveal the initiator's identity to the acceptor.
321c0b9f4feSDoug Rabson.It False
322c0b9f4feSDoug RabsonAuthenticate normally.
323c0b9f4feSDoug Rabson.El
324c0b9f4feSDoug Rabson.El
325c0b9f4feSDoug Rabson.It time_req
326c0b9f4feSDoug RabsonDesired number of seconds for which context
327c0b9f4feSDoug Rabsonshould remain valid.  Supply 0 to request a
328c0b9f4feSDoug Rabsondefault validity period.
329c0b9f4feSDoug Rabson.It input_chan_bindings
330c0b9f4feSDoug RabsonApplication-specified bindings.  Allows
331c0b9f4feSDoug Rabsonapplication to securely bind channel
332c0b9f4feSDoug Rabsonidentification information to the security
333c0b9f4feSDoug Rabsoncontext.  Specify
334c0b9f4feSDoug Rabson.Dv GSS_C_NO_CHANNEL_BINDINGS
335c0b9f4feSDoug Rabsonif channel bindings are not used.
336c0b9f4feSDoug Rabson.It input_token
337c0b9f4feSDoug RabsonToken received from peer application.
338c0b9f4feSDoug RabsonSupply
339c0b9f4feSDoug Rabson.Dv GSS_C_NO_BUFFER, or a pointer to
340c0b9f4feSDoug Rabsona buffer containing the value
341c0b9f4feSDoug Rabson.Dv GSS_C_EMPTY_BUFFER
342c0b9f4feSDoug Rabsonon initial call.
343c0b9f4feSDoug Rabson.It actual_mech_type
344c0b9f4feSDoug RabsonActual mechanism used.  The OID returned via
345c0b9f4feSDoug Rabsonthis parameter will be a pointer to static
346c0b9f4feSDoug Rabsonstorage that should be treated as read-only;
347c0b9f4feSDoug RabsonIn particular the application should not attempt
348c0b9f4feSDoug Rabsonto free it.  Specify
349c0b9f4feSDoug Rabson.Dv NULL if not required.
350c0b9f4feSDoug Rabson.It output_token
351c0b9f4feSDoug Rabsontoken to be sent to peer application.  If
352c0b9f4feSDoug Rabsonthe length field of the returned buffer is
353c0b9f4feSDoug Rabsonzero, no token need be sent to the peer
354c0b9f4feSDoug Rabsonapplication.  Storage associated with this
355c0b9f4feSDoug Rabsonbuffer must be freed by the application
356c0b9f4feSDoug Rabsonafter use with a call to
357c0b9f4feSDoug Rabson.Xr gss_release_buffer 3 .
358c0b9f4feSDoug Rabson.It ret_flags
359c0b9f4feSDoug RabsonContains various independent flags, each of which
360c0b9f4feSDoug Rabsonindicates that the context supports a specific
361c0b9f4feSDoug Rabsonservice option.  Specify
362c0b9f4feSDoug Rabson.Dv NULL if not
363c0b9f4feSDoug Rabsonrequired.  Symbolic names are provided
364c0b9f4feSDoug Rabsonfor each flag, and the symbolic names
365c0b9f4feSDoug Rabsoncorresponding to the required flags should be
366c0b9f4feSDoug Rabsonlogically-ANDed with the
367c0b9f4feSDoug Rabson.Fa ret_flags
368c0b9f4feSDoug Rabsonvalue to test
369c0b9f4feSDoug Rabsonwhether a given option is supported by the
370c0b9f4feSDoug Rabsoncontext.  The flags are:
371c0b9f4feSDoug Rabson.Bl -tag -width "WW"
372c0b9f4feSDoug Rabson.It GSS_C_DELEG_FLAG
373c0b9f4feSDoug Rabson.Bl -tag -width "False"
374c0b9f4feSDoug Rabson.It True
375c0b9f4feSDoug RabsonCredentials were delegated to the remote peer
376c0b9f4feSDoug Rabson.It False
377c0b9f4feSDoug RabsonNo credentials were delegated
378c0b9f4feSDoug Rabson.El
379c0b9f4feSDoug Rabson.It GSS_C_MUTUAL_FLAG
380c0b9f4feSDoug Rabson.Bl -tag -width "False"
381c0b9f4feSDoug Rabson.It True
382c0b9f4feSDoug RabsonThe remote peer has authenticated itself.
383c0b9f4feSDoug Rabson.It False
384c0b9f4feSDoug RabsonRemote peer has not authenticated itself.
385c0b9f4feSDoug Rabson.El
386c0b9f4feSDoug Rabson.It GSS_C_REPLAY_FLAG
387c0b9f4feSDoug Rabson.Bl -tag -width "False"
388c0b9f4feSDoug Rabson.It True
389c0b9f4feSDoug RabsonReplay of protected messages will be detected
390c0b9f4feSDoug Rabson.It False
391c0b9f4feSDoug RabsonReplayed messages will not be detected
392c0b9f4feSDoug Rabson.El
393c0b9f4feSDoug Rabson.It GSS_C_SEQUENCE_FLAG
394c0b9f4feSDoug Rabson.Bl -tag -width "False"
395c0b9f4feSDoug Rabson.It True
396c0b9f4feSDoug RabsonOut-of-sequence protected messages will be detected
397c0b9f4feSDoug Rabson.It False
398c0b9f4feSDoug RabsonOut-of-sequence messages will not be detected
399c0b9f4feSDoug Rabson.El
400c0b9f4feSDoug Rabson.It GSS_C_CONF_FLAG
401c0b9f4feSDoug Rabson.Bl -tag -width "False"
402c0b9f4feSDoug Rabson.It True
403c0b9f4feSDoug RabsonConfidentiality service may be invoked by calling
404c0b9f4feSDoug Rabson.Xr gss_wrap 3
405c0b9f4feSDoug Rabsonroutine
406c0b9f4feSDoug Rabson.It False
407c0b9f4feSDoug RabsonNo confidentiality service (via
408c0b9f4feSDoug Rabson.Xr gss_wrap 3 ) available.
409c0b9f4feSDoug Rabson.Xr gss_wrap 3 will
410c0b9f4feSDoug Rabsonprovide message encapsulation,
411c0b9f4feSDoug Rabsondata-origin authentication and
412c0b9f4feSDoug Rabsonintegrity services only.
413c0b9f4feSDoug Rabson.El
414c0b9f4feSDoug Rabson.It GSS_C_INTEG_FLAG
415c0b9f4feSDoug Rabson.Bl -tag -width "False"
416c0b9f4feSDoug Rabson.It True
417c0b9f4feSDoug RabsonIntegrity service may be invoked by calling either
418c0b9f4feSDoug Rabson.Xr gss_get_mic 3
419c0b9f4feSDoug Rabsonor
420c0b9f4feSDoug Rabson.Xr gss_wrap 3
421c0b9f4feSDoug Rabsonroutines.
422c0b9f4feSDoug Rabson.It False
423c0b9f4feSDoug RabsonPer-message integrity service unavailable.
424c0b9f4feSDoug Rabson.El
425c0b9f4feSDoug Rabson.It GSS_C_ANON_FLAG
426c0b9f4feSDoug Rabson.Bl -tag -width "False"
427c0b9f4feSDoug Rabson.It True
428c0b9f4feSDoug RabsonThe initiator's identity has not been
429c0b9f4feSDoug Rabsonrevealed, and will not be revealed if
430c0b9f4feSDoug Rabsonany emitted token is passed to the
431c0b9f4feSDoug Rabsonacceptor.
432c0b9f4feSDoug Rabson.It False
433c0b9f4feSDoug RabsonThe initiator's identity has been or will be authenticated normally.
434c0b9f4feSDoug Rabson.El
435c0b9f4feSDoug Rabson.It GSS_C_PROT_READY_FLAG
436c0b9f4feSDoug Rabson.Bl -tag -width "False"
437c0b9f4feSDoug Rabson.It True
438c0b9f4feSDoug RabsonProtection services (as specified by the states of the
439c0b9f4feSDoug Rabson.Dv GSS_C_CONF_FLAG
440c0b9f4feSDoug Rabsonand
441c0b9f4feSDoug Rabson.Dv GSS_C_INTEG_FLAG ) are available for
442c0b9f4feSDoug Rabsonuse if the accompanying major status
443c0b9f4feSDoug Rabsonreturn value is either
444c0b9f4feSDoug Rabson.Dv GSS_S_COMPLETE
445c0b9f4feSDoug Rabsonor
446c0b9f4feSDoug Rabson.Dv GSS_S_CONTINUE_NEEDED.
447c0b9f4feSDoug Rabson.It False
448c0b9f4feSDoug RabsonProtection services (as specified by the states of the
449c0b9f4feSDoug Rabson.Dv GSS_C_CONF_FLAG
450c0b9f4feSDoug Rabsonand
451c0b9f4feSDoug Rabson.Dv GSS_C_INTEG_FLAG ) are available
452c0b9f4feSDoug Rabsononly if the accompanying major status
453c0b9f4feSDoug Rabsonreturn value is
454c0b9f4feSDoug Rabson.Dv GSS_S_COMPLETE.
455c0b9f4feSDoug Rabson.El
456c0b9f4feSDoug Rabson.It GSS_C_TRANS_FLAG
457c0b9f4feSDoug Rabson.Bl -tag -width "False"
458c0b9f4feSDoug Rabson.It True
459c0b9f4feSDoug RabsonThe resultant security context may be transferred to other processes via
460c0b9f4feSDoug Rabsona call to
461c0b9f4feSDoug Rabson.Fn gss_export_sec_context .
462c0b9f4feSDoug Rabson.It False
463c0b9f4feSDoug RabsonThe security context is not transferable.
464c0b9f4feSDoug Rabson.El
465c0b9f4feSDoug Rabson.El
466c0b9f4feSDoug Rabson.Pp
467c0b9f4feSDoug RabsonAll other bits should be set to zero.
468c0b9f4feSDoug Rabson.It time_rec
469c0b9f4feSDoug RabsonNumber of seconds for which the context
470c0b9f4feSDoug Rabsonwill remain valid. If the implementation does
471c0b9f4feSDoug Rabsonnot support context expiration, the value
472c0b9f4feSDoug Rabson.Dv GSS_C_INDEFINITE will be returned.  Specify
473c0b9f4feSDoug Rabson.Dv NULL if not required.
474c0b9f4feSDoug Rabson.El
475c0b9f4feSDoug Rabson.Sh RETURN VALUES
476*6a557179SJoel Dahl.Bl -tag -width ".It GSS_S_CREDENTIALS_EXPIRED"
477c0b9f4feSDoug Rabson.It GSS_S_COMPLETE
478c0b9f4feSDoug RabsonSuccessful completion
479c0b9f4feSDoug Rabson.It GSS_S_CONTINUE_NEEDED
480c0b9f4feSDoug RabsonIndicates that a token from the peer
481c0b9f4feSDoug Rabsonapplication is required to complete the
482c0b9f4feSDoug Rabsoncontext, and that gss_init_sec_context
483c0b9f4feSDoug Rabsonmust be called again with that token.
484c0b9f4feSDoug Rabson.It GSS_S_DEFECTIVE_TOKEN
485c0b9f4feSDoug RabsonIndicates that consistency checks performed
486c0b9f4feSDoug Rabsonon the input_token failed
487c0b9f4feSDoug Rabson.It GSS_S_DEFECTIVE_CREDENTIAL
488c0b9f4feSDoug RabsonIndicates that consistency checks
489c0b9f4feSDoug Rabsonperformed on the credential failed.
490c0b9f4feSDoug Rabson.It GSS_S_NO_CRED
491c0b9f4feSDoug RabsonThe supplied credentials were not valid for
492c0b9f4feSDoug Rabsoncontext initiation, or the credential handle
493c0b9f4feSDoug Rabsondid not reference any credentials.
494c0b9f4feSDoug Rabson.It GSS_S_CREDENTIALS_EXPIRED
495c0b9f4feSDoug RabsonThe referenced credentials have expired
496c0b9f4feSDoug Rabson.It GSS_S_BAD_BINDINGS
497c0b9f4feSDoug RabsonThe input_token contains different channel
498c0b9f4feSDoug Rabsonbindings to those specified via the
499c0b9f4feSDoug Rabsoninput_chan_bindings parameter
500c0b9f4feSDoug Rabson.It GSS_S_BAD_SIG
501c0b9f4feSDoug RabsonThe input_token contains an invalid MIC, or a MIC
502c0b9f4feSDoug Rabsonthat could not be verified
503c0b9f4feSDoug Rabson.It GSS_S_OLD_TOKEN
504c0b9f4feSDoug RabsonThe input_token was too old.  This is a fatal
505c0b9f4feSDoug Rabsonerror during context establishment
506c0b9f4feSDoug Rabson.It GSS_S_DUPLICATE_TOKEN
507c0b9f4feSDoug RabsonThe input_token is valid, but is a duplicate
508c0b9f4feSDoug Rabsonof a token already processed.  This is a
509c0b9f4feSDoug Rabsonfatal error during context establishment.
510c0b9f4feSDoug Rabson.It GSS_S_NO_CONTEXT
511c0b9f4feSDoug RabsonIndicates that the supplied context handle did
512c0b9f4feSDoug Rabsonnot refer to a valid context
513c0b9f4feSDoug Rabson.It GSS_S_BAD_NAMETYPE
514c0b9f4feSDoug RabsonThe provided target_name parameter contained an
515c0b9f4feSDoug Rabsoninvalid or unsupported type of name
516c0b9f4feSDoug Rabson.It GSS_S_BAD_NAME
517c0b9f4feSDoug RabsonThe provided target_name parameter was ill-formed.
518c0b9f4feSDoug Rabson.It GSS_S_BAD_MECH
519c0b9f4feSDoug RabsonThe specified mechanism is not supported by the
520c0b9f4feSDoug Rabsonprovided credential, or is unrecognized by the
521c0b9f4feSDoug Rabsonimplementation.
522c0b9f4feSDoug Rabson.El
523c0b9f4feSDoug Rabson.Sh SEE ALSO
524c0b9f4feSDoug Rabson.Xr gss_accept_sec_context 3 ,
525c0b9f4feSDoug Rabson.Xr gss_delete_sec_context 3 ,
526c0b9f4feSDoug Rabson.Xr gss_get_mic 3 ,
527c0b9f4feSDoug Rabson.Xr gss_release_buffer 3 ,
528c0b9f4feSDoug Rabson.Xr gss_wrap 3
529c0b9f4feSDoug Rabson.Sh STANDARDS
530*6a557179SJoel Dahl.Bl -tag -width ".It RFC 2743"
531c0b9f4feSDoug Rabson.It RFC 2743
532c0b9f4feSDoug RabsonGeneric Security Service Application Program Interface Version 2, Update 1
533c0b9f4feSDoug Rabson.It RFC 2744
534c0b9f4feSDoug RabsonGeneric Security Service API Version 2 : C-bindings
535c0b9f4feSDoug Rabson.El
536c0b9f4feSDoug Rabson.Sh HISTORY
537c0b9f4feSDoug RabsonThe
538c0b9f4feSDoug Rabson.Nm
539d76ba3efSGavin Atkinsonfunction first appeared in
540c0b9f4feSDoug Rabson.Fx 7.0 .
541c0b9f4feSDoug Rabson.Sh AUTHORS
542c0b9f4feSDoug RabsonJohn Wray, Iris Associates
54360b9f20aSDoug Rabson.Sh COPYRIGHT
54460b9f20aSDoug RabsonCopyright (C) The Internet Society (2000).  All Rights Reserved.
54560b9f20aSDoug Rabson.Pp
54660b9f20aSDoug RabsonThis document and translations of it may be copied and furnished to
54760b9f20aSDoug Rabsonothers, and derivative works that comment on or otherwise explain it
54860b9f20aSDoug Rabsonor assist in its implementation may be prepared, copied, published
54960b9f20aSDoug Rabsonand distributed, in whole or in part, without restriction of any
55060b9f20aSDoug Rabsonkind, provided that the above copyright notice and this paragraph are
55160b9f20aSDoug Rabsonincluded on all such copies and derivative works.  However, this
55260b9f20aSDoug Rabsondocument itself may not be modified in any way, such as by removing
55360b9f20aSDoug Rabsonthe copyright notice or references to the Internet Society or other
55460b9f20aSDoug RabsonInternet organizations, except as needed for the purpose of
55560b9f20aSDoug Rabsondeveloping Internet standards in which case the procedures for
55660b9f20aSDoug Rabsoncopyrights defined in the Internet Standards process must be
55760b9f20aSDoug Rabsonfollowed, or as required to translate it into languages other than
55860b9f20aSDoug RabsonEnglish.
55960b9f20aSDoug Rabson.Pp
56060b9f20aSDoug RabsonThe limited permissions granted above are perpetual and will not be
56160b9f20aSDoug Rabsonrevoked by the Internet Society or its successors or assigns.
56260b9f20aSDoug Rabson.Pp
56360b9f20aSDoug RabsonThis document and the information contained herein is provided on an
56460b9f20aSDoug Rabson"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
56560b9f20aSDoug RabsonTASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
56660b9f20aSDoug RabsonBUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
56760b9f20aSDoug RabsonHEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
56860b9f20aSDoug RabsonMERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
569