Extensible Authentication Protocol (EAP)

来源:互联网 发布:网络购物平台 编辑:程序博客网 时间:2024/04/30 20:53

EAP协议


EAP协议由RFC3748定义。

EAP Multiplexing Model


         +-+-+-+-+-+-+-+-+-+-+-+-+  +-+-+-+-+-+-+-+-+-+-+-+-+         |           |           |  |           |           |         | EAP method| EAP method|  | EAP method| EAP method|         | Type = X  | Type = Y  |  | Type = X  | Type = Y  |         |       V   |           |  |       ^   |           |         +-+-+-+-!-+-+-+-+-+-+-+-+  +-+-+-+-!-+-+-+-+-+-+-+-+         |       !               |  |       !               |         |  EAP  ! Peer layer    |  |  EAP  ! Auth. layer   |         |       !               |  |       !               |         +-+-+-+-!-+-+-+-+-+-+-+-+  +-+-+-+-!-+-+-+-+-+-+-+-+         |       !               |  |       !               |         |  EAP  ! layer         |  |  EAP  ! layer         |         |       !               |  |       !               |         +-+-+-+-!-+-+-+-+-+-+-+-+  +-+-+-+-!-+-+-+-+-+-+-+-+         |       !               |  |       !               |         | Lower ! layer         |  | Lower ! layer         |         |       !               |  |       !               |         +-+-+-+-!-+-+-+-+-+-+-+-+  +-+-+-+-!-+-+-+-+-+-+-+-+                 !                          !                 !   Peer                   ! Authenticator                 +------------>-------------+

Pass-through Authenticator


        Peer         Pass-through Authenticator   Authentication                                                      Server   +-+-+-+-+-+-+                                   +-+-+-+-+-+-+   |           |                                   |           |   |EAP method |                                   |EAP method |   |     V     |                                   |     ^     |   +-+-+-!-+-+-+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+   +-+-+-!-+-+-+   |     !     |   |EAP  |  EAP  |             |   |     !     |   |     !     |   |Peer |  Auth.| EAP Auth.   |   |     !     |   |EAP  ! peer|   |     | +-----------+       |   |EAP  !Auth.|   |     !     |   |     | !     |     !       |   |     !     |   +-+-+-!-+-+-+   +-+-+-+-!-+-+-+-+-+-!-+-+-+-+   +-+-+-!-+-+-+   |     !     |   |       !     |     !       |   |     !     |   |EAP  !layer|   |   EAP !layer| EAP !layer  |   |EAP  !layer|   |     !     |   |       !     |     !       |   |     !     |   +-+-+-!-+-+-+   +-+-+-+-!-+-+-+-+-+-!-+-+-+-+   +-+-+-!-+-+-+   |     !     |   |       !     |     !       |   |     !     |   |Lower!layer|   |  Lower!layer| AAA ! /IP   |   | AAA ! /IP |   |     !     |   |       !     |     !       |   |     !     |   +-+-+-!-+-+-+   +-+-+-+-!-+-+-+-+-+-!-+-+-+-+   +-+-+-!-+-+-+         !                 !           !                 !         !                 !           !                 !         +-------->--------+           +--------->-------+

在Lower layer中,EAP可用于PPP,也可用于IEEE 802(即EAPoL)

 

EAP Packet Format

    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             |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |    Data ...   +-+-+-+-+

Code:

1 Request
2 Response
3 Success
4 Failure


Request和Response format:

    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      |  Type-Data ...   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Type:

1 Identity
2 Notification
3 Nak (Response only)
4 MD5-Challenge
5 One Time Password (OTP)
6 Generic Token Card (GTC)
254 Expanded Types
255 Experimental use


EAP-TTLS


Protocol Layering Model


   +-----------------------------------------------------------+   | AVPs, including authentication (PAP, CHAP, MS-CHAP, etc.) |   +-----------------------------------------------------------+   |                            TLS                            |   +-----------------------------------------------------------+   |                         EAP-TTLS                          |   +-----------------------------------------------------------+   |                            EAP                            |   +-----------------------------------------------------------+   |   Carrier Protocol (PPP, EAPOL, RADIUS, Diameter, etc.)   |   +-----------------------------------------------------------+


   +-----------------------------------------------------------+   |              EAP Method (MD-Challenge, etc.)              |   +-----------------------------------------------------------+   |                    AVPs, including EAP                    |   +-----------------------------------------------------------+   |                            TLS                            |   +-----------------------------------------------------------+   |                         EAP-TTLS                          |   +-----------------------------------------------------------+   |                            EAP                            |   +-----------------------------------------------------------+   |   Carrier Protocol (PPP, EAPOL, RADIUS, Diameter, etc.)   |   +-----------------------------------------------------------+


EAP-TTLS Package Format


    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      |     Flags     |        Message Length   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+            Message Length         |             Data...   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Code:1 for request, 2 for response.

Type: 21 (EAP-TTLS)

Flags
        0   1   2   3   4   5   6   7
      +---+---+---+---+---+---+---+---+
      |  L  |  M |  S |  R  |  R |        V        |
      +---+---+---+---+---+---+---+---+
      L = Length included
      M = More fragments
      S = Start
      R = Reserved
      V = Version (000 for EAP-TTLSv0)

EAP-PEAP


PEAPv2 Protocol Layers


PEAPv2 Part 1  Protocol Layers


   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |            TLS        |  Optional Outer TLVs    |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                    PEAP                         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     EAP                         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

PEAPv2 Part 2  Protocol Layers

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     EAP                         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |          Inner-TLVs (EAP-Payload TLV)           |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     TLS                         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                    PEAP                         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     EAP                         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


Format


    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      |   Flags | Ver |    Fragment Message Length   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |   Fragment Message Length     |    TLS Message Length   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |     TLS Message Length        |      TLS Data...   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |             Outer TLVs...   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   Code:1 - Request   2 - Response

   Type:25 - PEAP

   Flags
       0 1 2 3 4
      +-+-+-+-+-+
      | L M  S  T R|
      +-+-+-+-+-+
   L = Length included

      M = More fragments
      S = PEAP start
      T = TLS Length included
      R = Reserved (must be zero)

   Version
       0 1 2
      +-+-+-+
      |R|1|0|
      +-+-+-+
      R = Reserved (must be zero)

EAP-TLS


Request Format


   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      |     Flags     |      TLS Message Length   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |     TLS Message Length        |       TLS Data...   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type:13 -- EAP-TLS
Flags
      0 1 2 3 4 5 6 7 8
      +-+-+-+-+-+-+-+-+
      |L M S R R R R R|
      +-+-+-+-+-+-+-+-+
      L = Length included
      M = More fragments
      S = EAP-TLS start
      R = Reserved

Response Format


      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      |     Flags     |      TLS Message Length      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      |     TLS Message Length        |       TLS Data...      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type:13 -- EAP-TLS
Flags:
      0 1 2 3 4 5 6 7 8
      +-+-+-+-+-+-+-+-+
      |L M R R R R R R|
      +-+-+-+-+-+-+-+-+
      L = Length included
      M = More fragments
      R = Reserved

EAPOL

      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      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      |Protocol Version|     Type     |          Body Length          |      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      |    Packet Body ....         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type:
0000 0000  EAPOL-EAP    
0000 0001  EAPOL-Start
0000 0010  EAPOL-Logoff
0000 0011  EAPOL-Key
0000 0100  EAPOL-Encapsulated-ASF-Alert
0000 0101  EAPOL-MKA
0000 0110  EAPOL-Announcement (Generic)
0000 0111  EAPOL-Announcement (Specific)
0000 1000  EAPOL-Announcement-Req





1 0