idnits 2.17.1 draft-ietf-emu-eap-gpsk-12.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 16. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 1597. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 1608. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 1615. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 1621. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year == The document seems to use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 1, 2008) is 5683 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 4282 (Obsoleted by RFC 7542) ** Obsolete normative reference: RFC 4634 (Obsoleted by RFC 6234) -- Possible downref: Non-RFC (?) normative reference: ref. 'AES' -- Possible downref: Non-RFC (?) normative reference: ref. 'CMAC' -- Possible downref: Non-RFC (?) normative reference: ref. 'CBC' Summary: 4 errors (**), 0 flaws (~~), 2 warnings (==), 11 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 EMU Working Group T. Clancy 3 Internet-Draft LTS 4 Intended status: Standards Track H. Tschofenig 5 Expires: April 4, 2009 Nokia Siemens Networks 6 October 1, 2008 8 EAP Generalized Pre-Shared Key (EAP-GPSK) Method 9 draft-ietf-emu-eap-gpsk-12 11 Status of this Memo 13 By submitting this Internet-Draft, each author represents that any 14 applicable patent or other IPR claims of which he or she is aware 15 have been or will be disclosed, and any of which he or she becomes 16 aware will be disclosed, in accordance with Section 6 of BCP 79. 18 Internet-Drafts are working documents of the Internet Engineering 19 Task Force (IETF), its areas, and its working groups. Note that 20 other groups may also distribute working documents as Internet- 21 Drafts. 23 Internet-Drafts are draft documents valid for a maximum of six months 24 and may be updated, replaced, or obsoleted by other documents at any 25 time. It is inappropriate to use Internet-Drafts as reference 26 material or to cite them other than as "work in progress." 28 The list of current Internet-Drafts can be accessed at 29 http://www.ietf.org/ietf/1id-abstracts.txt. 31 The list of Internet-Draft Shadow Directories can be accessed at 32 http://www.ietf.org/shadow.html. 34 This Internet-Draft will expire on April 4, 2009. 36 Abstract 38 This Internet Draft defines an Extensible Authentication Protocol 39 method called EAP Generalized Pre-Shared Key (EAP-GPSK). This method 40 is a lightweight shared-key authentication protocol supporting mutual 41 authentication and key derivation. 43 Table of Contents 45 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 47 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 49 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 51 4. Key Derivation . . . . . . . . . . . . . . . . . . . . . . . . 9 53 5. Key Management . . . . . . . . . . . . . . . . . . . . . . . . 11 55 6. Ciphersuites . . . . . . . . . . . . . . . . . . . . . . . . . 12 57 7. Generalized Key Derivation Function (GKDF) . . . . . . . . . . 13 59 8. Ciphersuites Processing Rules . . . . . . . . . . . . . . . . 13 60 8.1. Ciphersuite #1 . . . . . . . . . . . . . . . . . . . . . 13 61 8.1.1. Encryption . . . . . . . . . . . . . . . . . . . . . . 13 62 8.1.2. Integrity . . . . . . . . . . . . . . . . . . . . . . 14 63 8.2. Ciphersuite #2 . . . . . . . . . . . . . . . . . . . . . 14 64 8.2.1. Encryption . . . . . . . . . . . . . . . . . . . . . . 14 65 8.2.2. Integrity . . . . . . . . . . . . . . . . . . . . . . 14 67 9. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . . 15 68 9.1. Header Format . . . . . . . . . . . . . . . . . . . . . . 15 69 9.2. Ciphersuite Formatting . . . . . . . . . . . . . . . . . 15 70 9.3. Payload Formatting . . . . . . . . . . . . . . . . . . . 16 71 9.4. Protected Data . . . . . . . . . . . . . . . . . . . . . 21 73 10. Packet Processing Rules . . . . . . . . . . . . . . . . . . . 24 75 11. Example Message Exchanges . . . . . . . . . . . . . . . . . . 25 77 12. Security Considerations . . . . . . . . . . . . . . . . . . . 28 78 12.1. Security Claims . . . . . . . . . . . . . . . . . . . . . 28 79 12.2. Mutual Authentication . . . . . . . . . . . . . . . . . . 29 80 12.3. Protected Result Indications . . . . . . . . . . . . . . 29 81 12.4. Integrity Protection . . . . . . . . . . . . . . . . . . 30 82 12.5. Replay Protection . . . . . . . . . . . . . . . . . . . . 30 83 12.6. Reflection attacks . . . . . . . . . . . . . . . . . . . 30 84 12.7. Dictionary Attacks . . . . . . . . . . . . . . . . . . . 30 85 12.8. Key Derivation and Key Strength . . . . . . . . . . . . . 31 86 12.9. Denial of Service Resistance . . . . . . . . . . . . . . 31 87 12.10. Session Independence . . . . . . . . . . . . . . . . . . 31 88 12.11. Compromise of the PSK . . . . . . . . . . . . . . . . . . 32 89 12.12. Fragmentation . . . . . . . . . . . . . . . . . . . . . . 32 90 12.13. Channel Binding . . . . . . . . . . . . . . . . . . . . . 32 91 12.14. Fast Reconnect . . . . . . . . . . . . . . . . . . . . . 32 92 12.15. Identity Protection . . . . . . . . . . . . . . . . . . . 33 93 12.16. Protected Ciphersuite Negotiation . . . . . . . . . . . . 33 94 12.17. Confidentiality . . . . . . . . . . . . . . . . . . . . . 33 95 12.18. Cryptographic Binding . . . . . . . . . . . . . . . . . . 34 97 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34 99 14. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 35 101 15. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 35 103 16. References . . . . . . . . . . . . . . . . . . . . . . . . . . 36 104 16.1. Normative References . . . . . . . . . . . . . . . . . . 36 105 16.2. Informative References . . . . . . . . . . . . . . . . . 37 107 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 37 108 Intellectual Property and Copyright Statements . . . . . . . . . . 39 110 1. Introduction 112 EAP Generalized Pre-Shared Key (EAP-GPSK) is an EAP method defining a 113 generalized pre-shared key authentication technique. Mutual 114 authentication is achieved through a nonce-based exchange that is 115 secured by a pre-shared key. 117 EAP-GPSK addresses a large number of design goals with the intention 118 of being applicable in a broad range of usage scenarios. 120 The main design goals of EAP-GPSK are 122 Simplicity: 124 EAP-GPSK should be easy to implement. 126 Security Model: 128 EAP-GPSK has been designed in a threat model where the attacker 129 has full control over the communication channel. This is the EAP 130 threat model that is presented in Section 7.1 of [RFC3748]. 132 Efficiency: 134 EAP-GPSK does not make use of public key cryptography and fully 135 relies of symmetric cryptography. The restriction on symmetric 136 cryptographic computations allows for low computational overhead. 137 Hence, EAP-GPSK is lightweight and well suited for any type of 138 device, especially those with processing power, memory and battery 139 constraints. Additionally it seeks to minimize the number of 140 round trips. 142 Flexibility: 144 EAP-GPSK offers cryptographic flexibility. At the beginning, the 145 EAP server proposes a list of ciphersuites. The client then 146 selects one. The current version of EAP-GPSK comprises two 147 ciphersuites, but additional ones can be easily added. 149 Extensibility: 151 The design of EAP-GPSK allows to securely exchange information 152 between the EAP peer and the EAP server using protected data 153 fields. These fields might, for example, be used to exchange 154 channel binding information or to provide support for identity 155 confidentiality. 157 2. Terminology 159 In this document, several words are used to signify the requirements 160 of the specification. These words are often capitalized. The key 161 words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", 162 "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document 163 are to be interpreted as described in [RFC2119]. 165 This section describes the various variables and functions used in 166 the EAP-GPSK method. 168 Variables: 170 CSuite_List: An octet array listing available ciphersuites (variable 171 length) 173 CSuite_Sel: Ciphersuite selected by the peer (6 octets) 175 ID_Peer: Peer NAI [RFC4282] 177 ID_Server: Server identity as an opaque blob. 179 KS: Integer representing the input key size in octets of the 180 selected ciphersuite CSuite_Sel. The key size is one of the 181 ciphersuite parameters. 183 ML: Integer representing the length of the MAC output, in octets, of 184 the selected ciphersuite CSuite_Sel. 186 PD_Payload: Data carried within the protected data payload 188 PD_Payload_Block: Block of possibly multiple PD_Payloads carried by 189 a GPSK packet 191 PL: Integer representing the length of the PSK in octets (2 octets). 192 PL MUST be larger than or equal to KS. 194 RAND_Peer: Random integer generated by the peer (32 octets) 196 RAND_Server: Random integer generated by the server (32 octets) 198 Operations: 200 A || B: Concatenation of octet strings A and B 202 A**B: Integer exponentiation 204 truncate(A,B): Returns the first B octets of A 206 ENC_X(Y): Encryption of message Y with a symmetric key X, using a 207 defined block cipher 209 KDF_X(Y): Key Derivation Function that generates an arbitrary number 210 of octets of output using secret X and seed Y 212 length(X): Function that returns the length of input X in octets, 213 encoded as a 2-octet integer in network byte order 215 MAC_X(Y): Keyed message authentication code computed over Y with 216 symmetric key X 218 SEC_X(Y): SEC is a function that provides integrity protection based 219 on the chosen ciphersuite. The function SEC uses the algorithm 220 defined by the selected ciphersuite and applies it to the message 221 content Y with key X. In short, SEC_X(Y) = Y || MAC_X(Y). 223 X[A..B]: Notation representing octets A through B of octet array X 225 The following abbreviations are used for the keying material: 227 EMSK: Extended Master Session Key is exported by the EAP method (64 228 octets) 230 MK: Master Key between the peer and EAP server from which all other 231 EAP method session keys are derived (KS octets) 233 MSK: Master Session Key exported by the EAP method (64 octets) 235 PK: Session key generated from the MK and used during protocol 236 exchange to encrypt protected data (KS octets) 238 PSK: Long-term key shared between the peer and the server (PL 239 octets) 241 SK: Session key generated from the MK and used during protocol 242 exchange to demonstrate knowledge of the PSK (KS octets) 244 3. Overview 246 The EAP framework (see Section 1.3 of [RFC3748]) defines three basic 247 steps that occur during the execution of an EAP conversation between 248 the EAP peer, the Authenticator and the EAP server. 250 1. The first phase, discovery, is handled by the underlying 251 protocol. 252 2. The EAP authentication phase with EAP-GPSK is defined in this 253 document. 254 3. The secure association distribution and secure association phases 255 are handled differently depending on the underlying protocol. 257 EAP-GPSK performs mutual authentication between EAP peer ("Peer") and 258 EAP server ("Server") based on a pre-shared key (PSK). The protocol 259 consists of the message exchanges (GPSK-1, ..., GPSK-4), in which 260 both sides exchange nonces and their identities, compute and exchange 261 a Message Authentication Code (MAC) over the previously exchanged 262 values, keyed with the pre-shared key. This MAC is considered as 263 proof of possession of the pre-shared key. Two further messages, 264 namely GPSK-Fail and GPSK-Protected-Fail are used to deal with error 265 situations. 267 A successful protocol exchange is shown in Figure 1. 269 +--------+ +--------+ 270 | | EAP-Request/Identity | | 271 | EAP |<------------------------------------| EAP | 272 | peer | | server | 273 | | EAP-Response/Identity | | 274 | |------------------------------------>| | 275 | | | | 276 | | EAP-Request/GPSK-1 | | 277 | |<------------------------------------| | 278 | | | | 279 | | EAP-Response/GPSK-2 | | 280 | |------------------------------------>| | 281 | | | | 282 | | EAP-Request/GPSK-3 | | 283 | |<------------------------------------| | 284 | | | | 285 | | EAP-Response/GPSK-4 | | 286 | |------------------------------------>| | 287 | | | | 288 | | EAP-Success | | 289 | |<------------------------------------| | 290 +--------+ +--------+ 292 Figure 1: EAP-GPSK: Successful Exchange 294 The full EAP-GPSK protocol is as follows: 295 GPSK-1: 297 ID_Server, RAND_Server, CSuite_List 299 GPSK-2: 301 SEC_SK(ID_Peer, ID_Server, RAND_Peer, RAND_Server, CSuite_List, 302 CSuite_Sel, [ ENC_PK(PD_Payload_Block) ] ) 304 GPSK-3: 306 SEC_SK(RAND_Peer, RAND_Server, ID_Server, CSuite_Sel, [ 307 ENC_PK(PD_Payload_Block) ] ) 309 GPSK-4: 311 SEC_SK( [ ENC_PK(PD_Payload_Block) ] ) 313 The EAP server begins EAP-GPSK by selecting a random number 314 RAND_Server and by encoding the supported ciphersuites into 315 CSuite_List. A ciphersuite consists of an encryption algorithm, a 316 key derivation function and a message authentication code. 318 In GPSK-1, the EAP server sends its identity ID_Server, a random 319 number RAND_Server and a list of supported ciphersuites CSuite_List. 320 The decision which ciphersuite to offer and which ciphersuite to pick 321 is policy- and implementation-dependent and therefore outside the 322 scope of this document. 324 In GPSK-2, the peer sends its identity ID_Peer and a random number 325 RAND_Peer. Furthermore, it repeats the received parameters of the 326 GPSK-1 message (ID_Server, RAND_Server, CSuite_List) and the selected 327 ciphersuite. It computes a Message Authentication Code over all the 328 transmitted parameters. 330 The EAP server verifies the received Message Authentication Code. In 331 case of successful verification, the EAP server computes a Message 332 Authentication Code over the session parameter and returns it to the 333 peer (within GPSK-3). Within GPSK-2 and GPSK-3, peer and EAP server 334 have the possibility to exchange encrypted protected data parameters. 336 The peer verifies the received Message Authentication Code. If the 337 verification is successful, GPSK-4 is prepared. This message can 338 optionally contain the peer's protected data parameters. 340 Upon receipt of GPSK-4, the server processes any included 341 PD_Payload_Block. Then, the EAP server sends an EAP Success message 342 to indicate the successful outcome of the authentication. 344 4. Key Derivation 346 EAP-GPSK provides key derivation in compliance to the requirements of 347 [RFC3748] and [I-D.ietf-eap-keying]. Note that this section provides 348 an abstract description for the key derivation procedure that needs 349 to be instantiated with a specific ciphersuite. 351 The long-term credential shared between EAP peer and EAP server 352 SHOULD be a strong pre-shared key PSK of at least 16 octets, though 353 its length and entropy is variable. While it is possible to use a 354 password or passphrase, doing so is NOT RECOMMENDED as it would make 355 EAP-GPSK vulnerable to dictionary attacks. 357 During an EAP-GPSK authentication, a Master Key MK, a Session Key SK 358 and a Protected Data Encryption Key PK (if using an encrypting 359 ciphersuite) are derived using the ciphersuite-specified KDF and data 360 exchanged during the execution of the protocol, namely 'RAND_Peer || 361 ID_Peer || RAND_Server || ID_Server' referred as inputString as its 362 short-hand form. 364 In case of successful completion, EAP-GPSK derives and exports an MSK 365 and EMSK both in length of 64 octets. 367 The following notation is used: KDF-X(Y, Z)[A..B], whereby 368 X is the length, in octets, of the desired output, 369 Y is a secret key, 370 Z is the inputString, 371 [A..B] extracts the string of octets starting with octet A finishing 372 with octet B from the output of the KDF function. 374 This keying material is derived using the ciphersuite-specified KDF 375 as follows: 377 o inputString = RAND_Peer || ID_Peer || RAND_Server || ID_Server 378 o MK = KDF-KS(PSK[0..KS-1], PL || PSK || CSuite_Sel || 379 inputString)[0..KS-1] 380 o MSK = KDF-{128+2*KS}(MK, inputString)[0..63] 381 o EMSK = KDF-{128+2*KS}(MK, inputString)[64..127] 382 o SK = KDF-{128+2*KS}(MK, inputString)[128..127+KS] 383 o PK = KDF-{128+2*KS}(MK, inputString)[128+KS..127+2*KS] (if using 384 an encrypting ciphersuite) 386 The value for PL is encoded as a 2-octet integer in network byte 387 order. 389 Additionally, the EAP keying framework [I-D.ietf-eap-keying] requires 390 the definition of a Method-ID, Session-ID, Peer-ID, and Server-ID. 391 These values are defined as: 393 o zero = 0x00 || 0x00 || ... || 0x00 (KS times) 394 o Method-ID = KDF-16(zero, "Method ID" || EAP_Method_Type || 395 CSuite_Sel || inputString)[0..15] 396 o Session-ID = Type_Code || Method_ID 397 o Peer-ID = ID_Peer 398 o Server-ID = ID_Server 400 EAP_Method_Type refers to the 1-octet IANA allocated EAP Type code 401 value. 403 Figure 2 depicts the key derivation procedure of EAP-GPSK. 405 +-------------+ +-------------------------------+ 406 | PL-octet | | RAND_Peer || ID_Peer || | 407 | PSK | | RAND_Server || ID_Server | 408 +-------------+ +-------------------------------+ 409 | | | 410 | +------------+ | | 411 | | CSuite_Sel | | | 412 | +------------+ | | 413 | | | | 414 v v v | 415 +--------------------------------------------+ | 416 | KDF | | 417 +--------------------------------------------+ | 418 | | 419 v | 420 +-------------+ | 421 | KS-octet | | 422 | MK | | 423 +-------------+ | 424 | | 425 v v 426 +---------------------------------------------------+ 427 | KDF | 428 +---------------------------------------------------+ 429 | | | | 430 v v v v 431 +---------+ +---------+ +----------+ +----------+ 432 | 64-octet| | 64-octet| | KS-octet | | KS-octet | 433 | MSK | | EMSK | | SK | | PK | 434 +---------+ +---------+ +----------+ +----------+ 436 Figure 2: EAP-GPSK Key Derivation 438 5. Key Management 440 In order to be interoperable, PSKs must be entered in the same way on 441 both the peer and server. The management interface for entering PSKs 442 MUST support entering PSKs up to 64 octets in length as ASCII strings 443 and in hexadecimal encoding. 445 Additionally, the ID_Peer and ID_Server MUST be provisioned with the 446 PSK. Validation of these values is by an octet-wise comparison. The 447 management interface SHOULD support entering non-ASCII octets for the 448 ID_Peer and ID_Server up to 254 octets in length. For more 449 information the reader is adviced to read Section 2.4 of RFC 4282 450 [RFC4282]. 452 6. Ciphersuites 454 The design of EAP-GPSK allows cryptographic algorithms and key sizes, 455 called ciphersuites, to be negotiated during the protocol run. The 456 ability to specify block-based and hash-based ciphersuites is 457 offered. Extensibility is provided with the introduction of new 458 ciphersuites; this document specifies an initial set. The CSuite/ 459 Specifier column in Figure 3 uniquely identifies a ciphersuite. 461 For a vendor-specific ciphersuite the first four octets are the 462 vendor-specific enterprise number contains the IANA assigned "SMI 463 Network Management Private Enterprise Codes" value (see [ENTNUM]), 464 encoded in network byte order. The last two octets are vendor 465 assigned for the specific ciphersuite. A vendor code of 0x00000000 466 indicates ciphersuites standardized by IETF in an IANA-maintained 467 registry. 469 The following ciphersuites are specified in this document: 471 +------------+----+-------------+----+--------------+----------------+ 472 | CSuite/ | KS | Encryption | ML | Integrity / | Key Derivation | 473 | Specifier | | | | KDF MAC | Function | 474 +------------+----+-------------+----+--------------+----------------+ 475 | 0x00000001 | 16 | AES-CBC-128 | 16 | AES-CMAC-128 | GKDF | 476 +------------+----+-------------+----+--------------+----------------+ 477 | 0x00000002 | 32 | NULL | 32 | HMAC-SHA256 | GKDF | 478 +------------+----+-------------+----+--------------+----------------+ 480 Figure 3: Ciphersuites 482 Ciphersuite 1, which is based on AES as a cryptographic primitive, 483 MUST be implemented. This document specifies also a second 484 ciphersuite, which MAY be implemented. Both ciphersuites defined in 485 this document make use of the GKDF, as defined in Section 7. The 486 following aspects need to be considered to ensure that the PSK that 487 is used as input to the GKDF is sufficiently long (in case it is 488 longer it needs to be truncated): 490 1. The PSK used with ciphersuite 1 MUST be 128 bits in length or 491 longer. 492 2. The PSK used with ciphersuite 2 MUST be 256 bits in length or 493 longer. 494 3. It is RECOMMENDED that 256 bit keys be provisioned in all cases 495 to provide enough entropy for all current and many possible 496 future ciphersuites. 498 Ciphersuites defined in the future that make use of the GKDF need to 499 specify a minimum PSK size (as it is done with the ciphersuites 500 listed in this document). 502 7. Generalized Key Derivation Function (GKDF) 504 Each ciphersuite needs to specify a key derivation function. The 505 ciphersuites defined in this document make use of the Generalized Key 506 Derivation Function (GKDF) that utilizes the MAC function defined in 507 the ciphersuite. Future ciphersuites can use any other formally 508 specified KDF that takes as arguments a key and a seed value, and 509 produces at least 128+2*KS octets of output. 511 GKDF has the following structure: 513 GKDF-X(Y, Z) 515 X length, in octets, of the desired output 516 Y secret key 517 Z inputString 519 GKDF-X (Y, Z) 520 { 521 n = ceiling integer of ( X / ML ); 522 /* determine number of output blocks */ 524 result = ""; 526 for i = 1 to n { 527 result = result || MAC_Y (i || Z); 528 } 530 return truncate(result, X) 531 } 533 Note that the variable 'i' in M_i is represented as a 2-octet value 534 in network byte order. 536 8. Ciphersuites Processing Rules 538 8.1. Ciphersuite #1 540 8.1.1. Encryption 542 With this ciphersuite all cryptography is built around a single 543 cryptographic primitive, AES-128 ([AES]). Within the protected data 544 frames, AES-128 is used in Cipher Block Chaining (CBC) mode of 545 operation (see [CBC]). This EAP method uses encryption in a single 546 payload, in the protected data payload (see Section 9.4). 548 In a nutshell, the CBC mode proceeds as follows. The IV is XORed 549 with the first plaintext block before it is encrypted. Then for 550 successive blocks, the previous ciphertext block is XORed with the 551 current plaintext, before it is encrypted. 553 8.1.2. Integrity 555 Ciphersuite 1 uses CMAC as Message Authentication Code. CMAC is 556 recommended by NIST. Among its advantages, CMAC is capable to work 557 with messages of arbitrary length. A detailed description of CMAC 558 can be found in [CMAC]. 560 The following instantiation is used: AES-CMAC-128(SK, Input) denotes 561 the MAC of Input under the key SK where Input refers to the following 562 content: 564 o Parameter within SEC_SK(Parameter) in message GPSK-2 565 o Parameter within SEC_SK(Parameter) in message GPSK-3 566 o Parameter within SEC_SK(Parameter) in message GPSK-4 568 8.2. Ciphersuite #2 570 8.2.1. Encryption 572 Ciphersuite 2 does not include an algorithm for encryption. With a 573 NULL encryption algorithm, encryption is defined as: 575 E_X(Y) = Y 577 When using this ciphersuite, the data exchanged inside the protected 578 data block is not encrypted. Therefore this mode MUST NOT be used if 579 confidential information appears inside the protected data block. 581 8.2.2. Integrity 583 Ciphersuite 2 uses the keyed MAC function HMAC, with the SHA256 hash 584 algorithm (see [RFC4634]). 586 For integrity protection the following instantiation is used: 588 HMAC-SHA256(SK, Input) denotes the MAC of Input under the key SK 589 where Input refers to the following content: 591 o Parameter within SEC_SK(Parameter) in message GPSK-2 592 o Parameter within SEC_SK(Parameter) in message GPSK-3 593 o Parameter within SEC_SK(Parameter) in message GPSK-4 595 9. Packet Formats 597 This section defines the packet format of the EAP-GPSK messages. 599 9.1. Header Format 601 The EAP-GPSK header has the following structure: 603 --- bit offset ---> 604 0 1 2 3 605 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 606 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 607 | Code | Identifier | Length | 608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 609 | Type | OP-Code | | 610 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 611 | | 612 ... Payload ... 613 | | 614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 616 Figure 4 618 The Code, Identifier, Length, and Type fields are all part of the EAP 619 header, and defined in [RFC3748]. The Type field in the EAP header 620 MUST be the value allocated by IANA for EAP-GPSK. 622 The OP-Code field is one of four values: 624 o 0x01 : GPSK-1 625 o 0x02 : GPSK-2 626 o 0x03 : GPSK-3 627 o 0x04 : GPSK-4 628 o 0x05 : GPSK-Fail 629 o 0x06 : GPSK-Protected-Fail 631 All other values of this OP-Code field are available via IANA 632 registration. 634 9.2. Ciphersuite Formatting 636 Ciphersuites are encoded as 6-octet arrays. The first four octets 637 indicate the CSuite/Vendor field. For vendor-specific ciphersuites, 638 this represents the vendor enterprise number and contains the IANA 639 assigned "SMI Network Management Private Enterprise Codes" value (see 640 [ENTNUM]), encoded in network byte order. The last two octets 641 indicate the CSuite/Specifier field, which identifies the particular 642 ciphersuite. The 4-octet CSuite/Vendor value 0x00000000 indicates 643 ciphersuites allocated by the IETF. 645 Graphically, they are represented as 647 --- bit offset ---> 648 0 1 2 3 649 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 650 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 651 | CSuite/Vendor = 0x00000000 or enterprise number | 652 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 653 | CSuite/Specifier | 654 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 656 Figure 5 658 CSuite_Sel is encoded as a 6-octet ciphersuite CSuite/Vendor and 659 CSuite/Specifier pair. 661 CSuite_List is a variable-length octet array of ciphersuites. It is 662 encoded by concatenating encoded ciphersuite values. Its length in 663 octets MUST be a multiple of 6. 665 9.3. Payload Formatting 667 Payload formatting is based on the protocol exchange description in 668 Section 3. 670 The GPSK-1 payload format is defined as follows: 672 --- bit offset ---> 673 0 1 2 3 674 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 675 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 676 | length(ID_Server) | | 677 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 678 | | 679 ... ID_Server ... 680 | | 681 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 682 | | 683 ... 32-octet RAND_Server ... 684 | | 685 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 686 | length(CSuite_List) | | 687 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 688 | | 689 ... CSuite_List ... 690 | | 691 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 693 Figure 6: GPSK-1 Payload 695 The GPSK-2 payload format is defined as follows: 697 --- bit offset ---> 698 0 1 2 3 699 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 700 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 701 | length(ID_Peer) | | 702 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 703 | | 704 ... ID_Peer ... 705 | | 706 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 707 | length(ID_Server) | | 708 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 709 | | 710 ... ID_Server ... 711 | | 712 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 713 | | 714 ... 32-octet RAND_Peer ... 715 | | 716 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 717 | | 718 ... 32-octet RAND_Server ... 719 | | 720 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 721 | length(CSuite_List) | | 722 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 723 | | 724 ... CSuite_List ... 725 | | 726 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 727 | CSuite_Sel | 728 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 729 | | length(PD_Payload_Block) | 730 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 731 | | 732 ... optional PD_Payload_Block ... 733 | | 734 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 735 | | 736 ... ML-octet payload MAC ... 737 | | 738 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 740 Figure 7: GPSK-2 Payload 742 If the optional protected data payload is not included, then 743 length(PD_Payload_Block)=0 and the PD payload is excluded. The 744 payload MAC covers the entire packet, from the ID_Peer length, up 745 through the optional PD_Payload_Block. 747 The GPSK-3 payload is defined as follows: 749 --- bit offset ---> 750 0 1 2 3 751 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 752 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 753 | | 754 ... 32-octet RAND_Peer ... 755 | | 756 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 757 | | 758 ... 32-octet RAND_Server ... 759 | | 760 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 761 | length(ID_Server) | | 762 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 763 | | 764 ... ID_Server ... 765 | | 766 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 767 | CSuite_Sel | 768 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 769 | | length(PD_Payload_Block) | 770 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 771 | | 772 ... optional PD_Payload_Block ... 773 | | 774 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 775 | | 776 ... ML-octet payload MAC ... 777 | | 778 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 780 Figure 8: GPSK-3 Payload 782 If the optional protected data payload is not included, then 783 length(PD_Payload_Block)=0 and the PD payload is excluded. The 784 payload MAC covers the entire packet, from the RAND_Peer, up through 785 the optional PD_Payload_Block. 787 The GPSK-4 payload format is defined as follows: 789 --- bit offset ---> 790 0 1 2 3 791 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 792 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 793 | length(PD_Payload_Block) | | 794 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 795 | | 796 ... optional PD_Payload_Block ... 797 | | 798 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 799 | | 800 ... ML-octet payload MAC ... 801 | | 802 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 804 Figure 9: GPSK-4 Payload 806 If the optional protected data payload is not included, then 807 length(PD_Payload_Block)=0 and the PD payload is excluded. The MAC 808 MUST always be included, regardless of the presence of 809 PD_Payload_Block. The payload MAC covers the entire packet, from the 810 PD_Payload_Block length up through the optional PD_Payload_Block. 812 The GPSK-Fail payload format is defined as follows: 814 --- bit offset ---> 815 0 1 2 3 816 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 817 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 818 | Failure-Code | 819 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 821 Figure 10: GPSK-Fail Payload 823 The GPSK-Protected-Fail payload format is defined as follows: 825 --- bit offset ---> 826 0 1 2 3 827 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 828 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 829 | Failure-Code | 830 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 831 | | 832 ... ML-octet payload MAC ... 833 | | 834 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 836 Figure 11: GPSK-Protected-Fail Payload 838 The Failure-Code field is one of three values, but can be extended: 840 o 0x00000001: PSK Not Found 841 o 0x00000002: Authentication Failure 842 o 0x00000003: Authorization Failure 843 All other values of this field are available via IANA registration. 845 "PSK Not Found" indicates a key for a particular user could not be 846 located, making authentication impossible. "Authentication Failure" 847 indicates a MAC failure due to a PSK mismatch. "Authorization 848 Failure" indicates that while the PSK being used is correct, the user 849 is not authorized to connect. 851 9.4. Protected Data 853 The protected data blocks are a generic mechanism for the peer and 854 server to securely exchange data. If the specified ciphersuite has a 855 NULL encryption primitive, then this channel only offers 856 authenticity, and not confidentiality. 858 These payloads are encoded as the concatenation of type-length-value 859 (TLV) triples called PD_Payloads. 861 Type values are encoded as a 6-octet string and represented by a 862 4-octet vendor and 2-octet specifier field. The vendor field 863 indicates the type as either standards-specified or vendor-specific. 864 If these four octets are 0x00000000, then the value is standards- 865 specified, and any other value represents a vendor-specific 866 enterprise number. 868 The specifier field indicates the actual type. For vendor field 869 0x00000000, the specifier field is maintained by IANA. For any other 870 vendor field, the specifier field is maintained by the vendor. 872 Length fields are specified as 2-octet integers in network byte 873 order, and reflect only the length of the value, and do not include 874 the length of the type and length fields. 876 Graphically, this can be depicted as follows: 878 --- bit offset ---> 879 0 1 2 3 880 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 881 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 882 | PData/Vendor | 883 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 884 PData/Specifier | PData/Length | 885 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 886 | | 887 ... PData/Value ... 888 | | 889 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 891 Protected Data Payload (PD_Payload) Formatting 893 These PD_Payloads are concatenated together to form a 894 PD_Payload_Block. The If the CSuite_Sel includes support for 895 encryption, then the PD_Payload_Block includes fields specifying an 896 initialization vector (IV), and the necessary padding. This can be 897 depicted as follows: 899 --- bit offset ---> 900 0 1 2 3 901 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 902 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 903 | IV Length | | 904 +-+-+-+-+-+-+-+-+ Initialization Vector + 905 | | 906 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 907 | | 908 ... PD_Payload ... 909 | | 910 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 911 | | 912 ... optional PD_Payload, etc ... 913 | | 914 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 915 | | Padding (0-255 octets) | 916 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ 917 | | Pad Length | 918 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 919 Protected Data Block (PD_Payload_Block) Formatting if Encryption 920 Supported 922 The Initialization Vector is a randomly chosen value whose length is 923 equal to the specified IV Length. The required length is defined by 924 the ciphersuite. Recipients MUST accept any value. Senders SHOULD 925 either pick this value pseudo-randomly and independently for each 926 message or use the final ciphertext block of the previous message 927 sent. Senders MUST NOT use the same value for each message, use a 928 sequence of values with low hamming distance (e.g., a sequence 929 number), or use ciphertext from a received message. IVs should be 930 selected per the security requirements of the underlying cipher. If 931 the data is not being encrypted, then the IV Length MUST be 0. If 932 the ciphersuite does not require an IV, or has a self-contained way 933 of communicating the IV, then the IV Length field MUST be 0. In 934 these cases the ciphersuite definition defines how the IV is 935 encapsulated in the PD_Payload. 937 The concatenation of PD_Payloads along with the padding and padding 938 length are all encrypted using the negotiated block cipher. If no 939 block cipher is specified, then these fields are not encrypted. 941 The Padding field MAY contain any value chosen by the sender. For 942 block-based cipher modes, the padding MUST have a length that makes 943 the combination of the concatenation of PD_Payloads, the Padding, and 944 the Pad Length to be a multiple of the encryption block size. If the 945 underlying ciphersuite does not require padding (e.g. a stream-based 946 cipher mode) or no encryption is being used, then the padding length 947 MUST still be present and be zero. 949 The Pad Length field is the length of the Padding field. The sender 950 SHOULD set the Pad Length to the minimum value that makes the 951 combination of the PD_Payloads, the Padding, and the Pad Length a 952 multiple of the block size (in the case of block-based cipher modes), 953 but the recipient MUST accept any length that results in proper 954 alignment. This field is encrypted with the negotiated cipher. 956 If the negotiated ciphersuite does not support encryption, then the 957 IV field MUST be of length zero and padding field MUST be of length 958 zero. The IV length and padding length fields MUST still be present, 959 and contain the value zero. The rationale for still requiring the 960 length fields is to allow for modular implementations where the 961 crypto processing is independent of the payload processing. This is 962 depicted in the following figure. 964 --- bit offset ---> 965 0 1 2 3 966 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 967 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 968 | 0x00 | | 969 +-+-+-+-+-+-+-+-+ PD_Payload ... 970 | | 971 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 972 | | 973 ... optional PD_Payload, etc +-+-+-+-+-+-+-+-+ 974 | | 0x00 | 975 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 977 Protected Data Block (PD_Payload_Block) Formatting Without Encryption 979 For PData/Vendor field 0x00000000, the following PData/Specifier 980 fields are defined: 981 o 0x0000 : Reserved 982 All other values of this field are available via IANA registration. 984 10. Packet Processing Rules 986 This section defines how the EAP peer and EAP server MUST behave when 987 received packet is deemed invalid. 989 Any EAP-GPSK packet that cannot be parsed by the EAP peer or the EAP 990 server MUST be silently discarded. An EAP peer or EAP server 991 receiving any unexpected packet (e.g., an EAP peer receiving GPSK-3 992 before receiving GPSK-1 or before transmitting GPSK-2) MUST silently 993 discard the packet. 995 GPSK-1 contains no MAC protection, so provided it properly parses, it 996 MUST be accepted by the peer. If the EAP peer has no ciphersuites in 997 common with the server or decides the ID_Server is that of a AAA 998 server to which it does not wish to authenticate, the EAP peer MUST 999 respond with an EAP-NAK. 1001 For GPSK-2, if ID_Peer is for an unknown user, the EAP server MUST 1002 send either a "PSK Not Found" GPSK-Fail message, or an 1003 "Authentication Failure" GPSK-Fail, depending on its policy. If the 1004 MAC validation fails, the server MUST transmit a GPSK-Fail message 1005 specifying "Authentication Failure". If the RAND_Server or 1006 CSuite_List field in GPSK-2 does not match the values in GPSK-1, the 1007 server MUST silently discard the packet. If server policy determines 1008 the peer is not authorized and the MAC is correct, the server MUST 1009 transmit a GPSK-Protected-Fail message indicating "Authorization 1010 Failure" and discard the received packet. 1012 A peer receiving a GPSK-Fail / GPSK-Protected-Fail message in 1013 response to a GPSK-2 message MUST replay the received GPSK-Fail / 1014 GPSK-Protected-Fail message. Then, the EAP server returns an EAP- 1015 Failure after receiving the GPSK-Fail / GPSK-Protected-Fail message 1016 to correctly finish the EAP conversation. If MAC validation on a 1017 GPSK-Protected-Fail packet fails, then the received packet MUST be 1018 silently discarded. 1020 For GPSK-3, a peer MUST silently discard messages where the RAND_Peer 1021 field does match the value transmitted in GPSK-2. An EAP peer MUST 1022 silently discard any packet whose MAC fails. 1024 For GPSK-4, a server MUST silently discard any packet whose MAC fails 1025 validation. 1027 If a decryption failure of a protected payload is detected, the 1028 recipient MUST silently discard the GPSK packet. 1030 11. Example Message Exchanges 1032 This section shows a couple of example message flows. 1034 A successful EAP-GPSK message exchange is shown in Figure 1. 1036 +--------+ +--------+ 1037 | | EAP-Request/Identity | | 1038 | EAP |<------------------------------------| EAP | 1039 | peer | | server | 1040 | | EAP-Response/Identity | | 1041 | |------------------------------------>| | 1042 | | | | 1043 | | EAP-Request/GPSK-1 | | 1044 | |<------------------------------------| | 1045 | | | | 1046 | | EAP-Response/EAP-NAK | | 1047 | |------------------------------------>| | 1048 | | | | 1049 | | EAP-Failure | | 1050 | |<------------------------------------| | 1051 +--------+ +--------+ 1053 EAP-GPSK: Unsuccessful Exchange (Unacceptable AAA server identity; 1054 ID_Server) 1056 +--------+ +--------+ 1057 | | EAP-Request/Identity | | 1058 | EAP |<------------------------------------| EAP | 1059 | peer | | server | 1060 | | EAP-Response/Identity | | 1061 | |------------------------------------>| | 1062 | | | | 1063 | | EAP-Request/GPSK-1 | | 1064 | |<------------------------------------| | 1065 | | | | 1066 | | EAP-Response/GPSK-2 | | 1067 | |------------------------------------>| | 1068 | | | | 1069 | | EAP-Request/GPSK-Fail | | 1070 | | (PSK Not Found or Authentication | | 1071 | | Failure) | | 1072 | |<------------------------------------| | 1073 | | | | 1074 | | EAP-Response/GPSK-Fail | | 1075 | | (PSK Not Found or Authentication | | 1076 | | Failure) | | 1077 | |------------------------------------>| | 1078 | | | | 1079 | | EAP-Failure | | 1080 | |<------------------------------------| | 1081 +--------+ +--------+ 1083 EAP-GPSK: Unsuccessful Exchange (Unknown user) 1085 +--------+ +--------+ 1086 | | EAP-Request/Identity | | 1087 | EAP |<------------------------------------| EAP | 1088 | peer | | server | 1089 | | EAP-Response/Identity | | 1090 | |------------------------------------>| | 1091 | | | | 1092 | | EAP-Request/GPSK-1 | | 1093 | |<------------------------------------| | 1094 | | | | 1095 | | EAP-Response/GPSK-2 | | 1096 | |------------------------------------>| | 1097 | | | | 1098 | | EAP-Request/GPSK-Fail | | 1099 | | (Authentication Failure) | | 1100 | |<------------------------------------| | 1101 | | | | 1102 | | EAP-Response/GPSK-Fail | | 1103 | | (Authentication Failure) | | 1104 | |------------------------------------>| | 1105 | | | | 1106 | | EAP-Failure | | 1107 | |<------------------------------------| | 1108 +--------+ +--------+ 1110 EAP-GPSK: Unsuccessful Exchange (Invalid MAC in GPSK-2) 1112 +--------+ +--------+ 1113 | | EAP-Request/Identity | | 1114 | EAP |<------------------------------------| EAP | 1115 | peer | | server | 1116 | | EAP-Response/Identity | | 1117 | |------------------------------------>| | 1118 | | | | 1119 | | EAP-Request/GPSK-1 | | 1120 | |<------------------------------------| | 1121 | | | | 1122 | | EAP-Response/GPSK-2 | | 1123 | |------------------------------------>| | 1124 | | | | 1125 | | EAP-Request/ | | 1126 | | GPSK-Protected-Fail | | 1127 | | (Authorization Failure) | | 1128 | |<------------------------------------| | 1129 | | | | 1130 | | EAP-Request/ | | 1131 | | GPSK-Protected-Fail | | 1132 | | (Authorization Failure) | | 1133 | |------------------------------------>| | 1134 | | | | 1135 | | EAP-Failure | | 1136 | |<------------------------------------| | 1137 +--------+ +--------+ 1139 EAP-GPSK: Unsuccessful Exchange (Authorization failure) 1141 12. Security Considerations 1143 [RFC3748] highlights several attacks that are possible against EAP 1144 since EAP itself does not provide any security. 1146 This section discusses the claimed security properties of EAP-GPSK as 1147 well as vulnerabilities and security recommendations in the threat 1148 model of [RFC3748]. 1150 12.1. Security Claims 1152 Auth. mechanism: Shared Keys 1153 Ciphersuite negotiation: Yes (Section 12.16) 1154 Mutual authentication: Yes (Section 12.2) 1155 Integrity protection: Yes (Section 12.4) 1156 Replay protection: Yes (Section 12.5) 1157 Confidentiality: No (Section 12.17, Section 12.15) 1158 Key derivation: Yes (Section 12.8) 1159 Key strength: Varies (Section 12.8) 1160 Dictionary attack prot.: No (Section 12.7) 1161 Fast reconnect: No (Section 12.14) 1162 Crypt. binding: N/A (Section 12.18) 1163 Session independence: Yes (Section 12.10) 1164 Fragmentation: No (Section 12.12) 1165 Channel binding: Extensible (Section 12.13) 1167 12.2. Mutual Authentication 1169 EAP-GPSK provides mutual authentication. 1171 The server believes that the peer is authentic when it successfully 1172 verifies the MAC in the GPSK-2 message and the peer believes that the 1173 server is authentic when it successfully verifies the MAC it receives 1174 with the GPSK-3 message. 1176 The key used for mutual authentication is derived based on the long- 1177 term secret PSK, nonces contributed by both parties and other 1178 parameters. The long-term secret PSK has to provide sufficient 1179 entropy and therefore sufficient strength. The nonces (RAND_Peer and 1180 RAND_Server) need to be fresh and unique for every session. In this 1181 way EAP-GPSK is not different than other authentication protocols 1182 based on pre-shared keys. 1184 12.3. Protected Result Indications 1186 EAP-GPSK supports protected results indication via the GPSK- 1187 Protected-Fail message. This allows a server to provide additional 1188 information to the peer as to why the session failed, and do so in an 1189 authenticated way (if possible). In particular, the server can 1190 indicate the lack of PSK (account not present), failed authentication 1191 (PSK incorrect), or authorization failure (account disabled or 1192 unauthorized). Only the third message could be integrity protected. 1194 It should be noted that these options make debugging network and 1195 account errors easier, but also leak information about accounts to 1196 attackers. An attacker can determine if a particular ID_Peer is a 1197 valid user on the network, or not. Thus implementers should use care 1198 in enabling this particular option on their servers. If they are in 1199 an environment where such attacks are of concern, then protected 1200 result indication capabilities should be disabled. 1202 12.4. Integrity Protection 1204 EAP-GPSK provides integrity protection based on the ciphersuites 1205 suggested in this document. Integrity protection is a minimum 1206 feature every ciphersuite must provide. 1208 12.5. Replay Protection 1210 EAP-GPSK provides replay protection of its mutual authentication part 1211 thanks to the use of random numbers RAND_Server and RAND_Peer. Since 1212 RAND_Server is 32 octets long, one expects to have to record 2**64 1213 (i.e., approximately 1.84*10**19) EAP-GPSK successful authentication 1214 before an protocol run can be replayed. Hence, EAP-GPSK provides 1215 replay protection of its mutual authentication part as long as 1216 RAND_Server and RAND_Peer are chosen at random, randomness is 1217 critical for replay protection. RFC 4086 [RFC4086] describes 1218 techniques for producing random quantities. 1220 12.6. Reflection attacks 1222 EAP-GPSK provides protection against reflection attacks in case of an 1223 extended authentication because the messages are constructed in a 1224 different fashion. 1226 Also note that EAP-GPSK does not provide MAC protection of the OP- 1227 Code field, but again since each message is constructed differently, 1228 it would not be possible to change the OP-Code of a valid message and 1229 still have it be parseable and accepted by the recipient. 1231 12.7. Dictionary Attacks 1233 EAP-GPSK relies on a long-term shared secret (PSK) that SHOULD be 1234 based on at least 16 octets of entropy to be fully secure. The EAP- 1235 GPSK protocol makes no special provisions to ensure keys based on 1236 passwords are used securely. Users who use passwords as the basis of 1237 their PSK are not protected against dictionary attacks. Derivation 1238 of the long-term shared secret from a password is strongly 1239 discouraged. 1241 The success of a dictionary attack against EAP-GPSK depends on the 1242 strength of the long-term shared secret (PSK) it uses. The PSK used 1243 by EAP-GPSK SHOULD be drawn from a pool of secrets that is at least 1244 2^128 bits large and whose distribution is uniformly random. Note 1245 that this does not imply resistance to dictionary attack, only that 1246 the probability of success in such an attack is acceptably remote. 1248 12.8. Key Derivation and Key Strength 1250 EAP-GPSK supports key derivation as shown in Section 4. 1252 Keys used within EAP-GPSK are all based on the security of the 1253 originating PSK. PSKs SHOULD have at least 16 octets of entropy. 1254 Independent of the protocol exchange (i.e. without knowing RAND_Peer 1255 and RAND_Server), the keys have been derived with sufficient input 1256 entropy to make them as secure as the underlying KDF output key 1257 length. 1259 12.9. Denial of Service Resistance 1261 There are three forms of denial of service attacks relevant for this 1262 document, namely (1) attacks that lead to vast amount of state being 1263 allocated, (2) attacks that attempt to prevent communication between 1264 the peer and server, and (3) attacks against computational resources. 1266 In an EAP-GPSK conversation the server has to maintain state, namely 1267 the 32-octet RAND_Server, when transmitting the GPSK-1 message to the 1268 peer. An adversary could therefore flood a server with a large 1269 number of EAP-GPSK communication attempts. An EAP server may 1270 therefore ensure that established state times out after a relatively 1271 short period of time when no further messages are received. This 1272 enables a sort of garbage collection. 1274 The client has to keep state information after receiving the GPSK-1 1275 message. To prevent a replay attack, all the client needs to do is 1276 to ensure that the value of RAND_Peer is consistent between GPSK-2 1277 and GPSK-3. Message GPSK-3 contains all the material required to re- 1278 compute the keying material. Thus, if a client chooses to implement 1279 this client-side DoS protection mechanism it only needs to maintain 1280 minimal state (RAND_Peer) between GPSK-2 and GPSK-3. 1282 Attacks that disrupt communication between the peer and server are 1283 mitigated by silently discarding messages with invalid MACs. Attacks 1284 against computational resources are mitigated by having very light- 1285 weight cryptographic operations required during each protocol round. 1287 The security considerations of EAP itself, see Section 5.2 and 1288 Section 7 of RFC 3748 [RFC3748], are also applicable to this 1289 specification (e.g., for example concerning EAP-based notifications). 1291 12.10. Session Independence 1293 Thanks to its key derivation mechanisms, EAP-GPSK provides session 1294 independence: passive attacks (such as capture of the EAP 1295 conversation) or active attacks (including compromise of the MSK or 1296 EMSK) do not enable compromise of subsequent or prior MSKs or EMSKs. 1297 The assumption that RAND_Peer and RAND_Server are random is central 1298 for the security of EAP-GPSK in general and session independence in 1299 particular. 1301 12.11. Compromise of the PSK 1303 EAP-GPSK does not provide perfect forward secrecy. Compromise of the 1304 PSK leads to compromise of recorded past sessions. 1306 Compromise of the PSK enables the attacker to impersonate the peer 1307 and the server and it allows the adversary to compromise future 1308 sessions. 1310 EAP-GPSK provides no protection against a legitimate peer sharing its 1311 PSK with a third party. Such protection may be provided by 1312 appropriate repositories for the PSK, which choice is outside the 1313 scope of this document. The PSK used by EAP-GPSK must only be shared 1314 between two parties: the peer and the server. In particular, this 1315 PSK must not be shared by a group of peers (e.g. those with different 1316 ID_Peer values) communicating with the same server. 1318 The PSK used by EAP-GPSK must be cryptographically separated from 1319 keys used by other protocols, otherwise the security of EAP-GPSK may 1320 be compromised. 1322 12.12. Fragmentation 1324 EAP-GPSK does not support fragmentation and reassembly since the 1325 message size is relatively small. However it should be noted that 1326 this impacts the length of protected data payloads that can be 1327 attached to messages. Also if the EAP frame is larger than the MTU 1328 of the underlying transport, and that transport does not support 1329 fragmentation, the frame will most likely not be transported. 1330 Consequently implementors and deployers should take care to ensure 1331 EAP-GPSK frames are short enough to work properly on the target 1332 underlying transport mechanism. 1334 12.13. Channel Binding 1336 This document enables the ability to exchange channel binding 1337 information. It does not, however, define the encoding of channel 1338 binding information in the document. 1340 12.14. Fast Reconnect 1342 EAP-GPSK does not provide the fast reconnect capability since this 1343 method is already at (or close to) the lower limit of the number of 1344 roundtrips and the cryptographic operations. 1346 12.15. Identity Protection 1348 Identity protection is not specified in this document. Extensions 1349 can be defined that enhance this protocol to provide this feature. 1351 12.16. Protected Ciphersuite Negotiation 1353 EAP-GPSK provides protected ciphersuite negotiation via the 1354 indication of available ciphersuites by the server in the first 1355 message and a confirmation by the peer in the subsequent message. 1357 Note, however, that the GPSK-2 message may optionally contain a 1358 payload, ENC_PK(PD_Payload_Block), protected with an algorithm based 1359 on a selected ciphersuite before the ciphersuite list has actually 1360 been authenticated. In the classical downgrading attack an adversary 1361 would chose a ciphersuite that it weak enough to that it could break 1362 it in real-time or to turn security off. The latter is not possible 1363 since any ciphersuite defined for EAP-GPSK must at least provide 1364 authentication and integrity protection. Confidentiality protection 1365 is optional. When, some time in the future, a ciphersuite contains 1366 algorithms that can be broken in real-time then a policy on peers and 1367 the server needs to indicate that such a ciphersuite must not be 1368 selected by any of parties. 1370 Furthermore, an adversary may modify the selection of the ciphersuite 1371 to for the client to select a ciphersuite that does not provide 1372 confidentiality protection. As a result this would cause the content 1373 of PD_Payload_Block to be transmitted in cleartext. When protocol 1374 designers extend EAP-GPSK to carry information in the 1375 PD_Payload_Block of the GPSK-2 message then it must be indicated 1376 whether confidentiality protection is mandatory. In case such an 1377 extension requires a ciphersuite with confidentiality protection then 1378 the policy at the peer must not transmit information of that 1379 extension in the PD_Payload_Block of the GPSK-2 message. The peer 1380 may, if possible, delay the transmission of this information element 1381 to the GPSK-4 message where the ciphersuite negotiation has been 1382 confirmed already. In general, when a ciphersuite is selected that 1383 does not provide confidentiality protection then information that 1384 demands confidentiality protection must not be included in any of the 1385 PD_Payload_Block objects. 1387 12.17. Confidentiality 1389 Although EAP-GPSK provides confidentiality in its protected data 1390 payloads, it cannot claim to do so as per Section 7.2.1 of [RFC3748] 1391 since it does not support identity protection. 1393 12.18. Cryptographic Binding 1395 Since EAP-GPSK does not tunnel another EAP method, it does not 1396 implement cryptographic binding. 1398 13. IANA Considerations 1400 This document requires IANA to allocate a new EAP Type for EAP-GPSK. 1402 This document requires IANA to create a new registry for 1403 ciphersuites, protected data types, failure codes and op-codes. IANA 1404 is furthermore instructed to add the specified ciphersuites, 1405 protected data types, failure codes and op-codes to these registries 1406 as defined below. Values can be added or modified per IETF REVIEW 1407 [RFC5226] defining either block-based or hash-based ciphersuites, 1408 protected data payloads, failure codes and op-codes. Each 1409 ciphersuite needs to provide processing rules and needs to specify 1410 how the following algorithms are instantiated: encryption, integrity, 1411 key derivation and key length. 1413 Figure 3 represents the initial ciphersuite CSuite/Specifier registry 1414 setup. The CSuite/Specifier field is 16 bits long. All other values 1415 are available via IANA registration. This registry should be named 1416 "EAP-GPSK Ciphersuites". 1418 The following is the initial protected data PData/Specifier registry 1419 setup, which should be named "EAP-GPSK Protected Data Payloads": 1421 o 0x0000 : Reserved 1423 The PData/Specifier field is 16 bits long and all other values are 1424 available via IANA registration. Each extension needs to indicate 1425 whether confidentiality protection for transmission between the EAP 1426 peer and the EAP server is mandatory. 1428 The following layout represents the initial Failure-Code registry 1429 setup, which should be named "EAP-GPSK Failure Codes": 1431 o 0x00000001: PSK Not Found 1432 o 0x00000002: Authentication Failure 1433 o 0x00000003: Authorization Failure 1435 The Failure-Code field is 32 bits long and all other values are 1436 available via IANA registration. 1438 The following layout represents the initial OP-Code registry setup, 1439 which should be named "EAP-GPSK OP Codes": 1441 o 0x01 : GPSK-1 1442 o 0x02 : GPSK-2 1443 o 0x03 : GPSK-3 1444 o 0x04 : GPSK-4 1445 o 0x05 : GPSK-Fail 1446 o 0x06 : GPSK-Protected-Fail 1448 The OP-Code field is 8 bits long and all other values are available 1449 via IANA registration. 1451 14. Contributors 1453 This work is a joint effort of the EAP Method Update (EMU) design 1454 team of the EMU Working Group that was created to develop a mechanism 1455 based on strong shared secrets that meets RFC 3748 [RFC3748] and RFC 1456 4017 [RFC4017] requirements. The design team members (in 1457 alphabetical order) were: 1459 o Jari Arkko 1460 o Mohamad Badra 1461 o Uri Blumenthal 1462 o Charles Clancy 1463 o Lakshminath Dondeti 1464 o David McGrew 1465 o Joe Salowey 1466 o Sharma Suman 1467 o Hannes Tschofenig 1468 o Jesse Walker 1470 Finally, we would like to thank Thomas Otto for his draft reviews, 1471 feedback and text contributions. 1473 15. Acknowledgments 1475 We would like to thank 1477 o Jouni Malinen and Bernard Aboba for their early draft comments in 1478 June 2006. Jouni Malinen developed the first prototype 1479 implementation. It can be found at: 1480 http://hostap.epitest.fi/releases/snapshots/ 1481 o Lakshminath Dondeti, David McGrew, Bernard Aboba, Michaela 1482 Vanderveen and Ray Bell for their input to the ciphersuite 1483 discussions between July and August 2006. 1484 o Lakshminath Dondeti for his detailed draft review (sent to the EMU 1485 ML on the 12th July 2006). 1487 o Based on a review requested from NIST Quynh Dang suggested changes 1488 to the GKDF function (December 2006). 1489 o Jouni Malinen and Victor Fajardo for their review in January 2007. 1490 o Jouni Malinen for his suggestions regarding the examples and the 1491 key derivation function in February 2007. 1492 o Bernard Aboba and Jouni Malinen for their review in February 2007. 1493 o Vidya Narayanan for her review in March 2007. 1494 o Pasi Eronen for his IESG review in March and July 2008. 1495 o Dan Harkins for his review in June 2008. 1496 o 1497 o Joe Salowey, the EMU working group chair, provided a document 1498 review in April 2007. Jouni Malinen also reviewed the document 1499 during the same month. 1500 o We would like to thank Paul Rowe, Arnab Roy, Prof. Andre Scedrov 1501 and Prof. John C. Mitchell for their analysis of EAP-GPSK and for 1502 pointing us to a client-side DoS attack, a downgrading attack and 1503 their input to the key derivation function. Based on their input 1504 the key derivation function has been modified and the text in the 1505 security consideration section has been updated. 1506 o Finally, we would like to thank our working group chair, Joe 1507 Salowey, for his support and for the time he spend on discussing 1508 open issues with us. 1510 16. References 1512 16.1. Normative References 1514 [I-D.ietf-eap-keying] 1515 Aboba, B., Simon, D., and P. Eronen, "Extensible 1516 Authentication Protocol (EAP) Key Management Framework", 1517 draft-ietf-eap-keying-22 (work in progress), 1518 November 2007. 1520 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1521 Requirement Levels", BCP 14, RFC 2119, March 1997. 1523 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1524 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1525 May 2008. 1527 [RFC3748] Aboba, B., Blunk, L., Vollbrecht, J., Carlson, J., and H. 1528 Levkowetz, "Extensible Authentication Protocol (EAP)", 1529 RFC 3748, June 2004. 1531 [RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The 1532 Network Access Identifier", RFC 4282, December 2005. 1534 [RFC4634] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 1535 (SHA and HMAC-SHA)", RFC 4634, July 2006. 1537 [AES] National Institute of Standards and Technology, 1538 "Specification for the Advanced Encryption Standard 1539 (AES)", Federal Information Processing Standards 1540 (FIPS) 197, November 2001. 1542 [CMAC] National Institute of Standards and Technology, 1543 "Recommendation for Block Cipher Modes of Operation: The 1544 CMAC Mode for Authentication", Special Publication 1545 (SP) 800-38B, May 2005. 1547 [CBC] National Institute of Standards and Technology, 1548 "Recommendation for Block Cipher Modes of Encryption. 1549 Methods and Techniques.", Special Publication (SP) 800- 1550 38A, December 2001. 1552 16.2. Informative References 1554 [RFC4017] Stanley, D., Walker, J., and B. Aboba, "Extensible 1555 Authentication Protocol (EAP) Method Requirements for 1556 Wireless LANs", RFC 4017, March 2005. 1558 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 1559 Requirements for Security", BCP 106, RFC 4086, June 2005. 1561 [ENTNUM] IANA, "SMI Network Management Private Enterprise Codes", 1562 IANA Assignments enterprise-numbers. 1564 Authors' Addresses 1566 T. Charles Clancy 1567 DoD Laboratory for Telecommunications Sciences 1568 8080 Greenmead Drive 1569 College Park, MD 20740 1570 USA 1572 Email: clancy@ltsnet.net 1573 Hannes Tschofenig 1574 Nokia Siemens Networks 1575 Linnoitustie 6 1576 Espoo 02600 1577 Finland 1579 Phone: +358 (50) 4871445 1580 Email: Hannes.Tschofenig@gmx.net 1581 URI: http://www.tschofenig.priv.at 1583 Full Copyright Statement 1585 Copyright (C) The IETF Trust (2008). 1587 This document is subject to the rights, licenses and restrictions 1588 contained in BCP 78, and except as set forth therein, the authors 1589 retain all their rights. 1591 This document and the information contained herein are provided on an 1592 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 1593 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 1594 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 1595 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 1596 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 1597 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1599 Intellectual Property 1601 The IETF takes no position regarding the validity or scope of any 1602 Intellectual Property Rights or other rights that might be claimed to 1603 pertain to the implementation or use of the technology described in 1604 this document or the extent to which any license under such rights 1605 might or might not be available; nor does it represent that it has 1606 made any independent effort to identify any such rights. Information 1607 on the procedures with respect to rights in RFC documents can be 1608 found in BCP 78 and BCP 79. 1610 Copies of IPR disclosures made to the IETF Secretariat and any 1611 assurances of licenses to be made available, or the result of an 1612 attempt made to obtain a general license or permission for the use of 1613 such proprietary rights by implementers or users of this 1614 specification can be obtained from the IETF on-line IPR repository at 1615 http://www.ietf.org/ipr. 1617 The IETF invites any interested party to bring to its attention any 1618 copyrights, patents or patent applications, or other proprietary 1619 rights that may cover technology that may be required to implement 1620 this standard. Please address the information to the IETF at 1621 ietf-ipr@ietf.org.