RFC 4178 - The Simple and Protected Generic Security Service(2)

时间:2006-11-01 来源: 作者: 点击:
IV)IfnomechlistMICtokenwasincludedbuttheMICtoken exchangeisrequired,thenegotiationSHALLbeterminated. GSS_Accept_sec_context()indicatesGSS_S_DEFECTIVE_TOKEN. c)Inthecasethatthechosenmechanismexchanges
  

       IV) If no mechlistMIC token was included but the MIC token
           exchange is required, the negotiation SHALL be terminated.
           GSS_Accept_sec_context() indicates GSS_S_DEFECTIVE_TOKEN.

   c) In the case that the chosen mechanism exchanges an odd number of
      mechanism tokens (i.e., the initiator sends the last mechanism
      token), the initiator does the following when generating the
      negotiation message containing the last mechanism token: if the
      negState was request-mic in the first reply from the target, a
      mechlistMIC token MUST be included; otherwise, the mechlistMIC

      token is OPTIONAL.  (Note that the MIC token exchange is required
      if a mechanism other than the initiator’s first choice is chosen.)
      In the case that the optimistic mechanism token is the only
      mechanism token for the initiator’s preferred mechanism, the
      mechlistMIC token is OPTIONAL.  Whether the mechlistMIC token is
      included, GSS_Init_sec_context() indicates GSS_S_CONTINUE_NEEDED.
      Initiators that wish to be compatible with legacy Windows SPNEGO
      implementations, as described in Appendix C, should not generate a
      mechlistMIC token when the MIC token exchange is not required.
      The acceptor then processes the last mechanism token and does one
      of the following:

        I) If a mechlistMIC token was included and is correctly
           verified, GSS_Accept_sec_context() indicates GSS_S_COMPLETE.
           The output negotiation message contains a mechlistMIC token
           and an accept_complete state.  The initiator MUST then verify
           this mechlistMIC token.

       II) If a mechlistMIC token was included but is incorrect, the
           negotiation SHALL be terminated.  GSS_Accept_sec_context()
           indicates GSS_S_DEFECTIVE_TOKEN.

      III) If no mechlistMIC token was included and the mechlistMIC
           token exchange is not required, GSS_Accept_sec_context()
           indicates GSS_S_COMPLETE.  The output negotiation message
           contains an accept_complete state.

       IV) In the case that the optimistic mechanism token is also the
           last mechanism token (when the initiator’s preferred
           mechanism is accepted by the target) and the target sends a
           request-mic state but the initiator did not send a
           mechlistMIC token, the target then MUST include a mechlistMIC
           token in that first reply.  GSS_Accept_sec_context()
           indicates GSS_S_CONTINUE_NEEDED.  The initiator MUST verify
           the received mechlistMIC token and generate a mechlistMIC
           token to send back to the target.  The target SHALL, in turn,
           verify the returned mechlistMIC token and complete the
           negotiation.

        V) If no mechlistMIC token was included and the acceptor sent a
           request-mic state in the first reply message (the exchange of
           MIC tokens is required), the negotiation SHALL be terminated.
           GSS_Accept_sec_context() indicates GSS_S_DEFECTIVE_TOKEN.

6.  Extensibility

   Two mechanisms are provided for extensibility.  First, the ASN.1
   structures in this specification MAY be expanded by IETF standards
   action.  Implementations receiving unknown fields MUST ignore these
   fields.

   Secondly, OIDs corresponding to a desired mechanism attribute (i.e.,
   mechanism variants) may be included in the set of preferred
   mechanisms by an initiator.  The acceptor can choose to honor this
   request by preferring mechanisms that have the included attributes.
   Future work within the Kitten working group is expected to
   standardize common attributes that SPNEGO mechanisms may wish to
   support.  At this time, it is sufficient to say that initiators MAY
   include OIDs that do not correspond to mechanisms.  Such OIDs MAY
   influence the acceptor’s choice of mechanism.  As discussed in
   Section 5, if there are mechanisms that, if present in the
   initiator’s list of mechanisms, might be preferred by the acceptor
   instead of the initiator’s preferred mechanism, the acceptor MUST
   demand the MIC token exchange.  As the consequence, acceptors MUST
   demand the MIC token exchange if they support negotiation of
   attributes not available in the initiator’s preferred mechanism,
   regardless of whether the initiator actually requested these
   attributes.

7.  Security Considerations

   In order to produce the MIC token for the mechanism list, the
   mechanism must provide integrity protection.  When the selected
   mechanism does not support integrity protection, the negotiation is
   vulnerable: an active attacker can force it to use a security
   mechanism that is not mutually preferred but is acceptable to the
   target.

   This protocol provides the following guarantees when per-message
   integrity services are available on the established mechanism
   context, and the mechanism list was altered by an adversary such that
   a mechanism that is not mutually preferred could be selected:

   a) If the last mechanism token is sent by the initiator, both peers
      shall fail;

   b) If the last mechanism token is sent by the acceptor, the acceptor
      shall not complete and the initiator, at worst, shall complete
      with its preferred mechanism being selected.

   The negotiation may not be terminated if an alteration was made but
   had no material impact.

   The protection of the negotiation depends on the strength of the
   integrity protection.  In particular, the strength of SPNEGO is no
   stronger than the integrity protection of the weakest mechanism
   acceptable to GSS-API peers.

   Note that where there exist multiple mechanisms with similar context
   tokens, but different semantics, such that some or all of the
   mechanisms’ context tokens can be easily altered so that one
   mechanism’s context tokens may pass for another of the similar
   mechanism’s context tokens, then there may exist a downgrade or
   similar attacks.  For example, if a given family of mechanisms uses
   the same context token syntax for two or more variants and depends on
   the OID in the initial token’s pseudo-ASN.1/DER wrapper, but does not
   provide integrity protection for that OID, then there may exist an
   attack against those mechanisms.  SPNEGO does not generally defeat
   such attacks.

   In all cases, the communicating peers are exposed to the denial of
   service threat.

8.  Acknowledgments

   The authors wish to thank Sam Hartman, Nicolas Williams, Ken Raeburn,
   Martin Rex, Jeff Altman, Tom Yu, Cristian Ilac, Simon Spero, and Bill
   Sommerfeld for their comments and suggestions during the development
   of this document.

   Luke Howard provided a prototype of this protocol in Heimdal and
   resolved several issues in the initial version of this document.

   Eric Baize and Denis Pinkas wrote the original SPNEGO specification
   [RFC2478] of which some of the text has been retained in this
   document.

9.  References

9.1.  Normative References

   [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
             Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC2743] Linn, J., "Generic Security Service Application Program
             Interface Version 2, Update 1", RFC 2743, January 2000.

   [X690]    ASN.1 encoding rules: Specification of Basic Encoding Rules
             (BER), Canonical Encoding Rules (CER) and Distinguished
             Encoding Rules (DER), ITU-T Recommendation X.690 (1997) |
             ISO/IEC International Standard 8825-1:1998.

9.2.  Informative References

   [RFC2478] Baize, E. and D. Pinkas, "The Simple and Protected GSS-API
             Negotiation Mechanism", RFC 2478, December 1998.

Appendix A.  SPNEGO ASN.1 Module

   SPNEGOASNOneSpec {
      iso(1) identified-organization(3) dod(6) internet(1)
      security(5) mechanism(5) snego (2) modules(4) spec2(2)
   } DEFINITIONS EXPLICIT TAGS ::= BEGIN

   MechType ::= OBJECT IDENTIFIER
       -- OID represents each security mechanism as suggested by
       -- [RFC2743]

   MechTypeList ::= SEQUENCE OF MechType

   NegotiationToken ::= CHOICE {
       negTokenInit    [0] NegTokenInit,
       negTokenResp    [1] NegTokenResp
   }

   NegTokenInit ::= SEQUENCE {
       mechTypes       [0] MechTypeList,
       reqFlags        [1] ContextFlags  OPTIONAL,
         -- inherited from RFC 2478 for backward compatibility,
         -- RECOMMENDED to be left out
       mechToken       [2] OCTET STRING  OPTIONAL,
       mechListMIC     [3] OCTET STRING  OPTIONAL,
       ...
   }
   NegTokenResp ::= SEQUENCE {
       negState       [0] ENUMERATED {
           accept-completed    (0),
           accept-incomplete   (1),
           reject              (2),
           request-mic         (3)
       }                                 OPTIONAL,
         -- REQUIRED in the first reply from the target
       supportedMech   [1] MechType      OPTIONAL,
         -- present only in the first reply from the target
       responseToken   [2] OCTET STRING  OPTIONAL,
       mechListMIC     [3] OCTET STRING  OPTIONAL,
       ...
   }

   ContextFlags ::= BIT STRING {
       delegFlag       (0),
       mutualFlag      (1),
       replayFlag      (2),
       sequenceFlag    (3),
       anonFlag        (4),

       confFlag        (5),
       integFlag       (6)
   } (SIZE (32))

   END

Appendix B.  GSS-API Negotiation Support API

   In order to provide to a GSS-API caller (the initiator or the target
   or both) with the ability to choose among the set of supported
   mechanisms, a reduced set of mechanisms for negotiation and two
   additional APIs are defined:

   o  GSS_Get_neg_mechs() indicates the set of security mechanisms
      available on the local system to the caller for negotiation, for
      which appropriate credentials are available.

   o  GSS_Set_neg_mechs() specifies the set of security mechanisms to be
      used on the local system by the caller for negotiation, for the
      given credentials.

B.1.  GSS_Set_neg_mechs Call

   Inputs:

   o  cred_handle CREDENTIAL HANDLE, -- NULL specifies default
       -- credentials
   o  mech_set SET OF OBJECT IDENTIFIER

   Outputs:

   o  major_status INTEGER,
   o  minor_status INTEGER

   Return major_status codes:

   o  GSS_S_COMPLETE indicates that the set of security mechanisms
      available for negotiation has been set to mech_set.
   o  GSS_S_FAILURE indicates that the requested operation could not be
      performed for reasons unspecified at the GSS-API level.

   This allows callers to specify the set of security mechanisms that
   may be negotiated with the credential identified by cred_handle.
   This call is intended to support specialized callers who need to
   restrict the set of negotiable security mechanisms from the set of
   all security mechanisms available to the caller (based on available

   credentials).  Note that if more than one mechanism is specified in
   mech_set, the order in which those mechanisms are specified implies a
   relative preference.

B.2.  GSS_Get_neg_mechs Call

   Input:

   o  cred_handle CREDENTIAL HANDLE -- NULL specifies default --
      credentials

   Outputs:

   o  major_status INTEGER,
   o  minor_status INTEGER,
   o  mech_set SET OF OBJECT IDENTIFIER

   Return major_status codes:

   o  GSS_S_COMPLETE indicates that the set of security mechanisms
      available for negotiation has been returned in mech_set.

   o  GSS_S_FAILURE indicates that the requested operation could not be
      performed for reasons unspecified at the GSS-API level.

   This allows callers to determine the set of security mechanisms
   available for negotiation with the credential identified by
   cred_handle.  This call is intended to support specialized callers
   who need to reduce the set of negotiable security mechanisms from the
   set of supported security mechanisms available to the caller (based
   on available credentials).

   Note: The GSS_Indicate_mechs() function indicates the full set of
   mechanism types available on the local system.  Since this call has
   no input parameter, the returned set is not necessarily available for
   all credentials.

Appendix C.  Changes since RFC 2478

   SPNEGO implementations in Microsoft Windows 2000/Windows XP/Windows
   Server 2003 have the following behavior: no mechlistMIC is produced
   and mechlistMIC is not processed if one is provided; if the initiator
   sends the last mechanism token, the acceptor will send back a
   negotiation token with an accept_complete state and no mechlistMIC
   token.  In addition, an incorrect OID (1.2.840.48018.1.2.2) can be
   used to identify the GSS-API Kerberos Version 5 mechanism.

   The following changes have been made to be compatible with these
   legacy implementations.

   *  NegTokenTarg is changed to negTokenResp and is the message format
      for all subsequent negotiation tokens.

   *  NegTokenInit is the message for the initial negotiation message,
      and only that message.

   *  mechTypes in negTokenInit is not optional.

   *  If the selected mechanism is also the most preferred mechanism for
      both peers, it is safe to omit the MIC tokens.

   If at least one of the two peers implements the updated pseudo
   mechanism in this document, the negotiation is protected.

   The following changes are to address problems in RFC 2478.

   *  reqFlags is not protected, therefore it should not impact the
      negotiation.

   *  DER encoding is required.

   *  GSS_GetMIC() input is clarified.

   *  Per-message integrity services are requested for the negotiated
      mechanism.

   *  Two MIC tokens are exchanged, one in each direction.

   An implementation that conforms to this specification will not
   inter-operate with a strict RFC 2748 implementation.  Even if the new
   implementation always sends a mechlistMIC token, it will still fail
   to inter-operate.  If it is a server, it will fail because it
   requests a mechlistMIC token using an option that older
   implementations do not support.  Clients will tend to fail as well.

   As an alternative to the approach chosen in this specification, we
   could have documented a correct behavior that is fully backward
   compatible with RFC 2478 and included an appendix on how to inter-
   operate with existing incorrect implementations of RFC 2478.

   As a practical matter, the SPNEGO implementers within the IETF have
   valued interoperability with the Microsoft implementations.  We were
   unable to choose to maintain reasonable security guarantees, to
   maintain interoperability with the Microsoft implementations, and to
   maintain interoperability with correct implementations of RFC 2478.

   The working group was not aware of any RFC 2478 implementations
   deployed on the Internet.  Even if there are such implementations, it
   is unlikely that they will inter-operate because of a critical flaw
   in the description of the encoding of the mechanism list in RFC 2478.

   With the approach taken in this specification, security is ensured
   between new implementations all the time while maintaining
   interoperability with the implementations deployed within the IETF
   community.  The working group believes that this justifies breaking
   compatibility with a correct implementation of RFC 2478.

Appendix D.  mechListMIC Computation Example

   The following is an example to illustrate how the mechListMIC field
   would be computed.

   The initial part of the DER encoding of NegTokenInit is constructed
   as follows (the "nn" are length encodings, possibly longer than one
   octet):

      30 -- identifier octet for constructed SEQUENCE (NegTokenInit)
      nn -- length

         -- contents octets of the SEQUENCE begin with
         -- DER encoding of "[0] MechTypeList":
         A0 -- identifier octet for constructed [0]
         nn -- length

             -- contents of the constructed [0] are DER encoding
             -- of MechTypeList (which is a SEQUENCE):
             30 -- identifier octet for constructed SEQUENCE
             nn -- length

                -- contents octets of the SEQUENCE begin with
                -- DER encoding of OBJECT IDENTIFIER:
                06 -- identifier octet for primitive OBJECT IDENTIFIER
                09 -- length
                2A 86 48 86 F7 12 01 02 02 -- Kerberos V5
                                           -- {1 2 840 113554 1 2 2}

   If a mechlistMIC needs to be generated (according to the rules in
   Section 5), it is computed by using the DER encoding of the type
   MechTypeList data from the initiator’s NegTokenInit token as input to
   the GSS_GetMIC() function.  In this case, the MIC would be computed
   over the following octets:

      DER encoding of MechTypeList:
      30 nn 06 09 2A 86 48 86 F7 12 01 02 02 ...

   Note that the identifier octet and length octet(s) for constructed
   [0] (A0 nn) are not included in the MIC computation.

Authors’ Addresses

   Larry Zhu
   Microsoft Corporation
   One Microsoft Way
   Redmond, WA  98052
   US

   EMail: lzhu@microsoft.com

   Paul Leach
   Microsoft Corporation
   One Microsoft Way
   Redmond, WA  98052
   US

   EMail: paulle@microsoft.com

   Karthik Jaganathan
   Microsoft Corporation
   One Microsoft Way
   Redmond, WA  98052
   US

   EMail: karthikj@microsoft.com

   Wyllys Ingersoll
   Sun Microsystems
   1775 Wiehle Avenue, 2nd Floor
   Reston, VA  20190
   US

   EMail: wyllys.ingersoll@sun.com

Full Copyright Statement

   Copyright (C) The Internet Society (2005).

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at ietf-
   ipr@ietf.org.

Acknowledgement

   Funding for the RFC Editor function is currently provided by the
   Internet Society.
------分隔线----------------------------
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
推荐内容