INTERNET-DRAFT                                            Bryan D. Payne
Category: Informational                                 Univ of Maryland
<draft-payne-eap-sm-00.txt>
9 May 2002                                          Nick L. Petroni, Jr.
                                                        Univ of Maryland

            Extensible Authentication Protocol State Machine

This document is an Internet-Draft and is in full conformance with all
provisions of Section 10 of RFC2026.

Internet-Drafts are working documents of the Internet Engineering Task
Force (IETF), its areas, and its working groups.  Note that other groups
may also distribute working documents as Internet- Drafts.

Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time.  It is inappropriate to use Internet-Drafts as reference material
or to cite them other than as "work in

The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt

The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.

1.  Copyright Notice

Copyright (C) The Internet Society (2002).  All Rights Reserved.

2.  Abstract

The specification for the Extensible Authentication Protocol (EAP) [2]
omits a state machine description.  This omission has led to ambiguity
in the specification and potential security problems in EAP
implementations.  This document outlines a state machine to be
integrated into the next revision of the EAP RFC.

3.  Introduction

This document offers a proposed state machine for RFC 2284bis (EAP).
There is a state machine for the peer and one for the authenticator.
Accompanying each state machine diagram is a description of the notation
used.  Whenever possible, the same notation has been used in both the
peer and authenticator state machines.

Each state machine provides explicit details regarding state transitions
that are associated with each message.  Therefore, if a message arrives



Payne,Petroni                 Informational                     [Page 1]





INTERNET-DRAFT              EAP State Machine                 9 May 2002


that is not handled by the current state, then the message MUST be
dropped and SHOULD be logged.  All malformed messages (i.e., messages
not complying to the format specified in RFC 2284bis) MUST be dropped
and SHOULD be logged.

One type of EAP message has been purposely omitted from the state
machines: the notification messages.  This was done because notification
request messages can be sent from the authenticator to the peer at any
point in the state machine.  Upon receipt of this request, the peer MUST
send a notification reply.  This transaction does not induce any changes
to the peer or authenticator state machines.

For simplicity, the state machine diagrams do not include any
information about timeouts.  However, any implementation SHOULD
transition to the initialization state after waiting n seconds in a
given state, where "n" is defined by the implementation.  Failure to
implement timeouts can cause the implementation to become stuck in a
state, so this is not recommended.

Additional details about the meaning of each state, and how to handle
messages in each state are included in the text accompanying each state
machine diagram.

3.1.  Requirements language

In this document, the key words "MAY", "MUST,  "MUST  NOT",  "optional",
"recommended",  "SHOULD",  and  "SHOULD  NOT",  are to be interpreted as
described in [1].

A protocol submission is not compliant if it fails to satisfy one or
more of the MUST or MUST NOT requirements for the capabilities that it
implements.  A protocol submission that satisfies all the MUST, MUST
NOT, SHOULD and SHOULD NOT requirements for its capabilities is said to
be "unconditionally compliant"; one that satisfies all the MUST and MUST
NOT requirements but not all the SHOULD or SHOULD NOT requirements for
its protocols is said to be "conditionally compliant."

4.  Policy

As noted in the title, EAP is extensible in nature. Although originally
designed to allow for a series of one-way authentications, current uses
and new EAP methods allow for mutual authentication via a single run of
the protocol.  As a direct result of the extensibility of the protocol,
both authenticators and peers are given the opportunity to enforce
policies via the protocol. For example, a peer may choose to only allow
EAP methods that provide mutual authentication or an authenticator may
choose to mandate three successful method authentications out of the
five it supports before allowing access.  While an advantage of this is



Payne,Petroni                 Informational                     [Page 2]





INTERNET-DRAFT              EAP State Machine                 9 May 2002


more flexibility, one disadvantage is the difficulty involved in
formalizing the process.  In order to provide for such flexibility, we
have introduced the concept of a policy for both the authenticator and
the peer. Given the procedures described below, the the authenticator
can insure that its policy is met before sending a success message and
the peer can insure that any success message it receives comes at an
allowable time. The result is a well-defined state machine that
maintains the extensibility of the protocol. Of course, the security of
the protocol directly depends on the effectiveness of the policy being
enforced.









































Payne,Petroni                 Informational                     [Page 3]





INTERNET-DRAFT              EAP State Machine                 9 May 2002


5.  EAP Peer State Machine

The following is a diagram of the EAP Peer state machine. Also included
is an explanation of the primitives and procedures referenced in the
diagram, as well as a clarification of notation.
                             --------------------
                            | Initialization     |
                            |====================|
  ------------------------->|initPolicy()        |
  |                          --------------------
  |                                  |
  |                                  |UCT
  |              Rec(ID Req.)        V      !Valid(Rec(Auth Req.))
  |  ---------------      ---------------------      -----------------
  | |Peer Ident.    |<---| Unauthenticated     |--->| Invalid Request |
  | |===============|    |=====================|    |=================|
  | | Send(ID resp.)|<---|authMethodSuccess = 0|<---| Send(NAK resp.) |
  |  ---------------      ---------------------      -----------------
  |                   UCT       |     ^      |   UCT
  |                             |     |      |
  |                             |     |      |
  |       Valid(Rec(Auth Req.)) |     |      | Rec(Success)
  |                             V     |      | && policySatisfied()
  |                 ***************** |      |
  |                 *               * |      V
  |                 * EAP Method    * |    -----------------
  |                 * Peer State    * |   | Authenticated   |
  |                 *   Machine     * |   |=================|
  |                 *===============* |   |                 |
  |                 *               * |    -----------------
  ----------------  * updatePolicy()* |
   Rec(Failure)     *               * |
                    *               * |
                    *               * |
                    *               * |
                    ***************** |
                            |         |
                            -----------
                            isSet(authMethodSuccess)

5.1.  Variables


authMethodSuccess
   Set when the current authentication method has been determined to
   succeed. SHOULD be set by the EAP Method Peer.





Payne,Petroni                 Informational                     [Page 4]





INTERNET-DRAFT              EAP State Machine                 9 May 2002


5.2.  Procedures


Send
   Send the EAP Response Packet with the ID field corresponding to the
   appropriate EAP Request Packet to the lower layer for delivery.

Receive
   Determine if a previously unprocessed packet of the specified type
   has been delivered from the lower level.

isSet
   Evaluate the specified variable to determine its truth value.

Valid
   Based on the peer's own policy, determine if the specified request
   type is supported and allowed. Return true if so, false if not.

initPolicy
   Reset the variables associated with the Peer's policy to their
   initial values.

updatePolicy
   Generic procedure call relating to the update of any/all necessary
   variables related to the Peer's policy.

policySatisfied
   Determine if the Peer's policy has been satisfied to the point that
   Success is an allowable transition.

5.3.  States


INITIALIZATION
   This state is entered when the peer protocol begins and anytime the
   protocol resets due to a failure.

UNAUTHENTICATED
   The state of the protocol after being initialized, but before
   entering a specific method's state machine.

PEER IDENTIFICATION
   State that handles the response to an ID request.

INVALID REQUEST
   State that responds to a request of an invalid type. Invalid is as
   defined by the Valid procedure and refers to the peer's policy for
   certain EAP methods (either unsupported or disallowed).



Payne,Petroni                 Informational                     [Page 5]





INTERNET-DRAFT              EAP State Machine                 9 May 2002


EAP METHOD PEER STATE MACHINE
   Each EAP method has its own state machine specific to that method.
   Because of the extensible nature of EAP, a particular peer's policy
   can significantly alter the operation of the protocol and therefore
   alter the peer state machine. For this reason, the state machine
   provides for policy and method-specific operation within the general
   context of the protocol. As shown in Section 3 , the state "EAP
   Method Authenticator State Machine" is left as a black-box
   representation of EAP methods. This method-specific state machine is
   responsible for updating the global variables associated with
   possible policies held by the larger authenticator state machine.
   This notion is represented in the Figure with a call to the function
   updatePolicy.

AUTHENTICATED
   The state reached after a receiving some indication of success, but
   only after determining such a success occurs at an allowable time.


































Payne,Petroni                 Informational                     [Page 6]





INTERNET-DRAFT              EAP State Machine                 9 May 2002


6.  EAP Authenticator State Machine


Let AMF = authMethodFail
    AMS = authMethodSucc
                                        -----------------
                                       | Initialization  |
                                       |=================|
-------------------------------------->| idCount = 0     |
|                                      | initPolicy()    |
|                                       -----------------
|                                              |
|                                              | UCT
|                                              V
|          ---------------------       -------------------
|         | Peer Identification |     | Unauthenticated   |<------------
|         |=====================|     |===================|            |
|       ->|  Send(ID Req.)      |<----|authMethodSucc = 0 |<---        |
|       | |  idCount++          |     |authMethodFail = 0 |   |        |
|       |  ---------------------       -------------------    |        |
|       |      |         |   |                       |        |        |
|       |      |         |   |Valid(Rec(ID Reply))   |        |        |
|       |      |         |   |                       |        |        |
|       --------         |   |             -----------        |        |
| !Valid(Rec(ID reply))  |   |             |                  |        |
| && idCount <           |   |             V                  |        |
|     idCountMax         |   |     *****************          |        |
|                        |   |     *               *          |        |
|                        |   |     * EAP Method    *          |        |
|                        |   ----->* Authenticator *-----------        |
|                        |         * State Machine * Rec(NAK)          |
|                        |         *===============*                   |
|                        |         *               *--------------------
|  !Valid(Rec(ID reply)))|         *updatePolicy() * isSet(AMS)
|  && idCount >=         |         *               * &&
|       idCountMax       |         *               * !policySatisfied()
|                  -------         *****************
|                  |                 |         |
|                  |                 |         |
|                  |       isSet(AMF)|         |isSet(AMS)
|                  |                 |         |&& policySatisfied()
|                  |                 V         V
|                  |        ---------------    ----------------
|                  ------->| Failure       |  | Authenticated  |
|                          |===============|  |================|
---------------------------| Send(Failure) |  | Send(Success)  |
            UCT             ---------------    ----------------




Payne,Petroni                 Informational                     [Page 7]





INTERNET-DRAFT              EAP State Machine                 9 May 2002


6.1.  Variables


idCounter
   Counts the number of times that a client is allowed to return an
   invalid ID reply.  RFC 2284bis recommends allowing the client at
   least three invalid ID replies to account for user error while typing
   in an identity.

authMethodFailure
   Set when the current authentication method has been determined to
   fail. SHOULD be set by the EAP Method Authenticator.

authMethodSuccess
   Set when the current authentication method has been determined to
   succeed. SHOULD be set by the EAP Method Authenticator.

   (Note that authMethodSuccess and authMethodFailure can not both be
   set to true at the same time.  This requirement MUST be maintained by
   the EAP Method Authenticator State Machine.)

6.2.  Constants


idCounterMax
   Specifies the max number of times that a peer can send an invalid ID
   reply before moving to a failure state.

6.3.  Procedures


Send
   Send the EAP Request Packet to the lower layer for delivery.

Receive
   Read a previously unprocessed packet of the specified type from the
   lower level once it is available.

Valid
   specified reply is what is expected. Return true if so, false if not.

initPolicy
   Reset the variables associated with the Authenticator's policy to
   their initial values.

updatePolicy
   Generic procedure call relating to the update of any/all necessary
   variables related to the Authenticator's policy.



Payne,Petroni                 Informational                     [Page 8]





INTERNET-DRAFT              EAP State Machine                 9 May 2002


policySatisfied
   Determine if the Authenticator's policy has been satisfied to the
   point that Success is an allowable transition.

6.4.  States


INITIALIZATION
   This state is entered when the authenticator protocol begins and
   anytime the protocol resets due to a failure.

UNAUTHENTICATED
   Under this state, the authenticator must decide if it will send an ID
   Request or proceed directly to the Auth Request.  If multiple Auth
   Requests are required by the authenticator's policy, then this state
   may be reached multiple times.

PEER IDENTIFICATION
   State that sends an ID request.

EAP METHOD AUTHENTICATOR STATE MACHINE
   Each EAP method has its own state machine specific to that method.
   Because of the extensible nature of EAP, a particular authenticator's
   policy can significantly alter the operation of the protocol and
   therefore alter the authenticator state machine. For this reason, the
   state machine provides for policy and method-specific operation
   within the general context of the protocol. As shown in Section 4,
   the state "EAP Method Peer State Machine" is left as a black-box
   representation of EAP methods.  This method-specific state machine is
   responsible for updating the global variables associated with
   possible policies held by the larger peer state machine. This notion
   is represented in the Figure with a call to the function
   updatePolicy.

FAILURE
   The state reached after sending the failure message.  The
   authenticator should reinitialize the state machine after sending a
   failure.

AUTHENTICATED
   The state reached after sending a success message.

7.  References


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




Payne,Petroni                 Informational                     [Page 9]





INTERNET-DRAFT              EAP State Machine                 9 May 2002


[2]  Blunk, L., Vollbrecht, J., Aboba, B., "Extensible Authentication
     Protocol (EAP)", RFC 2284, March 1998.

8.  Security Considerations

This document's intent is to describe the EAP state machine fully.  To
this end, any security concerns with this document are likely a
reflection of security concerns with EAP itself.

9.  IANA Considerations

This draft does not create any new number spaces for IANA
administration.

10.  Acknowledgments

Thanks to the members of the EAP working group who have discussed and
commented on this document.  We would also like to thank Chuk Yang Seng,
Univ of Maryland, for his through review of the state machines and
William Arbaugh, Univ of Maryland, for providing resources needed to
complete this document.  Finally, we would like to thank Bernard Aboba,
Microsoft, for being both flexible and helpful as we begin working with
the IETF.

11.  Authors' Addresses

Bryan D. Payne
Department of Computer Science
University of Maryland
A.V. Williams Building
College Park, MD 20742

Email: bdpayne@cs.umd.edu

Nick L. Petroni, Jr.
Department of Computer Science
University of Maryland
A.V. Williams Building
College Park, MD 20742

Email: npetroni@cs.umd.edu

12.  Intellectual Property Statement

The IETF takes no position regarding the validity or scope of any
intellectual property 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



Payne,Petroni                 Informational                    [Page 10]





INTERNET-DRAFT              EAP State Machine                 9 May 2002


might not be available; neither does it represent that it has made any
effort to identify any such rights.  Information on the IETF's
procedures with respect to rights in standards-track and standards-
related documentation can be found in BCP-11.  Copies of claims of
rights made available for publication 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
implementors or users of this specification can be obtained from the
IETF Secretariat.

The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary rights
which may cover technology that may be required to practice this
standard.  Please address the information to the IETF Executive
Director.

13.  Full Copyright Statement

Copyright (C) The Internet Society (2002).  All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it or
assist in its implementation may be prepared, copied, published and
distributed, in whole or in part, without restriction of any kind,
provided that the above copyright notice and this paragraph are included
on all such copies and derivative works.  However, this document itself
may not be modified in any way, such as by removing the copyright notice
or references to the Internet Society or other Internet organizations,
except as needed for the purpose of developing Internet standards in
which case the procedures for copyrights defined in the Internet
Standards process must be followed, or as required to translate it into
languages other than English.  The limited permissions granted above are
perpetual and will not be revoked by the Internet Society or its
successors or assigns.  This document and the information contained
herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE
INTERNET ENGINEERING TASK FORCE DISCLAIMS 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."

14.  Expiration Date

This memo is filed as <draft-payne-eap-sm-00.txt>, and expires November
10, 2002.








Payne,Petroni                 Informational                    [Page 11]