[RFCs/IDs] [Plain Text] [Tracker] [Diff1] [Diff2] [Nits]

Versions: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 RFC 4186

Network Working Group                             H. Haverinen (editor)
Internet Draft                                                    Nokia
                                                    J. Salowey (editor)
                                                                  Cisco
Expires: 27 April, 2004                                27 October, 2003



                         EAP SIM Authentication
                 draft-haverinen-pppext-eap-sim-12.txt


Status of this Memo

   This document is an Internet-Draft and is subject to 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 progress."

   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.

   Comments should be submitted to the eap@frascone.com mailing list.

   Distribution of this memo is unlimited.

Abstract

   This document specifies an Extensible Authentication Protocol (EAP)
   mechanism for authentication and session key distribution using the
   GSM Subscriber Identity Module (SIM). The mechanism specifies
   enhancements to GSM authentication and key agreement whereby
   multiple authentication triplets can be combined to create
   authentication responses and session keys of greater strength than
   the individual GSM triplets. The mechanism also includes network
   authentication, user anonymity support and a re-authentication
   procedure.







Haverinen and Salowey                                         [Page 1]

Internet Draft          EAP SIM Authentication        27 October, 2003


Table of Contents


   Status of this Memo.........................................1
   Abstract....................................................1
   Table of Contents...........................................2
   1. Introduction.............................................3
   2. Terms....................................................4
   3. Overview.................................................6
   4. Operation................................................8
   4.1. Version Negotiation....................................8
   4.2. Identity Management....................................9
   4.3. Re-Authentication.....................................25
   4.4. EAP/SIM Notifications.................................30
   4.5. Error Cases...........................................31
   4.6. Key Generation........................................33
   5. Message Format and Protocol Extensibility...............35
   5.1. Message Format........................................35
   5.2. Protocol Extensibility................................37
   6. Messages................................................37
   6.1. EAP-Request/SIM/Start.................................37
   6.2. EAP-Response/SIM/Start................................38
   6.3. EAP-Request/SIM/Challenge.............................38
   6.4. EAP-Response/SIM/Challenge............................39
   6.5. EAP-Request/SIM/Re-authentication.....................40
   6.6. EAP-Response/SIM/Re-authentication....................40
   6.7. EAP-Response/SIM/Client-Error.........................40
   6.8. EAP-Request/SIM/Notification..........................40
   6.9. EAP-Response/SIM/Notification.........................41
   7. Attributes..............................................41
   7.1. Table of Attributes...................................41
   7.2. AT_MAC................................................42
   7.3. AT_IV, AT_ENCR_DATA and AT_PADDING....................43
   7.4. AT_VERSION_LIST.......................................45
   7.5. AT_SELECTED_VERSION...................................46
   7.6. AT_NONCE_MT...........................................46
   7.7. AT_PERMANENT_ID_REQ...................................46
   7.8. AT_ANY_ID_REQ.........................................47
   7.9. AT_FULLAUTH_ID_REQ....................................47
   7.10. AT_IDENTITY..........................................47
   7.11. AT_RAND..............................................48
   7.12. AT_NEXT_PSEUDONYM....................................49
   7.13. AT_NEXT_REAUTH_ID....................................49
   7.14. AT_COUNTER...........................................50
   7.15. AT_COUNTER_TOO_SMALL.................................50
   7.16. AT_NONCE_S...........................................50
   7.17. AT_NOTIFICATION......................................51
   7.18. AT_CLIENT_ERROR_CODE.................................52
   8. IANA Considerations.....................................52
   9. Security Considerations.................................54
   9.1. Identity Protection...................................54
   9.2. Mutual Authentication and Triplet Exposure............54
   9.3. Key Derivation........................................55

Haverinen and Salowey  Expires: 27 April, 2004               [Page 2]

Internet Draft          EAP SIM Authentication        27 October, 2003


   9.4. Dictionary Attacks....................................56
   9.5. Credentials Reuse.....................................56
   9.6. Integrity and Replay Protection, and Confidentiality..57
   9.7. Negotiation Attacks...................................57
   9.8. Fast Reconnect........................................58
   9.9. Acknowledged Result Indications.......................58
   9.10. Man-in-the-middle Attacks............................58
   9.11. Generating Random Numbers............................59
   10. Security Claims........................................59
   11. Intellectual Property Right Notice.....................59
   12. Acknowledgements and Contributions.....................59
   12.1. Contributors.........................................59
   12.2. Acknowledgements.....................................60
   Normative References.......................................60
   Informative References.....................................61
   Editors' and Contributors' Contact Information.............63
   Annex A. Test Vectors......................................64
   Annex B. Pseudo-Random Number Generator....................72

1. Introduction

   This document specifies an Extensible Authentication Protocol (EAP)
   [EAP] mechanism for authentication and session key distribution
   using the GSM Subscriber Identity Module (SIM).

   GSM authentication is based on a challenge-response mechanism. The
   A3/A8 authentication algorithms that run on the SIM can be given a
   128-bit random number (RAND) as a challenge. The SIM runs an
   operator-specific algorithm, which takes the RAND and a secret key
   Ki stored on the SIM as input, and produces a 32-bit response (SRES)
   and a 64-bit long key Kc as output. The Kc key is originally
   intended to be used as an encryption key over the air interface, but
   in this protocol it is used for deriving keying material and not
   directly used. Hence the secrecy of Kc is critical to the security
   of this protocol. Please find more information about GSM
   authentication in [GSM 03.20].

   The lack of mutual authentication is a weakness in GSM
   authentication. The 64 bit cipher key (Kc) that is derived is not
   strong enough for data networks where stronger and longer keys are
   required. Hence in EAP/SIM, several RAND challenges are used for
   generating several 64-bit Kc keys, which are combined to constitute
   stronger keying material. In EAP/SIM the client issues a random
   number NONCE_MT to the network, in order to contribute to key
   derivation, and to prevent replays of EAP/SIM requests from previous
   exchanges. The NONCE_MT can be conceived as the client's challenge
   to the network. EAP/SIM also extends the combined RAND challenges
   and other messages with a message authentication code in order to
   provide message integrity protection along with mutual
   authentication.

   EAP/SIM specifies optional support for protecting the privacy of
   subscriber identity using the same concept as GSM, which is using

Haverinen and Salowey  Expires: 27 April, 2004               [Page 3]

Internet Draft          EAP SIM Authentication        27 October, 2003


   pseudonyms/temporary identifiers. It also specifies an optional re-
   authentication procedure.

   The security of EAP/SIM builds on underlying GSM mechanisms. The
   security properties of EAP/SIM are documented in Section 9 of this
   document. Implementers and users of EAP/SIM are advised to carefully
   study the security considerations in Section 9 in order to determine
   whether the security properties are sufficient for the environment
   in question, especially as the secrecy of Kc keys is key to the
   security of EAP/SIM. In brief, EAP/SIM is in no sense weaker than
   the GSM mechanisms. In some cases EAP/SIM provides better security
   properties than the underlying GSM mechanisms, particularly if the
   SIM credentials are only used for EAP/SIM and not re-used from
   GSM/GPRS. Many of the security features of EAP_SIM rely upon the
   secrecy of the Kc values in the SIM triplets, so protecting these
   values is key to the security of the EAP-SIM protocol. In any case,
   if the GSM authentication mechanisms are considered to be sufficient
   for use on the cellular networks, then EAP/SIM is expected to be
   sufficiently secure for other networks.

   The 3rd Generation Partnership Project (3GPP) has specified an
   enhanced Authentication and Key Exchange (AKA) architecture for the
   Universal Mobile Telecommunications System (UMTS). The UMTS AKA
   mechanism includes mutual authentication, replay protection and
   derivation of longer session keys. EAP AKA [EAP AKA] specifies an
   EAP method that is based on UMTS AKA. EAP AKA, which is a more
   secure protocol, may be used instead of EAP/SIM, if USIMs and 3G
   network infrastructure are available.

2. Terms

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in [RFC 2119].

   The terms and abbreviations "authenticator", "backend authentication
   server", "EAP server", "Silently Discard", "Master Session Key
   (MSK)", and "Extended Master Session Key (EMSK)" in this document
   are to be interpreted as described in [EAP].

   This document frequently uses the following terms and abbreviations:

   AAA protocol

      Authentication, Authorization and Accounting protocol

   AuC

      Authentication Centre. The GSM network element that provides the
      authentication triplets for authenticating the subscriber.




Haverinen and Salowey  Expires: 27 April, 2004               [Page 4]

Internet Draft          EAP SIM Authentication        27 October, 2003


   Authentication vector

      GSM triplets can be alternatively called authentication vectors.

   EAP

      Extensible Authentication Protocol.

   GSM

      Global System for Mobile communications.

   GSM Triplet

      The tuple formed by the three GSM authentication values RAND, Kc
      and SRES

   IMSI

      International Mobile Subscriber Identifier, used in GSM to
      identify subscribers.

   MAC

      Message Authentication Code

   NAI

      Network Access Identifier

   Permanent Identity

      The permanent identity of the peer, including an NAI realm
      portion in environments where a realm is used. The permanent
      identity is usually based on the IMSI. Used on full
      authentication only.

   Permanent Username

      The username portion of permanent identity, ie. not including any
      realm portions.

   Pseudonym Identity

      A pseudonym identity of the peer, including an NAI realm portion
      in environments where a real is used. Used on full authentication
      only.

   Pseudonym Username

      The username portion of pseudonym identity, ie. not including any
      realm portions.


Haverinen and Salowey  Expires: 27 April, 2004               [Page 5]

Internet Draft          EAP SIM Authentication        27 October, 2003


   Re-authentication Identity

      A re-authentication identity of the peer, including an NAI realm
      portion in environments where a real is used. Used on re-
      authentication only.

   Re-authentication Username

      The username portion of re-authentication identity, ie. not
      including any realm portions.

   SIM

      Subscriber Identity Module. The SIM is an application
      traditionally resident on smart cards distributed by GSM
      operators.

3. Overview

   Figure 1 shows an overview of the EAP/SIM full authentication
   procedure. The authenticator typically communicates with an EAP
   server that is located on a backend authentication server using an
   AAA protocol. The AAA communications is not shown in the figure.

   The first EAP Request issued by the network is EAP-Request/Identity.
   On full authentication, the peer's response includes either the
   user's International Mobile Subscriber Identity (IMSI) or a
   temporary identity (pseudonym) if identity privacy is in effect, as
   specified in Section 4.2.

   Following the peer's EAP-Response/Identity packet, the peer receives
   EAP Requests of type 18 (SIM) from the EAP server and sends the
   corresponding EAP Responses. The EAP packets that are of the Type
   SIM also have a Subtype field. On full authentication, the first
   EAP-Request/SIM packet is of the Subtype 10 (Start). EAP SIM packets
   encapsulate parameters in attributes, encoded in a Type, Length,
   Value format. The packet format and the use of attributes are
   specified in Section 5.

   The EAP-Request/SIM/Start packet contains the list of EAP/SIM
   version supported by the EAP server in the AT_VERSION_LIST
   attribute. This packet may also include attributes for requesting
   the subscriber identity, as specified in Section 4.2.

   The peer responds to EAP-Request/SIM/Start with the EAP-
   Response/SIM/Start packet, which includes the AT_NONCE_MT attribute
   that contains a random number NONCE_MT, chosen by the peer, and the
   AT_SELECTED_VERSION attribute that contains the version number
   selected by the peer. The version negotiation is protected by
   including the version list and the selected version in the
   calculation of keying material (Section 4.6).



Haverinen and Salowey  Expires: 27 April, 2004               [Page 6]

Internet Draft          EAP SIM Authentication        27 October, 2003


   After receiving the EAP Response/SIM/Start, the EAP server obtains n
   GSM triplets for use in authenticating the subscriber, where n = 2
   or n = 3. From the triplets, the EAP server derives the keying
   material, as specified in Section 4.6. The triplets may be obtained
   by contacting an Authentication Centre (AuC) on the GSM network; per
   GSM specifications, between 1 and 5 triplets may be obtained at a
   time.

   The next EAP Request the EAP Server issues is of the type SIM and
   subtype Challenge (11). It contains the RAND challenges and a
   message authentication code attribute AT_MAC to cover the
   challenges.

   On receipt of the EAP-Request/SIM/Challenge message, the peer runs
   the GSM authentication algorithm and calculates a copy of the
   message authentication code. The peer then verifies that the
   calculated MAC equals the received MAC. If the MAC's do not match,
   then the peer sends the EAP-Response/SIM/Client-Error packet and the
   authentication exchange terminates.

   Since the RAND's given to a peer are accompanied with the message
   authentication code AT_MAC, and since the peer's NONCE_MT value
   contributes to AT_MAC, the peer is able to verify that the EAP SIM
   message is fresh (not a replay) and that the sender possesses valid
   GSM triplets for the subscriber.

   If all checks out, the peer responds with the EAP-
   Response/SIM/Challenge, containing the AT_MAC attribute that covers
   the peer's SRES response values (Section 6.4). The EAP server
   verifies that the MAC is correct and sends the EAP-Success packet,
   indicating that the authentication was successful. The EAP server
   may also include derived keying material in the message it sends to
   the authenticator.





















Haverinen and Salowey  Expires: 27 April, 2004               [Page 7]

Internet Draft          EAP SIM Authentication        27 October, 2003


     Peer                                               Authenticator
       |                                                          |
       |                               EAP-Request/Identity       |
       |<---------------------------------------------------------|
       |                                                          |
       | EAP-Response/Identity                                    |
       |--------------------------------------------------------->|
       |                                                          |
       |                        EAP-Request/SIM/Start             |
       |                        (AT_VERSION_LIST)                 |
       |<---------------------------------------------------------|
       |                                                          |
       | EAP-Response/SIM/Start                                   |
       | (AT_NONCE_MT, AT_SELECTED_VERSION)                       |
       |--------------------------------------------------------->|
       |                                                          |
       |               EAP-Request/SIM/Challenge                  |
       |               (AT_RAND, AT_MAC)                          |
       |<---------------------------------------------------------|
       |                                                          |
   +-------------------------------------+                        |
   | Peer runs GSM algorithms,           |                        |
   | verifies AT_MAC and derives         |                        |
   | session keys                        |                        |
   +-------------------------------------+                        |
       |                                                          |
       | EAP-Response/SIM/Challenge                               |
       | (AT_MAC)                                                 |
       |--------------------------------------------------------->|
       |                                                          |
       |                                                          |
       |                                             EAP-Success  |
       |<---------------------------------------------------------|
       |                                                          |

   Figure 1 EAP/SIM full authentication procedure

   EAP SIM also includes a separate re-authentication procedure, which
   does not make use of the A3/A8 algorithms or the GSM infrastructure.
   Re-authentication is based on keys derived on full authentication.
   If the peer has maintained state information for re-authentication
   and wants to use re-authentication, then the peer indicates this by
   using a specific re-authentication identity instead of the permanent
   identity or a pseudonym identity. The re-authentication procedure is
   described in Section 4.3.

4. Operation

4.1. Version Negotiation

   EAP/SIM includes version negotiation so as to allow future
   developments in the protocol. The version negotiation is performed
   on full authentication and it uses two attributes, AT_VERSION_LIST,

Haverinen and Salowey  Expires: 27 April, 2004               [Page 8]

Internet Draft          EAP SIM Authentication        27 October, 2003


   which the server always includes in EAP-Request/SIM/Start, and
   AT_SELECTED_VERSION, which the peer includes in EAP-
   Response/SIM/Start on full authentication.

   AT_VERSION_LIST includes the EAP/SIM versions supported by the
   server. If AT_VERSION_LIST does not include a version that is
   implemented by the peer and allowed in the peer's security policy,
   then the peer MUST send the EAP-Response/SIM/Client-Error packet
   (Section 6.7) to the server with the error code "unsupported
   version". If a suitable version is included, then the peer includes
   the AT_SELECTED_VERSION attribute, containing the selected version,
   in the EAP-Response/SIM/Start packet. The peer MUST only indicate a
   version that is included in AT_VERSION_LIST. If several versions are
   acceptable, then the peer SHOULD choose the version that occurs
   first in the version list.

   The version number list of AT_VERSION_LIST and the selected version
   of AT_SELECTED_VERSION are included in the key derivation procedure
   (Section 4.6). If an attacker modifies either one of these
   attributes, then the peer and the server derive different keying
   material. Because K_aut keys are different, the server and peer
   calculate different AT_MAC values. Hence, the peer detects that
   AT_MAC included in EAP-Request/SIM/Challenge is incorrect and sends
   the EAP-Response/SIM/Client-Error packet. The authentication
   procedure terminates.

4.2. Identity Management

4.2.1 Format, Generation and Usage of Peer Identities

General

   In the beginning of EAP authentication, the Authenticator or the EAP
   server usually issues the EAP-Request/Identity packet to the peer.
   The peer responds with EAP-Response/Identity, which contains the
   user's identity. The formats of these packets are specified in
   [EAP].

   GSM subscribers are identified with the International Mobile
   Subscriber Identity (IMSI) [GSM 03.03]. The IMSI is composed of a
   three digit Mobile Country Code (MCC), a two or three digit Mobile
   Network Code (MNC) and a not more than 10 digit Mobile Subscriber
   Identification Number (MSIN). In other words, the IMSI is a string
   of not more than 15 digits. MCC and MNC uniquely identify the GSM
   operator and  help identify the AuC from which the authentication
   vectors need to be retrieved for this subscriber.

   Internet AAA protocols identify users with the Network Access
   Identifier (NAI) [RFC 2486]. When used in a roaming environment, the
   NAI is composed of a username and a realm, separated with "@"
   (username@realm). The username portion identifies the subscriber
   within the realm.


Haverinen and Salowey  Expires: 27 April, 2004               [Page 9]

Internet Draft          EAP SIM Authentication        27 October, 2003


   This section specifies the peer identity format used in EAP/SIM. In
   this document, the term identity or peer identity refers to the
   whole identity string that is used to identify the peer. The peer
   identity may include a realm portion. "Username" refers to the
   portion of the peer identity that identifies the user, i.e. the
   username does not include the realm portion.

Identity Privacy Support

   EAP/SIM includes optional identity privacy (anonymity) support that
   can be used to hide the cleartext permanent identity and thereby to
   make the subscriber's EAP exchanges untraceable to eavesdroppers.
   Because the permanent identity never changes, revealing it would
   help observers to track the user. The permanent identity is usually
   based on the IMSI, which may further help the tracking, because the
   same identifier may used in other contexts as well. Identity privacy
   is based on temporary identities, or pseudonyms, which are
   equivalent to but separate from the Temporary Mobile Subscriber
   Identities (TMSI) that are used on cellular networks. Please see
   Section 9.1 for security considerations regarding identity privacy.

Username Types in EAP/SIM identities

   There are three types of usernames in EAP/SIM peer identities:

   (1) Permanent usernames. For example,
   1123456789098765@myoperator.com might be a valid permanent identity.
   In this example, 1123456789098765 is the permanent username.

   (2) Pseudonym usernames. For example, 3s7ah6n9q@myoperator.com might
   be a valid pseudonym identity. In this example, 3s7ah6n9q is the
   pseudonym username.

   (3) Re-authentication usernames. For example,
   53953754a@myoperator.com might be a valid re-authentication
   identity. In this case, 53953754 is the re-authentication username.

   The first two types of identities are only used on full
   authentication and the last one only on re-authentication. When the
   optional identity privacy support is not used, the non-pseudonym
   permanent identity is used on full authentication. The re-
   authentication exchange is specified in Section 4.3.

Username Decoration

   In some environments, the peer may need to decorate the identity by
   prepending or appending the username with a string, in order to
   indicate supplementary AAA routing information in addition to the
   NAI realm. (The usage of a NAI realm portion is not considered to be
   decoration.) Username decoration is out of the scope of this
   document. However, it should be noted that username decoration might
   prevent the server from recognizing a valid username. Hence,
   although the peer MAY use username decoration in the identities the

Haverinen and Salowey  Expires: 27 April, 2004              [Page 10]

Internet Draft          EAP SIM Authentication        27 October, 2003


   peer includes in EAP-Response/Identity, and the EAP server MAY
   accept a decorated peer username in this message, the peer or the
   EAP server MUST NOT decorate any other peer identities that are used
   in various EAP/SIM attributes. Only the identity used in EAP-
   Response/Identity may be decorated.

NAI Realm Portion

   The peer MAY include a realm portion in the peer identity, as per
   the NAI format. The use of a realm portion is not mandatory.

   If a realm is used, the realm MAY be chosen by the operator and it
   MAY a configurable parameter in the EAP/SIM peer implementation. In
   this case, the peer is typically configured with the NAI realm of
   the home operator. Operators MAY reserve a specific realm name for
   EAP/SIM users. This convention makes it easy to recognize that the
   NAI identifies a GSM subscriber. Such reserved NAI realm may be
   useful as a hint as to the first authentication method to use during
   method negotiation. When the peer is using a pseudonym username
   instead of the permanent username, the peer selects the realm name
   portion similarly as it select the realm portion when using the
   permanent username.

   If no configured realm name is available, the peer MAY derive the
   realm name from the MCC and MNC portions of the IMSI. A recommended
   way to derive the realm from the IMSI using the realm
   3gppnetwork.org will be specified in [Draft 3GPP TS 23.234].
   Alternatively, the realm name may be obtained by concatenating
   "mnc", the MNC digits of IMSI, ".mcc", the MCC digits of IMSI and
   ".owlan.org". For example, if the IMSI is 123456789098765, and the
   MNC is three digits long, then the derived realm name is
   "mnc456.mcc123.owlan.org".

   The IMSI is a string of digits without any explicit structure, so
   the peer may not be able to determine the length of the MNC portion.
   If the peer is not able to determine whether the MNC is two or three
   digits long, the peer MAY use a 3-digit MNC. If the correct length
   of the MNC is two, then the MNC used in the realm name includes the
   first digit of MSIN. Hence, when configuring AAA networks for
   operators that have 2-digit MNC's, the network SHOULD also be
   prepared for realm names with incorrect 3-digit MNC's.

Format of the Permanent Username

   The non-pseudonym permanent username SHOULD be derived from the
   IMSI. In this case, the permanent username MUST be of the format "1"
   | IMSI, where the character "|" denotes concatenation. In other
   words, the first character of the username is the digit one (ASCII
   value 0x31), followed by the IMSI. The IMSI is an ASCII string that
   consists of not more than 15 decimal digits (ASCII values between
   0x30 and 0x39) as specified in [GSM 03.03].



Haverinen and Salowey  Expires: 27 April, 2004              [Page 11]

Internet Draft          EAP SIM Authentication        27 October, 2003


   The EAP server MAY use the leading "1" as a hint to try EAP/SIM as
   the first authentication method during method negotiation, rather
   than for example EAP/AKA. The EAP/SIM server MAY propose EAP/SIM
   even if the leading character was not "1".

   Alternatively, an implementation MAY choose a permanent username
   that is not based on the IMSI. In this case the selection of the
   username, its format, and its processing is out of the scope of this
   document. In this case, the peer implementation MUST NOT prepend any
   leading characters to the username.

Generating Pseudonyms and Re-authentication Identities by the Server

   Pseudonym usernames and re-authentication identities are generated
   by the EAP server. The EAP server produces pseudonym usernames and
   re-authentication identities in an implementation-dependent manner.
   Only the EAP server needs to be able to map the pseudonym username
   to the permanent identity, or to recognize a re-authentication
   identity. Regardless of construction method, the pseudonym username
   MUST conform to the grammar specified for the username portion of an
   NAI. The re-authentication identity also MUST conform to the NAI
   grammar. The EAP servers that the subscribers of an operator can use
   MUST ensure that the pseudonym usernames and the username portions
   used in re-authentication identities they generate are unique.

   In any case, it is necessary that permanent usernames, pseudonym
   usernames and re-authentication usernames are separate and
   recognizable from each other. It is also desirable that EAP SIM and
   EAP AKA user names be recognizable from each other as an aid for the
   server to which method to offer.

   In general, it is the task of the EAP server and the policies of its
   administrator to ensure sufficient separation in the usernames.
   Pseudonym usernames and re-authentication usernames are both
   produced and used by the EAP server. The EAP server MUST compose
   pseudonym usernames and re-authentication usernames so that it can
   recognize if a NAI username is an EAP SIM pseudonym username or an
   EAP SIM re-authentication username. For instance, when the usernames
   have been derived from the IMSI, the server could use different
   leading characters in the pseudonym usernames and re-authentication
   usernames (e.g. the pseudonym could begin with a leading "3"
   character). When mapping a re-authentication identity to a permanent
   identity, the server SHOULD only examine the username portion of the
   re-authentication identity and ignore the realm portion of the
   identity.

   Because the peer may fail to save a pseudonym username sent to in an
   EAP-Request/SIM/Challenge, for example due to malfunction, the EAP
   server SHOULD maintain at least one old pseudonym username in
   addition to the most recent pseudonym username.




Haverinen and Salowey  Expires: 27 April, 2004              [Page 12]

Internet Draft          EAP SIM Authentication        27 October, 2003


Transmitting Pseudonyms and Re-authentication Identities to the Peer

   The server transmits pseudonym usernames and re-authentication
   identities to the peer in cipher, using the AT_ENCR_DATA attribute.

   The EAP-Request/SIM/Challenge message MAY include an encrypted
   pseudonym username and/or an encrypted re-authentication identity in
   the value field of the AT_ENCR_DATA attribute. Because identity
   privacy support and re-authentication are optional to implement, the
   peer MAY ignore the AT_ENCR_DATA attribute and always use the
   permanent identity. On re-authentication (discussed in Section 4.3),
   the server MAY include a new encrypted re-authentication identity in
   the EAP-Request/SIM/Re-authentication message.

   On receipt of the EAP-Request/SIM/Challenge, the peer MAY decrypt
   the encrypted data in AT_ENCR_DATA and if a pseudonym username is
   included, the peer may use the obtained pseudonym username on the
   next full authentication. If a re-authentication identity is
   included, then the peer MAY save it and other re-authentication
   state information, as discussed in Section 4.3, for the next re-
   authentication.

   If the peer does not receive a new pseudonym username in the EAP-
   Request/SIM/Challenge message, the peer MAY use an old pseudonym
   username instead of the permanent username on next full
   authentication. The username portions of re-authentication
   identities are one-time usernames, which the peer MUST NOT re-use.

Usage of the Pseudonym by the Peer

   When the optional identity privacy support is used on full
   authentication, the peer MAY use the pseudonym username received as
   part of the previous full authentication sequence as the username
   portion of the NAI. The peer MUST NOT modify the pseudonym username
   received in AT_NEXT_PSEUDONYM. However, as discussed above, the peer
   MAY need to decorate the username in some environments by appending
   or prepending the username with a string that indicates
   supplementary AAA routing information.

   When using a pseudonym username in an environment where a realm
   portion is used, the peer concatenates the received pseudonym
   username with the "@" character and a NAI realm portion. The
   selection of the NAI realm is discussed above.

Usage of the Re-authentication Identity by the Peer

   On re-authentication, the peer uses the re-authentication identity,
   received as part of the previous authentication sequence. A new re-
   authentication identity may be delivered as part of both full
   authentication and re-authentication. The peer MUST NOT modify the
   username part of the re-authentication identity received in
   AT_NEXT_REAUTH_ID, except in cases when username decoration is
   required. Even in these cases, the "root" re-authentication username

Haverinen and Salowey  Expires: 27 April, 2004              [Page 13]

Internet Draft          EAP SIM Authentication        27 October, 2003


   must not be modified, but it may be appended or prepended with
   another string.

4.2.2 Communicating the Peer Identity to the Server

General

   The peer identity MAY be communicated to the server with the EAP-
   Response/Identity message. This message MAY contain the permanent
   identity, a pseudonym identity, or a re-authentication identity. If
   the peer uses the permanent identity or a pseudonym identity, which
   the server is able to map to the permanent identity, then the
   authentication proceeds as discussed in the overview of Section 3.
   If the peer uses a re-authentication identity, and the server
   recognized the identity and agrees on using re-authentication, then
   a re-authentication exchange is performed, as described in 4.3.

   The peer identity can also be transmitted from the peer to the
   server using EAP/SIM messages instead of EAP-Response/Identity. In
   this case, the server includes an identity requesting attribute
   (AT_ANY_ID_REQ, AT_FULLAUTH_ID_REQ or AT_PERMANENT_ID_REQ) in the
   EAP-Request/SIM/Start message, and the peer includes the AT_IDENTITY
   attribute, which contains the peer's identity, in the EAP-
   Response/SIM/Start message. The AT_ANY_ID_REQ attribute is a general
   identity requesting attribute, which the server uses if it does not
   specify which kind of an identity the peer should return in
   AT_IDENTITY. The server uses the AT_FULLAUTH_ID_REQ attribute to
   request either the permanent identity or a pseudonym identity. The
   server uses the AT_PERMANENT_ID_REQ attribute to request the peer to
   send its permanent identity.

   The identity format in the AT_IDENTITY attribute is the same as in
   the EAP-Response/Identity packet (except that identity decoration is
   not allowed). The AT_IDENTITY attribute contains a permanent
   identity, a pseudonym identity or a re-authentication identity.

   Obtaining the subscriber identity via EAP/SIM messages is useful if
   the server does not have any EAP/SIM peer identity at the beginning
   of the EAP/SIM exchange or does not recognize the identity the peer
   used in EAP-Response/Identity.  This may happen if, for example, the
   EAP-Response/Identity has been issued by some EAP method other than
   EAP/SIM or if intermediate entities or software layers in the peer
   have modified the identity string in the EAP-Response/Identity
   packet. Also, some EAP layer implementations may cache the identity
   string from the first EAP authentication and do not obtain a new
   identity string from the EAP method implementation on subsequent
   authentication exchanges.

   As the identity string is used in key derivation, any of these cases
   will result in failed authentication unless the EAP server uses
   EAP/SIM attributes to obtain an unmodified copy of the identity
   string.  Therefore, unless the EAP server can be certain that no
   intermediate element or software layer has modified the EAP-

Haverinen and Salowey  Expires: 27 April, 2004              [Page 14]

Internet Draft          EAP SIM Authentication        27 October, 2003


   Response/Identity packet, the EAP server SHOULD always use the
   EAP/SIM attributes to obtain the identity, even if the identity
   received in EAP-Response/Identity was valid.

   Please note that the EAP/SIM peer and the EAP/SIM server only
   process the AT_IDENTITY attribute and entities that only pass
   through EAP packets do not process this attribute. Hence, if the EAP
   server is not co-located in the authenticator, then the
   authenticator and other intermediate AAA elements (such as possible
   AAA proxy servers) will continue to refer to the peer with the
   original identity from the EAP-Response/Identity packet regardless
   of whether the AT_IDENTITY attribute is used in EAP/SIM to transmit
   another identity.

Choice of Identity for the EAP-Response/Identity

   If EAP/SIM peer is started upon receiving an EAP-Request/Identity
   message, then the peer performs the following steps.

   If the peer has maintained re-authentication state information and
   if the peer wants to use re-authentication, then the peer transmits
   the re-authentication identity in EAP-Response/Identity.

   Else, if the peer has a pseudonym username available, then the peer
   transmits the pseudonym identity in EAP-Response/Identity.

   In other cases, the peer transmits the permanent identity in EAP-
   Response/Identity.

Server Operation in the Beginning of EAP/SIM Exchange

   If the EAP server has not received any identity (permanent identity,
   pseudonym identity or re-authentication identity) from the peer when
   sending the first EAP/SIM request, or if the EAP server has received
   an EAP-Response/Identity packet but the contents do not appear to be
   a valid permanent identity, pseudonym identity or a re-
   authentication identity, then the server MUST request an identity
   from the peer using one of the methods below.

   The server sends the EAP-Request/SIM/Start message with the
   AT_PERMANENT_ID_REQ message to indicate that the server wants the
   peer to include the permanent identity in the AT_IDENTITY attribute
   of the EAP-Response/SIM/Start message. This is done in the following
   cases:

   - The server does not support re-authentication or identity privacy.

   - The server received an identity that it recognizes as a pseudonym
   identity but the server is not able to map the pseudonym identity to
   a permanent identity.

   The server issues the EAP-Request/SIM/Start packet with the
   AT_FULLAUTH_ID_REQ attribute to indicate that the server wants the

Haverinen and Salowey  Expires: 27 April, 2004              [Page 15]

Internet Draft          EAP SIM Authentication        27 October, 2003


   peer to include a full authentication identity (pseudonym identity
   or permanent identity) in the AT_IDENTITY attribute of the EAP-
   Response/SIM/Start message.  This is done in the following cases:

   - The server does not support re-authentication and the server
   supports identity privacy

   - The server received an identity that it recognizes as a re-
   authentication identity but the server is not able to map the re-
   authentication identity to a permanent identity

   The server issues the EAP-Request/SIM/Start packet with the
   AT_ANY_ID_REQ attribute to indicate that the server wants the peer
   to include an identity in the AT_IDENTITY attribute of the EAP-
   Response/SIM/Start message, and the server does not indicate any
   preferred type for the identity. This is done in other cases, such
   as when the server does not have any identity, or the server does
   not recognize the format of a received identity.

Processing of EAP-Request/SIM/Start by the Peer

   Upon receipt of an EAP-Request/SIM/Start message, the peer MUST
   perform the following steps.

   If the EAP-Request/SIM/Start does not include any identity request
   attribute, then the peer responds with EAP-Response/SIM/Start
   without AT_IDENTITY. The peer includes the AT_SELECTED_VERSION and
   AT_NONCE_MT attributes, because the exchange is a full
   authentication exchange.

   If the EAP-Request/SIM/Start includes AT_PERMANENT_ID_REQ the peer
   MUST either respond with EAP-Response/SIM/Start and include the
   permanent identity in AT_IDENTITY or respond with EAP-
   Response/SIM/Client-Error packet with code "unable to process
   packet".

   If the EAP-Request/SIM/Start includes AT_FULL_AUTH_ID_REQ, and if
   the peer has a pseudonym available, then the peer SHOULD respond
   with EAP-Response/SIM/Start and includes the pseudonym identity in
   AT_IDENTITY. If the peer does not have a pseudonym when it receives
   this message, then the peer MUST either respond with EAP-
   Response/SIM/Start and include the permanent identity in AT_IDENTITY
   or respond with EAP-Response/SIM/Client-Error packet with code
   "unable to process packet." The Peer MUST NOT use a re-
   authentication identity in the AT_IDENTITY attribute.

   If the EAP-Request/SIM/Start includes AT_ANY_ID_REQ, and if the peer
   has maintained re-authentication state information and the peer
   wants to use re-authentication, then the peer responds with EAP-
   Response/SIM/Start and includes the re-authentication identity in
   AT_IDENTITY. Else, if the peer has a pseudonym identity available,
   then the peer responds with EAP-Response/SIM/Start and includes the
   pseudonym identity in AT_IDENTITY. Else, the peer responds with EAP-

Haverinen and Salowey  Expires: 27 April, 2004              [Page 16]

Internet Draft          EAP SIM Authentication        27 October, 2003


   Response/SIM/Start and includes the permanent identity in
   AT_IDENTITY.

   An EAP/SIM exchange may include several EAP/SIM/Start rounds. The
   server may issue a second EAP-Request/SIM/Start, if it was not able
   to recognize the identity the peer used in the previous AT_IDENTITY
   attribute. At most three EAP/SIM/Start rounds can be used.
   AT_ANY_ID_REQ can only be used in the first EAP-Request/SIM/Start,
   in other words AT_ANY_ID_REQ MUST NOT be used in the second or third
   EAP-Request/SIM/Start. AT_FULLAUTH_ID_REQ MUST NOT be used if the
   previous EAP-Request/SIM/Start included AT_PERMANENT_ID_REQ. The
   peer operation in cases when it receives an unexpected attribute is
   specified in Section 4.5.1.

Attacks against Identity Privacy

   The section above specifies two possible ways the peer can operate
   upon receipt of AT_PERMANENT_ID_REQ. This is because a received
   AT_PERMANENT_ID_REQ does not necessarily originate from the valid
   network, but an active attacker may transmit an EAP-
   Request/SIM/Start packet with an AT_PERMANENT_ID_REQ attribute to
   the peer, in an effort to find out the true identity of the user. If
   the peer does not want to reveal its permanent identity, then the
   peer sends the EAP-Response/SIM/Client-Error packet with the error
   code "unable to process packet", and the authentication exchange
   terminates.

   Basically, there are two different policies that the peer can employ
   with regard to AT_PERMANENT_ID_REQ. A "conservative" peer assumes
   that the network is able to maintain pseudonyms robustly. Therefore,
   if a conservative peer has a pseudonym username, the peer responds
   with EAP-Response/SIM/Client-Error to the EAP packet with
   AT_PERMANENT_ID_REQ, because the peer believes that the valid
   network is able to map the pseudonym identity to the peer's
   permanent identity. (Alternatively, the conservative peer may accept
   AT_PERMANENT_ID_REQ in certain circumstances, for example if the
   pseudonym was received a long time ago.) The benefit of this policy
   is that it protects the peer against active attacks on anonymity. On
   the other hand, a "liberal" peer always accepts the
   AT_PERMANENT_ID_REQ and responds with the permanent identity. The
   benefit of this policy is that it works even if the valid network
   sometimes loses pseudonyms and is not able to map them to the
   permanent identity.

Processing of AT_IDENTITY by the Server

   When the server receives an EAP-Response/SIM/Start message with the
   AT_IDENTITY (in response to the server's identity requesting
   attribute), the server MUST operate as follows.

   If the server used AT_PERMANENT_ID_REQ, and if the AT_IDENTITY does
   not contain a valid permanent identity, then the server sends EAP
   Failure and the EAP exchange terminates. If the server recognizes

Haverinen and Salowey  Expires: 27 April, 2004              [Page 17]

Internet Draft          EAP SIM Authentication        27 October, 2003


   the permanent identity and is able to continue, then the server
   proceeds with full authentication by sending EAP-
   Request/SIM/Challenge.

   If the server used AT_FULLAUTH_ID_REQ, and if AT_IDENTITY contains a
   valid permanent identity or a pseudonym identity that the server can
   map to a valid permanent identity, then the server proceeds with
   full authentication by sending EAP-Request/SIM/Challenge. If
   AT_IDENTITY contains a pseudonym identity that the server is not
   able to map to a valid permanent identity, or an identity that the
   server is not able to recognize or classify, then the server sends
   EAP-Request/SIM/Start with AT_PERMANENT_ID_REQ.

   If the server used AT_ANY_ID_REQ, and if the AT_IDENTITY contains a
   valid permanent identity or a pseudonym identity that the server can
   map to a valid permanent identity, then the server proceeds with
   full authentication by sending EAP-Request/SIM/Challenge.

   If the server used AT_ANY_ID_REQ, and if AT_IDENTITY contains a
   valid re-authentication identity and the server agrees on using re-
   authentication, then the server proceeds with re-authentication by
   sending EAP-Request/SIM/Re-authentication (Section 4.3).

   If the server used AT_ANY_ID_REQ, and if the peer sent an EAP-
   Response/SIM/Start with only AT_IDENTITY (indicating re-
   authentication), but the server is not able to map the identity to a
   permanent identity, then the server sends EAP-Request/SIM/Start with
   AT_FULLAUTH_ID_REQ.

   If the server used AT_ANY_ID_REQ, and if AT_IDENTITY contains a
   valid re-authentication identity, which the server is able to map to
   a permanent identity, and if the server does not want to use re-
   authentication, then the server sends EAP-Request/SIM/Start without
   any identity requesting attributes.

   If the server used AT_ANY_ID_REQ, and AT_IDENTITY contains an
   identity that the server recognizes as a pseudonym identity but the
   server is not able to map the pseudonym identity to a permanent
   identity, then the server sends EAP-Request/SIM/Start with
   AT_PERMANENT_ID_REQ.

   If the server used AT_ANY_ID_REQ, and AT_IDENTITY contains an
   identity that the server is not able to recognize or classify, then
   the server sends EAP-Request/SIM/Start with AT_FULLAUTH_ID_REQ.

4.2.3 Message Sequence Examples (Informative)

   This section contains non-normative message sequence examples to
   illustrate how the peer identity can be communicated to the server.





Haverinen and Salowey  Expires: 27 April, 2004              [Page 18]

Internet Draft          EAP SIM Authentication        27 October, 2003


Full Authentication

   This case for full authentication is illustrated in the figure
   below. In this case, AT_IDENTITY contains either the permanent
   identity or a pseudonym identity. The same sequence is also used in
   case the server uses the AT_FULLAUTH_ID_REQ in EAP-
   Request/SIM/Start.

       Peer                                             Authenticator
          |                                                       |
          |                            +------------------------------+
          |                            | Server does not have any     |
          |                            | Subscriber identity available|
          |                            | When starting EAP/SIM        |
          |                            +------------------------------+
          |                                                       |
          |          EAP-Request/SIM/Start                        |
          |          (AT_ANY_ID_REQ, AT_VERSION_LIST)             |
          |<------------------------------------------------------|
          |                                                       |
          |                                                       |
          | EAP-Response/SIM/Start                                |
          | (AT_IDENTITY, AT_NONCE_MT,                            |
          |  AT_SELECTED_VERSION)                                 |
          |------------------------------------------------------>|
          |                                                       |


   If the peer uses its full authentication identity and the
   AT_IDENTITY attribute contains a valid permanent identity or a valid
   pseudonym identity that the EAP server is able to map to the
   permanent identity, then the full authentication sequence proceeds
   as usual with the EAP Server issuing the EAP-Request/SIM/Challenge
   message.

Re-authentication

   The case when the server uses the AT_ANY_ID_REQ and the peer wants
   to perform re-authentication is illustrated below.















Haverinen and Salowey  Expires: 27 April, 2004              [Page 19]

Internet Draft          EAP SIM Authentication        27 October, 2003


       Peer                                             Authenticator
          |                                                       |
          |                            +------------------------------+
          |                            | Server does not have any     |
          |                            | Subscriber identity available|
          |                            | When starting EAP/SIM        |
          |                            +------------------------------+
          |                                                       |
          |        EAP-Request/SIM/Start                          |
          |        (AT_ANY_ID_REQ, AT_VERSION_LIST)               |
          |<------------------------------------------------------|
          |                                                       |
          |                                                       |
          | EAP-Response/SIM/Start                                |
          | (AT_IDENTITY containing a re-authentication identity) |
          |------------------------------------------------------>|
          |                                                       |


   On re-authentication, if the AT_IDENTITY attribute contains a valid
   re-authentication identity and the server agrees on using re-
   authentication, then the server proceeds with the re-authentication
   sequence and issues the EAP-Request/SIM/Re-authentication packet, as
   specified in Section 4.3.

Fall Back to Full Authentication

   The case when the server does not recognize the re-authentication
   identity the peer used in AT_IDENTITY, and issues a second EAP-
   Request/SIM/Start message is illustrated below.
























Haverinen and Salowey  Expires: 27 April, 2004              [Page 20]

Internet Draft          EAP SIM Authentication        27 October, 2003


        Peer                                             Authenticator
          |                                                       |
          |                            +------------------------------+
          |                            | Server does not have any     |
          |                            | Subscriber identity available|
          |                            | When starting EAP/SIM        |
          |                            +------------------------------+
          |                                                       |
          |        EAP-Request/SIM/Start                          |
          |        (AT_ANY_ID_REQ, AT_VERSION_LIST)               |
          |<------------------------------------------------------|
          |                                                       |
          |                                                       |
          | EAP-Response/SIM/Start                                |
          | (AT_IDENTITY containing a re-authentication identity) |
          |------------------------------------------------------>|
          |                                                       |
          |                            +------------------------------+
          |                            | Server does not recognize    |
          |                            | The re-authentication        |
          |                            | Identity                     |
          |                            +------------------------------+
          |                                                       |
          |     EAP-Request/SIM/Start                             |
          |     (AT_FULLAUTH_ID_REQ, AT_VERSION_LIST)             |
          |<------------------------------------------------------|
          |                                                       |
          |                                                       |
          | EAP-Response/SIM/Start                                |
          | (AT_IDENTITY with a full-auth. identity, AT_NONCE_MT, |
          |  AT_SELECTED_VERSION)                                 |
          |------------------------------------------------------>|
          |                                                       |


Requesting the Permanent Identity 1

   The figure below illustrates the case when the EAP server fails to
   map the pseudonym identity included in the EAP-Response/Identity
   packet to a valid permanent identity.














Haverinen and Salowey  Expires: 27 April, 2004              [Page 21]

Internet Draft          EAP SIM Authentication        27 October, 2003


       Peer                                             Authenticator
          |                                                       |
          |                               EAP-Request/Identity    |
          |<------------------------------------------------------|
          |                                                       |
          | EAP-Response/Identity                                 |
          | (Includes a pseudonym)                                |
          |------------------------------------------------------>|
          |                                                       |
          |                            +------------------------------+
          |                            | Server fails to map the      |
          |                            | Pseudonym to a permanent id. |
          |                            +------------------------------+
          |                                                       |
          |  EAP-Request/SIM/Start                                |
          |  (AT_PERMANENT_ID_REQ, AT_VERSION_LIST)               |
          |<------------------------------------------------------|
          |                                                       |
          |                                                       |
          | EAP-Response/SIM/Start                                |
          | (AT_IDENTITY with permanent identity, AT_NONCE_MT,    |
          |  AT_SELECTED_VERSION)                                 |
          |------------------------------------------------------>|
          |                                                       |

   If the server recognizes the permanent identity, then the
   authentication sequence proceeds as usual with the EAP Server
   issuing the EAP-Request/SIM/Challenge message.

Requesting the Permanent Identity 2

   The figure below illustrates the case when the EAP server fails to
   map the pseudonym included in the AT_IDENTITY attribute to a valid
   permanent identity.




















Haverinen and Salowey  Expires: 27 April, 2004              [Page 22]

Internet Draft          EAP SIM Authentication        27 October, 2003


       Peer                                             Authenticator
          |                                                       |
          |                            +------------------------------+
          |                            | Server does not have any     |
          |                            | Subscriber identity available|
          |                            | When starting EAP/SIM        |
          |                            +------------------------------+
          |                                                       |
          |        EAP-Request/SIM/Start                          |
          |        (AT_ANY_ID_REQ, AT_VERSION_LIST)               |
          |<------------------------------------------------------|
          |                                                       |
          |                                                       |
          |EAP-Response/SIM/Start                                 |
          |(AT_IDENTITY with a pseudonym identity, AT_NONCE_MT,   |
          | AT_SELECTED_VERSION)                                  |
          |------------------------------------------------------>|
          |                                                       |
          |                                                       |
          |                           +-------------------------------+
          |                           | Server fails to map the       |
          |                           | Pseudonym in AT_IDENTITY      |
          |                           | to a valid permanent identity |
          |                           +-------------------------------+
          |                                                       |
          |                EAP-Request/SIM/Start                  |
          |                (AT_PERMANENT_ID_REQ, AT_VERSION_LIST) |
          |<------------------------------------------------------|
          |                                                       |
          |                                                       |
          | EAP-Response/SIM/Start                                |
          | (AT_IDENTITY with permanent identity,                 |
          |  AT_NONCE_MT, AT_SELECTED_VERSION)                    |
          |------------------------------------------------------>|
          |                                                       |

Three EAP/SIM/Start Roundtrips

   In the worst case, there are three EAP/SIM/Start round trips before
   the server has obtained an acceptable identity. This case is
   illustrated below.













Haverinen and Salowey  Expires: 27 April, 2004              [Page 23]

Internet Draft          EAP SIM Authentication        27 October, 2003


         Peer                                             Authenticator
          |                                                       |
          |                            +------------------------------+
          |                            | Server does not have any     |
          |                            | Subscriber identity available|
          |                            | When starting EAP/SIM        |
          |                            +------------------------------+
          |                                                       |
          |        EAP-Request/SIM/Start                          |
          |        (Includes AT_ANY_ID_REQ, AT_VERSION_LIST)      |
          |<------------------------------------------------------|
          |                                                       |
          | EAP-Response/SIM/Start                                |
          | (AT_IDENTITY with re-authentication identity)         |
          |------------------------------------------------------>|
          |                                                       |
          |                            +------------------------------+
          |                            | Server does not accept       |
          |                            | The re-authentication        |
          |                            | Identity                     |
          |                            +------------------------------+
          |                                                       |
          |     EAP-Request/SIM/Start                             |
          |     (AT_FULLAUTH_ID_REQ, AT_VERSION_LIST)             |
          |<------------------------------------------------------|
          |                                                       |
          |EAP-Response/SIM/Start                                 |
          |(AT_IDENTITY with a pseudonym identity, AT_NONCE_MT,   |
          | AT_SELECTED_VERSION)                                  |
          |------------------------------------------------------>|
          |                                                       |
          |                           +-------------------------------+
          |                           | Server fails to map the       |
          |                           | Pseudonym in AT_IDENTITY      |
          |                           | to a valid permanent identity |
          |                           +-------------------------------+
          |                                                       |
          |           EAP-Request/SIM/Start                       |
          |           (AT_PERMANENT_ID_REQ, AT_VERSION_LIST)      |
          |<------------------------------------------------------|
          |                                                       |
          |                                                       |
          | EAP-Response/SIM/Start                                |
          | (AT_IDENTITY with permanent identity, AT_NONCE_MT,    |
          |  AT_SELECTED_VERSION)                                 |
          |------------------------------------------------------>|
          |                                                       |

   After the last EAP-Response/SIM/Start message, the full
   authentication sequence proceeds as usual. If the EAP Server
   recognizes the permanent identity and is able to proceed, the server
   issues the EAP-Request/SIM/Challenge message.


Haverinen and Salowey  Expires: 27 April, 2004              [Page 24]

Internet Draft          EAP SIM Authentication        27 October, 2003


4.3. Re-Authentication

4.3.1 General

   In some environments, EAP authentication may be performed
   frequently. Because the EAP SIM full authentication procedure makes
   use of the GSM SIM A3/A8 algorithms, and it therefore requires 2 or
   3 fresh triplets from the Authentication Centre, the full
   authentication procedure is not very well suitable for frequent use.
   Therefore, EAP SIM includes a more inexpensive re-authentication
   procedure that does not make use of the SIM A3/A8 algorithms and
   does not need new triplets from the Authentication Centre. Re-
   authentication can be performed in fewer roundtrips than the full
   authentication.

   Re-authentication is optional to implement for both the EAP SIM
   server and peer. On each EAP authentication, either one of the
   entities may also fall back on full authentication if they do not
   want to use re-authentication.

   Re-authentication is based on the keys derived on the preceding full
   authentication. The same K_aut and K_encr keys as in full
   authentication are used to protect EAP SIM packets and attributes,
   and the original Master Key from full authentication is used to
   generate a fresh Master Session Key, as specified in Section 4.6.

   On re-authentication, the peer protects against replays with an
   unsigned 16-bit counter, included in the AT_COUNTER attribute. On
   full authentication, both the server and the peer initialize the
   counter to one. The counter value of at least one is used on the
   first re-authentication. On subsequent re-authentications, the
   counter MUST be greater than on any of the previous re-
   authentications. For example, on the second re-authentication,
   counter value is two or greater etc. The AT_COUNTER attribute is
   encrypted.

   The server includes an encrypted server nonce (AT_NONCE_S) in the
   re-authentication request. The AT_MAC attribute in the peer's
   response is calculated over NONCE_S to provide a challenge/response
   authentication scheme. The NONCE_S also contributes to the new
   Master Session Key.

   Both the peer and the server SHOULD have an upper limit for the
   number of subsequent re-authentications allowed before a full
   authentication needs to be performed. Because a 16-bit counter is
   used in re-authentication, the theoretical maximum number of re-
   authentications is reached when the counter value reaches 0xFFFF.

   In order to use re-authentication, the peer and the EAP server need
   to store the following values: Master Key, latest counter value and
   the next re-authentication identity. K_aut, K_encr may either be
   stored or derived again from MK. The server may also need to store
   the permanent identity of the user.

Haverinen and Salowey  Expires: 27 April, 2004              [Page 25]

Internet Draft          EAP SIM Authentication        27 October, 2003


4.3.2 Re-authentication Identity

   The re-authentication procedure makes use of separate re-
   authentication user identities. Pseudonyms and the permanent
   identity are reserved for full authentication only. If a re-
   authentication identity is lost and the network does not recognize
   it, the EAP server can fall back on full authentication.

   If the EAP server supports re-authentication, it MAY include the
   skippable AT_NEXT_REAUTH_ID attribute in the encrypted data of EAP-
   Request/SIM/Challenge message (Section 6.3). This attribute contains
   a new re-authentication identity for the next re-authentication. The
   peer MAY ignore this attribute, in which case it MUST use full
   authentication next time. If the peer wants to use re-
   authentication, it uses this re-authentication identity on next
   authentication. Even if the peer has a re-authentication identity,
   the peer MAY discard the re-authentication identity and use a
   pseudonym or the permanent identity instead, in which case full
   authentication MUST be performed.

   In environments where a realm portion is needed in the peer
   identity, the re-authentication identity received in
   AT_NEXT_REAUTH_ID MUST contain both a username portion and a realm
   portion, as per the NAI format. The EAP Server can choose an
   appropriate realm part in order to have the AAA infrastructure route
   subsequent re-authentication related requests to the same AAA
   server. For example, the realm part MAY include a portion that is
   specific to the AAA server. Hence, it is sufficient to store the
   context required for re-authentication in the AAA server that
   performed the full authentication.

   The peer MAY use the re-authentication identity in the EAP-
   Response/Identity packet or, in response to server's AT_ANY_ID_REQ
   attribute, the peer MAY use the re-authentication identity in the
   AT_IDENTITY attribute of the EAP-Response/SIM/Start packet. The peer
   MUST NOT modify the username portion of the re-authentication
   identity, but the peer MAY modify the realm portion or replace it
   with another realm portion.

   Even if the peer uses a re-authentication identity, the server may
   want to fall back on full authentication, for example because the
   server does not recognize the re-authentication identity or does not
   want to use re-authentication. In this case, the server starts the
   full authentication procedure by issuing an EAP-Request/SIM/Start
   packet. This packet always starts a full authentication sequence if
   it does not include the AT_ANY_ID_REQ attribute. If the server was
   not able to recover the peer's identity from the re-authentication
   identity, the server includes either the AT_FULLAUTH_ID_REQ or the
   AT_PERMANENT_ID_REQ attribute in this EAP request.





Haverinen and Salowey  Expires: 27 April, 2004              [Page 26]

Internet Draft          EAP SIM Authentication        27 October, 2003


4.3.3 Re-authentication Procedure

   The following figure illustrates the re-authentication procedure.
   Encrypted attributes are denoted with '*'. The peer uses its re-
   authentication identity in the EAP-Response/Identity packet. As
   discussed above, an alternative way to communicate the re-
   authentication identity to the server is for the peer to use the
   AT_IDENTITY attribute in the EAP-Response/SIM/Start message. This
   latter case is not illustrated in the figure below, and it is only
   possible when the server requests the peer to send its identity by
   including the AT_ANY_ID_REQ attribute in the EAP-Request/SIM/Start
   packet.

   If the server recognizes the re-authentication identity and agrees
   on using re-authentication, then the server sends the EAP-
   Request/SIM/Re-authentication packet to the peer. This packet MUST
   include the encrypted AT_COUNTER attribute, with a fresh counter
   value, the encrypted AT_NONCE_S attribute that contains a random
   number chosen by the server, the AT_ENCR_DATA and the AT_IV
   attributes used for encryption, and the AT_MAC attribute that
   contains a message authentication code over the packet. The packet
   MAY also include an encrypted AT_NEXT_REAUTH_ID attribute that
   contains the next re-authentication identity.

   Re-authentication identities are one-time identities. If the peer
   does not receive a new re-authentication identity, it MUST use
   either the permanent identity or a pseudonym identity on the next
   authentication to initiate full authentication.

   The peer verifies that the counter value is fresh (greater than any
   previously used value). The peer also verifies that AT_MAC is
   correct. The peer MAY save the next re-authentication identity from
   the encrypted AT_NEXT_REAUTH_ID for next time. If all checks are
   successful, the peer responds with the EAP-Response/SIM/Re-
   authentication packet, including the AT_COUNTER attribute with the
   same counter value and the AT_MAC attribute.

   The server verifies the AT_MAC attribute and also verifies that the
   counter value is the same that it used in the EAP-Request/SIM/Re-
   authentication packet. If these checks are successful, the re-
   authentication has succeeded and the server sends the EAP-Success
   packet to the peer.












Haverinen and Salowey  Expires: 27 April, 2004              [Page 27]

Internet Draft          EAP SIM Authentication        27 October, 2003


       Peer                                             Authenticator
          |                                                       |
          |                               EAP-Request/Identity    |
          |<------------------------------------------------------|
          |                                                       |
          | EAP-Response/Identity                                 |
          | (Includes a re-authentication identity)               |
          |------------------------------------------------------>|
          |                                                       |
          |                          +--------------------------------+
          |                          | Server recognizes the identity |
          |                          | and agrees on using fast       |
          |                          | re-authentication              |
          |                          +--------------------------------+
          |                                                       |
          |  EAP-Request/SIM/Re-authentication                    |
          |  (AT_IV, AT_ENCR_DATA, *AT_COUNTER,                   |
          |   *AT_NONCE_S, *AT_NEXT_REAUTH_ID, AT_MAC)            |
          |<------------------------------------------------------|
          |                                                       |
          |                                                       |
     +-----------------------------------------------+            |
     | Peer verifies AT_MAC and the freshness of     |            |
     | the counter. Peer MAY store the new re-       |            |
     | authentication identity for next re-auth.     |            |
     +-----------------------------------------------+            |
          |                                                       |
          | EAP-Response/SIM/Re-authentication                    |
          | (AT_IV, AT_ENCR_DATA, *AT_COUNTER with same value,    |
          |  AT_MAC)                                              |
          |------------------------------------------------------>|
          |                                                       |
          |                          +--------------------------------+
          |                          | Server verifies AT_MAC and     |
          |                          | the counter                    |
          |                          +--------------------------------+
          |                                                       |
          |                                          EAP-Success  |
          |<------------------------------------------------------|
          |                                                       |

4.3.4 Re-authentication Procedure when Counter is Too Small

   If the peer does not accept the counter value of EAP-Request/SIM/Re-
   authentication, it indicates the counter synchronization problem by
   including the encrypted AT_COUNTER_TOO_SMALL in EAP-Response/SIM/Re-
   authentication. The server responds with EAP-Request/SIM/Start to
   initiate a normal full authentication procedure. This is illustrated
   in the following figure. Encrypted attributes are denoted with '*'.





Haverinen and Salowey  Expires: 27 April, 2004              [Page 28]

Internet Draft          EAP SIM Authentication        27 October, 2003


       Peer                                             Authenticator
          |                                                       |
          |                               EAP-Request/Identity    |
          |<------------------------------------------------------|
          |                                                       |
          | EAP-Response/Identity                                 |
          | (Includes a re-authentication identity)               |
          |------------------------------------------------------>|
          |                                                       |
          |  EAP-Request/SIM/Re-authentication                    |
          |  (AT_IV, AT_ENCR_DATA, *AT_COUNTER,                   |
          |   *AT_NONCE_S, *AT_NEXT_REAUTH_ID, AT_MAC)            |
          |<------------------------------------------------------|
          |                                                       |
     +-----------------------------------------------+            |
     | AT_MAC is valid but the counter is not fresh. |            |
     +-----------------------------------------------+            |
          |                                                       |
          | EAP-Response/SIM/Re-authentication                    |
          | (AT_IV, AT_ENCR_DATA, *AT_COUNTER_TOO_SMALL,          |
          |  *AT_COUNTER, AT_MAC)                                 |
          |------------------------------------------------------>|
          |                                                       |
          |            +----------------------------------------------+
          |            | Server verifies AT_MAC but detects           |
          |            | That peer has included AT_COUNTER_TOO_SMALL  |
          |            +----------------------------------------------+
          |                                                       |
          |                        EAP-Request/SIM/Start          |
          |                        (AT_VERSION_LIST)              |
          |<------------------------------------------------------|
          |                                                       |
     +---------------------------------------------------------------+
     |                Normal full authentication follows.            |
     +---------------------------------------------------------------+
          |                                                       |


   In the figure above, the first three messages are similar to the
   basic re-authentication case. When the peer detects that the counter
   value is not fresh, it includes the AT_COUNTER_TOO_SMALL attribute
   in EAP-Response/SIM/Re-authentication. This attribute doesn't
   contain any data but it is a request for the server to initiate full
   authentication. In this case, the peer MUST ignore the contents of
   the server's AT_NEXT_REAUTH_ID attribute.

   On receipt of AT_COUNTER_TOO_SMALL, the server verifies AT_MAC and
   verifies that AT_COUNTER contains the same as in the EAP-
   Request/SIM/Re-authentication packet. If not, the server terminates
   the authentication exchange and sends the EAP Failure packet. If all
   checks on the packet are successful, the server transmits a new EAP-
   Request/SIM/Start packet and the full authentication procedure is
   performed as usual. Since the server already knows the subscriber

Haverinen and Salowey  Expires: 27 April, 2004              [Page 29]

Internet Draft          EAP SIM Authentication        27 October, 2003


   identity, it MUST NOT include AT_ANY_ID_REQ, AT_FULLAUTH_ID_REQ or
   AT_PERMANENT_ID_REQ in the EAP-Request/SIM/Start.

4.4. EAP/SIM Notifications

   The EAP-Request/Notification, specified in [EAP], can be used to
   convey a displayable message from the EAP server to the peer.
   Because these messages are textual messages, it may be hard for the
   peer to present them in the user's preferred language. Therefore,
   EAP/SIM uses a separate EAP/SIM message subtype to transmit
   localizable notification codes instead of the EAP-
   Request/Notification packet.

   The EAP server MAY issue an EAP-Request/SIM/Notification packet to
   the peer. The peer MAY show a notification message to the user and
   the peer MUST respond to the EAP server with an EAP-
   Response/SIM/Notification packet, even if the peer did not recognize
   the notification code.

   The notification code is a 16-bit number. The most significant bit
   is called the Failure bit (F bit). The F bit specifies whether the
   notification implies failure. The code values with the F bit set to
   zero (code values 0...32767) are used on unsuccessful cases. The
   receipt of a notification code from this range implies failed
   authentication, so the peer can use the notification as a failure
   indication. After receiving the EAP-Response/SIM/Notification for
   these notification codes, the server MUST send the EAP-Failure
   packet.

   The receipt of a notification code with the F bit set to one (values
   32768...65536) does not imply failure, so the peer MUST NOT change
   its state when it receives such a notification. (This version of the
   protocol does not specify any notification codes with the F bit set
   to one.)

   The second most significant bit of the notification code is called
   the Phase bit (P bit). It specifies at which phase of the EAP/SIM
   exchange the notification can be used. If the P bit is set to zero,
   the notification can only be used after the EAP/SIM/Challenge round
   in full authentication or the EAP/SIM/Re-authentication round in
   reautentication. For these notifications, the AT_MAC attribute MUST
   be included in both EAP-Request/SIM/Notification and EAP-
   Response/SIM/Notification.

   If the P bit is set to one, the notification can only by used before
   the EAP/SIM/Challenge round in full authentication or the
   EAP/SIM/Re-authentication round in reauthentication. For these
   notifications, the AT_MAC attribute MUST NOT be included in either
   EAP-Request/SIM/Notification or EAP-Response/SIM/Notification. (This
   version of the protocol does not specify any notification codes with
   the P bit set to one.)



Haverinen and Salowey  Expires: 27 April, 2004              [Page 30]

Internet Draft          EAP SIM Authentication        27 October, 2003


   Some of the notification codes are authorization related and hence
   not usually considered as part of the responsibility of an EAP
   method. However, they are included as part of EAP/SIM because there
   are currently no other ways to convey this information to the user
   in a localizable way, and the information is potentially useful for
   the user. An EAP/SIM server implementation may decide never to send
   these EAP/SIM notifications.

4.5. Error Cases

   This section specifies the operation of the peer and the server in
   error cases. The subsections below require the EAP/SIM peer and
   server to send an error packet (EAP-Response/SIM/Client-Error or EAP
   Failure) in error cases. However, implementations SHOULD NOT rely
   upon the correct error reporting behavior of the peer,
   authenticator, or the server.  It is possible for error and other
   messages to be lost in transit or for a malicious participant to
   attempt to consume resources by not issuing error messages.  Both
   the peer and the EAP server SHOULD have a mechanism to clean up
   state even if an error message or EAP Success is not received after
   a timeout period.

4.5.1 Peer Operation

   In general, if an EAP/SIM peer detects an error in a received
   EAP/SIM packet, the EAP/SIM implementation responds with the EAP-
   Response/SIM/Client-Error packet. In response to the EAP-
   Response/SIM/Client-Error, the EAP server MUST issue the EAP Failure
   packet and the authentication exchange terminates.

   By default, the peer uses the client error code 0, "unable to
   process packet". This error code is used in the following cases:

   - the peer is not able to parse the EAP request, i.e. the EAP
   request is malformed

   - the peer encountered a malformed attribute

   - wrong attribute types or duplicate attributes have been included
   in the EAP request

   - a mandatory attribute is missing

   - unrecognized non-skippable attribute

   - unrecognized or unexpected EAP/SIM Subtype in the EAP request

   - A RAND challenge repeated in AT_RAND

   - invalid AT_MAC

   - invalid pad bytes in AT_PADDING


Haverinen and Salowey  Expires: 27 April, 2004              [Page 31]

Internet Draft          EAP SIM Authentication        27 October, 2003


   - the peer does not want to process AT_PERMANENT_ID_REQ

   Separate error codes have been defined for the following error cases
   in Section 7.18:

   As specified in Section 4.1, when processing the AT_VERSION_LIST
   attribute, which lists the EAP/SIM versions supported by the server,
   if the attribute does not include a version that is implemented by
   the peer and allowed in the peer's security policy, then the peer
   MUST send the EAP-Response/SIM/Client-Error packet with the error
   code "unsupported version".

   When processing the AT_RAND attribute, the peer MUST send the EAP-
   Response/SIM/Client-Error packet with the error code "insufficient
   number of challenges", if the number of RAND challenges is smaller
   than what is required by peer's local policy.

   If the peer believes that the RAND challenges included in AT_RAND
   are not fresh e.g. because it is capable of remembering some
   previously used RANDs, the peer MUST send the EAP-
   Response/SIM/Client-Error packet with the error code "RANDs are not
   fresh".

4.5.2 Server Operation

   If an EAP/SIM server detects an error in a received EAP/SIM
   response, the server MUST issue the EAP Failure packet and the
   authentication exchange terminates. The errors cases when the server
   issues an EAP Failure include the following:

   - the server is not able to parse the peer's EAP response

   - the server encounters a malformed attribute, a non-recognized non-
   skippable attribute, or a duplicate attribute

   - a mandatory attribute is missing or an invalid attribute was
   included

   - unrecognized or unexpected EAP/SIM Subtype in the EAP Response

   - invalid AT_MAC

   - invalid AT_COUNTER

4.5.3 EAP Failure

   As normally in EAP, the EAP server sends the EAP-Failure packet to
   the peer when the authentication procedure fails on the EAP Server.
   In EAP/SIM, this may occur for example if the EAP server does not
   recognize the peer identity, or if the EAP server is not able to
   obtain the GSM triplets for the subscriber or the authentication
   exchange times out. The server may also send EAP Failure if there is


Haverinen and Salowey  Expires: 27 April, 2004              [Page 32]

Internet Draft          EAP SIM Authentication        27 October, 2003


   an error in the received EAP/SIM response, as discussed in Section
   4.5.2.

   The server can send EAP-Failure at any time in the EAP exchange. The
   peer MUST process EAP-Failure.

.5.4 EAP Success

   On full authentication, the server can only send EAP-Success after
   the EAP/SIM/Challenge round. The peer MUST silently discard any EAP-
   Success packets if they are received before the peer has
   successfully authenticated the server and sent the EAP-
   Response/SIM/Challenge packet.

   On re-authentication, EAP-Success can only be sent after the
   EAP/SIM/Re-authentication round. The peer MUST silently discard any
   EAP-Success packets if they are received before the peer has
   successfully authenticated the server and sent the EAP-
   Response/SIM/Re-authentication packet.

   If the peer receives an EAP/SIM notification (section 4.4) that
   indicates failure, then the peer MUST no longer accept the EAP-
   Success packet even if the server authentication was successfully
   completed.

4.6. Key Generation

   This section specifies how keying material is generated.

   On EAP SIM full authentication, a Master Key (MK) is derived from
   the underlying GSM authentication values (Kc keys), the NONCE_MT and
   other relevant context as follows.

   MK = SHA1(Identity|n*Kc| NONCE_MT| Version List| Selected Version)

   In the formula above, the "|" character denotes concatenation.
   Identity denotes the peer identity string without any terminating
   null characters. It is the identity from the AT_IDENTITY attribute
   from the last EAP-Response/SIM/Start packet, or, if AT_IDENTITY was
   not used, the identity from the EAP-Response/Identity packet. The
   identity string is included as-is, without any changes and including
   the possible identity decoration. The notation n*Kc denotes the n Kc
   values concatenated. The Kc keys are used in the same order as the
   RAND challenges in AT_RAND attribute. NONCE_MT denotes the NONCE_MT
   value (not the AT_NONCE_MT attribute but just the nonce value). The
   Version List includes the 2-byte supported version numbers from
   AT_VERSION_LIST, in the same order as in the attribute. The Selected
   Version is the 2-byte selected version from AT_SELECTED_VERSION.
   Network byte order is used, just as in the attributes. The hash
   function SHA-1 is specified in [SHA-1]. If several EAP/SIM/Start
   roundtrips are used in an EAP/SIM exchange, then the NONCE_MT,
   Version List and Selected version from the last EAP/SIM/Start round
   are used, and the previous EAP/SIM/Start rounds are ignored.

Haverinen and Salowey  Expires: 27 April, 2004              [Page 33]

Internet Draft          EAP SIM Authentication        27 October, 2003


   The Master Key is fed into a Pseudo-Random number Function (PRF)
   which generates separate Transient EAP Keys (TEKs) for protecting
   EAP SIM packets, as well as a Master Session Key (MSK) for link
   layer security and an Extended Master Session Key (EMSK) for other
   purposes. On re-authentication, the same TEKs MUST be used for
   protecting EAP packets, but a new MSK and a new EMSK MUST be derived
   from the original MK and new values exchanged in the re-
   authentication.

   EAP SIM requires two TEKs for its own purposes, the authentication
   key K_aut to be used with the AT_MAC attribute, and the encryption
   key K_encr, to be used with the AT_ENCR_DATA attribute. The same
   K_aut and K_encr keys are used in full authentication and subsequent
   re-authentications.

   Key derivation is based on the random number generation specified in
   NIST Federal Information Processing Standards (FIPS) Publication
   186-2 [PRF]. The pseudo-random number generator is specified in the
   change notice 1 (2001 October 5) of [PRF] (Algorithm 1). As
   specified in the change notice (page 74), when Algorithm 1 is used
   as a general-purpose pseudo-random number generator, the "mod q"
   term in step 3.3 is omitted. The function G used in the algorithm is
   constructed via Secure Hash Standard as specified in Appendix 3.3 of
   the standard. It should be noted that the function G is very similar
   to SHA-1, but the message padding is different. Please refer to
   [PRF] for full details. For convenience, the random number algorithm
   with the correct modification is cited in Annex B.

   160-bit XKEY and XVAL values are used, so b = 160. On each full
   authentication, the Master Key is used as the initial secret seed-
   key XKEY. The optional user input values (XSEED_j) in step 3.1 are
   set to zero.

   The resulting 320-bit random numbers x_0, x_1, ..., x_m-1 are
   concatenated and partitioned into suitable-sized chunks and used as
   keys in the following order: K_encr (128 bits), K_aut (128 bits),
   Master Session Key (64 bytes), Extended Master Session Key (64
   bytes).

   On re-authentication, the same pseudo-random number generator can be
   used to generate a new Master Session Key and new Initialization
   Vectors. The seed value XKEY' is calculated as follows:

      XKEY' = SHA1(Identity|counter|NONCE_S| MK)

   In the formula above, the Identity denotes the re-authentication
   identity, without any terminating null characters, from the
   AT_IDENTITY attribute of the EAP-Response/SIM/Start packet, or, if
   EAP-Response/SIM/Start was not used on re-authentication, the
   identity string from the EAP-Response/Identity packet. The counter
   denotes the counter value from AT_COUNTER attribute used in the EAP-
   Response/SIM/Re-authentication packet. The counter is used in
   network byte order. NONCE_S denotes the 16-byte NONCE_S value from

Haverinen and Salowey  Expires: 27 April, 2004              [Page 34]

Internet Draft          EAP SIM Authentication        27 October, 2003


   the AT_NONCE_S attribute used in the EAP-Request/SIM/Re-
   authentication packet. The MK is the Master Key derived on the
   preceding full authentication. The pseudo-random number generator is
   run with the new seed value XKEY', and the resulting 320-bit random
   numbers x_0, x_1, ..., x_m-1 are concatenated and partitioned into
   64-byte chunks and used as the new 64-byte Master Session Key and
   the new 64-byte Extended Master Session Key.

   The first 32 bytes of the MSK can be used as the Pairwise Master Key
   (PMK) for IEEE 802.11i.

   When the RADIUS attributes specified in [RFC 2548] are used to
   transport keying material, then the first 32 bytes of the MSK
   correspond to MS-MPPE-RECV-KEY and the second 32 bytes to MS-MPPE-
   SEND-KEY. In this case, only 64 bytes of keying material (the MSK)
   are used.

   When generating the initial Master Key, the hash function is used as
   a mixing function to combine several session keys (Kc's) generated
   by the GSM authentication procedure and the random number NONCE_MT
   into a single session key. There are several reasons for this. The
   current GSM session keys are at most 64 bits, so two or more of them
   are needed to generate a longer key. By using a one-way function to
   combine the keys, we are assured that even if an attacker managed to
   learn one of the EAP/SIM session keys, it wouldn't help him in
   learning the original GSM Kc's. In addition, since we include the
   random number NONCE_MT in the calculation, the peer is able to
   verify that the EAP SIM packets it receives from the network are
   fresh and not a replay. (Please see also Section 9.)

5. Message Format and Protocol Extensibility

5.1. Message Format

   As specified in [EAP], EAP packets begin with the Code, Identifiers,
   Length, and Type fields, which are followed by EAP method specific
   Type-Data. The Code field in the EAP header is set to 1 for EAP
   requests, and to 2 for EAP Responses. The usage of the Length and
   Identifier fields in the EAP header are also specified in [EAP]. In
   EAP/SIM, the Type field is set to 18.

   In EAP/SIM, the Type-Data begins with an EAP/SIM header that
   consists of a 1-octet Subtype field and a 2-octet reserved field.
   The Subtype values used in EAP/SIM are defined in Section 8. The
   formats of the EAP header and the EAP/SIM header are shown below.









Haverinen and Salowey  Expires: 27 April, 2004              [Page 35]

Internet Draft          EAP SIM Authentication        27 October, 2003


     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |     Code      |  Identifier   |            Length             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |     Type      |    Subtype    |           Reserved            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


   The rest of the Type-Data, immediately following the EAP/SIM header,
   consists of attributes that are encoded in Type, Length, Value
   format. The figure below shows the generic format of an attribute.

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      Type     |    Length     |  Value...
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+



   Attribute Type

      Indicates the particular type of attribute. The attribute type
      values are listed in Section 8.

   Length

      Indicates the length of this attribute in multiples of four
      bytes. The maximum length of an attribute is 1024 bytes. The
      length includes the Attribute Type and Length bytes.

   Value

      The particular data associated with this attribute. This field is
      always included and it may be two or more bytes in length. The
      type and length fields determine the format and length of the
      value field.

   Attributes numbered within the range 0 through 127 are called non-
   skippable attributes. When an EAP/SIM peer encounters a non-
   skippable attribute that the peer does not recognize, the peer MUST
   send the EAP-Response/SIM/Client-Error packet which terminates the
   authentication exchange. If an EAP/SIM server encounters a non-
   skippable attribute that the server does not recognize, then the
   server sends the EAP Failure packet which terminates the
   authentication exchange.

   Attributes within the range of 128 through 255 are called skippable
   attributes. When a skippable attribute is encountered that is not
   recognized it is ignored. The rest of the attributes and message
   data MUST still be processed. The Length field of the attribute is


Haverinen and Salowey  Expires: 27 April, 2004              [Page 36]

Internet Draft          EAP SIM Authentication        27 October, 2003


   used to skip the attribute value in searching for the next
   attribute.

   Unless otherwise specified, the order of the attributes in an
   EAP/SIM message is insignificant and an EAP/SIM implementation
   should not assume a certain order to be used.

   Attributes can be encapsulated within other attributes. In other
   words, the value field of an attribute type can be specified to
   contain other attributes.

5.2. Protocol Extensibility

   EAP/SIM can be extended by specifying new attribute types. If
   skippable attributes are used, it is possible to extend the protocol
   without breaking old implementations. However, any new attributes
   added to the EAP-Request/SIM/Start or EAP-Response/SIM/Start packets
   would not be integrity protected. Therefore, these messages MUST NOT
   be extended in the current version of EAP/SIM.

   When specifying new attributes, it should be noted that EAP/SIM does
   not support message fragmentation. Hence, the sizes of the new
   extensions MUST be limited so that the maximum transfer unit (MTU)
   of the underlying lower layer is not exceeded. According to [EAP],
   lower layers must provide an EAP MTU of 1020 bytes or greater, so
   any extensions to EAP/SIM SHOULD NOT exceed the EAP MTU of 1020
   bytes.

   Because EAP/SIM supports version negotiation, new versions of the
   protocol can also be specified by using a new version number.

6. Messages

   This section specifies the messages used in EAP/SIM. It specifies
   when a message may be transmitted or accepted, which attributes are
   allowed in a message, which attributes are required in a message,
   and other message specific details. The general message format is
   specified in Section 5.1.

6.1. EAP-Request/SIM/Start

   In full authentication the first SIM specific EAP Request is EAP-
   Request/SIM/Start. The EAP/SIM/Start roundtrip is used for two
   purposes. In full authentication this packet is used to request the
   peer to send the AT_NONCE_MT attribute to the server. In addition,
   as specified in Section 4.2, the Start round trip may be used by the
   server for obtaining the peer identity. As discussed in Section 4.2,
   several Start rounds may be required in order to obtain a valid peer
   identity.

   The server MUST always include the AT_VERSION_LIST attribute.



Haverinen and Salowey  Expires: 27 April, 2004              [Page 37]

Internet Draft          EAP SIM Authentication        27 October, 2003


   The server MAY include one of the following identity requesting
   attributes: AT_PERMANENT_ID_REQ, AT_FULLAUTH_ID_REQ, and
   AT_ANY_ID_REQ. These three attributes are mutually exclusive, so the
   server MUST NOT include more than one of the attributes.

   If the server has received a response from the peer, it MUST NOT
   issue a new EAP-Request/SIM/Start packet if it has either previously
   issued an EAP-Request/SIM/Start message without any identity
   requesting attributes or with the AT_PERMANENT_ID_REQ attribute.

   If the server has received a response from the peer, it MUST NOT
   issue a new EAP-Request/SIM/Start packet with the AT_ANY_ID_REQ or
   AT_FULLAUTH_ID_REQ attributes if it has previously issued an EAP-
   Request/SIM/Start message with the AT_FULLAUTH_ID_REQ attribute

   If the server has received a response from the peer, it MUST NOT
   issue a new EAP-Request/SIM/Start packet with the AT_ANY_ID_REQ
   attribute if the server has previously issued an EAP-
   Request/SIM/Start message with the AT_ANY_ID_REQ attribute.

   This message MUST NOT include AT_MAC, AT_IV, or AT_ENCR_DATA.

6.2. EAP-Response/SIM/Start

   The peer sends EAP-Response/SIM/Start in response to a valid EAP-
   Request/SIM/Start from the server.

   If and only if the server's EAP-Request/SIM/Start includes one of
   the identity requesting attributes, then the peer MUST include the
   AT_IDENTITY attribute. The usage of AT_IDENITY is defined in Section
   4.2.

   The AT_NONCE_MT attribute MUST NOT be included if the AT_IDENTITY
   with a re-authentication identity is present for re-authentication.
   AT_NONCE_MT MUST be included in all other cases (full
   authentication).

   The AT_SELECTED_VERSION attribute MUST NOT be included if the
   AT_IDENTITY attribute with a re-authentication identity is present
   for re-authentication. In all other cases, AT_SELECTED_VERSION MUST
   be included (full authentication). This attribute is used in version
   negotiation, as specified in Section 4.1.

   This message MUST NOT include AT_MAC, AT_IV, or AT_ENCR_DATA.

6.3. EAP-Request/SIM/Challenge

   The server sends the EAP-Request/SIM/Challenge after receiving a
   valid EAP-Response/SIM/Start, containing AT_NONCE_MT and
   AT_SELECTED_VERSION, and after successfully obtaining the subscriber
   identity.

   The AT_RAND attribute MUST be included.

Haverinen and Salowey  Expires: 27 April, 2004              [Page 38]

Internet Draft          EAP SIM Authentication        27 October, 2003


   The AT_MAC attribute MUST be included. For EAP-
   Request/SIM/Challenge, the MAC code is calculated over the following
   data:

   EAP packet| NONCE_MT


   The EAP packet is represented as specified in Section 5.1. It is
   followed by the 16-byte NONCE_MT value from the peer's AT_NONCE_MT
   attribute.

   The EAP-Request/SIM/Challenge packet MAY include encrypted
   attributes for identity privacy and for communicating the next re-
   authentication identity. In this case, the AT_IV and AT_ENCR_DATA
   attributes are included (Section 7.3).

   The plaintext of the AT_ENCR_DATA value field consists of nested
   attributes. The nested attributes MAY include AT_PADDING (as
   specified in Section 7.3). If the server supports identity privacy
   and wants to communicate a pseudonym to the peer for the next full
   authentication, then the nested encrypted attributes include the
   AT_NEXT_PSEUDONYM attribute. If the server supports re-
   authentication and wants to communicate a re-authentication identity
   to the peer, then the nested encrypted attributes include the
   AT_NEXT_REAUTH_ID attribute.

6.4. EAP-Response/SIM/Challenge

   The peer sends EAP-Response/SIM/Challenge in response to a valid
   EAP-Request/SIM/Challenge.

   The AT_MAC attribute MUST be included. For EAP-
   Response/SIM/Challenge, the MAC code is calculated over the
   following data:

   EAP packet| n*SRES


   The EAP packet is represented as specified in Section 5.1. The EAP
   packet bytes are immediately followed by the two or three SRES
   values concatenated, denoted above with the notation n*SRES. The
   SRES values are used in the same order as the corresponding RAND
   challenges in server's AT_RAND attribute.

   Later versions of this protocol MAY make use of the AT_ENCR_DATA and
   AT_IV attributes in this message to include encrypted (skippable)
   attributes. The EAP server MUST process EAP-Response/SIM/Challenge
   messages that include these attributes even if the server did not
   implement these optional attributes.





Haverinen and Salowey  Expires: 27 April, 2004              [Page 39]

Internet Draft          EAP SIM Authentication        27 October, 2003


6.5. EAP-Request/SIM/Re-authentication

   The server sends the EAP-Request/SIM/Re-authentication message if it
   wants to use re-authentication, and if it has received a valid re-
   authentication identity in EAP-Response/Identity or EAP-
   Response/SIM/Start.

   AT_MAC MUST be included. No message-specific data is included in the
   MAC calculation. See Section 7.2.

   The AT_IV and AT_ENCR_DATA attributes MUST be included. The
   plaintext consists of the following nested encrypted attributes,
   which MUST be included: AT_COUNTER and AT_NONCE_S. In addition, the
   nested encrypted attributes MAY include the following attributes:
   AT_NEXT_REAUTH_ID and AT_PADDING.

6.6. EAP-Response/SIM/Re-authentication

   The client sends the EAP-Response/SIM/Re-authentication packet in
   response to a valid EAP-Request/SIM/Re-authentication.

   The AT_MAC attribute MUST be included. For EAP-Response/SIM/Re-
   authentication, the MAC code is calculated over the following data:

    EAP packet| NONCE_S

   The EAP packet is represented as specified in Section 5.1. It is
   followed by the 16-byte NONCE_S value from the server's AT_NONCE_S
   attribute.

   The AT_IV and AT_ENCR_DATA attributes MUST be included. The nested
   encrypted attributes MUST include the AT_COUNTER attribute. The
   AT_COUNTER_TOO_SMALL attribute MAY be included in the nested
   encrypted attributes, and it is included in cases specified in
   Section 4.3. The AT_PADDING attribute MAY be included.

6.7. EAP-Response/SIM/Client-Error

   The peer sends EAP-Response/SIM/Client-Error in error cases, as
   specified in Section 4.5.1.

   The AT_CLIENT_ERROR_CODE attribute MUST be included.

   The AT_MAC, AT_IV, or AT_ENCR_DATA attributes MUST NOT be used with
   this packet.

6.8. EAP-Request/SIM/Notification

   The usage of this message is specified in Section 4.4.

   The AT_NOTIFICATION attribute MUST be included.



Haverinen and Salowey  Expires: 27 April, 2004              [Page 40]

Internet Draft          EAP SIM Authentication        27 October, 2003


   The AT_MAC attribute is included in cases discussed in Section 4.4.
   No message-specific data is included in the MAC calculation. See
   Section 7.2.

   Later versions of this protocol MAY make use of the AT_ENCR_DATA and
   AT_IV attributes in this message to include encrypted (skippable)
   attributes. These attributes MAY be included only if the P bit of
   the notification code in AT_NOTIFICATION is set to zero.

6.9. EAP-Response/SIM/Notification

   The usage of this message is specified in Section 4.4. Because this
   packet is only an acknowledgement of EAP-Request/SIM/Notification,
   it does not contain any mandatory attributes.

   The AT_MAC attribute is included in cases described in Section 4.4.
   No message-specific data is included in the MAC calculation, see
   Section 7.2.

   Later versions of this protocol MAY make use of the AT_ENCR_DATA and
   AT_IV attributes in this message to include encrypted (skippable)
   attributes. These attributes MAY be included only if the P bit of
   the notification code in the AT_NOTIFICATION attribute of the
   server's EAP-Request/SIM/Notification packet is set to zero.

7. Attributes

   This section specifies the format of message attributes. The
   attribute type numbers are specified in Section 8.

7.1. Table of Attributes

   The following table provides a guide to which attributes may be
   found in which kinds of messages, and in what quantity. Messages are
   denoted with numbers in parentheses as follows: (1) EAP-
   Request/SIM/Start, (2) EAP-Response/SIM/Start, (3) EAP-
   Request/SIM/Challenge, (4) EAP-Response/SIM/Challenge, (5) EAP-
   Request/SIM/Notification, (6) EAP-Response/SIM/Notification, (7)
   EAP-Response/SIM/Client-Error (8) EAP-Request/SIM/Re-authentication,
   and (9) EAP-Response/SIM/Re-authentication. The column denoted with
   "Encr" indicates whether the attribute is a nested attribute that
   MUST be included within AT_ENCR_DATA, and the column denoted with
   "Skip" indicates whether the attribute is a skippable attribute.

   "0" indicates that the attribute MUST NOT be included in the
   message, "1" indicates that the attribute MUST be included in the
   message, "0-1" indicates that the attribute