Fix KRB-FX-CF2 for enctypes with non-dense keyspaces
[heimdal.git] / doc / standardisation / draft-ietf-kitten-gssapi-store-cred-02.txt
blob80125f960602ce67c0bb20a4d72a0681df5c67cd
4 NETWORK WORKING GROUP                                        N. Williams
5 Internet-Draft                                                       Sun
6 Intended status: Informational                          October 19, 2006
7 Expires: April 22, 2007
10           GSS-API Extension for Storing Delegated Credentials
11                draft-ietf-kitten-gssapi-store-cred-02.txt
13 Status of this Memo
15    By submitting this Internet-Draft, each author represents that any
16    applicable patent or other IPR claims of which he or she is aware
17    have been or will be disclosed, and any of which he or she becomes
18    aware will be disclosed, in accordance with Section 6 of BCP 79.
20    Internet-Drafts are working documents of the Internet Engineering
21    Task Force (IETF), its areas, and its working groups.  Note that
22    other groups may also distribute working documents as Internet-
23    Drafts.
25    Internet-Drafts are draft documents valid for a maximum of six months
26    and may be updated, replaced, or obsoleted by other documents at any
27    time.  It is inappropriate to use Internet-Drafts as reference
28    material or to cite them other than as "work in progress."
30    The list of current Internet-Drafts can be accessed at
31    http://www.ietf.org/ietf/1id-abstracts.txt.
33    The list of Internet-Draft Shadow Directories can be accessed at
34    http://www.ietf.org/shadow.html.
36    This Internet-Draft will expire on April 22, 2007.
38 Copyright Notice
40    Copyright (C) The Internet Society (2006).
55 Williams                 Expires April 22, 2007                 [Page 1]
57 Internet-Draft              GSS_Store_cred()                October 2006
60 Abstract
62    This document defines a new function for the GSS-API which allows
63    applications to store delegated (and other) credentials in the
64    implicit GSS-API credential store.  This is needed for GSS-API
65    applications to use delegated credentials as they would use other
66    credentials.
69 Table of Contents
71    1.  Conventions used in this document  . . . . . . . . . . . . . .  3
72    2.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  4
73    3.  GSS_Store_cred() . . . . . . . . . . . . . . . . . . . . . . .  5
74    4.  C-Bindings . . . . . . . . . . . . . . . . . . . . . . . . . .  7
75    5.  Examples . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
76    6.  Security considerations  . . . . . . . . . . . . . . . . . . .  9
77    7.  Normative References . . . . . . . . . . . . . . . . . . . . . 10
78        Author's Address . . . . . . . . . . . . . . . . . . . . . . . 11
79        Intellectual Property and Copyright Statements . . . . . . . . 12
111 Williams                 Expires April 22, 2007                 [Page 2]
113 Internet-Draft              GSS_Store_cred()                October 2006
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 22, 2007                 [Page 3]
169 Internet-Draft              GSS_Store_cred()                October 2006
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    Applications may be able to change the credential store from which
185    credentials can be acquired, either by changing user contexts (where
186    the applications have the privilege to do so) or by other means
187    (where a user may have multiple credential stores).
189    Some GSS-API acceptor applications always change user contexts, after
190    accepting a GSS-API security context and making appropriate
191    authorization checks, to the user context corresponding to the
192    initiator principal name or to a context requested by the initiator.
193    The means by which credential stores are managed are generally beyond
194    the scope of the GSS-API.
196    In the case of delegated credential handles however, such credentials
197    do not exist in the acceptor's credential store or in the credential
198    stores of the user contexts to which the acceptor application might
199    change.  The GSS-API provides no mechanism by which delegated
200    credential handles can be made available for acquisition through
201    GSS_Acquire_cred()/GSS_Add_cred().  The GSS-API also does not provide
202    any credential import/export interfaces like the GSS-API context
203    import/export interfaces.
205    Thus acceptors are limited to making only direct use of delegated
206    credential handles and only with GSS_Init_sec_context(),
207    GSS_Inquire_cred*() and GSS_Release_cred().  This limitation is
208    particularly onerous on Unix systems where a call to exec() to
209    replace the process image obliterates any delegated credentials
210    handle that may exist in that process.
212    In order to make delegated credentials generally as useful as
213    credentials that can be acquired with GSS_Acquire_cred() and
214    GSS_Add_cred() a primitive is needed which allows storing of
215    credentials in the implicit credential store.  This primitive we call
216    "GSS_Store_cred()."
223 Williams                 Expires April 22, 2007                 [Page 4]
225 Internet-Draft              GSS_Store_cred()                October 2006
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 22, 2007                 [Page 5]
281 Internet-Draft              GSS_Store_cred()                October 2006
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 22, 2007                 [Page 6]
337 Internet-Draft              GSS_Store_cred()                October 2006
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_handle,
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 22, 2007                 [Page 7]
393 Internet-Draft              GSS_Store_cred()                October 2006
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 -- all
419           * OS-specific details.
420           */
421          if (change_user_context(requested_username))
422             (void) gss_store_creds(&minor_status, deleg_cred,
423                                    GSS_C_INITIATE, actual_mech,
424                                    0, 1, NULL, NULL);
425          }
426          else ...
427       }
428       else ...
447 Williams                 Expires April 22, 2007                 [Page 8]
449 Internet-Draft              GSS_Store_cred()                October 2006
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()).
503 Williams                 Expires April 22, 2007                 [Page 9]
505 Internet-Draft              GSS_Store_cred()                October 2006
508 7.  Normative References
510    [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
511               Requirement Levels", BCP 14, RFC 2119, March 1997.
513    [RFC2743]  Linn, J., "Generic Security Service Application Program
514               Interface Version 2, Update 1", RFC 2743, January 2000.
516    [RFC2744]  Wray, J., "Generic Security Service API Version 2 :
517               C-bindings", RFC 2744, January 2000.
559 Williams                 Expires April 22, 2007                [Page 10]
561 Internet-Draft              GSS_Store_cred()                October 2006
564 Author's Address
566    Nicolas Williams
567    Sun Microsystems
568    5300 Riata Trace Ct
569    Austin, TX  78727
570    US
572    Email: Nicolas.Williams@sun.com
615 Williams                 Expires April 22, 2007                [Page 11]
617 Internet-Draft              GSS_Store_cred()                October 2006
620 Full Copyright Statement
622    Copyright (C) The Internet Society (2006).
624    This document is subject to the rights, licenses and restrictions
625    contained in BCP 78, and except as set forth therein, the authors
626    retain all their rights.
628    This document and the information contained herein are provided on an
629    "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
630    OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
631    ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
632    INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
633    INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
634    WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
637 Intellectual Property
639    The IETF takes no position regarding the validity or scope of any
640    Intellectual Property Rights or other rights that might be claimed to
641    pertain to the implementation or use of the technology described in
642    this document or the extent to which any license under such rights
643    might or might not be available; nor does it represent that it has
644    made any independent effort to identify any such rights.  Information
645    on the procedures with respect to rights in RFC documents can be
646    found in BCP 78 and BCP 79.
648    Copies of IPR disclosures made to the IETF Secretariat and any
649    assurances of licenses to be made available, or the result of an
650    attempt made to obtain a general license or permission for the use of
651    such proprietary rights by implementers or users of this
652    specification can be obtained from the IETF on-line IPR repository at
653    http://www.ietf.org/ipr.
655    The IETF invites any interested party to bring to its attention any
656    copyrights, patents or patent applications, or other proprietary
657    rights that may cover technology that may be required to implement
658    this standard.  Please address the information to the IETF at
659    ietf-ipr@ietf.org.
662 Acknowledgment
664    Funding for the RFC Editor function is provided by the IETF
665    Administrative Support Activity (IASA).
671 Williams                 Expires April 22, 2007                [Page 12]