idnits 2.17.1 draft-ietf-hip-dex-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. 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 and authors Copyright Line does not match the current year -- The document date (October 22, 2016) is 2714 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) == Outdated reference: A later version (-20) exists of draft-ietf-hip-rfc4423-bis-14 Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HIP WG R. Moskowitz, Ed. 3 Internet-Draft HTT Consulting 4 Intended status: Standards Track R. Hummen 5 Expires: April 25, 2017 Hirschmann Automation and Control 6 October 22, 2016 8 HIP Diet EXchange (DEX) 9 draft-ietf-hip-dex-04 11 Abstract 13 This document specifies the Host Identity Protocol Diet EXchange (HIP 14 DEX), a variant of the Host Identity Protocol Version 2 (HIPv2). The 15 HIP DEX protocol design aims at reducing the overhead of the employed 16 cryptographic primitives by omitting public-key signatures and hash 17 functions. In doing so, the main goal is to still deliver similar 18 security properties to HIPv2. 20 The HIP DEX protocol is primarily designed for computation or memory- 21 constrained sensor/actuator devices. Like HIPv2, it is expected to 22 be used together with a suitable security protocol such as the 23 Encapsulated Security Payload (ESP) for the protection of upper layer 24 protocol data. In addition, HIP DEX can also be used as a keying 25 mechanism for security primitives at the MAC layer, e.g., for IEEE 26 802.15.4 networks. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at http://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on April 25, 2017. 45 Copyright Notice 47 Copyright (c) 2016 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (http://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 63 1.1. The HIP Diet EXchange (DEX) . . . . . . . . . . . . . . . 4 64 1.2. Memo Structure . . . . . . . . . . . . . . . . . . . . . 5 65 2. Terms and Definitions . . . . . . . . . . . . . . . . . . . . 6 66 2.1. Requirements Terminology . . . . . . . . . . . . . . . . 6 67 2.2. Notation . . . . . . . . . . . . . . . . . . . . . . . . 6 68 2.3. Definitions . . . . . . . . . . . . . . . . . . . . . . . 6 69 3. Host Identity (HI) and its Structure . . . . . . . . . . . . 7 70 3.1. Host Identity Tag (HIT) . . . . . . . . . . . . . . . . . 8 71 3.2. Generating a HIT from an HI . . . . . . . . . . . . . . . 9 72 4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 9 73 4.1. Creating a HIP Association . . . . . . . . . . . . . . . 9 74 4.1.1. HIP Puzzle Mechanism . . . . . . . . . . . . . . . . 11 75 4.1.2. HIP State Machine . . . . . . . . . . . . . . . . . . 12 76 4.1.3. HIP DEX Security Associations . . . . . . . . . . . . 16 77 4.1.4. User Data Considerations . . . . . . . . . . . . . . 17 78 5. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . 17 79 5.1. Payload Format . . . . . . . . . . . . . . . . . . . . . 17 80 5.2. HIP Parameters . . . . . . . . . . . . . . . . . . . . . 17 81 5.2.1. DH_GROUP_LIST . . . . . . . . . . . . . . . . . . . . 18 82 5.2.2. HIP_CIPHER . . . . . . . . . . . . . . . . . . . . . 18 83 5.2.3. HOST_ID . . . . . . . . . . . . . . . . . . . . . . . 19 84 5.2.4. HIT_SUITE_LIST . . . . . . . . . . . . . . . . . . . 19 85 5.2.5. ENCRYPTED_KEY . . . . . . . . . . . . . . . . . . . . 19 86 5.3. HIP Packets . . . . . . . . . . . . . . . . . . . . . . . 20 87 5.3.1. I1 - the HIP Initiator Packet . . . . . . . . . . . . 21 88 5.3.2. R1 - the HIP Responder Packet . . . . . . . . . . . . 22 89 5.3.3. I2 - the Second HIP Initiator Packet . . . . . . . . 24 90 5.3.4. R2 - the Second HIP Responder Packet . . . . . . . . 25 91 5.4. ICMP Messages . . . . . . . . . . . . . . . . . . . . . . 26 92 6. Packet Processing . . . . . . . . . . . . . . . . . . . . . . 26 93 6.1. Solving the Puzzle . . . . . . . . . . . . . . . . . . . 26 94 6.2. HIP_MAC Calculation and Verification . . . . . . . . . . 27 95 6.2.1. CMAC Calculation . . . . . . . . . . . . . . . . . . 27 96 6.3. HIP DEX KEYMAT Generation . . . . . . . . . . . . . . . . 28 97 6.4. Initiation of a HIP Diet EXchange . . . . . . . . . . . . 31 98 6.5. Processing Incoming I1 Packets . . . . . . . . . . . . . 31 99 6.6. Processing Incoming R1 Packets . . . . . . . . . . . . . 32 100 6.7. Processing Incoming I2 Packets . . . . . . . . . . . . . 35 101 6.8. Processing Incoming R2 Packets . . . . . . . . . . . . . 38 102 6.9. Processing Incoming NOTIFY Packets . . . . . . . . . . . 39 103 6.10. Processing UPDATE, CLOSE, and CLOSE_ACK Packets . . . . . 40 104 6.11. Handling State Loss . . . . . . . . . . . . . . . . . . . 40 105 7. HIP Policies . . . . . . . . . . . . . . . . . . . . . . . . 40 106 8. Interoperability between HIP DEX and HIPv2 . . . . . . . . . 40 107 9. Security Considerations . . . . . . . . . . . . . . . . . . . 41 108 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 42 109 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 43 110 12. Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . 43 111 12.1. Changes in draft-ietf-hip-dex-04 . . . . . . . . . . . . 43 112 12.2. Changes in draft-ietf-hip-dex-03 . . . . . . . . . . . . 43 113 12.3. Changes in draft-ietf-hip-dex-02 . . . . . . . . . . . . 44 114 12.4. Changes in draft-ietf-hip-dex-01 . . . . . . . . . . . . 44 115 12.5. Changes in draft-ietf-hip-dex-00 . . . . . . . . . . . . 44 116 12.6. Changes in draft-moskowitz-hip-rg-dex-06 . . . . . . . . 44 117 12.7. Changes in draft-moskowitz-hip-dex-00 . . . . . . . . . 44 118 12.8. Changes in draft-moskowitz-hip-dex-01 . . . . . . . . . 44 119 12.9. Changes in draft-moskowitz-hip-dex-02 . . . . . . . . . 45 120 12.10. Changes in draft-moskowitz-hip-dex-03 . . . . . . . . . 45 121 12.11. Changes in draft-moskowitz-hip-dex-04 . . . . . . . . . 45 122 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 46 123 13.1. Normative References . . . . . . . . . . . . . . . . . . 46 124 13.2. Informative References . . . . . . . . . . . . . . . . . 47 125 Appendix A. Password-based two-factor authentication during the 126 HIP DEX handshake . . . . . . . . . . . . . . . . . 49 127 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 49 129 1. Introduction 131 This document specifies the Host Identity Protocol Diet EXchange (HIP 132 DEX). HIP DEX builds on the Base EXchange (BEX) of the Host Identity 133 Protocol Version 2 (HIPv2) [RFC7401]. HIP DEX preserves the protocol 134 semantics as well as the general packet structure of HIPv2. Hence, 135 it is recommended that [RFC7401] is well-understood before reading 136 this document. 138 The main differences between HIP BEX and HIP DEX are: 140 1. Minimum collection of cryptographic primitives to reduce the 141 protocol overhead. 143 * Static Elliptic Curve Diffie-Hellman key pairs for peer 144 authentication and encryption of the session key. 146 * AES-CTR for symmetric encryption and AES-CMAC for MACing 147 function. 149 * A simple fold function for HIT generation. 151 2. Forfeit of Perfect Forward Secrecy with the dropping of an 152 ephemeral Diffie-Hellman key agreement. 154 3. Forfeit of digital signatures with the removal of a hash 155 function. Reliance on ECDH derived key used in HIP_MAC to prove 156 ownership of the private key. 158 4. Diffie-Hellman derived key ONLY used to protect the HIP packets. 159 A separate secret exchange within the HIP packets creates the 160 session key(s). 162 5. Optional retransmission strategy tailored to handle the 163 potentially extensive processing time of the employed 164 cryptographic operations on computationally constrained devices. 166 By eliminating the need for public-key signatures and the ephemeral 167 DH key agreement, HIP DEX reduces the computation, energy, 168 transmission, and memory requirements for public-key cryptography 169 (see [LN08]) in the HIPv2 protocol design. Moreover, by dropping the 170 cryptographic hash function, HIP DEX affords a more efficient 171 protocol implementation than HIP BEX with respect to the 172 corresponding computation and memory requirements. This makes HIP 173 DEX especially suitable for constrained devices as defined in 174 [RFC7228]. 176 This document focuses on the protocol specifications related to 177 differences between HIP BEX and HIP DEX. Where differences are not 178 called out explicitly, the protocol specification of HIP DEX is the 179 same as defined in [RFC7401]. 181 1.1. The HIP Diet EXchange (DEX) 183 The HIP Diet EXchange is a two-party cryptographic protocol used to 184 establish a secure communication context between hosts. The first 185 party is called the Initiator and the second party the Responder. 186 The four-packet exchange helps to make HIP DEX DoS resilient. The 187 Initiator and the Responder exchange their static Elliptic Curve 188 Diffie-Hellman (ECDH) keys in the 2nd and 3rd handshake packet. The 189 parties then authenticate each other in the 3rd and 4th handshake 190 packet based on the ECDH-derived keying material. The Initiator and 191 the Responder additionally transmit keying material for the session 192 key in these last two handshake packets. This is to prevent overuse 193 of the static ECDH-derived keying material. Moreover, the Responder 194 starts a puzzle exchange in the 2nd packet and the Initiator 195 completes this exchange in the 3rd packet before the Responder 196 performs computationally expensive operations or stores any state 197 from the exchange. Given this handshake structure, HIP DEX 198 operationally is very similar to HIP BEX. Moreover, the employed 199 model is also fairly equivalent to 802.11-2007 [IEEE.802-11.2007] 200 Master Key and Pair-wise Transient Key, but handled in a single 201 exchange. 203 HIP DEX does not have the option to encrypt the Host Identity of the 204 Initiator in the 3rd packet. The Responder's Host Identity also is 205 not protected. Thus, contrary to HIPv2, HIP DEX does not provide for 206 end-point anonymity and any signaling that indicates such anonymity 207 should be ignored. 209 As in [RFC7401], data packets start to flow after the 4th packet. 210 The 3rd and 4th HIP packets may carry data payload in the future. 211 However, the details of this may be defined later. 213 An existing HIP association can be updated with the update mechanism 214 defined in [RFC7401]. Likewise, the association can be torn down 215 with the defined closing mechanism for HIPv2 if it is no longer 216 needed. In doing so, HIP DEX omits the HIP_SIGNATURE parameters of 217 the original HIPv2 specification. 219 Finally, HIP DEX is designed as an end-to-end authentication and key 220 establishment protocol. As such, it can be used in combination with 221 Encapsulated Security Payload (ESP) [RFC7402] as well as with other 222 end-to-end security protocols. In addition, HIP DEX can also be used 223 as a keying mechanism for security primitives at the MAC layer, e.g., 224 for IEEE 802.15.4 networks [IEEE.802-15-4.2011]. It is worth 225 mentioning that the HIP DEX base protocol does not cover all the 226 fine-grained policy control found in Internet Key Exchange Version 2 227 (IKEv2) [RFC7296] that allows IKEv2 to support complex gateway 228 policies. Thus, HIP DEX is not a replacement for IKEv2. 230 1.2. Memo Structure 232 The rest of this memo is structured as follows. Section 2 defines 233 the central keywords, notation, and terms used throughout this 234 document. Section 3 defines the structure of the Host Identity and 235 its various representations. Section 4 gives an overview of the HIP 236 Diet EXchange protocol. Sections 5 and 6 define the detailed packet 237 formats and rules for packet processing. Finally, Sections 7, 9, and 238 10 discuss policy, security, and IANA considerations, respectively. 240 2. Terms and Definitions 242 2.1. Requirements Terminology 244 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 245 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 246 document are to be interpreted as described in RFC 2119 [RFC2119]. 248 2.2. Notation 250 [x] indicates that x is optional. 252 {x} indicates that x is encrypted. 254 X(y) indicates that y is a parameter of X. 256 i indicates that x exists i times. 258 --> signifies "Initiator to Responder" communication (requests). 260 <-- signifies "Responder to Initiator" communication (replies). 262 | signifies concatenation of information - e.g., X | Y is the 263 concatenation of X and Y. 265 FOLD (X, K) denotes the partitioning of X into n K-bit segments and 266 the iterative folding of these segments via XOR. I.e., X = x_1, 267 x_2, ..., x_n, where x_i is of length K and the last segment x_n 268 is padded to length K by appending 0 bits. FOLD then is computed 269 as FOLD(X, K) = t_n, where t_i = t_i-1 XOR x_i and t_1 = x_1. 271 Ltrunc (M(x), K) denotes the lowest order K bits of the result of 272 the MAC function M on the input x. 274 2.3. Definitions 276 HIP Diet Exchange (DEX): The ECDH-based HIP handshake for 277 establishing a new HIP association. 279 Host Identity (HI): The static ECDH public key that represents the 280 identity of the host. In HIP DEX, a host proves ownership of the 281 private key belonging to its HI by creating a HIP_MAC with the 282 derived ECDH key (c.f. Section 3). 284 Host Identity Tag (HIT): A shorthand for the HI in IPv6 format. It 285 is generated by folding the HI (c.f. Section 3). 287 HIT Suite: A HIT Suite groups all algorithms that are required to 288 generate and use an HI and its HIT. In particular, these 289 algorithms are: 1) ECDH and 2) FOLD. 291 HIP association: The shared state between two peers after completion 292 of the HIP DEX handshake. 294 Initiator: The host that initiates the HIP DEX handshake. This role 295 is typically forgotten once the handshake is completed. 297 Responder: The host that responds to the Initiator in the HIP DEX 298 handshake. This role is typically forgotten once the handshake is 299 completed. 301 Responder's HIT Hash Algorithm (RHASH): In HIP DEX, RHASH is 302 redefined as CMAC. Still, note that CMAC is a message 303 authentication code (MAC) and not a cryptographic hash function. 304 Thus, a mapping from CMAC(x,y) to RHASH(z) must be defined where 305 RHASH is used. Moreover, RHASH has different security properties 306 in HIP DEX and is not used for HIT generation. 308 Length of the Responder's HIT Hash Algorithm (RHASH_len): The 309 natural output length of RHASH in bits. 311 CMAC: The Cipher-based Message Authentication Code with the 128-bit 312 Advanced Encryption Standard (AES) defined in RFC 4493 [RFC4493]. 314 CKDF: CMAC-based Key Derivation Function. 316 3. Host Identity (HI) and its Structure 318 In this section, the properties of the Host Identity and Host 319 Identity Tag are discussed, and the exact format for them is defined. 320 In HIP, the public key of an asymmetric key pair is used as the Host 321 Identity (HI). Correspondingly, the host itself is defined as the 322 entity that holds the private key of the key pair. See the HIP 323 architecture specification [I-D.ietf-hip-rfc4423-bis] for more 324 details on the difference between an identity and the corresponding 325 identifier. 327 HIP DEX implementations MUST support the Elliptic Curve Diffie- 328 Hellman (ECDH) [RFC6090] key exchange for generating the HI as 329 defined in Section 5.2.3. No additional algorithms are supported at 330 this time. 332 A compressed encoding of the HI, the Host Identity Tag (HIT), is used 333 in the handshake packets to represent the HI. The DEX Host Identity 334 Tag (HIT) is different from the BEX HIT in two ways: 336 o The HIT suite ID MUST only be a DEX HIT ID (see Section 5.2.4). 338 o The DEX HIT is not generated via a cryptographic hash. Rather, it 339 is a compression of the HI. 341 Due to the latter property, an attacker may be able to find a 342 collision with a HIT that is in use. Hence, policy decisions such as 343 access control MUST NOT be based solely on the HIT. Instead, the HI 344 of a host SHOULD be considered. 346 Carrying HIs and HITs in the header of user data packets would 347 increase the overhead of packets. Thus, it is not expected that 348 these parameters are carried in every packet, but other methods are 349 used to map the data packets to the corresponding HIs. In some 350 cases, this allows to use HIP DEX without any additional headers in 351 the user data packets. For example, if ESP is used to protect data 352 traffic, the Security Parameter Index (SPI) carried in the ESP header 353 can be used to map the encrypted data packet to the correct HIP DEX 354 association. 356 3.1. Host Identity Tag (HIT) 358 With HIP DEX, the HIT is a 128-bit value - a compression of the HI 359 prepended with a specific prefix. There are two advantages of using 360 a hashed encoding over the actual variable-sized public key in 361 protocols. First, the fixed length of the HIT keeps packet sizes 362 manageable and eases protocol coding. Second, it presents a 363 consistent format for the protocol, independent of the underlying 364 identity technology in use. 366 The structure of the HIT is based on RFC 7343 [RFC7343], called 367 Overlay Routable Cryptographic Hash Identifiers (ORCHIDs), and 368 consists of three parts: first, an IANA assigned prefix to 369 distinguish it from other IPv6 addresses. Second, a four-bit 370 encoding of the algorithms that were used for generating the HI and 371 the compressed representation of the HI. Third, a 96-bit hashed 372 representation of the HI. In contrast to HIPv2, HIP DEX employs HITs 373 that are NOT generated by means of a cryptographic hash. Instead, 374 the HI is compressed to 96 bits as defined in the following section. 376 3.2. Generating a HIT from an HI 378 The HIT does not follow the exact semantics of an ORCHID as there is 379 no hash function in HIP DEX. Still, its structure is strongly 380 aligned with the ORCHID design. The same IPv6 prefix used in HIPv2 381 is used for HIP DEX. The HIP DEX HIT suite (see Section 10) is used 382 for the four bits of the Orchid Generation Algorithm (OGA) field in 383 the ORCHID. The hash representation in an ORCHID is replaced with 384 FOLD(HI,96). 386 4. Protocol Overview 388 This section gives a simplified overview of the HIP DEX protocol 389 operation and does not contain all the details of the packet formats 390 or the packet processing steps. Section 5 and Section 6 describe 391 these aspects in more detail and are normative in case of any 392 conflicts with this section. Importantly, the information given in 393 this section focuses on the differences between the HIPv2 and HIP DEX 394 protocol specifications. 396 4.1. Creating a HIP Association 398 By definition, the system initiating a HIP Diet EXchange is the 399 Initiator, and the peer is the Responder. This distinction is 400 typically forgotten once the handshake completes, and either party 401 can become the Initiator in future communications. 403 The HIP Diet EXchange serves to manage the establishment of state 404 between an Initiator and a Responder. The first packet, I1, 405 initiates the exchange, and the last three packets, R1, I2, and R2, 406 constitute an authenticated Diffie-Hellman [DH76] key exchange for 407 the Master Key SA generation. This Master Key SA is used by the 408 Initiator and the Responder to wrap secret keying material in the I2 409 and R2 packets. Based on the exchanged keying material, the peers 410 then derive a Pair-wise Key SA if cryptographic keys are needed, 411 e.g., for ESP-based protection of user data. 413 The Initiator first sends a trigger packet, I1, to the Responder. 414 This packet contains the HIT of the Initiator and the HIT of the 415 Responder, if it is known. Moreover, the I1 packet initializes the 416 negotiation of the Diffie-Hellman group that is used for generating 417 the the Master Key SA. Therefore, the I1 packet contains a list of 418 Diffie-Hellman Group IDs supported by the Initiator. Note that in 419 some cases it may be possible to replace this trigger packet by some 420 other form of a trigger, in which case the protocol starts with the 421 Responder sending the R1 packet. In such cases, another mechanism to 422 convey the Initiator's supported DH Groups (e.g., by using a default 423 group) must be specified. 425 The second packet, R1, starts the actual authenticated Diffie-Hellman 426 key exchange. It contains a puzzle - a cryptographic challenge that 427 the Initiator must solve before continuing the exchange. The level 428 of difficulty of the puzzle can be adjusted based on level of trust 429 with the Initiator, current load, or other factors. In addition, the 430 R1 contains the Responder's Diffie-Hellman parameter and lists of 431 cryptographic algorithms supported by the Responder. Based on these 432 lists, the Initiator can continue, abort, or restart the handshake 433 with a different selection of cryptographic algorithms. 435 In the I2 packet, the Initiator MUST display the solution to the 436 received puzzle. Without a correct solution, the I2 packet is 437 discarded. The I2 also contains a key wrap parameter that carries 438 secret keying material of the Initiator. This keying material is 439 only half of the final session key. The packet is authenticated by 440 the sender (Initiator) via a MAC. 442 The R2 packet acknowledges the receipt of the I2 packet and completes 443 the handshake. The R2 contains a key wrap parameter that carries the 444 rest of the keying material of the Responder. The packet is 445 authenticated by the sender (Responder) via a MAC. 447 The HIP DEX handshake is illustrated below. The terms "ENC(DH,x)" 448 and "ENC(DH,y)" refer to the random values x and y that are wrapped 449 based on the Master Key SA (indicated by ENC and DH). Note that x 450 and y each constitute half the final session key material. The 451 packets also contain other parameters that are not shown in this 452 figure. 454 Initiator Responder 456 I1: 457 ---------------------------------> 458 remain stateless 459 R1: puzzle, HI 460 <-------------------------------- 461 solve puzzle 462 perform ECDH 463 encrypt x 464 I2: solution, HI, ENC(DH,x), mac 465 ---------------------------------> 466 check puzzle 467 perform ECDH 468 check mac 469 decrypt x 470 encrypt y 471 R2: ENC(DH,y), mac 472 <--------------------------------- 473 check mac 474 decrypt y 476 4.1.1. HIP Puzzle Mechanism 478 The purpose of the HIP puzzle mechanism is to protect the Responder 479 from a number of denial-of-service threats. It allows the Responder 480 to delay state creation until receiving the I2 packet. Furthermore, 481 the puzzle allows the Responder to use a fairly cheap calculation to 482 check that the Initiator is "sincere" in the sense that it has 483 churned enough CPU cycles in solving the puzzle. 485 The puzzle mechanism enables a Responder to immediately reject an I2 486 packet if it does not contain a valid puzzle solution. To verify the 487 puzzle solution, the Responder only has to compute a single CMAC 488 operation. After a successful puzzle verification, the Responder can 489 securely create session-specific state and perform CPU-intensive 490 operations such as a Diffie-Hellman key generation. By varying the 491 difficulty of the puzzle, the Responder can frustrate CPU or memory 492 targeted DoS attacks. Under normal network conditions, the puzzle 493 difficulty SHOULD be zero, thus effectively reverting the puzzle 494 mechanism to a cookie-based DoS protection mechanism. Without 495 setting the puzzle difficulty to zero under normal network 496 conditions, potentially scarce computation resources at the Initiator 497 would be churned unnecessarily. 499 Conceptually, the puzzle mechanism in HIP DEX is the same as in 500 HIPv2. Hence, this document refers to Sections 4.1.1 and 4.1.2 in 502 [RFC7401] for more detailed information about the employed mechanism. 503 Notably, the only differences between the puzzle mechanism in HIP DEX 504 and HIPv2 are that HIP DEX does not employ pre-computation of R1 505 packets and uses CMAC instead of a hash function for solving and 506 verifying a puzzle. The implications of these changes on the puzzle 507 implementation are discussed in Section 6.1. 509 4.1.2. HIP State Machine 511 The HIP DEX state machine has the same states as the HIPv2 state 512 machine (see 4.4. in [RFC7401]). However, HIP DEX features a 513 retransmission strategy with an optional reception acknowledgement 514 for the I2 packet. The goal of this additional acknowledgement is to 515 reduce premature I2 retransmissions in case of devices with low 516 computation resources [HWZ13]. As a result, there are minor changes 517 regarding the transitions in the HIP DEX state machine. The 518 following section documents these differences compared to HIPv2. 520 4.1.2.1. HIP DEX Retransmission Mechanism 522 For the retransmission of I1 and I2 packets, the Initiator adopts the 523 retransmission strategy of HIPv2 (see Section 4.4.3. in [RFC7401]). 524 This strategy is based on a timeout that is set to a value larger 525 than the worst-case anticipated round-trip time (RTT). For each 526 received I1 or I2 packet, the Responder sends an R1 or R2 packet, 527 respectively. This design trait enables the Responder to remain 528 stateless until the reception and successful processing of the I2 529 packet. The Initiator stops retransmitting I1 or I2 packets after 530 the reception of the corresponding R1 or R2. If the Initiator did 531 not receive an R1 packet after I1_RETRIES_MAX tries, it stops I1 532 retransmissions. Likewise, it stops retransmitting the I2 packet 533 after I2_RETRIES_MAX unsuccessful tries. 535 For repeatedly received I2 packets, the Responder SHOULD NOT perform 536 operations related to the Diffie-Hellman key exchange or the keying 537 material wrapped in the ENCRYPTED_KEY parameters. Instead, it SHOULD 538 re-use the previously established state to re-create the 539 corresponding R2 packet in order to prevent unnecessary computation 540 overhead. 542 The potentially high processing time of an I2 packet at a (resource- 543 constrained) Responder may cause premature retransmissions if the 544 time required for I2 transmission and processing exceeds the RTT- 545 based retransmission timeout. Thus, the Initiator should also take 546 the processing time of the I2 packet at the Responder into account 547 for retransmission purposes. To this end, the Responder MAY notify 548 the Initiator about the anticipated delay once the puzzle solution 549 was successfully verified and if the remaining I2 packet processing 550 incurs a high processing delay. The Responder MAY therefore send a 551 NOTIFY packet (see Section 5.3.6. in [RFC7401]) to the Initiator 552 before the Responder commences the ECDH operation. The NOTIFY packet 553 serves as an acknowledgement for the I2 packet and consists of a 554 NOTIFICATION parameter with Notify Message Type I2_ACKNOWLEDGEMENT 555 (see Section 5.2.19. in [RFC7401]). The NOTIFICATION parameter 556 contains the anticipated remaining processing time for the I2 packet 557 in milliseconds as two-octet Notification Data. This processing time 558 can, e.g., be estimated by measuring the computation time of the ECDH 559 key derivation operation during the Responder start-up procedure. 560 After the I2 processing has finished, the Responder sends the regular 561 R2 packet. 563 When the Initiator receives the NOTIFY packet, it sets the I2 564 retransmission timeout to the I2 processing time indicated in the 565 NOTIFICATION parameter plus half the RTT-based timeout value. In 566 doing so, the Initiator MUST NOT set the retransmission timeout to a 567 higher value than allowed by a local policy. This is to prevent 568 unauthenticated NOTIFY packets from maliciously delaying the 569 handshake beyond a well-defined upper bound in case of a lost R2 570 packet. At the same time, this extended retransmission timeout 571 enables the Initiator to defer I2 retransmissions until the point in 572 time when the Responder should have completed its I2 packet 573 processing and the network should have delivered the R2 packet 574 according to the employed worst-case estimates. 576 4.1.2.2. HIP State Processes 578 HIP DEX clarifies or introduces the following new transitions. 580 System behavior in state I2-SENT, Table 1. 582 +---------------------+---------------------------------------------+ 583 | Trigger | Action | 584 +---------------------+---------------------------------------------+ 585 | Receive NOTIFY, | Set I2 retransmission timer to value in | 586 | process | I2_ACKNOWLEDGEMENT Notification Data plus | 587 | | 1/2 RTT-based timeout value and stay at | 588 | | I2-SENT | 589 | | | 590 | Timeout | Increment trial counter | 591 | | | 592 | | If counter is less than I2_RETRIES_MAX, | 593 | | send I2, reset timer to RTT-based timeout, | 594 | | and stay at I2-SENT | 595 | | | 596 | | If counter is greater than I2_RETRIES_MAX, | 597 | | go to E-FAILED | 598 +---------------------+---------------------------------------------+ 600 Table 1: I2-SENT - Waiting to finish the HIP Diet EXchange 602 4.1.2.3. Simplified HIP State Diagram 604 The following diagram shows the major state transitions. Transitions 605 based on received packets implicitly assume that the packets are 606 successfully authenticated or processed. 608 +--+ +----------------------------+ 609 recv I1, send R1 | | | | 610 | v v | 611 +--------------+ recv I2, send R2 | 612 +----------------| UNASSOCIATED |----------------+ | 613 datagram | +--+ +--------------+ | | 614 to send, | | | Alg. not supported, | | 615 send I1 | | | send I1 | | 616 . v | v | | 617 . +---------+ recv I2, send R2 | | 618 +---->| I1-SENT |--------------------------------------+ | | 619 | +---------+ +----------------------+ | | | 620 | | recv R1, | recv I2, send R2 | | | | 621 | v send I2 | v v v | 622 | +---------+----------+ +---------+ | 623 | +--->| I2-SENT |<-------------+ +------------| R2-SENT |<---+ | 624 | | +---------+ recv NOTIFY, | | +---------+ | | 625 | | | | | reset timer | | data or| | | 626 | |recv R1, | | +--------------+ | EC timeout| | | 627 | |send I2 +-|--------------------+ | receive I2,| | 628 | | | | +-------------+ | send R2| | 629 | | | +-------->| ESTABLISHED |<---------+ | | 630 | | | recv R2 +-------------+ | | 631 | | | | | | receive I2, send R2 | | 632 | | +------------+ | +-------------------------------+ | 633 | | | +-----------+ | | 634 | | | no packet sent/received| +---+ | | 635 | | | for UAL min, send CLOSE| | |timeout | | 636 | | | v v |(UAL+MSL) | | 637 | | | +---------+ |retransmit | | 638 +--|----------|------------------------| CLOSING |-+CLOSE | | 639 | | +---------+ | | 640 | | | | | | | | 641 +----------|-------------------------+ | | +----------------+ | 642 | | +-----------+ +------------------|--+ 643 | | |recv CLOSE, recv CLOSE_ACK | | 644 | +-------------+ |send CLOSE_ACK or timeout | | 645 | recv CLOSE, | | (UAL+MSL) | | 646 | send CLOSE_ACK v v | | 647 | +--------+ receive I2, send R2 | | 648 +---------------------| CLOSED |------------------------------+ | 649 +--------+ | 650 ^ | | | 651 recv CLOSE, send CLOSE_ACK| | | timeout (UAL+2MSL) | 652 +-+ +------------------------------------+ 654 4.1.3. HIP DEX Security Associations 656 HIP DEX establishes two Security Associations (SA), one for the 657 Diffie-Hellman derived key, or Master Key, and one for the session 658 key, or Pair-wise Key. 660 4.1.3.1. Master Key SA 662 The Master Key SA is used to authenticate HIP packets and to encrypt 663 selected HIP parameters in the HIP DEX packet exchanges. Since only 664 little data is protected by this SA, it can be long-lived with no 665 need for rekeying. 667 The Master Key SA contains the following elements: 669 o Source HIT 671 o Destination HIT 673 o HIP_Encrypt Key 675 o HIP_MAC Key 677 The HIP_Encrypt and HIP_MAC keys are extracted from the Diffie- 678 Hellman derived key as described in Section 6.3. Their length is 679 determined by the HIP_CIPHER. 681 4.1.3.2. Pair-wise Key SA 683 The Pair-wise Key SA is used to authenticate and to encrypt user 684 data. It is refreshed (or rekeyed) using an UPDATE packet exchange. 685 The Pair-wise Key SA elements are defined by the data transform (e.g. 686 ESP_TRANSFORM [RFC7402]). 688 The keys for the Pair-wise Key SA are derived based on the wrapped 689 keying material exchanged in the ENCRYPTED_KEY parameter (see 690 Section 5.2.5) of the I2 and R2 packets. Specifically, the exchanged 691 keying material of the two peers is concatenated. This concatenation 692 forms the input to a Key Derivation Function (KDF). If the data 693 transform does not specify its own KDF, the key derivation function 694 defined in Section 6.3 is used. Even though this input is randomly 695 distributed, a KDF Extract phase may be needed to get the proper 696 length for the input to the KDF Expand phase. 698 4.1.4. User Data Considerations 700 The User Data Considerations in Section 4.5. of [RFC7401] also apply 701 to HIP DEX. There is only one difference between HIPv2 and HIP DEX. 702 Loss of state due to system reboot may be a critical performance 703 issue for resource-constrained devices. Thus, implementors MAY 704 choose to use non-volatile, secure storage for HIP states in order 705 for them to survive a system reboot. This will limit state loss 706 during reboots to only those situations with an SA timeout. 708 5. Packet Formats 710 5.1. Payload Format 712 HIP DEX employs the same fixed HIP header and payload structure as 713 HIPv2. As such, the specifications in Section 5.1 of [RFC7401] also 714 apply to HIP DEX. 716 5.2. HIP Parameters 718 The HIP parameters carry information that is necessary for 719 establishing and maintaining a HIP association. For example, the 720 peer's public keys as well as the signaling for negotiating ciphers 721 and payload handling are encapsulated in HIP parameters. Additional 722 information, meaningful for end-hosts or middleboxes, may also be 723 included in HIP parameters. The specification of the HIP parameters 724 and their mapping to HIP packets and packet types is flexible to 725 allow HIP extensions to define new parameters and new protocol 726 behavior. 728 In HIP packets, HIP parameters are ordered according to their numeric 729 type number and encoded in TLV format. 731 HIP DEX reuses the HIP parameters of HIPv2 defined in Section 5.2. of 732 [RFC7401] where possible. Still, HIP DEX further restricts and/or 733 extends the following existing parameter types: 735 o DH_GROUP_LIST and HOST_ID are restricted to ECC-based suites. 737 o HIP_CIPHER is restricted to AES-128-CTR and NULL-ENCRYPT. 739 o HIT_SUITE_LIST is limited to the HIT suite ECDH/FOLD. 741 o RHASH and RHASH_len are redefined to CMAC for the PUZZLE, 742 SOLUTION, and HIP_MAC parameters (see Section 6.1 and 743 Section 6.2). 745 In addition, HIP DEX introduces the following new parameter: 747 +------------------+------+----------+------------------------------+ 748 | TLV | Type | Length | Data | 749 +------------------+------+----------+------------------------------+ 750 | ENCRYPTED_KEY | 643 | variable | Encrypted container for the | 751 | | | | session key exchange | 752 +------------------+------+----------+------------------------------+ 754 5.2.1. DH_GROUP_LIST 756 The DH_GROUP_LIST parameter contains the list of supported DH Group 757 IDs of a host. It is defined in Section 5.2.6 of [RFC7401]. With 758 HIP DEX, the DH Group IDs are restricted to: 760 Group KDF Value 762 NIST P-256 [RFC5903] CKDF 7 763 NIST P-384 [RFC5903] CKDF 8 764 NIST P-521 [RFC5903] CKDF 9 765 SECP160R1 [SECG] CKDF 10 766 Curve25519 [RFC7748] CKDF 11 767 Curve448 [RFC7748] CKDF 12 769 The ECDH groups with values 7 - 9 are defined in [RFC5903] and 770 [RFC6090]. ECDH group 10 is covered in [SECG] and Appendix D of 771 [RFC7401]. These curves, when used with HIP MUST have a co-factor of 772 1. 774 The ECDH groups with values 11 and 12 are defined in [RFC7748]. 775 These curves have cofactors of 8 and 4 (respectively). 777 5.2.2. HIP_CIPHER 779 The HIP_CIPHER parameter contains the list of supported cipher 780 algorithms to be used for encrypting the contents of the ENCRYPTED 781 and ENCRYPTED_KEY parameters. The HIP_CIPHER parameter is defined in 782 Section 5.2.8 of [RFC7401]. With HIP DEX, the Suite IDs are limited 783 to: 785 Suite ID Value 787 RESERVED 0 788 NULL-ENCRYPT 1 ([RFC2410]) 789 AES-128-CTR 5 ([RFC3686]) 791 Mandatory implementation: AES-128-CTR. Implementors SHOULD support 792 NULL-ENCRYPT ([RFC2410]) for testing/debugging purposes but MUST NOT 793 offer or accept this value unless explicitly configured for testing/ 794 debugging of HIP. 796 5.2.3. HOST_ID 798 The HOST_ID parameter conveys the Host Identity (HI) along with 799 optional information about a host. It is defined in Section 5.2.9 of 800 [RFC7401]. 802 HIP DEX uses the public portion of a host's static ECDH key-pair as 803 the HI. Correspondingly, HIP DEX limits the HI algorithms to the 804 following new profile: 806 Algorithm profiles Value 808 ECDH 11 [RFC6090] (REQUIRED) 810 HIP DEX HIs are serialized equally to the ECC-based HIs in HIPv2 (see 811 Section 5.2.9. of [RFC7401]). The Group ID of the HIP DEX HI is 812 encoded in the "ECC curve" field of the HOST_ID parameter. The 813 supported DH Group IDs are defined in Section 5.2.1. 815 5.2.4. HIT_SUITE_LIST 817 The HIT_SUITE_LIST parameter contains a list of the supported HIT 818 suite IDs of the Responder. Based on the HIT_SUITE_LIST, the 819 Initiator can determine which source HIT Suite IDs are supported by 820 the Responder. The HIT_SUITE_LIST parameter is defined in 821 Section 5.2.10 of [RFC7401]. 823 The following new HIT Suite IDs are defined for HIP DEX, and the 824 relationship between the four-bit ID value used in the OGA ID field 825 and the eight-bit encoding within the HIT_SUITE_LIST ID field is 826 clarified: 828 HIT Suite Four-bit ID Eight-bit encoding 830 ECDH/FOLD 8 0x80 832 Note that the dedicated HIP DEX HIT Suite ID in the OGA ID field 833 allows the peers to distinguish a HIP DEX handshake from a HIPv2 834 handshake. The Responder MUST respond with a HIP DEX HIT suite ID 835 when the HIT of the Initiator is a HIP DEX HIT. 837 5.2.5. ENCRYPTED_KEY 838 0 1 2 3 839 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 840 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 841 | Type | Length | 842 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 843 / Encrypted value / 844 / / 845 / +-------------------------------+ 846 / | Padding | 847 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 849 Type 643 850 Length length in octets, excluding Type, Length, and 851 Padding 852 Encrypted The value is encrypted using an encryption algorithm 853 value as defined in the HIP_CIPHER parameter. 855 The ENCRYPTED_KEY parameter encapsulates a random value that is later 856 used in the session key creation process (see Section 6.3). This 857 random value MUST have a length of at least 64 bit. The puzzle value 858 #I and the puzzle solution #J (see [RFC7401]) are used as the 859 initialization vector (IV) for the encryption process. To this end, 860 the IV is computed as FOLD(I | J, 128). Moreover, a 16 bit counter 861 value, which is initialized to zero on first use, is appended to the 862 IV value in order to guarantee that a non-repeating nonce is fed to 863 the encryption algorithm defined by the HIP_CIPHER. 865 Once this encryption process is completed, the "encrypted value" data 866 field is ready for inclusion in the Parameter. If necessary, 867 additional Padding for 8-byte alignment is then added according to 868 the rules of TLV Format in [RFC7401]. 870 5.3. HIP Packets 872 HIP DEX uses the same eight basic HIP packets as HIPv2 (see 873 Section 5.3 of [RFC7401]). Four of them are for the HIP handshake 874 (I1, R1, I2, and R2), one is for updating an association (UPDATE), 875 one is for sending notifications (NOTIFY), and two are for closing 876 the association (CLOSE and CLOSE_ACK). There are some differences 877 regarding the HIP parameters that are included in the handshake 878 packets concerning HIP BEX and HIP DEX. This section covers these 879 differences for the DEX packets. Packets not discussed here, follow 880 the structure defined in [RFC7401]. 882 An important difference between packets in HIP BEX and HIP DEX is 883 that the DIFFIE_HELLMAN and the HIP_SIGNATURE parameters are not 884 included in HIP DEX. Thus, the R1 packet is completely unprotected 885 and can be spoofed. As a result, negotiation parameters contained in 886 the R1 packet have to be re-included in later, protected packets in 887 order to detect and prevent potential downgrading attacks. Moreover, 888 the I2, R2, UPDATE, NOTIFY, CLOSE, and CLOSE_ACK packets are not 889 covered by a signature and purely rely on the HIP_MAC parameter for 890 packet authentication. The processing of these packets is changed 891 accordingly. 893 In the future, an optional upper-layer payload MAY follow the HIP 894 header. The Next Header field in the header indicates if there is 895 additional data following the HIP header. 897 5.3.1. I1 - the HIP Initiator Packet 899 The HIP header values for the I1 packet: 901 Header: 902 Packet Type = 1 903 SRC HIT = Initiator's HIT 904 DST HIT = Responder's HIT, or NULL 906 IP ( HIP ( DH_GROUP_LIST ) ) 908 Valid control bits: none 910 The I1 packet contains the fixed HIP header and the Initiator's 911 DH_GROUP_LIST. The Initiator's HIT Suite ID MUST be of a HIP DEX 912 type as defined in Section 5.2.4. 914 Regarding the Responder's HIT, the Initiator may receive this HIT 915 either from a DNS lookup of the Responder's FQDN, from some other 916 repository, or from a local table. The Responder's HIT also MUST be 917 of a HIP DEX type. If the Initiator does not know the Responder's 918 HIT, it may attempt to use opportunistic mode by using NULL (all 919 zeros) as the Responder's HIT. See Section 4.1.8 of [RFC7401] for 920 detailed information about the "HIP Opportunistic Mode". 922 As the Initiator's and the Responder's HITs are compressions of the 923 employed HIs, they determine the DH Group ID that must be used in 924 order to successfully conclude the triggered handshake. HITs, 925 however, only include the OGA ID identifying the HI algorithm. They 926 do not include information about the specific group ID of the HI. To 927 inform the Responder about its employed and its otherwise supported 928 DH Group IDs, the Initiator therefore includes the DH_GROUP_LIST 929 parameter in the I1 packet. This parameter MUST include the DH group 930 ID that corresponds to the currently employed Initiator HIT as the 931 first list element. With HIP DEX, the DH_GROUP_LIST parameter MUST 932 only include ECDH groups defined in Section 5.2.1. 934 Since this packet is so easy to spoof even if it were protected, no 935 attempt is made to add to its generation or processing cost. As a 936 result, the DH_GROUP_LIST in the I1 packet is not protected. 938 Implementations MUST be able to handle a storm of received I1 939 packets, discarding those with common content that arrive within a 940 small time delta. 942 5.3.2. R1 - the HIP Responder Packet 944 The HIP header values for the R1 packet: 946 Header: 947 Packet Type = 2 948 SRC HIT = Responder's HIT 949 DST HIT = Initiator's HIT 951 IP ( HIP ( [ R1_COUNTER, ] 952 PUZZLE, 953 DH_GROUP_LIST, 954 HIP_CIPHER, 955 HOST_ID, 956 HIT_SUITE_LIST, 957 TRANSPORT_FORMAT_LIST, 958 [ <, ECHO_REQUEST_UNSIGNED >i ]) 960 Valid control bits: A 962 If the Responder's HI is an anonymous one, the A control MUST be set. 964 The Initiator's HIT MUST match the one received in the I1 packet if 965 the R1 is a response to an I1. If the Responder has multiple HIs, 966 the Responder's HIT MUST match the Initiator's request. If the 967 Initiator used opportunistic mode, the Responder may select among its 968 HIs as described below. See Section 4.1.8 of [RFC7401] for detailed 969 information about the "HIP Opportunistic Mode". 971 The R1 packet generation counter is used to determine the currently 972 valid generation of puzzles. The value is increased periodically, 973 and it is RECOMMENDED that it is increased at least as often as 974 solutions to old puzzles are no longer accepted. 976 The Puzzle contains a Random value #I and the puzzle difficulty K. 977 The difficulty K indicates the number of lower-order bits, in the 978 puzzle CMAC result, that MUST be zeros (see [RFC7401]). Responders 979 SHOULD set K to zero by default and only increase the puzzle 980 difficulty to protect against a DoS attack targeting the HIP DEX 981 handshake. A puzzle difficulty of zero effectively turns the puzzle 982 mechanism into a return-routablility test and is strongly encouraged 983 during normal operation in order to conserve energy resources as well 984 as to prevent unnecessary handshake delay in case of a resource- 985 constrained Initiator. 987 The DH_GROUP_LIST parameter contains the Responder's order of 988 preference based on which it chose the ECDH key contained in the 989 HOST_ID parameter (see below). This allows the Initiator to 990 determine whether its own DH_GROUP_LIST in the I1 packet was 991 manipulated by an attacker. There is a further risk that the 992 Responder's DH_GROUP_LIST was manipulated by an attacker, as the R1 993 packet cannot be authenticated in HI DEX. Thus, this parameter is 994 repeated in the R2 packet to allow for a final, cryptographically 995 secured validation. 997 The HIP_CIPHER contains the encryption algorithms supported by the 998 Responder to protect the key exchange, in the order of preference. 999 All implementations MUST support the AES-CTR [RFC3686]. 1001 The HIT_SUITE_LIST parameter is an ordered list of the Responder's 1002 supported and preferred HIT Suites. It enables a Responder to notify 1003 the Initiator about other available HIT suites than the one used in 1004 the current handshake. Based on the received HIT_SUITE_LIST, the 1005 Initiator MAY decide to abort the current handshake and initiate a 1006 new handshake with a different mutually supported HIT suite. This 1007 mechanism can, e.g., be used to move from an initial HIP DEX 1008 handshake to a HIP BEX handshake for peers supporting both protocol 1009 variants. 1011 The HOST_ID parameter depends on the received DH_GROUP_LIST parameter 1012 and the Responder HIT in the I1 packet. Specifically, if the I1 1013 contains a Responder HIT, the Responder verifies that this HIT 1014 matches the required DH group based on the received DH_GROUP_LIST 1015 parameter included in the I1. In case of a positive result, the 1016 Responder selects the corresponding HOST_ID for inclusion in the R1 1017 packet. Likewise, if the Responder HIT in the I1 packet is NULL 1018 (i.e., during an opportunistic handshake), the Responder chooses its 1019 HOST_ID according to the Initiator's employed DH group as indicated 1020 in the received DH_GROUP_LIST parameter and sets the source HIT in 1021 the R1 packet accordingly. If the Responder however does not support 1022 the DH group required by the Initiator or if the Responder HIT in the 1023 I1 packet does not match the required DH group, the Responder selects 1024 the mutually preferred and supported DH group based on the 1025 DH_GROUP_LIST parameter in the I1 packet. The Responder then 1026 includes the corresponding ECDH key in the HOST_ID parameter. This 1027 parameter also indicates the selected DH group. Moreover, the 1028 Responder sets the source HIT in the R2 packet based on the 1029 destination HIT from the I1 packet. Based on the deviating DH group 1030 ID in the HOST_ID parameter, the Initiator then SHOULD abort the 1031 current handshake and initiate a new handshake with the mutually 1032 supported DH group as far as local policies (see Section 7) permit. 1034 The TRANSPORT_FORMAT_LIST parameter is an ordered list of the 1035 Responder's supported and preferred transport format types. The list 1036 allows the Initiator and the Responder to agree on a common type for 1037 payload protection. Currently, the only transport format defined is 1038 IPsec ESP [RFC7402]. 1040 The ECHO_REQUEST_UNSIGNED parameters contain data that the sender 1041 wants to receive unmodified in the corresponding response packet in 1042 the ECHO_RESPONSE_UNSIGNED parameter. The R1 packet may contain zero 1043 or more ECHO_REQUEST_UNSIGNED parameters. 1045 5.3.3. I2 - the Second HIP Initiator Packet 1047 The HIP header values for the I2 packet: 1049 Header: 1050 Type = 3 1051 SRC HIT = Initiator's HIT 1052 DST HIT = Responder's HIT 1054 IP ( HIP ( [R1_COUNTER,] 1055 SOLUTION, 1056 HIP_CIPHER, 1057 ENCRYPTED_KEY, 1058 HOST_ID, 1059 TRANSPORT_FORMAT_LIST, 1060 HIP_MAC, 1061 [<, ECHO_RESPONSE_UNSIGNED>i )] ) 1063 Valid control bits: A 1065 The HITs MUST match the ones used in the R1 packet. 1067 If the Initiator's HI is an anonymous one, the A control bit MUST be 1068 set. 1070 If present in the R1 packet, the Initiator MUST include an unmodified 1071 copy of the R1_COUNTER parameter into the I2 packet. 1073 The Solution contains the Random #I from the R1 packet and the 1074 computed #J value. The low-order #K bits of the RHASH(I | ... | J) 1075 MUST be zero. 1077 The HIP_CIPHER contains the single encryption transform selected by 1078 the Initiator that it uses to encrypt the ENCRYPTED and ENCRYPTED_KEY 1079 parameters. The chosen cipher MUST correspond to one of the ciphers 1080 offered by the Responder in the R1. All implementations MUST support 1081 the AES-CTR transform [RFC3686]. 1083 The HOST_ID parameter contains the Initiator HI corresponding to the 1084 Initiator HIT. 1086 The ENCRYPTED_KEY parameter contains an Initiator generated random 1087 value that MUST be uniformly distributed. This random value is 1088 encrypted with the Master Key SA using the HIP_CIPHER encryption 1089 algorithm. 1091 The ECHO_RESPONSE_UNSIGNED parameter(s) contain the unmodified Opaque 1092 data copied from the corresponding echo request parameter(s). This 1093 parameter can also be used for two-factor password authentication as 1094 shown in Appendix A. 1096 The TRANSPORT_FORMAT_LIST parameter contains the single transport 1097 format type selected by the Initiator. The chosen type MUST 1098 correspond to one of the types offered by the Responder in the R1 1099 packet. Currently, the only transport format defined is the ESP 1100 transport format [RFC7402]. 1102 The MAC is calculated over the whole HIP envelope, excluding any 1103 parameters after the HIP_MAC parameter as described in Section 6.2. 1104 The Responder MUST validate the HIP_MAC parameter. 1106 5.3.4. R2 - the Second HIP Responder Packet 1108 The HIP header values for the R2 packet: 1110 Header: 1111 Packet Type = 4 1112 SRC HIT = Responder's HIT 1113 DST HIT = Initiator's HIT 1115 IP ( HIP ( DH_GROUP_LIST, 1116 HIP_CIPHER, 1117 ENCRYPTED_KEY, 1118 HIT_SUITE_LIST, 1119 TRANSPORT_FORMAT_LIST, 1120 HIP_MAC) 1122 Valid control bits: none 1124 The HITs used MUST match the ones used in the I2 packet. 1126 The Responder repeats the DH_GROUP_LIST, HIP_CIPHER, HIT_SUITE_LIST, 1127 and TRANSPORT_FORMAT_LIST parameters in the R2 packet. These 1128 parameters MUST be the same as included in the R1 packet. The 1129 parameter are re-included here because the R2 packet is MACed and 1130 thus cannot be altered by an attacker. For verification purposes, 1131 the Initiator re-evaluates the selected suites and compares the 1132 results against the chosen ones. If the re-evaluated suites do not 1133 match the chosen ones, the Initiator acts based on its local policy. 1135 The ENCRYPTED_KEY parameter contains an Responder generated random 1136 value that MUST be uniformly distributed. This random value is 1137 encrypted with the Master Key SA using the HIP_CIPHER encryption 1138 algorithm. 1140 The MAC is calculated over the whole HIP envelope, excluding any 1141 parameters after the HIP_MAC, as described in Section 6.2. The 1142 Initiator MUST validate the HIP_MAC parameter. 1144 5.4. ICMP Messages 1146 When a HIP implementation detects a problem with an incoming packet, 1147 and it either cannot determine the identity of the sender of the 1148 packet or does not have any existing HIP association with the sender 1149 of the packet, it MAY respond with an ICMP packet. Any such reply 1150 MUST be rate-limited as described in [RFC4443]. In most cases, the 1151 ICMP packet has the Parameter Problem type (12 for ICMPv4, 4 for 1152 ICMPv6), with the Pointer field pointing to the field that caused the 1153 ICMP message to be generated. The problem cases specified in 1154 Section 5.4. of [RFC7401] also apply to HIP DEX. 1156 6. Packet Processing 1158 Due to the adopted protocol semantics and the inherited general 1159 packet structure, the packet processing in HIP DEX only differs from 1160 HIPv2 in very few places. Here, we focus on these differences and 1161 refer to Section 6 in [RFC7401] otherwise. 1163 The processing of outgoing and incoming application data remains the 1164 same as in HIP BEX (see Sections 6.1 and 6.2 in [RFC7401]). 1166 6.1. Solving the Puzzle 1168 The procedures for solving and verifying a puzzle in HIP DEX are 1169 strongly based on the corresponding procedures in HIPv2. The only 1170 exceptions are that HIP DEX does not use pre-computation of R1 1171 packets and that RHASH is set to CMAC. As a result, the pre- 1172 computation step in Section 6.3 of [RFC7401] is skipped in HIP DEX. 1174 Moreover, the Initiator solves a puzzle by computing: 1175 Ltrunc( CMAC( I, HIT-I | HIT-R | J ), K ) == 0 1177 Similarly, the Responder verifies a puzzle by computing: 1178 V := Ltrunc( CMAC( I, HIT-I | HIT-R | J ), K ) 1180 Apart from these modifications, the procedures defined in Section 6.3 1181 of [RFC7401] also apply for HIP DEX. 1183 6.2. HIP_MAC Calculation and Verification 1185 The following subsections define the actions for processing the 1186 HIP_MAC parameter. 1188 6.2.1. CMAC Calculation 1190 The HIP_MAC calculation uses RHASH, i.e., CMAC, as the underlying 1191 cryptographic function. The scope of the calculation for HIP_MAC is: 1193 CMAC: { HIP header | [ Parameters ] } 1195 where Parameters include all HIP parameters of the packet that is 1196 being calculated with Type values ranging from 1 to (HIP_MAC's Type 1197 value - 1) and exclude parameters with Type values greater or equal 1198 to HIP_MAC's Type value. 1200 During HIP_MAC calculation, the following applies: 1202 o In the HIP header, the Checksum field is set to zero. 1204 o In the HIP header, the Header Length field value is calculated to 1205 the beginning of the HIP_MAC parameter. 1207 The parameter order is described in Section 5.2.1 of [RFC7401]. 1209 The CMAC calculation and verification process is as follows: 1211 Packet sender: 1213 1. Create the HIP packet, without the HIP_MAC or any other parameter 1214 with greater Type value than the HIP_MAC parameter has. 1216 2. Calculate the Header Length field in the HIP header. 1218 3. Compute the CMAC using either HIP-gl or HIP-lg integrity key 1219 retrieved from KEYMAT as defined in Section 6.3. 1221 4. Add the HIP_MAC parameter to the packet and any parameter with 1222 greater Type value than the HIP_MAC's that may follow. 1224 5. Recalculate the Length field in the HIP header. 1226 Packet receiver: 1228 1. Verify the HIP header Length field. 1230 2. Remove the HIP_MAC parameter, as well as all other parameters 1231 that follow it with greater Type value, saving the contents if 1232 they will be needed later. 1234 3. Recalculate the HIP packet length in the HIP header and clear the 1235 Checksum field (set it to all zeros). 1237 4. Compute the CMAC using either HIP-gl or HIP-lg integrity key as 1238 defined in Section 6.3 and verify it against the received CMAC. 1240 5. Set Checksum and Header Length fields in the HIP header to 1241 original values. Note that the Checksum and Length fields 1242 contain incorrect values after this step. 1244 6.3. HIP DEX KEYMAT Generation 1246 The HIP DEX KEYMAT process is used to derive the keys for the Master 1247 Key SA as well as for the Pair-wise Key SA. The keys for the Master 1248 Key SA are based on the Diffie-Hellman derived key, Kij, which is 1249 produced during the HIP DEX handshake. The Initiator generates Kij 1250 during the creation of the I2 packet and the Responder generates Kij 1251 once it receives the I2 packet. This is why the I2 packet can 1252 already contain authenticated and/or encrypted information. 1254 The keys derived for the Pair-wise Key SA are not used during the HIP 1255 DEX handshake. Instead, these keys are made available as payload 1256 protection keys (e.g., for IPsec). Some payload protection 1257 mechanisms have their own Key Derivation Function, and if so this 1258 mechanism SHOULD be used. Otherwise, the HIP DEX KEYMAT process MUST 1259 be used to derive the keys of the Pair-wise Key SA based on the 1260 concatenation of the random values that are contained in the 1261 exchanged ENCRYPTED_KEY parameters. 1263 The HIP DEX KEYMAT process is based on the is the Hash-based Key 1264 Derivation Function (HKDF) defined in [RFC5869] and consists of two 1265 components, CKDF-Extract and CKDF-Expand. The CKDF-Extract function 1266 compresses a non-uniformly distributed key, such as the output of a 1267 Diffie-Hellman key derivation, to extract the key entropy into a 1268 fixed length output. The CKDF-Expand function takes either the 1269 output of the Extract function or directly uses a uniformly 1270 distributed key and expands the length of the key, repeatedly 1271 distributing the key entropy, to produce the keys needed. 1273 The key derivation for the Master Key SA employs always both the 1274 Extract and Expand phases. The Pair-wise Key SA needs only the 1275 Extract phase when key is smaller or equal to 128 bits, but otherwise 1276 requires also the Expand phase. 1278 The CKDF-Extract function is the following operation: 1280 CKDF-Extract(I, IKM, info) -> PRK 1282 Inputs: 1283 I Random #I from the PUZZLE parameter 1284 IKM Input keying material, i.e., the Diffie-Hellman derived 1285 key for the Master Key SA and the concatenation of the 1286 random values of the ENCRYPTED_KEY parameters in the 1287 same order as the HITs with sort(HIT-I | HIT-R) for the 1288 Pair-wise Key SA 1289 info sort(HIT-I | HIT-R) | "CKDF-Extract" 1290 where "CKDF-Extract" is an octet string 1292 Output: 1293 PRK a pseudorandom key (of RHASH_len/8 octets) 1295 The pseudorandom key PRK is calculated as follows: 1297 PRK = CMAC(I, IKM | info) 1299 The CKDF-Expand function is the following operation: 1301 CKDF-Expand(PRK, info, L) -> OKM 1303 Inputs: 1304 PRK a pseudorandom key of at least RHASH_len/8 octets 1305 (either the output from the extract step or the 1306 concatenation of the random values of the 1307 ENCRYPTED_KEY parameters in the same order as the 1308 HITs with sort(HIT-I | HIT-R) in case of no extract) 1309 info sort(HIT-I | HIT-R) | "CKDF-Expand" 1310 where "CKDF-Expand" is an octet string 1311 L length of output keying material in octets 1312 (<= 255*RHASH_len/8) 1314 Output: 1315 OKM output keying material (of L octets) 1317 The output keying material OKM is calculated as follows: 1319 N = ceil(L/RHASH_len/8) 1320 T = T(1) | T(2) | T(3) | ... | T(N) 1321 OKM = first L octets of T 1323 where 1325 T(0) = empty string (zero length) 1326 T(1) = CMAC(PRK, T(0) | info | 0x01) 1327 T(2) = CMAC(PRK, T(1) | info | 0x02) 1328 T(3) = CMAC(PRK, T(2) | info | 0x03) 1329 ... 1331 (where the constant concatenated to the end of each T(n) is a 1332 single octet.) 1334 sort(HIT-I | HIT-R) is defined as the network byte order 1335 concatenation of the two HITs, with the smaller HIT preceding the 1336 larger HIT, resulting from the numeric comparison of the two HITs 1337 interpreted as positive (unsigned) 128-bit integers in network byte 1338 order. 1340 The initial keys for the Master Key SA are drawn sequentially in the 1341 order that is determined by the numeric comparison of the two HITs, 1342 with the comparison method described in the previous paragraph. 1343 HOST_g denotes the host with the greater HIT value, and HOST_l the 1344 host with the lower HIT value. 1346 The drawing order for initial keys: 1348 1. HIP-gl encryption key for HOST_g's outgoing HIP packets 1349 2. HIP-gl integrity (CMAC) key for HOST_g's outgoing HIP packets 1351 3. HIP-lg encryption key for HOST_l's outgoing HIP packets 1353 4. HIP-lg integrity (CMAC) key for HOST_l's outgoing HIP packets 1355 The number of bits drawn for a given algorithm is the "natural" size 1356 of the keys regarding the algorithm defined in the HIP_CIPHER. For 1357 the mandatory algorithms, the following size applies: 1359 AES 128 bits 1361 If other key sizes are used, they must be treated as different 1362 encryption algorithms and defined separately. 1364 6.4. Initiation of a HIP Diet EXchange 1366 The initiation of a HIP DEX handshake proceeds as described in 1367 Section 6.6 of [RFC7401]. The I1 packet contents are specified in 1368 Section 5.3.1. 1370 6.5. Processing Incoming I1 Packets 1372 I1 packets in HIP DEX are handled almost identical to HIPv2 (see 1373 Section 6.7 of [RFC7401]). The main differences are that the 1374 Responder SHOULD select a HIP DEX HIT Suite in the R1 response. 1375 Moreover, as R1 packets are neither covered by a signature nor incur 1376 the overhead of generating an ephemeral Diffie-Hellman key-pair, pre- 1377 computation of an R1 is only marginally beneficial, but would incur 1378 additional memory resources at the Responder. Hence, the R1 pre- 1379 computation SHOULD be omitted in HIP DEX. 1381 Correspondingly, the modified conceptual processing rules for 1382 responding to an I1 packet are as follows: 1384 1. The Responder MUST check that the Responder's HIT in the received 1385 I1 packet is either one of its own HITs or NULL. Otherwise, it 1386 must drop the packet. 1388 2. If the Responder is in ESTABLISHED state, the Responder MAY 1389 respond to this with an R1 packet, prepare to drop an existing 1390 HIP security association with the peer, and stay at ESTABLISHED 1391 state. 1393 3. If the Responder is in I1-SENT state, it MUST make a comparison 1394 between the sender's HIT and its own (i.e., the receiver's) HIT. 1395 If the sender's HIT is greater than its own HIT, it should drop 1396 the I1 packet and stay at I1-SENT. If the sender's HIT is 1397 smaller than its own HIT, it SHOULD send the R1 packet and stay 1398 at I1-SENT. The HIT comparison is performed as defined in 1399 Section 6.3. 1401 4. If the implementation chooses to respond to the I1 packet with an 1402 R1 packet, it creates a new R1 according to the format described 1403 in Section 5.3.2. It chooses the HI based on the destination HIT 1404 and the DH_GROUP_LIST in the I1 packet. If the implementation 1405 does not support the DH group required by the Initiator or if the 1406 destination HIT in the I1 packet does not match the required DH 1407 group, it selects the mutually preferred and supported DH group 1408 based on the DH_GROUP_LIST parameter in the I1 packet. The 1409 implementation includes the corresponding ECDH public key in the 1410 HOST_ID parameter. If no suitable DH Group ID was contained in 1411 the DH_GROUP_LIST in the I1 packet, it sends an R1 packet with 1412 any suitable ECDH public key. 1414 5. If the received Responder's HIT in the I1 packet is not NULL, the 1415 Responder's HIT in the R1 packet MUST match the destination HIT 1416 in the I1 packet. Otherwise, the Responder MUST select a HIT 1417 with the same HIT Suite as the Initiator's HIT. If this HIT 1418 Suite is not supported by the Responder, it SHOULD select a 1419 REQUIRED HIT Suite from Section 5.2.10 of [RFC7401], which is 1420 currently RSA/DSA/SHA-256. Other than that, selecting the HIT is 1421 a local policy matter. 1423 6. The Responder expresses its supported HIP transport formats in 1424 the TRANSPORT_FORMAT_LIST as described in Section 5.2.11 of 1425 [RFC7401]. The Responder MUST provide at least one payload 1426 transport format type. 1428 7. The Responder sends the R1 packet to the source IP address of the 1429 I1 packet. 1431 Note that only steps 4 and 5 have been changed with regard to the 1432 processing rules of HIPv2. The considerations about R1 management 1433 (except pre-computation) and malformed I1 packets in Sections 6.7.1 1434 and 6.7.2 of [RFC7401] likewise apply to HIP DEX. 1436 6.6. Processing Incoming R1 Packets 1438 R1 packets in HIP DEX are handled identically to HIPv2 (see 1439 Section 6.8 in [RFC7401]) with the following exceptions: HIP DEX uses 1440 ECDH public keys as HIs and does not employ signatures. 1442 The modified conceptual processing rules for responding to an R1 1443 packet are as follows: 1445 1. A system receiving an R1 MUST first check to see if it has sent 1446 an I1 packet to the originator of the R1 packet (i.e., it has a 1447 HIP association that is in state I1-SENT and that is associated 1448 with the HITs in the R1). Unless the I1 packet was sent in 1449 opportunistic mode (see Section 4.1.8 of [RFC7401]), the IP 1450 addresses in the received R1 packet SHOULD be ignored by the R1 1451 processing and, when looking up the correct HIP association, the 1452 received R1 packet SHOULD be matched against the associations 1453 using only the HITs. If a match exists, the system should 1454 process the R1 packet as described below. 1456 2. Otherwise, if the system is in any state other than I1-SENT or 1457 I2-SENT with respect to the HITs included in the R1 packet, it 1458 SHOULD silently drop the R1 packet and remain in the current 1459 state. 1461 3. If the HIP association state is I1-SENT or I2-SENT, the received 1462 Initiator's HIT MUST correspond to the HIT used in the original 1463 I1 packet. Also, the Responder's HIT MUST correspond to the one 1464 used in the I1 packet, unless this packet contained a NULL HIT. 1466 4. If the HIP association state is I1-SENT, and multiple valid R1 1467 packets are present, the system MUST select from among the R1 1468 packets with the largest R1 generation counter. 1470 5. The system MUST check that the Initiator's HIT Suite is 1471 contained in the HIT_SUITE_LIST parameter in the R1 packet 1472 (i.e., the Initiator's HIT Suite is supported by the Responder). 1473 If the HIT Suite is supported by the Responder, the system 1474 proceeds normally. Otherwise, the system MAY stay in state 1475 I1-SENT and restart the HIP DEX handshake by sending a new I1 1476 packet with an Initiator HIT that is supported by the Responder 1477 and hence is contained in the HIT_SUITE_LIST in the R1 packet. 1478 The system MAY abort the handshake if no suitable source HIT is 1479 available. The system SHOULD wait for an acceptable time span 1480 to allow further R1 packets with higher R1 generation counters 1481 or different HIT and HIT Suites to arrive before restarting or 1482 aborting the HIP DEX handshake. 1484 6. The system MUST check that the DH Group ID in the HOST_ID 1485 parameter in the R1 matches the first DH Group ID in the 1486 Responder's DH_GROUP_LIST in the R1 packet, and also that this 1487 Group ID corresponds to a value that was included in the 1488 Initiator's DH_GROUP_LIST in the I1 packet. If the DH Group ID 1489 of the HOST_ID parameter does not express the Responder's best 1490 choice, the Initiator can conclude that the DH_GROUP_LIST in the 1491 I1 or R1 packet was adversely modified. In such a case, the 1492 Initiator MAY send a new I1 packet; however, it SHOULD NOT 1493 change its preference in the DH_GROUP_LIST in the new I1 packet. 1494 Alternatively, the Initiator MAY abort the HIP DEX handshake. 1495 Moreover, if the DH Group ID indicated in the HOST_ID parameter 1496 does not match the DH Group ID of the HI employed by the 1497 Initiator, the system SHOULD wait for an acceptable time span to 1498 allow further R1 packets with different DH Group IDs to arrive 1499 before restarting or aborting the HIP DEX handshake. When 1500 restarting the handshake, the Initiator MUST consult local 1501 policies (see Section 7) regarding the use of another, mutually 1502 supported DH group for the subsequent handshake with the 1503 Responder. 1505 7. If the HIP association state is I2-SENT, the system MAY re-enter 1506 state I1-SENT and process the received R1 packet if it has a 1507 larger R1 generation counter than the R1 packet responded to 1508 previously. 1510 8. The R1 packet may have the A-bit set - in this case, the system 1511 MAY choose to refuse it by dropping the R1 packet and returning 1512 to state UNASSOCIATED. The system SHOULD consider dropping the 1513 R1 packet only if it used a NULL HIT in the I1 packet. If the 1514 A-bit is set, the Responder's HIT is anonymous and SHOULD NOT be 1515 stored permanently. 1517 9. The system SHOULD attempt to validate the HIT against the 1518 received Host Identity by using the received Host Identity to 1519 construct a HIT and verify that it matches the Sender's HIT. 1521 10. The system MUST store the received R1 generation counter for 1522 future reference. 1524 11. The system attempts to solve the puzzle in the R1 packet. The 1525 system MUST terminate the search after exceeding the remaining 1526 lifetime of the puzzle. If the puzzle is not successfully 1527 solved, the implementation MAY either resend the I1 packet 1528 within the retry bounds or abandon the HIP base exchange. 1530 12. The system computes standard Diffie-Hellman keying material 1531 according to the public value and Group ID provided in the 1532 HOST_ID parameter. The Diffie-Hellman keying material Kij is 1533 used for key extraction as specified in Section 6.3. 1535 13. The system selects the HIP_CIPHER ID from the choices presented 1536 in the R1 packet and uses the selected values subsequently when 1537 generating and using encryption keys, and when sending the I2 1538 packet. If the proposed alternatives are not acceptable to the 1539 system, it may either resend an I1 packet within the retry 1540 bounds or abandon the HIP base exchange. 1542 14. The system chooses one suitable transport format from the 1543 TRANSPORT_FORMAT_LIST and includes the respective transport 1544 format parameter in the subsequent I2 packet. 1546 15. The system initializes the remaining variables in the associated 1547 state, including Update ID counters. 1549 16. The system prepares and sends an I2 packet as described in 1550 Section 5.3.3. 1552 17. The system SHOULD start a timer whose timeout value SHOULD be 1553 larger than the worst-case anticipated RTT, and MUST increment a 1554 trial counter associated with the I2 packet. The sender SHOULD 1555 retransmit the I2 packet upon a timeout and restart the timer, 1556 up to a maximum of I2_RETRIES_MAX tries. 1558 18. If the system is in state I1-SENT, it SHALL transition to state 1559 I2-SENT. If the system is in any other state, it remains in the 1560 current state. 1562 Note that step 4 from the original processing rules of HIPv2 1563 (signature verification) has been removed in the above processing 1564 rules for HIP DEX. Moreover, step 7 of the original processing rules 1565 has been adapted in step 6 above to account for the fact that HIP DEX 1566 uses ECDH public keys as HIs. The considerations about malformed R1 1567 packets in Sections 6.8.1 of [RFC7401] also apply to HIP DEX. 1569 6.7. Processing Incoming I2 Packets 1571 The processing of I2 packets follows similar rules as HIPv2 (see 1572 Section 6.9 of [RFC7401]). The main differences to HIPv2 are that 1573 HIP DEX introduces a new session key exchange via the ENCRYPTED_KEY 1574 parameter as well as an I2 reception acknowledgement for 1575 retransmission purposes. Moreover, with HIP DEX the Initiator is 1576 responsible for triggering retransmissions, whereas the Responder 1577 merely replies to received I2 packets. 1579 The modified HIP DEX conceptual processing rules for responding to an 1580 I2 packet are: 1582 1. The system MAY perform checks to verify that the I2 packet 1583 corresponds to a recently sent R1 packet. Such checks are 1584 implementation dependent. See Appendix A in [RFC7401] for a 1585 description of an example implementation. 1587 2. The system MUST check that the Responder's HIT corresponds to 1588 one of its own HITs and MUST drop the packet otherwise. 1590 3. The system MUST further check that the Initiator's HIT Suite is 1591 supported. The Responder SHOULD silently drop I2 packets with 1592 unsupported Initiator HITs. 1594 4. If the system's state machine is in the R2-SENT state, the 1595 system MUST check to see if the newly received I2 packet is 1596 similar to the one that triggered moving to R2-SENT. If so, it 1597 MUST retransmit a previously sent R2 packet and reset the 1598 R2-SENT timer. The system SHOULD re-use the previously 1599 established state to re-create the corresponding R2 packet in 1600 order to prevent unnecessary computation overhead. 1602 5. If the system's state machine is in the I2-SENT state, the 1603 system MUST make a comparison between its local and sender's 1604 HITs (similarly as in Section 6.3). If the local HIT is smaller 1605 than the sender's HIT, it should drop the I2 packet, use the 1606 peer Diffie-Hellman key, ENCRYPTED_KEY keying material and nonce 1607 #I from the R1 packet received earlier, and get the local 1608 Diffie-Hellman key, ENCRYPTED_KEY keying material, and nonce #J 1609 from the I2 packet sent to the peer earlier. Otherwise, the 1610 system should process the received I2 packet and drop any 1611 previously derived Diffie-Hellman keying material Kij and 1612 ENCRYPTED_KEY keying material it might have generated upon 1613 sending the I2 packet previously. The peer Diffie-Hellman key, 1614 ENCRYPTED_KEY, and the nonce #J are taken from the just arrived 1615 I2 packet. The local Diffie-Hellman key, ENCRYPTED_KEY keying 1616 material, and the nonce #I are the ones that were sent earlier 1617 in the R1 packet. 1619 6. If the system's state machine is in the I1-SENT state, and the 1620 HITs in the I2 packet match those used in the previously sent I1 1621 packet, the system uses this received I2 packet as the basis for 1622 the HIP association it was trying to form, and stops 1623 retransmitting I1 packets (provided that the I2 packet passes 1624 the additional checks below). 1626 7. If the system's state machine is in any state other than 1627 R2-SENT, the system SHOULD check that the echoed R1 generation 1628 counter in the I2 packet is within the acceptable range if the 1629 counter is included. Implementations MUST accept puzzles from 1630 the current generation and MAY accept puzzles from earlier 1631 generations. If the generation counter in the newly received I2 1632 packet is outside the accepted range, the I2 packet is stale 1633 (and perhaps replayed) and SHOULD be dropped. 1635 8. The system MUST validate the solution to the puzzle as described 1636 in Section 6.1. 1638 9. The I2 packet MUST have a single value in the HIP_CIPHER 1639 parameter, which MUST match one of the values offered to the 1640 Initiator in the R1 packet. 1642 10. The system MUST derive Diffie-Hellman keying material Kij based 1643 on the public value and Group ID in the HOST_ID parameter. This 1644 keying material is used to derive the keys of the Master Key SA 1645 as described in Section 6.3. If the Diffie-Hellman Group ID is 1646 unsupported, the I2 packet is silently dropped. If the 1647 processing time for the derivation of the Diffie-Hellman keying 1648 material Kij is likely to cause premature I2 retransmissions by 1649 the Initiator, the system MAY send a NOTIFY packet before 1650 starting the key derivation process. The NOTIFY packet contains 1651 a NOTIFICATION parameter with Notify Message Type 1652 I2_ACKNOWLEDGEMENT. The NOTIFICATION parameter indicates the 1653 anticipated remaining processing time for the I2 packet in 1654 milliseconds as two-octet Notification Data. 1656 11. The implementation SHOULD also verify that the Initiator's HIT 1657 in the I2 packet corresponds to the Host Identity sent in the I2 1658 packet. (Note: some middleboxes may not be able to make this 1659 verification.) 1661 12. The system MUST process the TRANSPORT_FORMAT_LIST parameter. 1662 Other documents specifying transport formats (e.g., [RFC7402]) 1663 contain specifications for handling any specific transport 1664 selected. 1666 13. The system MUST verify the HIP_MAC according to the procedures 1667 in Section 6.2. 1669 14. If the checks above are valid, then the system proceeds with 1670 further I2 processing; otherwise, it discards the I2 and its 1671 state machine remains in the same state. 1673 15. The I2 packet may have the A-bit set - in this case, the system 1674 MAY choose to refuse it by dropping the I2 and the state machine 1675 returns to state UNASSOCIATED. If the A-bit is set, the 1676 Initiator's HIT is anonymous and should not be stored 1677 permanently. 1679 16. The system MUST decrypt the keying material from the 1680 ENCRYPTED_KEY parameter. This keying material is a partial 1681 input to the key derivation process for the Pair-wise Key SA 1682 (see Section 6.3). 1684 17. The system initializes the remaining variables in the associated 1685 state, including Update ID counters. 1687 18. Upon successful processing of an I2 packet when the system's 1688 state machine is in state UNASSOCIATED, I1-SENT, I2-SENT, or 1689 R2-SENT, an R2 packet is sent as described in Section 5.3.4 and 1690 the system's state machine transitions to state R2-SENT. 1692 19. Upon successful processing of an I2 packet when the system's 1693 state machine is in state ESTABLISHED, the old HIP association 1694 is dropped and a new one is installed, an R2 packet is sent as 1695 described in Section 5.3.4, and the system's state machine 1696 transitions to R2-SENT. 1698 20. Upon the system's state machine transitioning to R2-SENT, the 1699 system starts a timer. The state machine transitions to 1700 ESTABLISHED if some data has been received on the incoming HIP 1701 association, or an UPDATE packet has been received (or some 1702 other packet that indicates that the peer system's state machine 1703 has moved to ESTABLISHED). If the timer expires (allowing for a 1704 maximal amount of retransmissions of I2 packets), the state 1705 machine transitions to ESTABLISHED. 1707 Note that steps 11 (encrypted HOST_ID) and 15 (signature 1708 verification) from the original processing rules of HIPv2 have been 1709 removed in the above processing rules for HIP DEX. Moreover, step 10 1710 of the HIPv2 processing rules has been adapted to account for 1711 optional extension of the retransmission mechanism. Step 16 has been 1712 added to the processing rules in this document. The considerations 1713 about malformed I2 packets in Sections 6.9.1 of [RFC7401] also apply 1714 to HIP DEX. 1716 6.8. Processing Incoming R2 Packets 1718 R2 packets in HIP DEX are handled identically to HIPv2 (see 1719 Section 6.10 of [RFC7401]) with the following exceptions: HIP DEX 1720 introduces a new session key exchange via the ENCRYPTED_KEY parameter 1721 and does not employ signatures. 1723 The modified conceptual processing rules for responding to an R2 1724 packet are as follows: 1726 1. If the system is in any other state than I2-SENT, the R2 packet 1727 is silently dropped. 1729 2. The system MUST verify that the HITs in use correspond to the 1730 HITs that were received in the R1 packet that caused the 1731 transition to the I2-SENT state. 1733 3. The system MUST verify the HIP_MAC according to the procedures in 1734 Section 6.2. 1736 4. The system MUST re-evaluate the DH_GROUP_LIST, HIP_CIPHER, 1737 HIT_SUITE_LIST, and TRANSPORT_FORMAT_LIST parameters in the R2 1738 packet and compare the results against the chosen suites. 1740 5. If any of the checks above fail, there is a high probability of 1741 an ongoing man-in-the-middle or other security attack. The 1742 system SHOULD act accordingly, based on its local policy. 1744 6. The system MUST decrypt the keying material from the 1745 ENCRYPTED_KEY parameter. This keying material is a partial input 1746 to the key derivation process for the Pair-wise Key SA (see 1747 Section 6.3). 1749 7. Upon successful processing of the R2 packet, the state machine 1750 transitions to state ESTABLISHED. 1752 Note that step 4 (signature verification) from the original 1753 processing rules of HIPv2 has been replaced with a negotiation re- 1754 evaluation in the above processing rules for HIP DEX. Moreover, step 1755 6 has been added to the processing rules. 1757 6.9. Processing Incoming NOTIFY Packets 1759 Processing of NOTIFY packets is OPTIONAL. If processed, any errors 1760 in a received NOTIFICATION parameter SHOULD be logged. Received 1761 errors MUST be considered only as informational, and the receiver 1762 SHOULD NOT change its HIP state purely based on the received NOTIFY 1763 packet. 1765 If a NOTIFY packet is received in state I2-SENT, this packet may be 1766 an I2 reception acknowledgement of the optional retransmission 1767 mechanism extension and SHOULD be processed. The following steps 1768 define the conceptual processing rules for such incoming NOTIFY 1769 packets in state I2-SENT: 1771 1. The system MUST verify that the HITs in use correspond to the 1772 HITs that were received in the R1 packet that caused the 1773 transition to the I2-SENT state. If this check fails, the NOTIFY 1774 packet SHOULD be dropped silently. 1776 2. If the NOTIFY packet contains a NOTIFICATION parameter with 1777 Notify Message Type I2_ACKNOWLEDGEMENT, the system SHOULD set the 1778 I2 retransmission timer to the I2 processing time indicated in 1779 the NOTIFICATION parameter plus half the RTT-based timeout value. 1780 The system MUST NOT set the retransmission timeout to a higher 1781 value than allowed by a local policy. Moreover, the system 1782 SHOULD reset the I2 retransmission timer to the RTT-based timeout 1783 value after the next I2 retransmission. 1785 6.10. Processing UPDATE, CLOSE, and CLOSE_ACK Packets 1787 UPDATE, CLOSE, and CLOSE_ACK packets are handled similarly in HIP DEX 1788 as in HIPv2 (see Sections 6.11, 6.12, 6.14, and 6.15 of [RFC7401]). 1789 The only difference is the that the HIP_SIGNATURE is never present 1790 and, therefore, is not required to be processed by the receiving 1791 party. 1793 [RFC7402] specifies the rekeying of an existing HIP SA using the 1794 UPDATE message. This rekeying procedure can also be used with HIP 1795 DEX. However, where rekeying involves a new Diffie-Hellman key 1796 exchange, HIP DEX peers MUST establish a new HIP association in order 1797 to create a new Pair-wise Key SA due to the use of static ECDH key- 1798 pairs with HIP DEX. 1800 6.11. Handling State Loss 1802 Implementors MAY choose to use non-volatile, secure storage for HIP 1803 states in order for them to survive a system reboot. If no secure 1804 storage capabilities are available, the system SHOULD delete the 1805 corresponding HIP state, including the keying material. If the 1806 implementation does drop the state (as RECOMMENDED), it MUST also 1807 drop the peer's R1 generation counter value, unless a local policy 1808 explicitly defines that the value of that particular host is stored. 1809 Such storing of the R1 generation counter values MUST be configured 1810 by explicit HITs. 1812 7. HIP Policies 1814 There are a number of variables that will influence the HIP exchanges 1815 that each host must support. The value of #K used in the HIP R1 must 1816 be chosen with care. Values of #K that are too high will exclude 1817 clients with weak CPUs because these devices cannot solve the puzzle 1818 within a reasonable amount of time. #K should only be raised if a 1819 Responder is under high load, i.e., it cannot process all incoming 1820 HIP handshakes any more. If a Responder is not under high load, #K 1821 SHOULD be 0. 1823 All HIP DEX implementations SHOULD provide for an Access Control List 1824 (ACL), representing for which hosts they accept HIP diet exchanges, 1825 and the preferred transport format and local lifetimes. Wildcarding 1826 SHOULD be supported for such ACLs. 1828 8. Interoperability between HIP DEX and HIPv2 1830 HIP DEX and HIPv2 both use the same protocol number and packet 1831 formats. Hence, an implementation that either supports HIP DEX or 1832 HIPv2 must be able to detect the dialect that the peer is speaking. 1834 This section outlines how a HIP DEX implementation can achieve such 1835 detection for the two relevant cases where: 1837 1. the Initiator supports HIP DEX and the Responder supports HIP 1838 BEX, 1840 2. the Initiator supports HIP BEX and the Responder supports HIP 1841 DEX. 1843 In the first case, the HIP DEX implementation (Initiator) inspects 1844 the Responder's HIT prior to sending the I1 packet. If the OGA ID 1845 field of this HIT does not indicate the HIP DEX HIT Suite ID, the HIP 1846 DEX implementation cancels the handshake. If the Responder is 1847 unknown prior to sending the I1 packet (i.e., opportunistic mode), 1848 the HIP DEX implementation performs the above check on reception of 1849 the R1 packet and cancels the handshake in case of a negative result. 1850 In both failure scenarios, the implementation should report an error 1851 to the user via appropriate means. 1853 In the second case, the HIP DEX implementation (Responder) inspects 1854 the Initiator's HIT on reception of an I1 packet. If the OGA ID 1855 field of this HIT does not indicate the HIP DEX HIT Suite ID, the HIP 1856 DEX implementation cancels the handshake and sends an ICMP packet 1857 with type Parameter Problem, with the Pointer pointing to the source 1858 HIT, to the Initiator. 1860 Note that an implementation may also support both HIP DEX and HIPv2. 1861 It then uses the above procedure to determine the protocol variant 1862 that is supported by its handshake peer and performs the 1863 corresponding handshake. 1865 9. Security Considerations 1867 HIP DEX closely resembles HIPv2. As such, the security 1868 considerations discussed in Section 8 of [RFC7401] similarly apply to 1869 HIP DEX. HIP DEX, however, replaces the SIGMA-based authenticated 1870 Diffie-Hellman key exchange of HIPv2 with an exchange of random 1871 keying material that is encrypted with a Diffie-Hellman derived key. 1872 Both the Initiator and Responder contribute to this keying material. 1873 As a result, the following additional security considerations apply 1874 to HIP DEX: 1876 o The strength of the keys for the Pair-wise Key SA is based on the 1877 quality of the random keying material generated by the Initiator 1878 and the Responder. As either peer may be a sensor or an actuator 1879 device, there is a natural concern about the quality of its random 1880 number generator. 1882 o HIP DEX lacks the Perfect Forward Secrecy (PFS) property of HIPv2. 1883 Consequently, if an HI is compromised, all HIP connections 1884 protected with that HI are compromised. 1886 o The puzzle mechanism using CMAC may need further study regarding 1887 the level of difficulty. 1889 o The HIP DEX HIT generation may present new attack opportunities. 1890 Hence, HIP DEX HITs should not be use as the only means to 1891 identify a peer in an ACL. Instead, the use of the peer's HI is 1892 recommended. 1894 o The R1 packet is unauthenticated and offers an adversary a new 1895 attack vector against the Initiator. This is mitigated by only 1896 processing a received R1 packet when the Initiator has previously 1897 sent a corresponding I1 packet. Moreover, the Responder repeats 1898 the DH_GROUP_LIST, HIP_CIPHER, HIT_SUITE_LIST, and 1899 TRANSPORT_FORMAT_LIST parameters in the R2 packet in order to 1900 enable the Initiator to verify that these parameters have not been 1901 modified by an attacker in the unprotected R1 packet. 1903 The optional retransmission extension of HIP DEX is based on a NOTIFY 1904 packet that the Responder can use to inform the Initiator about the 1905 reception of an I2 packet. The Responder, however, cannot protect 1906 the authenticity of this packet as it did not yet set up the Master 1907 Key SA. Hence, an eavesdropping adversary may send spoofed reception 1908 acknowledgements for an overheard I2 packet and signal an arbitrary 1909 I2 processing time to the Initiator. The adversary can, e.g., 1910 indicate a lower I2 processing time than actually required by the 1911 Responder in order to cause premature retransmissions. To protect 1912 against this attack, the Initiator SHOULD set the NOTIFY-based 1913 timeout value to the maximum indicated packet processing time in case 1914 of conflicting NOTIFY packets. This allows the legitimate Responder 1915 to extend the retransmission timeout to the intended length. The 1916 adversary, however, can still arbitrarily delay the protocol 1917 handshake beyond the Responder's actual I2 processing time. To limit 1918 the extend of such a maliciously induced handshake delay, this 1919 specification additionally requires the Initiator not to set the 1920 NOTIFY-based timeout value higher than allowed by a local policy. 1922 10. IANA Considerations 1924 The following changes to the "Host Identity Protocol (HIP) 1925 Parameters" registries have been made: 1927 HIT Suite ID This document defines the new HIT Suite "ECDH/FOLD" 1928 (see Section 5.2.4). 1930 Parameter Type This document defines the new HIP parameter 1931 "ENCRYPTED_KEY" with type number 643 (see Section 5.2.5). 1933 HIP Cipher ID This document defines the new HIP Cipher ID "AES- 1934 128-CTR" (see Section 5.2.2). 1936 HI Algorithm This document defines the new HI Algorithm "ECDH" (see 1937 Section 5.2.3). 1939 ECC Curve Label This document specifies a new algorithm-specific 1940 subregistry named "ECDH Curve Label". The values for this 1941 subregistry are defined in Section 5.2.1. 1943 11. Acknowledgments 1945 The drive to put HIP on a cryptographic 'Diet' came out of a number 1946 of discussions with sensor vendors at IEEE 802.15 meetings. David 1947 McGrew was very helpful in crafting this document. Special thanks to 1948 Miika Komu for reviewing this document in the context of Convince 1949 Celtic+ project. 1951 12. Changelog 1953 This section summarizes the changes made from draft-moskowitz-hip-rg- 1954 dex-05, which was the first stable version of the draft. Note that 1955 the draft was renamed after draft-moskowitz-hip-rg-dex-06. 1957 The draft was then renamed from draft-moskowitz-hip-dex to draft- 1958 ietf-hip-dex. 1960 12.1. Changes in draft-ietf-hip-dex-04 1962 o Added new paragraph on rekeying procedure with HIP DEX. 1964 o Updated references. 1966 o Editorial changes. 1968 12.2. Changes in draft-ietf-hip-dex-03 1970 o Added new section on HIP DEX/HIPv2 interoperability 1972 o Added reference to RFC4493 for CMAC. 1974 o Added reference to RFC5869 for CKDF. 1976 o Added processing of NOTIFY message in I2-SENT of state diagram. 1978 o Editorial changes. 1980 12.3. Changes in draft-ietf-hip-dex-02 1982 o Author address change. 1984 12.4. Changes in draft-ietf-hip-dex-01 1986 o Added the new ECDH groups of Curve25519 and Curve448 from RFC 1987 7748. 1989 12.5. Changes in draft-ietf-hip-dex-00 1991 o The Internet Draft was adopted by the HIP WG. 1993 12.6. Changes in draft-moskowitz-hip-rg-dex-06 1995 o A major change in the ENCRYPT parameter to use AES-CTR rather than 1996 AES-CBC. 1998 12.7. Changes in draft-moskowitz-hip-dex-00 2000 o Draft name change. HIPRG ended in IRTF, HIP DEX is now individual 2001 submission. 2003 o Added the change section. 2005 o Added a Definitions section. 2007 o Changed I2 and R2 packets to reflect use of AES-CTR for 2008 ENCRYPTED_KEY parameter. 2010 o Cleaned up KEYMAT Generation text. 2012 o Added Appendix with C code for the ECDH shared secret generation 2013 on an 8 bit processor. 2015 12.8. Changes in draft-moskowitz-hip-dex-01 2017 o Numerous editorial changes. 2019 o New retransmission strategy. 2021 o New HIT generation mechanism. 2023 o Modified layout of ENCRYPTED_KEY parameter. 2025 o Clarify to use puzzle difficulty of zero under normal network 2026 conditions. 2028 o Align inclusion directive of R1_COUNTER with HIPv2 (from SHOULD to 2029 MUST). 2031 o Align inclusion of TRANSPORT_FORMAT_LIST with HIPv2 (added to R1 2032 and I2). 2034 o HIP_CIPHER, HIT_SUITE_LIST, and TRANSPORT_FORMAT_LIST must now be 2035 echoed in R2 packet. 2037 o Added new author. 2039 12.9. Changes in draft-moskowitz-hip-dex-02 2041 o Introduced formal definition of FOLD function. 2043 o Clarified use of CMAC for puzzle computation in section "Solving 2044 the Puzzle". 2046 o Several editorial changes. 2048 12.10. Changes in draft-moskowitz-hip-dex-03 2050 o Addressed HI crypto agility. 2052 o Clarified purpose of secret exchanged via ENCRYPTED_KEY parameter. 2054 o Extended the IV in the ENCRYPTED_KEY parameter. 2056 o Introduced forward-references to HIP DEX KEYMAT process and 2057 improved KEYMAT section. 2059 o Replaced Appendix A on "C code for ECC point multiplication" with 2060 short discussion in introduction. 2062 o Updated references. 2064 o Further editorial changes. 2066 12.11. Changes in draft-moskowitz-hip-dex-04 2068 o Improved retransmission extension. 2070 o Updated and strongly revised packet processing rules. 2072 o Updated security considerations. 2074 o Updated IANA considerations. 2076 o Move the HI Algorithm for ECDH to a value of 11. 2078 o Many editorial changes. 2080 13. References 2082 13.1. Normative References 2084 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2085 Requirement Levels", BCP 14, RFC 2119, 2086 DOI 10.17487/RFC2119, March 1997, 2087 . 2089 [RFC2410] Glenn, R. and S. Kent, "The NULL Encryption Algorithm and 2090 Its Use With IPsec", RFC 2410, DOI 10.17487/RFC2410, 2091 November 1998, . 2093 [RFC3686] Housley, R., "Using Advanced Encryption Standard (AES) 2094 Counter Mode With IPsec Encapsulating Security Payload 2095 (ESP)", RFC 3686, DOI 10.17487/RFC3686, January 2004, 2096 . 2098 [RFC4443] Conta, A., Deering, S., and M. Gupta, Ed., "Internet 2099 Control Message Protocol (ICMPv6) for the Internet 2100 Protocol Version 6 (IPv6) Specification", RFC 4443, 2101 DOI 10.17487/RFC4443, March 2006, 2102 . 2104 [RFC7343] Laganier, J. and F. Dupont, "An IPv6 Prefix for Overlay 2105 Routable Cryptographic Hash Identifiers Version 2 2106 (ORCHIDv2)", RFC 7343, DOI 10.17487/RFC7343, September 2107 2014, . 2109 [RFC7401] Moskowitz, R., Ed., Heer, T., Jokela, P., and T. 2110 Henderson, "Host Identity Protocol Version 2 (HIPv2)", 2111 RFC 7401, DOI 10.17487/RFC7401, April 2015, 2112 . 2114 [RFC7402] Jokela, P., Moskowitz, R., and J. Melen, "Using the 2115 Encapsulating Security Payload (ESP) Transport Format with 2116 the Host Identity Protocol (HIP)", RFC 7402, 2117 DOI 10.17487/RFC7402, April 2015, 2118 . 2120 13.2. Informative References 2122 [DH76] Diffie, W. and M. Hellman, "New Directions in 2123 Cryptography", IEEE Transactions on Information 2124 Theory vol. IT-22, number 6, pages 644-654, Nov 1976. 2126 [HWZ13] Hummen, R., Wirtz, H., Ziegeldorf, J., Hiller, J., and K. 2127 Wehrle, "Tailoring End-to-End IP Security Protocols to the 2128 Internet of Things", in Proceedings of IEEE International 2129 Conference on Network Protocols (ICNP 2013), October 2013. 2131 [I-D.ietf-hip-rfc4423-bis] 2132 Moskowitz, R. and M. Komu, "Host Identity Protocol 2133 Architecture", draft-ietf-hip-rfc4423-bis-14 (work in 2134 progress), June 2016. 2136 [IEEE.802-11.2007] 2137 "Information technology - Telecommunications and 2138 information exchange between systems - Local and 2139 metropolitan area networks - Specific requirements - Part 2140 11: Wireless LAN Medium Access Control (MAC) and Physical 2141 Layer (PHY) Specifications", IEEE Standard 802.11, June 2142 2007, . 2145 [IEEE.802-15-4.2011] 2146 "Information technology - Telecommunications and 2147 information exchange between systems - Local and 2148 metropolitan area networks - Specific requirements - Part 2149 15.4: Wireless Medium Access Control (MAC) and Physical 2150 Layer (PHY) Specifications for Low-Rate Wireless Personal 2151 Area Networks (WPANs)", IEEE Standard 802.15.4, September 2152 2011, . 2155 [LN08] Liu, A. and H. Ning, "TinyECC: A Configurable Library for 2156 Elliptic Curve Cryptography in Wireless Sensor Networks", 2157 in Proceedings of International Conference on Information 2158 Processing in Sensor Networks (IPSN 2008), April 2008. 2160 [RFC4493] Song, JH., Poovendran, R., Lee, J., and T. Iwata, "The 2161 AES-CMAC Algorithm", RFC 4493, DOI 10.17487/RFC4493, June 2162 2006, . 2164 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 2165 Key Derivation Function (HKDF)", RFC 5869, 2166 DOI 10.17487/RFC5869, May 2010, 2167 . 2169 [RFC5903] Fu, D. and J. Solinas, "Elliptic Curve Groups modulo a 2170 Prime (ECP Groups) for IKE and IKEv2", RFC 5903, 2171 DOI 10.17487/RFC5903, June 2010, 2172 . 2174 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 2175 Curve Cryptography Algorithms", RFC 6090, 2176 DOI 10.17487/RFC6090, February 2011, 2177 . 2179 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 2180 Constrained-Node Networks", RFC 7228, 2181 DOI 10.17487/RFC7228, May 2014, 2182 . 2184 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 2185 Kivinen, "Internet Key Exchange Protocol Version 2 2186 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 2187 2014, . 2189 [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves 2190 for Security", RFC 7748, DOI 10.17487/RFC7748, January 2191 2016, . 2193 [SECG] SECG, "Recommended Elliptic Curve Domain Parameters", SEC 2194 2 , 2000, . 2196 Appendix A. Password-based two-factor authentication during the HIP DEX 2197 handshake 2199 HIP DEX allows to identify authorized connections based on a two- 2200 factor authentication mechanism. With two-factor authentication, 2201 devices that are authorized to communicate with each other are 2202 required to be pre-provisioned with a shared (group) key. The 2203 Initiator uses this pre-provisioned key to encrypt the 2204 ECHO_RESPONSE_UNSIGNED in the I2 packet. Upon reception of the I2, 2205 the Responder verifies that its challenge in the 2206 ECHO_REQUEST_UNSIGNED parameter in the R1 packet has been encrypted 2207 with the correct key. If verified successfully, the Responder 2208 proceeds with the handshake. Otherwise, it silently drops the I2 2209 packet. 2211 Note that there is no explicit signaling in the HIP DEX handshake for 2212 this behavior. Thus, knowledge of two-factor authentication must be 2213 configured externally prior to the handshake. 2215 Authors' Addresses 2217 Robert Moskowitz (editor) 2218 HTT Consulting 2219 Oak Park, MI 2220 USA 2222 EMail: rgm@htt-consult.com 2224 Rene Hummen 2225 Hirschmann Automation and Control 2226 Stuttgarter Strasse 45-51 2227 Neckartenzlingen 72654 2228 Germany 2230 EMail: rene.hummen@belden.com