3 .\" Copyright (c) 2005 Doug Rabson
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" 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.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" The following commands are required for all man pages.
31 .Dt GSS_ADD_CRED 3 PRM
35 .Nd Construct credentials incrementally
36 .\" This next command is for sections 2 and 3 only.
42 .Fa "OM_uint32 *minor_status"
43 .Fa "const gss_cred_id_t input_cred_handle"
44 .Fa "const gss_name_t desired_name"
45 .Fa "const gss_OID desired_mech"
46 .Fa "gss_cred_usage_t cred_usage"
47 .Fa "OM_uint32 initiator_time_req"
48 .Fa "OM_uint32 acceptor_time_req"
49 .Fa "gss_cred_id_t *output_cred_handle"
50 .Fa "gss_OID_set *actual_mechs"
51 .Fa "OM_uint32 *initiator_time_rec"
52 .Fa "OM_uint32 *acceptor_time_rec"
55 Adds a credential-element to a credential.
56 The credential-element is identified by the name of the principal to
58 GSS-API implementations must impose a local access-control policy on
59 callers of this routine to prevent unauthorized callers from acquiring
60 credential-elements to which they are not entitled.
61 This routine is not intended to provide a "login to the network"
63 as such a function would involve the creation of new
64 mechanism-specific authentication data,
65 rather than merely acquiring a GSS-API handle to existing data.
68 should be defined in implementation-specific extensions to the API.
74 the call is interpreted as a request to add a credential element that
75 will invoke default behavior when passed to
76 .Fn gss_init_sec_context
82 .Fn gss_accept_sec_context
90 This routine is expected to be used primarily by context acceptors,
91 since implementations are likely to provide mechanism-specific ways of
92 obtaining GSS-API initiator credentials from the system login process.
93 Some implementations may therefore not support the acquisition of
99 for any name other than
101 or a name produced by applying either
103 to a valid credential,
105 .Fn gss_inquire_context
106 to an active context.
108 If credential acquisition is time-consuming for a mechanism,
109 the mechanism may choose to delay the actual acquisition until the
110 credential is required (e.g. by
111 .Fn gss_init_sec_context
113 .Fn gss_accept_sec_context ).
114 Such mechanism-specific implementation decisions should be invisible
115 to the calling application;
118 immediately following the call of
120 must return valid credential data,
121 and may therefore incur the overhead of a deferred credential acquisition.
123 This routine can be used to either compose a new credential containing
124 all credential-elements of the original in addition to the
125 newly-acquire credential-element,
126 or to add the new credential-element to an existing credential.
130 .Fa output_cred_handle
132 the new credential-element will be added to the credential identified
134 .Fa input_cred_handle ;
135 if a valid pointer is specified for the
136 .Fa output_cred_handle
138 a new credential handle will be created.
141 .Dv GSS_C_NO_CREDENTIAL
143 .Fa input_cred_handle ,
145 will compose a credential (and set the
146 .Fa output_cred_handle
147 parameter accordingly) based on default behavior.
148 That is, the call will have the same effect as if the application had
150 .Fn gss_acquire_cred ,
151 specifying the same usage and passing
155 parameter to obtain an explicit credential handle embodying default
157 passed this credential handle to
161 on the first credential handle.
164 .Dv GSS_C_NO_CREDENTIAL
166 .Fa input_cred_handle
170 .Fa output_cred_handle
173 .Bl -tag -width ".It output_cred_handle"
175 Mechanism specific status code.
176 .It input_cred_handle
177 The credential to which a credential-element will be added.
179 .Dv GSS_C_NO_CREDENTIAL
180 is specified, the routine will compose the new credential based on
181 default behavior (see description above).
182 Note that, while the credential-handle is not modified by
184 the underlying credential will be modified if
185 .Fa output_credential_handle
189 Name of principal whose credential should be acquired.
191 Underlying security mechanism with which the credential may be used.
193 .Bl -tag -width "GSS_C_INITIATE"
195 Credential may be used either to initiate or accept security
198 Credential will only be used to initiate security contexts.
200 Credential will only be used to accept security contexts.
202 .It initiator_time_req
203 Number of seconds that the credential should remain valid for
204 initiating security contexts.
205 This argument is ignored if the composed credentials are of type
209 to request that the credentials have the maximum permitted initiator lifetime.
210 .It acceptor_time_req
211 Number of seconds that the credential should remain valid for
212 accepting security contexts.
213 This argument is ignored if the composed credentials are of type
217 to request that the credentials have the maximum permitted initiator lifetime.
218 .It output_cred_handle
219 The returned credential handle,
221 the new credential-element and all the credential-elements from
222 .Fa input_cred_handle .
223 If a valid pointer to a
225 is supplied for this parameter,
227 creates a new credential handle containing all credential-elements
229 .Fa input_cred_handle
230 and the newly acquired credential-element;
233 is specified for this parameter,
234 the newly acquired credential-element will be added to the credential
236 .Fa input_cred_handle .
238 The resources associated with any credential handle returned via this
239 parameter must be released by the application after use with a call to
240 .Fn gss_release_cred .
242 The complete set of mechanisms for which the new credential is valid.
243 Storage for the returned OID-set must be freed by the application
244 after use with a call to
245 .Fn gss_release_oid_set .
247 .Dv NULL if not required.
248 .It initiator_time_rec
249 Actual number of seconds for which the returned credentials will
250 remain valid for initiating contexts using the specified mechanism.
251 If the implementation or mechanism does not support expiration of
259 .It acceptor_time_rec
260 Actual number of seconds for which the returned credentials will
261 remain valid for accepting security contexts using the specified
263 If the implementation or mechanism does not support expiration of
273 .Bl -tag -width ".It GSS_S_CREDENTIALS_EXPIRED"
275 Successful completion.
277 Unavailable mechanism requested.
278 .It GSS_S_BAD_NAMETYPE
279 Type contained within desired_name parameter is not supported
281 Value supplied for desired_name parameter is ill-formed.
282 .It GSS_S_DUPLICATE_ELEMENT
283 The credential already contains an element for the requested mechanism
284 with overlapping usage and validity period.
285 .It GSS_S_CREDENTIALS_EXPIRED
286 The required credentials could not be added because they have expired.
288 No credentials were found for the specified name.
291 .Xr gss_accept_sec_context 3 ,
292 .Xr gss_acquire_cred 3 ,
293 .Xr gss_init_sec_context 3 ,
294 .Xr gss_inquire_context 3 ,
295 .Xr gss_inquire_cred 3 ,
296 .Xr gss_release_cred 3 ,
297 .Xr gss_release_oid_set 3
299 .Bl -tag -width ".It RFC 2743"
301 Generic Security Service Application Program Interface Version 2, Update 1
303 Generic Security Service API Version 2 : C-bindings
308 function first appeared in
311 John Wray, Iris Associates
313 Copyright (C) The Internet Society (2000). All Rights Reserved.
315 This document and translations of it may be copied and furnished to
316 others, and derivative works that comment on or otherwise explain it
317 or assist in its implementation may be prepared, copied, published
318 and distributed, in whole or in part, without restriction of any
319 kind, provided that the above copyright notice and this paragraph are
320 included on all such copies and derivative works. However, this
321 document itself may not be modified in any way, such as by removing
322 the copyright notice or references to the Internet Society or other
323 Internet organizations, except as needed for the purpose of
324 developing Internet standards in which case the procedures for
325 copyrights defined in the Internet Standards process must be
326 followed, or as required to translate it into languages other than
329 The limited permissions granted above are perpetual and will not be
330 revoked by the Internet Society or its successors or assigns.
332 This document and the information contained herein is provided on an
333 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
334 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
335 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
336 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
337 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.