switch to getarg directly
[heimdal.git] / doc / standardisation / draft-ietf-kitten-gssapi-store-cred-01.txt
blob0327d87099d9dd2f8efe1e48e279ff42cc694d60
4 NETWORK WORKING GROUP                                        N. Williams
5 Internet-Draft                                                       Sun
6 Expires: April 19, 2006                                 October 16, 2005
9           GSS-API Extension for Storing Delegated Credentials
10                draft-ietf-kitten-gssapi-store-cred-01.txt
12 Status of this Memo
14    By submitting this Internet-Draft, each author represents that any
15    applicable patent or other IPR claims of which he or she is aware
16    have been or will be disclosed, and any of which he or she becomes
17    aware will be disclosed, in accordance with Section 6 of BCP 79.
19    Internet-Drafts are working documents of the Internet Engineering
20    Task Force (IETF), its areas, and its working groups.  Note that
21    other groups may also distribute working documents as Internet-
22    Drafts.
24    Internet-Drafts are draft documents valid for a maximum of six months
25    and may be updated, replaced, or obsoleted by other documents at any
26    time.  It is inappropriate to use Internet-Drafts as reference
27    material or to cite them other than as "work in progress."
29    The list of current Internet-Drafts can be accessed at
30    http://www.ietf.org/ietf/1id-abstracts.txt.
32    The list of Internet-Draft Shadow Directories can be accessed at
33    http://www.ietf.org/shadow.html.
35    This Internet-Draft will expire on April 19, 2006.
37 Copyright Notice
39    Copyright (C) The Internet Society (2005).
41 Abstract
43    This document defines a new function for the GSS-API which allows
44    applications to store delegated (and other) credentials in the
45    implicit GSS-API credential store.  This is needed for GSS-API
46    applications to use delegated credentials as they would use other
47    credentials.
55 Williams                 Expires April 19, 2006                 [Page 1]
57 Internet-Draft              GSS_Store_cred()                October 2005
60 Table of Contents
62    1.  Conventions used in this document  . . . . . . . . . . . . . .  3
63    2.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  4
64    3.  GSS_Store_cred() . . . . . . . . . . . . . . . . . . . . . . .  5
65    4.  C-Bindings . . . . . . . . . . . . . . . . . . . . . . . . . .  7
66    5.  Examples . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
67    6.  Security considerations  . . . . . . . . . . . . . . . . . . .  9
68    7.  Normative  . . . . . . . . . . . . . . . . . . . . . . . . . .  9
69        Author's Address . . . . . . . . . . . . . . . . . . . . . . . 10
70        Intellectual Property and Copyright Statements . . . . . . . . 11
111 Williams                 Expires April 19, 2006                 [Page 2]
113 Internet-Draft              GSS_Store_cred()                October 2005
116 1.  Conventions used in this document
118    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
119    "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
120    document are to be interpreted as described in [RFC2119].
167 Williams                 Expires April 19, 2006                 [Page 3]
169 Internet-Draft              GSS_Store_cred()                October 2005
172 2.  Introduction
174    The GSS-API [RFC2743] clearly assumes that credentials exist in an
175    implicit store whence they can be acquired using GSS_Acquire_cred()
176    and GSS_Add_cred() or through use of the default credential.
177    Multiple credential stores may exist on a given host, but only one
178    store may be accessed by GSS_Acquire_cred() and GSS_Add_cred() at any
179    given time.
181    This assumption can be seen in sections 1.1.1.2 and 1.1.1.3 of
182    [RFC2743] as well as in section 3.5 of [RFC2744].
184    Note to the RFC editor: please remove this note before publication.]
186    Applications may be able to change the credential store from which
187    credentials can be acquired, either by changing user contexts (where
188    the applications have the privilege to do so) or by other means
189    (where a user may have multiple credential stores).
191    Some GSS-API acceptor applications always change user contexts, after
192    accepting a GSS-API security context and making appropriate
193    authorization checks, to the user context corresponding to the
194    initiator principal name or to a context requested by the initiator.
195    The means by which credential stores are managed are generally beyond
196    the scope of the GSS-API.
198    In the case of delegated credential handles however, such credentials
199    do not exist in the acceptor's credential store or in the credential
200    stores of the user contexts to which the acceptor application might
201    change - which is precisely the raison d'etre of credential
202    delegation.  But the GSS-API provides no mechanism by which delegated
203    credential handles can be made available for acquisition through
204    GSS_Acquire_cred()/GSS_Add_cred().  The GSS-API also does not provide
205    any credential import/export interfaces like the GSS-API context
206    import/export interfaces.
208    Thus acceptors are limited to making only direct use of delegated
209    credential handles and only with GSS_Init_sec_context(),
210    GSS_Inquire_cred*() and GSS_Release_cred().  This limitation is
211    particularly onerous on Unix systems where a call to exec() to
212    replace the process image obliterates the delegated credentials
213    handle.
215    In order to make delegated credentials generally as useful as
216    credentials that can be acquired with GSS_Acquire_cred() and
217    GSS_Add_cred() a primitive is needed which allows storing of
218    credentials in the implicit credential store.  This primitive we call
219    "GSS_Store_cred()."
223 Williams                 Expires April 19, 2006                 [Page 4]
225 Internet-Draft              GSS_Store_cred()                October 2005
228 3.  GSS_Store_cred()
230    Inputs:
232    o  input_cred_handle CREDENTIAL HANDLE, -- credential to store; MUST
233       NOT be GSS_C_NO_CREDENTIAL
235    o  cred_usage INTEGER -- 0=INITIATE-AND-ACCEPT, 1=INITIATE-ONLY,
236       2=ACCEPT-ONLY
238    o  desired_mech_element OBJECT IDENTIFIER, -- if GSS_C_NULL_OID then
239       store all the elements of the input_cred_handle, otherwise store
240       only the element of the corresponding mechanism
242    o  overwrite_cred BOOLEAN, -- if TRUE replace any credential for the
243       same principal in the credential store
245    o  default_cred BOOLEAN -- if TRUE make the stored credential
246       available as the default credential (for acquisition with
247       GSS_C_NO_NAME as the desired name or for use as
248       GSS_C_NO_CREDENTIAL)
250    Outputs:
252    o  major_status INTEGER,
254    o  minor_status INTEGER,
256    o  mech_elements_stored SET OF OBJECT IDENTIFIER, -- the set of
257       mechanism OIDs for which credential elements were successfully
258       stored
260    o  cred_usage_stored INTEGER -- like cred_usage, but indicates what
261       kind of credential was stored (useful when the cred_usage input
262       parameter is set to INITIATE-AND-ACCEPT)
264    Return major_status codes:
266    o  GSS_S_COMPLETE indicates that the credentials were successfully
267       stored.
269    o  GSS_S_CREDENTIALS_EXPIRED indicates that the input credentials had
270       expired or expired before they could be stored.
272    o  GSS_S_NO_CRED indicates that no input credentials were given.
274    o  GSS_S_UNAVAILABLE indicates that the credential store is not
275       available.
279 Williams                 Expires April 19, 2006                 [Page 5]
281 Internet-Draft              GSS_Store_cred()                October 2005
284    o  GSS_S_DUPLICATE_ELEMENT indicates that an element of the input
285       credential could not be stored because a credential for the same
286       principal exists in the current credential store and the
287       overwrite_cred input argument was FALSE.
289    o  GSS_S_FAILURE indicates that the credential could not be stored
290       for some other reason.  The minor status code may provide more
291       information if a non-GSS_C_NULL_OID desired_mech_element was
292       given.
294    GSS_Store_cred() is used to store, in the current credential store, a
295    given credential that has either been acquired from a different
296    credential store or been accepted as a delegated credential.
298    Specific mechanism elements of a credential can be stored one at a
299    time by specifying a non-GSS_C_NULL_OID mechanism OID as the
300    desired_mech_element input argument, in which case the minor status
301    output SHOULD have a mechanism-specific value when the major status
302    is not GSS_S_COMPLETE.
304    The initiator, acceptor or both usages of the input credential may be
305    stored as per the cred_usage input argument.
307    The credential elements that were actually stored, when the major
308    status is GSS_S_COMPLETE, are indicated through the cred_usage_stored
309    and mech_elements_stored function outputs.
311    If credentials already exist in the current store for the principal
312    of the input_cred_handle, then those credentials are not replaced
313    with the input credentials unless the overwrite_cred input argument
314    is TRUE.
316    Finally, if the current credential store has no default credential
317    (that is, no credential that could be acquired for GSS_C_NO_NAME) or
318    if the default_cred input argument is TRUE, and the input credential
319    can be successfully stored, then the input credential will be
320    available for acquisition with GSS_C_NO_NAME as the desired name
321    input to GSS_Acquire_cred() or GSS_Add_cred() as well as for use as
322    GSS_C_NO_CREDENTIAL for the cred_handle inputs to GSS_Inquire_cred(),
323    GSS_Inquire_cred_by_mech(), GSS_Init_sec_context() and
324    GSS_Accept_sec_context().
335 Williams                 Expires April 19, 2006                 [Page 6]
337 Internet-Draft              GSS_Store_cred()                October 2005
340 4.  C-Bindings
342    The C-bindings for GSS_Store_cred() make use of types from and are
343    designed based on the style of the GSS-APIv2 C-Bindings [RFC2744].
346       OM_uint32 gss_store_cred(
347          OM_uint32         *minor_status,
348          gss_cred_id_t     input_cred,
349          gss_cred_usage_t  cred_usage,
350          const gss_OID     desired_mech,
351          OM_uint32         overwrite_cred,
352          OM_uint32         default_cred,
353          gss_OID_set       *elements_stored,
354          gss_cred_usage_t  *cred_usage_stored)
357    Figure 1
359    The two boolean arguments, 'overwrite_cred' and 'default_cred' are
360    typed as OM_uint32; 0 corresponds to FALSE, non-zero values
361    correspond to TRUE.
391 Williams                 Expires April 19, 2006                 [Page 7]
393 Internet-Draft              GSS_Store_cred()                October 2005
396 5.   Examples
398    The intended usage of GSS_Store_cred() is to make delegated
399    credentials available to child processes of GSS-API acceptor
400    applications.  Example pseudo-code:
403       /*
404        * <GSS_Accept_sec_context() loop resulting in GSS_S_COMPLETE,
405        * an initiator name (hereafter, "src_name") and a delegated
406        * credential handle (hereafter "deleg_cred").>
407        *
408        * <"requested_username" is a username derived from the
409        * initiator name or explicitly requested by the initiator
410        * application.>
411        */
412       ...
414       if (authorize_gss_client(src_name, requested_username)) {
415          /*
416           * For Unix-type platforms this may mean calling setuid() and
417           * it may or may not also mean setting/unsetting such
418           * environment variables as KRB5CCNAME and what not.
419           */
420          if (change_user_context(requested_username))
421             (void) gss_store_creds(&minor_status, deleg_cred,
422                                    GSS_C_INITIATE, actual_mech,
423                                    0, 1, NULL, NULL);
424          }
425          else ...
426       }
427       else ...
447 Williams                 Expires April 19, 2006                 [Page 8]
449 Internet-Draft              GSS_Store_cred()                October 2005
452 6.  Security considerations
454    Acceptor applications MUST only store delegated credentials into
455    appropriate credential stores and only after proper authorization of
456    the authenticated initiator principal to the requested service(s).
458    Acceptor applications that have no use for delegated credentials MUST
459    release them (such acceptor applications that use the GSS-API
460    C-Bindings may simply provide a NULL value for the
461    delegated_cred_handle argument to gss_accept_sec_context()).
463 7.  Normative
465    [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
466               Requirement Levels", BCP 14, RFC 2119, March 1997.
468    [RFC2743]  Linn, J., "Generic Security Service Application Program
469               Interface Version 2, Update 1", RFC 2743, January 2000.
471    [RFC2744]  Wray, J., "Generic Security Service API Version 2 :
472               C-bindings", RFC 2744, January 2000.
503 Williams                 Expires April 19, 2006                 [Page 9]
505 Internet-Draft              GSS_Store_cred()                October 2005
508 Author's Address
510    Nicolas Williams
511    Sun Microsystems
512    5300 Riata Trace Ct
513    Austin, TX  78727
514    US
516    Email: Nicolas.Williams@sun.com
559 Williams                 Expires April 19, 2006                [Page 10]
561 Internet-Draft              GSS_Store_cred()                October 2005
564 Intellectual Property Statement
566    The IETF takes no position regarding the validity or scope of any
567    Intellectual Property Rights or other rights that might be claimed to
568    pertain to the implementation or use of the technology described in
569    this document or the extent to which any license under such rights
570    might or might not be available; nor does it represent that it has
571    made any independent effort to identify any such rights.  Information
572    on the procedures with respect to rights in RFC documents can be
573    found in BCP 78 and BCP 79.
575    Copies of IPR disclosures made to the IETF Secretariat and any
576    assurances of licenses to be made available, or the result of an
577    attempt made to obtain a general license or permission for the use of
578    such proprietary rights by implementers or users of this
579    specification can be obtained from the IETF on-line IPR repository at
580    http://www.ietf.org/ipr.
582    The IETF invites any interested party to bring to its attention any
583    copyrights, patents or patent applications, or other proprietary
584    rights that may cover technology that may be required to implement
585    this standard.  Please address the information to the IETF at
586    ietf-ipr@ietf.org.
589 Disclaimer of Validity
591    This document and the information contained herein are provided on an
592    "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
593    OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
594    ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
595    INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
596    INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
597    WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
600 Copyright Statement
602    Copyright (C) The Internet Society (2005).  This document is subject
603    to the rights, licenses and restrictions contained in BCP 78, and
604    except as set forth therein, the authors retain all their rights.
607 Acknowledgment
609    Funding for the RFC Editor function is currently provided by the
610    Internet Society.
615 Williams                 Expires April 19, 2006                [Page 11]