idnits 2.17.1 draft-ietf-hip-dex-09.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 (September 25, 2019) is 1672 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) ** Downref: Normative reference to an Experimental RFC: RFC 6261 Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 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: March 28, 2020 Hirschmann Automation and Control 6 M. Komu 7 Ericsson 8 September 25, 2019 10 HIP Diet EXchange (DEX) 11 draft-ietf-hip-dex-09 13 Abstract 15 This document specifies the Host Identity Protocol Diet EXchange (HIP 16 DEX), a variant of the Host Identity Protocol Version 2 (HIPv2). The 17 HIP DEX protocol design aims at reducing the overhead of the employed 18 cryptographic primitives by omitting public-key signatures and hash 19 functions. 21 The HIP DEX protocol is primarily designed for computation or memory- 22 constrained sensor/actuator devices. Like HIPv2, it is expected to 23 be used together with a suitable security protocol such as the 24 Encapsulated Security Payload (ESP) for the protection of upper layer 25 protocol data. In addition, HIP DEX can also be used as a keying 26 mechanism for security primitives at the MAC layer, e.g., for IEEE 27 802.15.4 networks. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on March 28, 2020. 46 Copyright Notice 48 Copyright (c) 2019 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (https://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 64 1.1. The HIP Diet EXchange (DEX) . . . . . . . . . . . . . . . 5 65 1.2. Memo Structure . . . . . . . . . . . . . . . . . . . . . 6 66 2. Terms, Notation and Definitions . . . . . . . . . . . . . . . 6 67 2.1. Requirements Terminology . . . . . . . . . . . . . . . . 6 68 2.2. Notation . . . . . . . . . . . . . . . . . . . . . . . . 6 69 2.3. Definitions . . . . . . . . . . . . . . . . . . . . . . . 7 70 3. Host Identity (HI) and its Structure . . . . . . . . . . . . 8 71 3.1. Host Identity Tag (HIT) . . . . . . . . . . . . . . . . . 9 72 3.2. Generating a HIT from an HI . . . . . . . . . . . . . . . 9 73 4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 9 74 4.1. Creating a HIP Association . . . . . . . . . . . . . . . 10 75 4.1.1. HIP Puzzle Mechanism . . . . . . . . . . . . . . . . 11 76 4.1.2. HIP State Machine . . . . . . . . . . . . . . . . . . 12 77 4.1.3. HIP DEX Security Associations . . . . . . . . . . . . 16 78 4.1.4. User Data Considerations . . . . . . . . . . . . . . 17 79 5. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . 17 80 5.1. Payload Format . . . . . . . . . . . . . . . . . . . . . 17 81 5.2. HIP Parameters . . . . . . . . . . . . . . . . . . . . . 17 82 5.2.1. DH_GROUP_LIST . . . . . . . . . . . . . . . . . . . . 18 83 5.2.2. HIP_CIPHER . . . . . . . . . . . . . . . . . . . . . 18 84 5.2.3. HOST_ID . . . . . . . . . . . . . . . . . . . . . . . 19 85 5.2.4. HIT_SUITE_LIST . . . . . . . . . . . . . . . . . . . 19 86 5.2.5. ENCRYPTED_KEY . . . . . . . . . . . . . . . . . . . . 20 87 5.3. HIP Packets . . . . . . . . . . . . . . . . . . . . . . . 20 88 5.3.1. I1 - the HIP Initiator Packet . . . . . . . . . . . . 21 89 5.3.2. R1 - the HIP Responder Packet . . . . . . . . . . . . 22 90 5.3.3. I2 - the Second HIP Initiator Packet . . . . . . . . 24 91 5.3.4. R2 - the Second HIP Responder Packet . . . . . . . . 25 92 5.4. ICMP Messages . . . . . . . . . . . . . . . . . . . . . . 26 93 6. Packet Processing . . . . . . . . . . . . . . . . . . . . . . 26 94 6.1. Solving the Puzzle . . . . . . . . . . . . . . . . . . . 27 95 6.2. HIP_MAC Calculation and Verification . . . . . . . . . . 27 96 6.2.1. CMAC Calculation . . . . . . . . . . . . . . . . . . 27 97 6.3. HIP DEX KEYMAT Generation . . . . . . . . . . . . . . . . 28 98 6.4. Initiation of a HIP Diet EXchange . . . . . . . . . . . . 31 99 6.5. Processing Incoming I1 Packets . . . . . . . . . . . . . 31 100 6.6. Processing Incoming R1 Packets . . . . . . . . . . . . . 32 101 6.7. Processing Incoming I2 Packets . . . . . . . . . . . . . 35 102 6.8. Processing Incoming R2 Packets . . . . . . . . . . . . . 38 103 6.9. Processing Incoming NOTIFY Packets . . . . . . . . . . . 39 104 6.10. Processing UPDATE, CLOSE, and CLOSE_ACK Packets . . . . . 40 105 6.11. Handling State Loss . . . . . . . . . . . . . . . . . . . 40 106 7. HIP Policies . . . . . . . . . . . . . . . . . . . . . . . . 40 107 8. Interoperability between HIP DEX and HIPv2 . . . . . . . . . 41 108 9. Security Considerations . . . . . . . . . . . . . . . . . . . 41 109 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 43 110 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 43 111 12. Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . 44 112 12.1. Changes in draft-ietf-hip-dex-09 . . . . . . . . . . . . 44 113 12.2. Changes in draft-ietf-hip-dex-05 . . . . . . . . . . . . 44 114 12.3. Changes in draft-ietf-hip-dex-04 . . . . . . . . . . . . 44 115 12.4. Changes in draft-ietf-hip-dex-03 . . . . . . . . . . . . 44 116 12.5. Changes in draft-ietf-hip-dex-02 . . . . . . . . . . . . 45 117 12.6. Changes in draft-ietf-hip-dex-01 . . . . . . . . . . . . 45 118 12.7. Changes in draft-ietf-hip-dex-00 . . . . . . . . . . . . 45 119 12.8. Changes in draft-moskowitz-hip-rg-dex-06 . . . . . . . . 45 120 12.9. Changes in draft-moskowitz-hip-dex-00 . . . . . . . . . 45 121 12.10. Changes in draft-moskowitz-hip-dex-01 . . . . . . . . . 45 122 12.11. Changes in draft-moskowitz-hip-dex-02 . . . . . . . . . 46 123 12.12. Changes in draft-moskowitz-hip-dex-03 . . . . . . . . . 46 124 12.13. Changes in draft-moskowitz-hip-dex-04 . . . . . . . . . 46 125 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 47 126 13.1. Normative References . . . . . . . . . . . . . . . . . . 47 127 13.2. Informative References . . . . . . . . . . . . . . . . . 48 128 Appendix A. Password-based two-factor authentication during the 129 HIP DEX handshake . . . . . . . . . . . . . . . . . 50 130 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 50 132 1. Introduction 134 This document specifies the Host Identity Protocol Diet EXchange (HIP 135 DEX). HIP DEX builds on the Base EXchange (BEX) of the Host Identity 136 Protocol Version 2 (HIPv2) [RFC7401]. HIP DEX preserves the protocol 137 semantics as well as the general packet structure of HIPv2. Hence, 138 it is recommended that [RFC7401] is well-understood before reading 139 this document. 141 The main differences between HIP BEX and HIP DEX are: 143 1. HIP DEX uses a different set of cryptographic primitives compared 144 to HIP BEX with the goal to reduce the protocol overhead: 146 * Peer authentication and key agreement in HIP DEX are based on 147 static Elliptic Curve Diffie-Hellman (ECDH) key pairs. This 148 replaces the use of public-key signatures and ephemeral 149 Diffie-Hellman key pairs in HIPv2. 151 * HIP DEX uses AES-CTR for symmetric-key encryption and AES-CMAC 152 as its MACing function. In contrast, HIPv2 currently supports 153 AES-CBC for encryption and HMAC-SHA-1, HMAC-SHA-256, or HMAC- 154 SHA-384 for MACing. 156 * HIP DEX defines a simple fold function to efficiently generate 157 HITs, whereas the HIT generation of HIPv2 is based on SHA-1, 158 SHA-256, or SHA-384. 160 2. HIP DEX forfeits the HIPv2 Perfect Forward Secrecy property of 161 HIPv2 due to the removal of the ephemeral Diffie-Hellman key 162 agreement. 164 3. HIP DEX forfeits the use of digital signatures with the removal 165 of a hash function. Peer authentication with HIP DEX, therefore, 166 is based on the use of the ECDH derived key in the HIP_MAC 167 parameter. 169 4. With HIP DEX, the ECDH derived key is only used to protect HIP 170 packets. Separate session key(s) are used to protect the 171 transmission of upper layer protocol data. These session key(s) 172 are established via a new secret exchange during the handshake. 174 5. HIP DEX introduced a new, optional retransmission strategy that 175 is specifically designed to handle potentially extensive 176 processing times of the employed cryptographic operations on 177 computationally constrained devices. 179 By eliminating the need for public-key signatures and the ephemeral 180 DH key agreement, HIP DEX reduces the computational, energy, 181 transmission, and memory requirements for public-key cryptography 182 (see [LN08]) in the HIPv2 protocol design. This makes HIP DEX 183 especially suitable for constrained devices as defined in [RFC7228]. 185 This document focuses on the protocol specifications related to 186 differences between HIP BEX and HIP DEX. Where differences are not 187 called out explicitly, the protocol specification of HIP DEX is the 188 same as defined in [RFC7401]. 190 1.1. The HIP Diet EXchange (DEX) 192 The HIP Diet EXchange is a two-party cryptographic protocol used to 193 establish a secure communication context between hosts. The first 194 party is called the Initiator and the second party the Responder. 195 The four-packet exchange helps to make HIP DEX Denial of Service 196 (DoS) resilient. The Initiator and the Responder exchange their 197 static Elliptic Curve Diffie-Hellman (ECDH) keys in the R1 and I2 198 handshake packet. The parties then authenticate each other in the I2 199 and R2 handshake packet based on the ECDH-derived keying material. 200 The Initiator and the Responder additionally transmit keying material 201 for the session key in these last two handshake packets (I2 and R2). 202 This is to prevent overuse of the static ECDH-derived keying 203 material. Moreover, the Responder starts a puzzle exchange in the R1 204 packet and the Initiator completes this exchange in the I2 packet 205 before the Responder performs computationally expensive operations or 206 stores any state from the exchange. Given this handshake structure, 207 HIP DEX operationally is very similar to HIP BEX. Moreover, the 208 employed model is also fairly equivalent to 802.11-2007 209 [IEEE.802-11.2007] Master Key and Pair-wise Transient Key, but 210 handled in a single exchange. 212 HIP DEX does not have the option to encrypt the Host Identity of the 213 Initiator in the I2 packet. The Responder's Host Identity also is 214 not protected. Thus, contrary to HIPv2, HIP DEX does not provide for 215 end-point anonymity and any signaling (i.e., HOST_ID parameter 216 contained with an ENCRYPTED parameter) that indicates such anonymity 217 should be ignored. 219 As in [RFC7401], data packets start to flow after the R2 packet. The 220 I2 and R2 packets may carry a data payload in the future. However, 221 the details of this may be defined later. 223 An existing HIP association can be updated with the update mechanism 224 defined in [RFC7401]. Likewise, the association can be torn down 225 with the defined closing mechanism for HIPv2 if it is no longer 226 needed. In doing so, HIP DEX omits the HIP_SIGNATURE parameters of 227 the original HIPv2 specification. 229 Finally, HIP DEX is designed as an end-to-end authentication and key 230 establishment protocol. As such, it can be used in combination with 231 Encapsulated Security Payload (ESP) [RFC7402] as well as with other 232 end-to-end security protocols. In addition, HIP DEX can also be used 233 as a keying mechanism for security primitives at the MAC layer, e.g., 234 for IEEE 802.15.4 networks [IEEE.802-15-4.2011]. It is worth 235 mentioning that the HIP DEX base protocol does not cover all the 236 fine-grained policy control found in Internet Key Exchange Version 2 237 (IKEv2) [RFC7296] that allows IKEv2 to support complex gateway 238 policies. Thus, HIP DEX is not a replacement for IKEv2. 240 1.2. Memo Structure 242 The rest of this memo is structured as follows. Section 2 defines 243 the central keywords, notation, and terms used throughout this 244 document. Section 3 defines the structure of the Host Identity and 245 its various representations. Section 4 gives an overview of the HIP 246 Diet EXchange protocol. Sections 5 and 6 define the detailed packet 247 formats and rules for packet processing. Finally, Sections 7, 8, 9, 248 and 10 discuss policy, interoperability between HIPv2 vs DEX, 249 security, and IANA considerations, respectively. 251 2. Terms, Notation and Definitions 253 2.1. Requirements Terminology 255 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 256 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 257 "OPTIONAL" in this document are to be interpreted as described in BCP 258 14 [RFC2119] [RFC8174] when, and only when, they appear in all 259 capitals, as shown here. 261 2.2. Notation 263 [x] indicates that x is optional. 265 {x} indicates that x is encrypted. 267 X(y) indicates that y is a parameter of X. 269 i indicates that x exists i times. 271 --> signifies "Initiator to Responder" communication (requests). 273 <-- signifies "Responder to Initiator" communication (replies). 275 | signifies concatenation of information - e.g., X | Y is the 276 concatenation of X and Y. 278 FOLD (X, K) denotes the partitioning of X into n K-bit segments and 279 the iterative folding of these segments via XOR. I.e., X = x_1, 280 x_2, ..., x_n, where x_i is of length K and the last segment x_n 281 is padded to length K by appending 0 bits. FOLD then is computed 282 as FOLD(X, K) = t_n, where t_i = t_i-1 XOR x_i and t_1 = x_1. 284 Ltrunc (M(x), K) denotes the lowest order K bits of the result of 285 the MAC function M on the input x. 287 sort (HIT-I | HIT-R) sort(HIT-I | HIT-R) is defined as the network 288 byte order concatenation of the two HITs, with the smaller HIT 289 preceding the larger HIT, resulting from the numeric comparison of 290 the two HITs interpreted as positive (unsigned) 128-bit integers 291 in network byte order. 293 2.3. Definitions 295 HIP Diet Exchange (DEX): The ECDH-based HIP handshake for 296 establishing a new HIP association. 298 Host Identity (HI): The static ECDH public key that represents the 299 identity of the host. In HIP DEX, a host proves ownership of the 300 private key belonging to its HI by creating a HIP_MAC with the 301 derived ECDH key (see Section 3). 303 Host Identity Tag (HIT): A shorthand for the HI in IPv6 format. It 304 is generated by folding the HI (see Section 3). 306 HIT Suite: A HIT Suite groups all algorithms that are required to 307 generate and use an HI and its HIT. In particular, these 308 algorithms are: 1) ECDH and 2) FOLD. 310 HIP association: The shared state between two peers after completion 311 of the HIP DEX handshake. 313 Initiator: The host that initiates the HIP DEX handshake. This role 314 is typically forgotten once the handshake is completed. 316 Responder: The host that responds to the Initiator in the HIP DEX 317 handshake. This role is typically forgotten once the handshake is 318 completed. 320 Responder's HIT Hash Algorithm (RHASH): In HIP DEX, RHASH is 321 redefined as CMAC. Still, note that CMAC is a message 322 authentication code (MAC) and not a cryptographic hash function. 323 Thus, a mapping from CMAC(x,y) to RHASH(z) must be defined where 324 RHASH is used. Moreover, RHASH has different security properties 325 in HIP DEX and is not used for HIT generation. 327 Length of the Responder's HIT Hash Algorithm (RHASH_len): The 328 natural output length of RHASH in bits. 330 CMAC: The Cipher-based Message Authentication Code with the 128-bit 331 Advanced Encryption Standard (AES) defined in RFC 4493 [RFC4493]. 333 CKDF: CMAC-based Key Derivation Function. 335 Nonce #I: Nonce #I refers to the corresponding field in the PUZZLE 336 parameter (see section 5.2.4 in [RFC7401]. It is also referred to 337 as "random value #I" in this document. 339 Puzzle difficulty K: The Initiator has to compute a solution for the 340 puzzle. The level of computational difficulty is denoted by the 341 #K field in the puzzle parameter (see section 5.2.4 in [RFC7401]. 343 3. Host Identity (HI) and its Structure 345 In this section, the properties of the Host Identity and Host 346 Identity Tag are discussed, and the exact format for them is defined. 347 In HIP, the public key of an asymmetric key pair is used as the Host 348 Identity (HI). Correspondingly, the host itself is defined as the 349 entity that holds the private key of the key pair. See the HIP 350 architecture specification [I-D.ietf-hip-rfc4423-bis] for more 351 details on the difference between an identity and the corresponding 352 identifier. 354 HIP DEX implementations MUST support the Elliptic Curve Diffie- 355 Hellman (ECDH) [RFC6090] key exchange for generating the HI as 356 defined in Section 5.2.3. No additional algorithms are supported at 357 this time. 359 A compressed encoding of the HI, the Host Identity Tag (HIT), is used 360 in the handshake packets to represent the HI. The DEX Host Identity 361 Tag (HIT) is different from the BEX HIT in two ways: 363 o The HIT suite ID MUST only be a DEX HIT ID (see Section 5.2.4). 365 o The DEX HIT is not generated via a cryptographic hash. Rather, it 366 is a compression of the HI. 368 Due to the latter property, an attacker may be able to find a 369 collision with a HIT that is in use. Hence, policy decisions such as 370 access control MUST NOT be based solely on the HIT. Instead, the HI 371 of a host SHOULD be considered. 373 Carrying HIs and HITs in the header of user data packets would 374 increase the overhead of packets. Thus, it is not expected that 375 these parameters are carried in every packet, but other methods are 376 used to map the data packets to the corresponding HIs. In some 377 cases, this allows to use HIP DEX without any additional headers in 378 the user data packets. For example, if ESP is used to protect data 379 traffic, the Security Parameter Index (SPI) carried in the ESP header 380 can be used to map the encrypted data packet to the correct HIP DEX 381 association. When other user data packet formats are used, the 382 corresponding extensions need to define a replacement for the 383 ESP_TRANSFORM [RFC7402] parameter along with associated semantics, 384 but this procedure is outside the scope of this document. 386 3.1. Host Identity Tag (HIT) 388 With HIP DEX, the HIT is a 128-bit value - a compression of the HI 389 prepended with a specific prefix. There are two advantages of using 390 a hashed encoding over the actual variable-sized public key in 391 protocols. First, the fixed length of the HIT keeps packet sizes 392 manageable and eases protocol coding. Second, it presents a 393 consistent format for the protocol, independent of the underlying 394 identity technology in use. 396 The structure of the HIT is based on RFC 7343 [RFC7343], called 397 Overlay Routable Cryptographic Hash Identifiers (ORCHIDs), and 398 consists of three parts: first, an IANA assigned prefix to 399 distinguish it from other IPv6 addresses. Second, a four-bit 400 encoding of the algorithms that were used for generating the HI and 401 the compressed representation of the HI. Third, a 96-bit hashed 402 representation of the HI. In contrast to HIPv2, HIP DEX employs HITs 403 that are NOT generated by means of a cryptographic hash. Instead, 404 the HI is compressed to 96 bits as defined in the following section. 406 3.2. Generating a HIT from an HI 408 The HIT does not follow the exact semantics of an ORCHID as there is 409 no hash function in HIP DEX. Still, its structure is strongly 410 aligned with the ORCHID design. The same IPv6 prefix used in HIPv2 411 is used for HIP DEX. The HIP DEX HIT suite (see Section 10) is used 412 for the four bits of the Orchid Generation Algorithm (OGA) field in 413 the ORCHID. The hash representation in an ORCHID is replaced with 414 FOLD(HI,96). 416 4. Protocol Overview 418 This section gives a simplified overview of the HIP DEX protocol 419 operation and does not contain all the details of the packet formats 420 or the packet processing steps. Section 5 and Section 6 describe 421 these aspects in more detail and are normative in case of any 422 conflicts with this section. Importantly, the information given in 423 this section focuses on the differences between the HIPv2 and HIP DEX 424 protocol specifications. 426 4.1. Creating a HIP Association 428 By definition, the system initiating a HIP Diet EXchange is the 429 Initiator, and the peer is the Responder. This distinction is 430 typically forgotten once the handshake completes, and either party 431 can become the Initiator in future communications. 433 The HIP Diet EXchange serves to manage the establishment of state 434 between an Initiator and a Responder. The first packet, I1, 435 initiates the exchange, and the last three packets, R1, I2, and R2, 436 constitute an authenticated Diffie-Hellman [DH76] key exchange for 437 the Master Key SA generation. This Master Key SA is used by the 438 Initiator and the Responder to wrap secret keying material in the I2 439 and R2 packets. Based on the exchanged keying material, the peers 440 then derive a Pair-wise Key SA if cryptographic keys are needed, 441 e.g., for ESP-based protection of user data. 443 The Initiator first sends a trigger packet, I1, to the Responder. 444 This packet contains the HIT of the Initiator and the HIT of the 445 Responder, if it is known. Moreover, the I1 packet initializes the 446 negotiation of the Diffie-Hellman group that is used for generating 447 the the Master Key SA. Therefore, the I1 packet contains a list of 448 Diffie-Hellman Group IDs supported by the Initiator. Note that in 449 some cases it may be possible to replace this trigger packet by some 450 other form of a trigger, in which case the protocol starts with the 451 Responder sending the R1 packet. In such cases, another mechanism to 452 convey the Initiator's supported DH Groups (e.g., by using a default 453 group) must be specified. 455 The second packet, R1, starts the actual authenticated Diffie-Hellman 456 key exchange. It contains a puzzle - a cryptographic challenge that 457 the Initiator must solve before continuing the exchange. The level 458 of difficulty of the puzzle can be adjusted based on level of trust 459 with the Initiator, current load, or other factors. In addition, the 460 R1 contains the Responder's Diffie-Hellman parameter and lists of 461 cryptographic algorithms supported by the Responder. Based on these 462 lists, the Initiator can continue, abort, or restart the handshake 463 with a different selection of cryptographic algorithms. 465 In the I2 packet, the Initiator MUST display the solution to the 466 received puzzle. Without a correct solution, the I2 packet is 467 discarded. The I2 also contains a key wrap parameter that carries 468 secret keying material of the Initiator. This keying material is 469 only half of the final session key. The packet is authenticated by 470 the sender (Initiator) via a MAC. 472 The R2 packet acknowledges the receipt of the I2 packet and completes 473 the handshake. The R2 contains a key wrap parameter that carries the 474 rest of the keying material of the Responder. The packet is 475 authenticated by the sender (Responder) via a MAC. 477 The HIP DEX handshake is illustrated below. The terms "ENC(DH,x)" 478 and "ENC(DH,y)" refer to the random values x and y that are wrapped 479 based on the Master Key SA (indicated by ENC and DH). Note that x 480 and y each constitute half of the final session key material. The 481 packets also contain other parameters that are not shown in this 482 figure. 484 Initiator Responder 486 I1: 487 ---------------------------------> 488 remain stateless 489 R1: puzzle, HI 490 <-------------------------------- 491 solve puzzle 492 perform ECDH 493 encrypt x 494 I2: solution, HI, ENC(DH,x), mac 495 ---------------------------------> 496 check puzzle 497 perform ECDH 498 check MAC 499 decrypt x 500 encrypt y 501 R2: ENC(DH,y), mac 502 <--------------------------------- 503 check MAC 504 decrypt y 506 Figure 1: High-level overview of the HIP Diet EXchange 508 4.1.1. HIP Puzzle Mechanism 510 The purpose of the HIP puzzle mechanism is to protect the Responder 511 from a number of denial-of-service threats. It allows the Responder 512 to delay state creation until receiving the I2 packet. Furthermore, 513 the puzzle allows the Responder to use a fairly cheap calculation to 514 check that the Initiator is "sincere" in the sense that it has 515 churned enough CPU cycles in solving the puzzle. 517 The puzzle mechanism enables a Responder to immediately reject an I2 518 packet if it does not contain a valid puzzle solution. To verify the 519 puzzle solution, the Responder only has to compute a single CMAC 520 operation. After a successful puzzle verification, the Responder can 521 securely create session-specific state and perform CPU-intensive 522 operations such as a Diffie-Hellman key generation. By varying the 523 difficulty of the puzzle, the Responder can frustrate CPU or memory 524 targeted DoS attacks. Under normal network conditions, the puzzle 525 difficulty SHOULD be zero, thus effectively reverting the puzzle 526 mechanism to a cookie-based DoS protection mechanism. Without 527 setting the puzzle difficulty to zero under normal network 528 conditions, potentially scarce computation resources at the Initiator 529 would be churned unnecessarily. 531 Conceptually, the puzzle mechanism in HIP DEX is the same as in 532 HIPv2. Hence, this document refers to Sections 4.1.1 and 4.1.2 in 533 [RFC7401] for more detailed information about the employed mechanism. 534 Notably, the only differences between the puzzle mechanism in HIP DEX 535 and HIPv2 are that HIP DEX does not employ pre-computation of R1 536 packets and uses CMAC instead of a hash function for solving and 537 verifying a puzzle. The implications of these changes on the puzzle 538 implementation are discussed in Section 6.1. 540 4.1.2. HIP State Machine 542 The HIP DEX state machine has the same states as the HIPv2 state 543 machine (see 4.4. in [RFC7401]). However, HIP DEX features a 544 retransmission strategy with an optional reception acknowledgement 545 for the I2 packet. The goal of this additional acknowledgement is to 546 reduce premature I2 retransmissions in case of devices with low 547 computation resources [HWZ13]. As a result, there are minor changes 548 regarding the transitions in the HIP DEX state machine. The 549 following section documents these differences compared to HIPv2. 551 4.1.2.1. HIP DEX Retransmission Mechanism 553 For the retransmission of I1 and I2 packets, the Initiator adopts the 554 retransmission strategy of HIPv2 (see Section 4.4.3. in [RFC7401]). 555 This strategy is based on a timeout that is set to a value larger 556 than the worst-case anticipated round-trip time (RTT). For each 557 received I1 or I2 packet, the Responder sends an R1 or R2 packet, 558 respectively. This design trait enables the Responder to remain 559 stateless until the reception and successful processing of the I2 560 packet. The Initiator stops retransmitting I1 or I2 packets after 561 the reception of the corresponding R1 or R2. If the Initiator did 562 not receive an R1 packet after I1_RETRIES_MAX tries, it stops I1 563 retransmissions. Likewise, it stops retransmitting the I2 packet 564 after I2_RETRIES_MAX unsuccessful tries. 566 For repeatedly received I2 packets, the Responder SHOULD NOT perform 567 operations related to the Diffie-Hellman key exchange or the keying 568 material wrapped in the ENCRYPTED_KEY parameters. Instead, it SHOULD 569 re-use the previously established state to re-create the 570 corresponding R2 packet in order to prevent unnecessary computation 571 overhead. 573 The potentially high processing time of an I2 packet at a (resource- 574 constrained) Responder may cause premature retransmissions if the 575 time required for I2 transmission and processing exceeds the RTT- 576 based retransmission timeout. Thus, the Initiator should also take 577 the processing time of the I2 packet at the Responder into account 578 for retransmission purposes. To this end, the Responder MAY notify 579 the Initiator about the anticipated delay once the puzzle solution 580 was successfully verified and if the remaining I2 packet processing 581 incurs a high processing delay. The Responder MAY therefore send a 582 NOTIFY packet (see Section 5.3.6. in [RFC7401]) to the Initiator 583 before the Responder commences the ECDH operation. The NOTIFY packet 584 serves as an acknowledgement for the I2 packet and consists of a 585 NOTIFICATION parameter with Notify Message Type I2_ACKNOWLEDGEMENT 586 (see Section 5.2.19. in [RFC7401]). The NOTIFICATION parameter 587 contains the anticipated remaining processing time for the I2 packet 588 in milliseconds as two-octet Notification Data. This processing time 589 can, e.g., be estimated by measuring the computation time of the ECDH 590 key derivation operation during the Responder start-up procedure. 591 After the I2 processing has finished, the Responder sends the regular 592 R2 packet. 594 When the Initiator receives the NOTIFY packet, it sets the I2 595 retransmission timeout to the I2 processing time indicated in the 596 NOTIFICATION parameter plus half the RTT-based timeout value. In 597 doing so, the Initiator MUST NOT set the retransmission timeout to a 598 higher value than allowed by a local policy. This is to prevent 599 unauthenticated NOTIFY packets from maliciously delaying the 600 handshake beyond a well-defined upper bound in case of a lost R2 601 packet. At the same time, this extended retransmission timeout 602 enables the Initiator to defer I2 retransmissions until the point in 603 time when the Responder should have completed its I2 packet 604 processing and the network should have delivered the R2 packet 605 according to the employed worst-case estimates. 607 4.1.2.2. HIP State Processes 609 HIP DEX clarifies or introduces the following new transitions. 611 System behavior in state I2-SENT, Table 1. 613 +---------------------+---------------------------------------------+ 614 | Trigger | Action | 615 +---------------------+---------------------------------------------+ 616 | Receive NOTIFY, | Set I2 retransmission timer to value in | 617 | process | I2_ACKNOWLEDGEMENT Notification Data plus | 618 | | 1/2 RTT-based timeout value and stay at | 619 | | I2-SENT | 620 | | | 621 | | | 622 | | | 623 | Timeout | Increment trial counter | 624 | | | 625 | | | 626 | | | 627 | | If counter is less than I2_RETRIES_MAX, | 628 | | send I2, reset timer to RTT-based timeout, | 629 | | and stay at I2-SENT | 630 | | | 631 | | | 632 | | | 633 | | If counter is greater than I2_RETRIES_MAX, | 634 | | go to E-FAILED | 635 +---------------------+---------------------------------------------+ 637 Table 1: I2-SENT - Waiting to finish the HIP Diet EXchange 639 4.1.2.3. Simplified HIP State Diagram 641 The following diagram shows the major state transitions. Transitions 642 based on received packets implicitly assume that the packets are 643 successfully authenticated or processed. 645 +--+ +----------------------------+ 646 recv I1, send R1 | | | | 647 | v v | 648 +--------------+ recv I2, send R2 | 649 +----------------| UNASSOCIATED |----------------+ | 650 datagram | +--+ +--------------+ | | 651 to send, | | | Alg. not supported, | | 652 send I1 | | | send I1 | | 653 . v | v | | 654 . +---------+ recv I2, send R2 | | 655 +---->| I1-SENT |--------------------------------------+ | | 656 | +---------+ +----------------------+ | | | 657 | | recv R1, | recv I2, send R2 | | | | 658 | v send I2 | v v v | 659 | +---------+----------+ +---------+ | 660 | +--->| I2-SENT |<-------------+ +------------| R2-SENT |<---+ | 661 | | +---------+ recv NOTIFY, | | +---------+ | | 662 | | | | | reset timer | | data or| | | 663 | |recv R1, | | +--------------+ | EC timeout| | | 664 | |send I2 +-|--------------------+ | receive I2,| | 665 | | | | +-------------+ | send R2| | 666 | | | +-------->| ESTABLISHED |<---------+ | | 667 | | | recv R2 +-------------+ | | 668 | | | | | | receive I2, send R2 | | 669 | | +------------+ | +-------------------------------+ | 670 | | | +-----------+ | | 671 | | | no packet sent/received| +---+ | | 672 | | | for UAL min, send CLOSE| | |timeout | | 673 | | | v v |(UAL+MSL) | | 674 | | | +---------+ |retransmit | | 675 +--|----------|------------------------| CLOSING |-+CLOSE | | 676 | | +---------+ | | 677 | | | | | | | | 678 +----------|-------------------------+ | | +----------------+ | 679 | | +-----------+ +------------------|--+ 680 | | |recv CLOSE, recv CLOSE_ACK | | 681 | +-------------+ |send CLOSE_ACK or timeout | | 682 | recv CLOSE, | | (UAL+MSL) | | 683 | send CLOSE_ACK v v | | 684 | +--------+ receive I2, send R2 | | 685 +---------------------| CLOSED |------------------------------+ | 686 +--------+ | 687 ^ | | | 688 recv CLOSE, send CLOSE_ACK| | | timeout (UAL+2MSL) | 689 +-+ +------------------------------------+ 691 4.1.3. HIP DEX Security Associations 693 HIP DEX establishes two Security Associations (SA), one for the 694 Diffie-Hellman derived key, or Master Key, and one for the session 695 key, or Pair-wise Key. 697 4.1.3.1. Master Key SA 699 The Master Key SA is used to authenticate HIP packets and to encrypt 700 selected HIP parameters in the HIP DEX packet exchanges. Since only 701 a small amount of data is protected by this SA, it can be long-lived 702 with no need for rekeying. At the latest, the system MUST initiate 703 rekeying when its incoming ESP sequence counter is going to overflow, 704 and he system MUST NOT replace its keying material until the rekeying 705 packet exchange successfully completes as described in Section 6.8 in 706 [RFC7402]. 708 The Master Key SA contains the following elements: 710 o Source HIT 712 o Destination HIT 714 o HIP_Encrypt Key 716 o HIP_MAC Key 718 The HIP_Encrypt and HIP_MAC keys are extracted from the Diffie- 719 Hellman derived key as described in Section 6.3. Their length is 720 determined by the HIP_CIPHER. 722 4.1.3.2. Pair-wise Key SA 724 The Pair-wise Key SA is used to authenticate and to encrypt user 725 data. It is refreshed (or rekeyed) using an UPDATE packet exchange. 726 The Pair-wise Key SA elements are defined by the data transform 727 (e.g., ESP_TRANSFORM [RFC7402]). 729 The keys for the Pair-wise Key SA are derived based on the wrapped 730 keying material exchanged in the ENCRYPTED_KEY parameter (see 731 Section 5.2.5) of the I2 and R2 packets. Specifically, the exchanged 732 keying material of the two peers is concatenated. This concatenation 733 forms the input to a Key Derivation Function (KDF). If the data 734 transform does not specify its own KDF, the key derivation function 735 defined in Section 6.3 is used. Even though the concatenated input 736 is randomly distributed, a KDF Extract phase may be needed to get the 737 proper length for the input to the KDF Expand phase. 739 4.1.4. User Data Considerations 741 The User Data Considerations in Section 4.5. of [RFC7401] also apply 742 to HIP DEX. There is only one difference between HIPv2 and HIP DEX. 743 Loss of state due to system reboot may be a critical performance 744 issue for resource-constrained devices. Thus, implementors MAY 745 choose to use non-volatile, secure storage for HIP states in order 746 for them to survive a system reboot as discussed in Section 6.11. 747 Using non-volatile storage will limit state loss during reboots to 748 only those situations with an SA timeout. 750 5. Packet Formats 752 5.1. Payload Format 754 HIP DEX employs the same fixed HIP header and payload structure as 755 HIPv2. As such, the specifications in Section 5.1 of [RFC7401] also 756 apply to HIP DEX. 758 5.2. HIP Parameters 760 The HIP parameters carry information that is necessary for 761 establishing and maintaining a HIP association. For example, the 762 peer's public keys as well as the signaling for negotiating ciphers 763 and payload handling are encapsulated in HIP parameters. Additional 764 information, meaningful for end-hosts or middleboxes, may also be 765 included in HIP parameters. The specification of the HIP parameters 766 and their mapping to HIP packets and packet types is flexible to 767 allow HIP extensions to define new parameters and new protocol 768 behavior. 770 In HIP packets, HIP parameters are ordered according to their numeric 771 type number and encoded in TLV format. 773 HIP DEX reuses the HIP parameters of HIPv2 defined in Section 5.2. of 774 [RFC7401] where possible. Still, HIP DEX further restricts and/or 775 extends the following existing parameter types: 777 o DH_GROUP_LIST and HOST_ID are restricted to ECC-based suites. 779 o HIP_CIPHER is restricted to AES-128-CTR and NULL-ENCRYPT. 781 o HIT_SUITE_LIST is limited to the HIT suite ECDH/FOLD. 783 o RHASH and RHASH_len are redefined to CMAC for the PUZZLE, 784 SOLUTION, and HIP_MAC parameters (see Section 6.1 and 785 Section 6.2). 787 In addition, HIP DEX introduces the following new parameter: 789 +------------------+------+----------+------------------------------+ 790 | TLV | Type | Length | Data | 791 +------------------+------+----------+------------------------------+ 792 | ENCRYPTED_KEY | 643 | variable | Encrypted container for the | 793 | | | | session key exchange | 794 +------------------+------+----------+------------------------------+ 796 5.2.1. DH_GROUP_LIST 798 The DH_GROUP_LIST parameter contains the list of supported DH Group 799 IDs of a host. It is defined in Section 5.2.6 of [RFC7401]. With 800 HIP DEX, the DH Group IDs are restricted to: 802 Group KDF Value 804 NIST P-256 [RFC5903] CKDF 7 805 NIST P-384 [RFC5903] CKDF 8 806 NIST P-521 [RFC5903] CKDF 9 807 SECP160R1 [SECG] CKDF 10 808 Curve25519 [RFC7748] CKDF 12 809 Curve448 [RFC7748] CKDF 13 811 The ECDH groups with values 7 - 9 are defined in [RFC5903] and 812 [RFC6090]. ECDH group 10 is covered in [SECG] and Appendix D of 813 [RFC7401]. These curves, when used with HIP MUST have a co-factor of 814 1. 816 The ECDH groups with values 12 and 13 are defined in [RFC7748]. 817 These curves have cofactors of 8 and 4 (respectively). 819 5.2.2. HIP_CIPHER 821 The HIP_CIPHER parameter contains the list of supported cipher 822 algorithms to be used for encrypting the contents of the ENCRYPTED 823 and ENCRYPTED_KEY parameters. The HIP_CIPHER parameter is defined in 824 Section 5.2.8 of [RFC7401]. With HIP DEX, the Suite IDs are limited 825 to: 827 Suite ID Value 829 RESERVED 0 830 NULL-ENCRYPT 1 ([RFC2410]) 831 AES-128-CTR 5 ([RFC3686]) 833 Mandatory implementation: AES-128-CTR. Implementors SHOULD support 834 NULL-ENCRYPT ([RFC2410]) for testing/debugging purposes but MUST NOT 835 offer or accept this value unless explicitly configured for testing/ 836 debugging of HIP. 838 5.2.3. HOST_ID 840 The HOST_ID parameter conveys the Host Identity (HI) along with 841 optional information about a host. The HOST_ID parameter is defined 842 in Section 5.2.9 of [RFC7401]. 844 HIP DEX uses the public portion of a host's static ECDH key-pair as 845 the HI. Correspondingly, HIP DEX limits the HI algorithms to the 846 following new profile: 848 Algorithm profiles Value 850 ECDH 11 [RFC6090] (REQUIRED) 852 HIP DEX HIs are serialized equally to the ECC-based HIs in HIPv2 (see 853 Section 5.2.9. of [RFC7401]). The Group ID of the HIP DEX HI is 854 encoded in the "ECC curve" field of the HOST_ID parameter. The 855 supported DH Group IDs are defined in Section 5.2.1. 857 5.2.4. HIT_SUITE_LIST 859 The HIT_SUITE_LIST parameter contains a list of the supported HIT 860 suite IDs of the Responder. Based on the HIT_SUITE_LIST, the 861 Initiator can determine which source HIT Suite IDs are supported by 862 the Responder. The HIT_SUITE_LIST parameter is defined in 863 Section 5.2.10 of [RFC7401]. 865 The following new HIT Suite ID is defined for HIP DEX, and the 866 relationship between the four-bit ID value used in the OGA ID field 867 and the eight-bit encoding within the HIT_SUITE_LIST ID field is 868 clarified: 870 HIT Suite Four-bit ID Eight-bit encoding 872 ECDH/FOLD 4 0x40 874 Note that the dedicated HIP DEX HIT Suite ID in the OGA ID field 875 allows the peers to distinguish a HIP DEX handshake from a HIPv2 876 handshake. The Responder MUST respond with a HIP DEX HIT suite ID 877 when the HIT of the Initiator is a HIP DEX HIT. 879 5.2.5. ENCRYPTED_KEY 881 0 1 2 3 882 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 883 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 884 | Type | Length | 885 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 886 / Encrypted value / 887 / / 888 / +-------------------------------+ 889 / | Padding | 890 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 892 Type 643 893 Length length in octets, excluding Type, Length, and 894 Padding 895 Encrypted The value is encrypted using an encryption algorithm 896 value as defined in the HIP_CIPHER parameter. 898 The ENCRYPTED_KEY parameter encapsulates a random value that is later 899 used in the session key creation process (see Section 6.3). This 900 random value MUST have a length of at least 64 bits. The puzzle 901 value #I and the puzzle solution #J (see Section 4.1.2 in [RFC7401]) 902 are used as the initialization vector (IV) for the encryption 903 process. To this end, the IV is computed as FOLD(I | J, 128). 904 Moreover, a 16 bit counter value, which is initialized to zero on 905 first use, is appended to the IV value in order to guarantee that a 906 non-repeating nonce is fed to the encryption algorithm defined by the 907 HIP_CIPHER. 909 Once this encryption process is completed, the "encrypted value" data 910 field is ready for inclusion in the Parameter. If necessary, 911 additional Padding for 8-byte alignment is then added according to 912 the rules of TLV Format in [RFC7401]. 914 5.3. HIP Packets 916 HIP DEX uses the same eight basic HIP packets as HIPv2 (see 917 Section 5.3 of [RFC7401]). Four of them are for the HIP handshake 918 (I1, R1, I2, and R2), one is for updating an association (UPDATE), 919 one is for sending notifications (NOTIFY), and two are for closing 920 the association (CLOSE and CLOSE_ACK). There are some differences 921 regarding the HIP parameters that are included in the handshake 922 packets concerning HIP BEX and HIP DEX. This section covers these 923 differences for the DEX packets. Packets not discussed here, follow 924 the structure defined in [RFC7401]. 926 An important difference between packets in HIP BEX and HIP DEX is 927 that the DIFFIE_HELLMAN and the HIP_SIGNATURE parameters are not 928 included in HIP DEX. Thus, the R1 packet is completely unprotected 929 and can be spoofed. As a result, negotiation parameters contained in 930 the R1 packet have to be re-included in later, protected packets in 931 order to detect and prevent potential downgrading attacks. Moreover, 932 the I2, R2, UPDATE, NOTIFY, CLOSE, and CLOSE_ACK packets are not 933 covered by a signature and purely rely on the HIP_MAC parameter for 934 packet authentication. The processing of these packets is changed 935 accordingly. 937 In the future, an optional upper-layer payload MAY follow the HIP 938 header. The Next Header field in the header indicates if there is 939 additional data following the HIP header. 941 5.3.1. I1 - the HIP Initiator Packet 943 The HIP header values for the I1 packet: 945 Header: 946 Packet Type = 1 947 SRC HIT = Initiator's HIT 948 DST HIT = Responder's HIT, or NULL 950 IP ( HIP ( DH_GROUP_LIST ) ) 952 Valid control bits: none 954 The I1 packet contains the fixed HIP header and the Initiator's 955 DH_GROUP_LIST. The Initiator's HIT Suite ID MUST be of a HIP DEX 956 type as defined in Section 5.2.4. 958 Regarding the Responder's HIT, the Initiator may receive this HIT 959 either from a DNS lookup of the Responder's FQDN, from some other 960 repository, or from a local table. The Responder's HIT also MUST be 961 of a HIP DEX type. If the Initiator does not know the Responder's 962 HIT, it may attempt to use opportunistic mode by using NULL (all 963 zeros) as the Responder's HIT. See Section 4.1.8 of [RFC7401] for 964 detailed information about the "HIP Opportunistic Mode". 966 As the Initiator's and the Responder's HITs are compressions of the 967 employed HIs, they determine the DH Group ID that must be used in 968 order to successfully conclude the triggered handshake. HITs, 969 however, only include the OGA ID identifying the HI algorithm. They 970 do not include information about the specific group ID of the HI. To 971 inform the Responder about its employed and its otherwise supported 972 DH Group IDs, the Initiator therefore includes the DH_GROUP_LIST 973 parameter in the I1 packet. This parameter MUST include the DH group 974 ID that corresponds to the currently employed Initiator HIT as the 975 first list element. With HIP DEX, the DH_GROUP_LIST parameter MUST 976 only include ECDH groups defined in Section 5.2.1. 978 Since this packet is so easy to spoof even if it were protected, no 979 attempt is made to add to its generation or processing cost. As a 980 result, the DH_GROUP_LIST in the I1 packet is not protected. 982 Implementations MUST be able to handle a storm of received I1 983 packets, discarding those with common content that arrive within a 984 small time delta. 986 5.3.2. R1 - the HIP Responder Packet 988 The HIP header values for the R1 packet: 990 Header: 991 Packet Type = 2 992 SRC HIT = Responder's HIT 993 DST HIT = Initiator's HIT 995 IP ( HIP ( [ R1_COUNTER, ] 996 PUZZLE, 997 DH_GROUP_LIST, 998 HIP_CIPHER, 999 HOST_ID, 1000 HIT_SUITE_LIST, 1001 TRANSPORT_FORMAT_LIST, 1002 [ <, ECHO_REQUEST_UNSIGNED >i ]) 1004 Valid control bits: A 1006 If the Responder's HI is an anonymous one, the A control MUST be set. 1008 The Initiator's HIT MUST match the one received in the I1 packet if 1009 the R1 is a response to an I1. If the Responder has multiple HIs, 1010 the Responder's HIT MUST match the Initiator's request. If the 1011 Initiator used opportunistic mode, the Responder may select among its 1012 HIs as described below. See Section 4.1.8 of [RFC7401] for detailed 1013 information about the "HIP Opportunistic Mode". 1015 The R1 packet generation counter is used to determine the currently 1016 valid generation of puzzles. The value is increased periodically, 1017 and it is RECOMMENDED that it is increased at least as often as 1018 solutions to old puzzles are no longer accepted. 1020 The Puzzle contains a Random value #I and the puzzle difficulty K. 1021 The difficulty K indicates the number of lower-order bits, in the 1022 puzzle CMAC result, that MUST be zeros (see [RFC7401]). Responders 1023 SHOULD set K to zero by default and only increase the puzzle 1024 difficulty to protect against a DoS attack targeting the HIP DEX 1025 handshake. A puzzle difficulty of zero effectively turns the puzzle 1026 mechanism into a return-routablility test and is strongly encouraged 1027 during normal operation in order to conserve energy resources as well 1028 as to prevent unnecessary handshake delay in case of a resource- 1029 constrained Initiator. Please also refer to Section 7 for further 1030 recommendations on choosing puzzle difficulty. 1032 The DH_GROUP_LIST parameter contains the Responder's order of 1033 preference based on which the Responder chose the ECDH key contained 1034 in the HOST_ID parameter (see below). This allows the Initiator to 1035 determine whether its own DH_GROUP_LIST in the I1 packet was 1036 manipulated by an attacker. There is a further risk that the 1037 Responder's DH_GROUP_LIST was manipulated by an attacker, as the R1 1038 packet cannot be authenticated in HI DEX. Thus, this parameter is 1039 repeated in the R2 packet to allow for a final, cryptographically 1040 secured validation. 1042 The HIP_CIPHER contains the encryption algorithms supported by the 1043 Responder to protect the key exchange, in the order of preference. 1044 All implementations MUST support the AES-CTR [RFC3686]. 1046 The HIT_SUITE_LIST parameter is an ordered list of the Responder's 1047 supported and preferred HIT Suites. It enables a Responder to notify 1048 the Initiator about other available HIT suites than the one used in 1049 the current handshake. Based on the received HIT_SUITE_LIST, the 1050 Initiator MAY decide to abort the current handshake and initiate a 1051 new handshake with a different mutually supported HIT suite. This 1052 mechanism can, e.g., be used to move from an initial HIP DEX 1053 handshake to a HIP BEX handshake for peers supporting both protocol 1054 variants. 1056 The HOST_ID parameter depends on the received DH_GROUP_LIST parameter 1057 and the Responder HIT in the I1 packet. Specifically, if the I1 1058 contains a Responder HIT, the Responder verifies that this HIT 1059 matches the required DH group based on the received DH_GROUP_LIST 1060 parameter included in the I1. In case of a positive result, the 1061 Responder selects the corresponding HOST_ID for inclusion in the R1 1062 packet. Likewise, if the Responder HIT in the I1 packet is NULL 1063 (i.e., during an opportunistic handshake), the Responder chooses its 1064 HOST_ID according to the Initiator's employed DH group as indicated 1065 in the received DH_GROUP_LIST parameter and sets the source HIT in 1066 the R1 packet accordingly. If the Responder however does not support 1067 the DH group required by the Initiator or if the Responder HIT in the 1068 I1 packet does not match the required DH group, the Responder selects 1069 the mutually preferred and supported DH group based on the 1070 DH_GROUP_LIST parameter in the I1 packet. The Responder then 1071 includes the corresponding ECDH key in the HOST_ID parameter. This 1072 parameter also indicates the selected DH group. Moreover, the 1073 Responder sets the source HIT in the R2 packet based on the 1074 destination HIT from the I1 packet. Based on the deviating DH group 1075 ID in the HOST_ID parameter, the Initiator then SHOULD abort the 1076 current handshake and initiate a new handshake with the mutually 1077 supported DH group as far as local policies (see Section 7) permit. 1079 The TRANSPORT_FORMAT_LIST parameter is an ordered list of the 1080 Responder's supported and preferred transport format types. The list 1081 allows the Initiator and the Responder to agree on a common type for 1082 payload protection. The different format types are DEFAULT, ESP and 1083 ESP-TCP as explained in Section 3.1 in [RFC6261]. 1085 The ECHO_REQUEST_UNSIGNED parameters contain data that the sender 1086 wants to receive unmodified in the corresponding response packet in 1087 the ECHO_RESPONSE_UNSIGNED parameter. The R1 packet may contain zero 1088 or more ECHO_REQUEST_UNSIGNED parameters. 1090 5.3.3. I2 - the Second HIP Initiator Packet 1092 The HIP header values for the I2 packet: 1094 Header: 1095 Type = 3 1096 SRC HIT = Initiator's HIT 1097 DST HIT = Responder's HIT 1099 IP ( HIP ( [R1_COUNTER,] 1100 SOLUTION, 1101 HIP_CIPHER, 1102 ENCRYPTED_KEY, 1103 HOST_ID, 1104 TRANSPORT_FORMAT_LIST, 1105 HIP_MAC, 1106 [<, ECHO_RESPONSE_UNSIGNED>i )] ) 1108 Valid control bits: A 1110 The HITs MUST match the ones used in the R1 packet. 1112 If the Initiator's HI is an anonymous one, the A control bit MUST be 1113 set. 1115 If present in the R1 packet, the Initiator MUST include an unmodified 1116 copy of the R1_COUNTER parameter into the I2 packet. 1118 The Solution contains the Random #I from the R1 packet and the 1119 computed #J value. The low-order #K bits of the RHASH(I | ... | J) 1120 MUST be zero. 1122 The HIP_CIPHER contains the single encryption transform selected by 1123 the Initiator that it uses to encrypt the ENCRYPTED and ENCRYPTED_KEY 1124 parameters. The chosen cipher MUST correspond to one of the ciphers 1125 offered by the Responder in the R1. All implementations MUST support 1126 the AES-CTR transform [RFC3686]. 1128 The HOST_ID parameter contains the Initiator HI corresponding to the 1129 Initiator HIT. 1131 The ENCRYPTED_KEY parameter contains an Initiator generated random 1132 value that MUST be uniformly distributed. This random value is 1133 encrypted with the Master Key SA using the HIP_CIPHER encryption 1134 algorithm. 1136 The ECHO_RESPONSE_UNSIGNED parameter(s) contain the unmodified Opaque 1137 data copied from the corresponding echo request parameter(s). This 1138 parameter can also be used for two-factor password authentication as 1139 shown in Appendix A. 1141 The TRANSPORT_FORMAT_LIST parameter contains the single transport 1142 format type selected by the Initiator. The chosen type MUST 1143 correspond to one of the types offered by the Responder in the R1 1144 packet. The different format types are DEFAULT, ESP and ESP-TCP as 1145 explained in Section 3.1 in [RFC6261]. 1147 The MAC is calculated over the whole HIP envelope, excluding any 1148 parameters after the HIP_MAC parameter as described in Section 6.2. 1149 The Responder MUST validate the HIP_MAC parameter. 1151 5.3.4. R2 - the Second HIP Responder Packet 1153 The HIP header values for the R2 packet: 1155 Header: 1156 Packet Type = 4 1157 SRC HIT = Responder's HIT 1158 DST HIT = Initiator's HIT 1160 IP ( HIP ( DH_GROUP_LIST, 1161 HIP_CIPHER, 1162 ENCRYPTED_KEY, 1163 HIT_SUITE_LIST, 1164 TRANSPORT_FORMAT_LIST, 1165 HIP_MAC) 1167 Valid control bits: none 1169 The HITs used MUST match the ones used in the I2 packet. 1171 The Responder repeats the DH_GROUP_LIST, HIP_CIPHER, HIT_SUITE_LIST, 1172 and TRANSPORT_FORMAT_LIST parameters in the R2 packet. These 1173 parameters MUST be the same as included in the R1 packet. The 1174 parameter are re-included here because the R2 packet is MACed and 1175 thus cannot be altered by an attacker. For verification purposes, 1176 the Initiator re-evaluates the selected suites and compares the 1177 results against the chosen ones. If the re-evaluated suites do not 1178 match the chosen ones, the Initiator acts based on its local policy. 1180 The ENCRYPTED_KEY parameter contains an Responder generated random 1181 value that MUST be uniformly distributed. This random value is 1182 encrypted with the Master Key SA using the HIP_CIPHER encryption 1183 algorithm. 1185 The MAC is calculated over the whole HIP envelope, excluding any 1186 parameters after the HIP_MAC, as described in Section 6.2. The 1187 Initiator MUST validate the HIP_MAC parameter. 1189 5.4. ICMP Messages 1191 When a HIP implementation detects a problem with an incoming packet, 1192 and it either cannot determine the identity of the sender of the 1193 packet or does not have any existing HIP association with the sender 1194 of the packet, it MAY respond with an ICMP packet. Any such reply 1195 MUST be rate-limited as described in [RFC4443]. In most cases, the 1196 ICMP packet has the Parameter Problem type (12 for ICMPv4, 4 for 1197 ICMPv6), with the Pointer field pointing to the field that caused the 1198 ICMP message to be generated. The problem cases specified in 1199 Section 5.4. of [RFC7401] also apply to HIP DEX. 1201 6. Packet Processing 1203 Due to the adopted protocol semantics and the inherited general 1204 packet structure, the packet processing in HIP DEX only differs from 1205 HIPv2 in very few places. Here, we focus on these differences and 1206 refer to Section 6 in [RFC7401] otherwise. 1208 The processing of outgoing and incoming application data remains the 1209 same as in HIP BEX (see Sections 6.1 and 6.2 in [RFC7401]). 1211 It should be noted that many of the packet processing rules are 1212 denoted here with "SHOULD" but may be updated to "MUST" when further 1213 implementation experience provides better guidance. 1215 6.1. Solving the Puzzle 1217 The procedures for solving and verifying a puzzle in HIP DEX are 1218 strongly based on the corresponding procedures in HIPv2. The only 1219 exceptions are that HIP DEX does not use pre-computation of R1 1220 packets and that RHASH is set to CMAC. As a result, the pre- 1221 computation step in Section 6.3 of [RFC7401] is skipped in HIP DEX. 1223 Moreover, the Initiator solves a puzzle by computing: 1224 Ltrunc( CMAC( I, HIT-I | HIT-R | J ), K ) == 0 1226 Similarly, the Responder verifies a puzzle by computing: 1227 V := Ltrunc( CMAC( I, HIT-I | HIT-R | J ), K ) 1229 Apart from these modifications, the procedures defined in Section 6.3 1230 of [RFC7401] also apply for HIP DEX. 1232 6.2. HIP_MAC Calculation and Verification 1234 The following subsections define the actions for processing the 1235 HIP_MAC parameter. 1237 6.2.1. CMAC Calculation 1239 The HIP_MAC calculation uses RHASH, i.e., CMAC, as the underlying 1240 cryptographic function. The scope of the calculation for HIP_MAC is: 1242 CMAC: { HIP header | [ Parameters ] } 1244 where Parameters include all HIP parameters of the packet that is 1245 being calculated with Type values ranging from 1 to (HIP_MAC's Type 1246 value - 1) and exclude parameters with Type values greater or equal 1247 to HIP_MAC's Type value. 1249 During HIP_MAC calculation, the following applies: 1251 o In the HIP header, the Checksum field is set to zero. 1253 o In the HIP header, the Header Length field value is calculated to 1254 the beginning of the HIP_MAC parameter. 1256 The parameter order is described in Section 5.2.1 of [RFC7401]. 1258 The CMAC calculation and verification process is as follows: 1260 Packet sender: 1262 1. Create the HIP packet, without the HIP_MAC or any other parameter 1263 with greater Type value than the HIP_MAC parameter has. 1265 2. Calculate the Header Length field in the HIP header. 1267 3. Compute the CMAC using either HIP-gl or HIP-lg integrity key 1268 retrieved from KEYMAT as defined in Section 6.3. HIP-gl refers 1269 to host with greater HIT value and HIP-lg refers to the host with 1270 smaller HIT value. 1272 4. Add the HIP_MAC parameter to the packet and any parameter with 1273 greater Type value than the HIP_MAC's that may follow. 1275 5. Recalculate the Length field in the HIP header. 1277 Packet receiver: 1279 1. Verify the HIP header Length field. 1281 2. Remove the HIP_MAC parameter, as well as all other parameters 1282 that follow it with greater Type value, saving the contents if 1283 they will be needed later. 1285 3. Recalculate the HIP packet length in the HIP header and clear the 1286 Checksum field (set it to all zeros). 1288 4. Compute the CMAC using either HIP-gl or HIP-lg integrity key as 1289 defined in Section 6.3 and verify it against the received CMAC. 1291 5. Set Checksum and Header Length fields in the HIP header to 1292 original values. Note that the Checksum and Length fields 1293 contain incorrect values after this step. 1295 6.3. HIP DEX KEYMAT Generation 1297 The HIP DEX KEYMAT process is used to derive the keys for the Master 1298 Key SA as well as for the Pair-wise Key SA. The keys for the Master 1299 Key SA are based on the Diffie-Hellman derived key, Kij, which is 1300 produced during the HIP DEX handshake. The Initiator generates Kij 1301 during the creation of the I2 packet and the Responder generates Kij 1302 once it receives the I2 packet. This is why the I2 packet can 1303 already contain authenticated and/or encrypted information. 1305 The keys derived for the Pair-wise Key SA are not used during the HIP 1306 DEX handshake. Instead, these keys are made available as payload 1307 protection keys (e.g., for IPsec). Some payload protection 1308 mechanisms have their own Key Derivation Function, and if so this 1309 mechanism SHOULD be used. Otherwise, the HIP DEX KEYMAT process MUST 1310 be used to derive the keys of the Pair-wise Key SA based on the 1311 concatenation of the random values that are contained in the 1312 exchanged ENCRYPTED_KEY parameters. 1314 The HIP DEX KEYMAT process is based on the is the Hash-based Key 1315 Derivation Function (HKDF) defined in [RFC5869] and consists of two 1316 components, CKDF-Extract and CKDF-Expand. The CKDF-Extract function 1317 compresses a non-uniformly distributed key, such as the output of a 1318 Diffie-Hellman key derivation, to extract the key entropy into a 1319 fixed length output. The CKDF-Expand function takes either the 1320 output of the Extract function or directly uses a uniformly 1321 distributed key and expands the length of the key, repeatedly 1322 distributing the key entropy, to produce the keys needed. 1324 The key derivation for the Master Key SA employs always both the 1325 Extract and Expand phases. The Pair-wise Key SA needs only the 1326 Extract phase when key is smaller or equal to 128 bits, but otherwise 1327 requires also the Expand phase. 1329 The CKDF-Extract function is the following operation: 1331 CKDF-Extract(I, IKM, info) -> PRK 1333 Inputs: 1334 I Random #I from the PUZZLE parameter 1335 IKM Input keying material, i.e., the Diffie-Hellman derived 1336 key for the Master Key SA and the concatenation of the 1337 random values of the ENCRYPTED_KEY parameters in the 1338 same order as the HITs with sort(HIT-I | HIT-R) for the 1339 Pair-wise Key SA 1340 info sort(HIT-I | HIT-R) | "CKDF-Extract" 1341 where "CKDF-Extract" is an octet string 1343 Output: 1344 PRK a pseudorandom key (of RHASH_len/8 octets) 1346 The pseudorandom key PRK is calculated as follows: 1348 PRK = CMAC(I, IKM | info) 1350 The CKDF-Expand function is the following operation: 1352 CKDF-Expand(PRK, info, L) -> OKM 1354 Inputs: 1355 PRK a pseudorandom key of at least RHASH_len/8 octets 1356 (either the output from the extract step or the 1357 concatenation of the random values of the 1358 ENCRYPTED_KEY parameters in the same order as the 1359 HITs with sort(HIT-I | HIT-R) in case of no extract) 1360 info sort(HIT-I | HIT-R) | "CKDF-Expand" 1361 where "CKDF-Expand" is an octet string 1362 L length of output keying material in octets 1363 (<= 255*RHASH_len/8) 1365 Output: 1366 OKM output keying material (of L octets) 1368 The output keying material OKM is calculated as follows: 1370 N = ceil(L/(RHASH_len/8)) 1371 T = T(1) | T(2) | T(3) | ... | T(N) 1372 OKM = first L octets of T 1374 where 1376 T(0) = empty string (zero length) 1377 T(1) = CMAC(PRK, T(0) | info | 0x01) 1378 T(2) = CMAC(PRK, T(1) | info | 0x02) 1379 T(3) = CMAC(PRK, T(2) | info | 0x03) 1380 ... 1382 (where the constant concatenated to the end of each T(n) is a 1383 single octet.) 1385 sort(HIT-I | HIT-R) is defined as the network byte order 1386 concatenation of the two HITs, with the smaller HIT preceding the 1387 larger HIT, resulting from the numeric comparison of the two HITs 1388 interpreted as positive (unsigned) 128-bit integers in network byte 1389 order. 1391 The initial keys for the Master Key SA are drawn sequentially in the 1392 order that is determined by the numeric comparison of the two HITs, 1393 with the comparison method described in the previous paragraph. 1394 HOST_g denotes the host with the greater HIT value, and HOST_l the 1395 host with the lower HIT value. 1397 The drawing order for initial keys: 1399 1. HIP-gl encryption key for HOST_g's outgoing HIP packets 1400 2. HIP-gl integrity (CMAC) key for HOST_g's outgoing HIP packets 1402 3. HIP-lg encryption key for HOST_l's outgoing HIP packets 1404 4. HIP-lg integrity (CMAC) key for HOST_l's outgoing HIP packets 1406 The number of bits drawn for a given algorithm is the "natural" size 1407 of the keys regarding the algorithm defined in the HIP_CIPHER. For 1408 the mandatory algorithms, the following size applies: 1410 AES 128 bits 1412 If other key sizes are used, they must be treated as different 1413 encryption algorithms and defined separately. 1415 6.4. Initiation of a HIP Diet EXchange 1417 The initiation of a HIP DEX handshake proceeds as described in 1418 Section 6.6 of [RFC7401]. The I1 packet contents are specified in 1419 Section 5.3.1. 1421 6.5. Processing Incoming I1 Packets 1423 I1 packets in HIP DEX are handled almost identical to HIPv2 (see 1424 Section 6.7 of [RFC7401]). The main differences are that the 1425 Responder SHOULD select a HIP DEX HIT Suite in the R1 response. 1426 Moreover, as R1 packets are neither covered by a signature nor incur 1427 the overhead of generating an ephemeral Diffie-Hellman key-pair, pre- 1428 computation of an R1 is only marginally beneficial, but would incur 1429 additional memory resources at the Responder. Hence, the R1 pre- 1430 computation SHOULD be omitted in HIP DEX. 1432 Correspondingly, the modified conceptual processing rules for 1433 responding to an I1 packet are as follows: 1435 1. The Responder MUST check that the Responder's HIT in the received 1436 I1 packet is either one of its own HITs or NULL. Otherwise, it 1437 MUST drop the packet. 1439 2. If the Responder is in ESTABLISHED state, the Responder MAY 1440 respond to this with an R1 packet, prepare to drop an existing 1441 HIP security association with the peer, and stay at ESTABLISHED 1442 state. 1444 3. If the Responder is in I1-SENT state, it MUST make a comparison 1445 between the sender's HIT and its own (i.e., the receiver's) HIT. 1446 If the sender's HIT is greater than its own HIT, it should drop 1447 the I1 packet and stay at I1-SENT. If the sender's HIT is 1448 smaller than its own HIT, it SHOULD send the R1 packet and stay 1449 at I1-SENT. The HIT comparison is performed as defined in 1450 Section 6.3. 1452 4. If the implementation chooses to respond to the I1 packet with an 1453 R1 packet, it creates a new R1 according to the format described 1454 in Section 5.3.2. It chooses the HI based on the destination HIT 1455 and the DH_GROUP_LIST in the I1 packet. If the implementation 1456 does not support the DH group required by the Initiator or if the 1457 destination HIT in the I1 packet does not match the required DH 1458 group, it selects the mutually preferred and supported DH group 1459 based on the DH_GROUP_LIST parameter in the I1 packet. The 1460 implementation includes the corresponding ECDH public key in the 1461 HOST_ID parameter. If no suitable DH Group ID was contained in 1462 the DH_GROUP_LIST in the I1 packet, it sends an R1 packet with 1463 any suitable ECDH public key. 1465 5. If the received Responder's HIT in the I1 packet is not NULL, the 1466 Responder's HIT in the R1 packet MUST match the destination HIT 1467 in the I1 packet. Otherwise, the Responder MUST select a HIT 1468 with the same HIT Suite as the Initiator's HIT. If this HIT 1469 Suite is not supported by the Responder, it SHOULD select a 1470 REQUIRED HIT Suite from Section 5.2.10 of [RFC7401], which is 1471 currently RSA/DSA/SHA-256. Other than that, selecting the HIT is 1472 a local policy matter. 1474 6. The Responder expresses its supported HIP transport formats in 1475 the TRANSPORT_FORMAT_LIST as described in Section 5.2.11 of 1476 [RFC7401]. The Responder MUST provide at least one payload 1477 transport format type. 1479 7. The Responder sends the R1 packet to the source IP address of the 1480 I1 packet. 1482 Note that only steps 4 and 5 have been changed with regard to the 1483 processing rules of HIPv2. The considerations about R1 management 1484 (except pre-computation) and malformed I1 packets in Sections 6.7.1 1485 and 6.7.2 of [RFC7401] likewise apply to HIP DEX. 1487 6.6. Processing Incoming R1 Packets 1489 R1 packets in HIP DEX are handled identically to HIPv2 (see 1490 Section 6.8 in [RFC7401]) with the following exceptions: HIP DEX uses 1491 ECDH public keys as HIs and does not employ signatures. 1493 The modified conceptual processing rules for responding to an R1 1494 packet are as follows: 1496 1. A system receiving an R1 MUST first check to see if it has sent 1497 an I1 packet to the originator of the R1 packet (i.e., it has a 1498 HIP association that is in state I1-SENT and that is associated 1499 with the HITs in the R1). Unless the I1 packet was sent in 1500 opportunistic mode (see Section 4.1.8 of [RFC7401]), the IP 1501 addresses in the received R1 packet SHOULD be ignored by the R1 1502 processing and, when looking up the correct HIP association, the 1503 received R1 packet SHOULD be matched against the associations 1504 using only the HITs. If a match exists, the system processes 1505 the R1 packet as described below. 1507 2. Otherwise, if the system is in any state other than I1-SENT or 1508 I2-SENT with respect to the HITs included in the R1 packet, it 1509 SHOULD silently drop the R1 packet and remain in the current 1510 state. 1512 3. If the HIP association state is I1-SENT or I2-SENT, the received 1513 Initiator's HIT MUST correspond to the HIT used in the original 1514 I1 packet. Also, the Responder's HIT MUST correspond to the one 1515 used in the I1 packet, unless this packet contained a NULL HIT. 1517 4. If the HIP association state is I1-SENT, and multiple valid R1 1518 packets are present, the system MUST select from among the R1 1519 packets with the largest R1 generation counter. 1521 5. The system MUST check that the Initiator's HIT Suite is 1522 contained in the HIT_SUITE_LIST parameter in the R1 packet 1523 (i.e., the Initiator's HIT Suite is supported by the Responder). 1524 If the HIT Suite is supported by the Responder, the system 1525 proceeds normally. Otherwise, the system MAY stay in state 1526 I1-SENT and restart the HIP DEX handshake by sending a new I1 1527 packet with an Initiator HIT that is supported by the Responder 1528 and hence is contained in the HIT_SUITE_LIST in the R1 packet. 1529 The system MAY abort the handshake if no suitable source HIT is 1530 available. The system SHOULD wait for an acceptable time span 1531 to allow further R1 packets with higher R1 generation counters 1532 or different HIT and HIT Suites to arrive before restarting or 1533 aborting the HIP DEX handshake. 1535 6. The system MUST check that the DH Group ID in the HOST_ID 1536 parameter in the R1 matches the first DH Group ID in the 1537 Responder's DH_GROUP_LIST in the R1 packet, and also that this 1538 Group ID corresponds to a value that was included in the 1539 Initiator's DH_GROUP_LIST in the I1 packet. If the DH Group ID 1540 of the HOST_ID parameter does not express the Responder's best 1541 choice, the Initiator can conclude that the DH_GROUP_LIST in the 1542 I1 or R1 packet was adversely modified. In such a case, the 1543 Initiator MAY send a new I1 packet; however, it SHOULD NOT 1544 change its preference in the DH_GROUP_LIST in the new I1 packet. 1545 Alternatively, the Initiator MAY abort the HIP DEX handshake. 1546 Moreover, if the DH Group ID indicated in the HOST_ID parameter 1547 does not match the DH Group ID of the HI employed by the 1548 Initiator, the system SHOULD wait for an acceptable time span to 1549 allow further R1 packets with different DH Group IDs to arrive 1550 before restarting or aborting the HIP DEX handshake. When 1551 restarting the handshake, the Initiator MUST consult local 1552 policies (see Section 7) regarding the use of another, mutually 1553 supported DH group for the subsequent handshake with the 1554 Responder. 1556 7. If the HIP association state is I2-SENT, the system MAY re-enter 1557 state I1-SENT and process the received R1 packet if it has a 1558 larger R1 generation counter than the R1 packet responded to 1559 previously. 1561 8. The R1 packet can have the A-bit set - in this case, the system 1562 MAY choose to refuse it by dropping the R1 packet and returning 1563 to state UNASSOCIATED. The system SHOULD consider dropping the 1564 R1 packet only if it used a NULL HIT in the I1 packet. If the 1565 A-bit is set, the Responder's HIT is anonymous and SHOULD NOT be 1566 stored permanently. 1568 9. The system SHOULD attempt to validate the HIT against the 1569 received Host Identity by using the received Host Identity to 1570 construct a HIT and verify that it matches the Sender's HIT. 1572 10. The system MUST store the received R1 generation counter for 1573 future reference. 1575 11. The system attempts to solve the puzzle in the R1 packet. The 1576 system MUST terminate the search after exceeding the remaining 1577 lifetime of the puzzle. If the puzzle is not successfully 1578 solved, the implementation MAY either resend the I1 packet 1579 within the retry bounds or abandon the HIP base exchange. 1581 12. The system computes standard Diffie-Hellman keying material 1582 according to the public value and Group ID provided in the 1583 HOST_ID parameter. The Diffie-Hellman keying material Kij is 1584 used for key extraction as specified in Section 6.3. 1586 13. The system selects the HIP_CIPHER ID from the choices presented 1587 in the R1 packet and uses the selected values subsequently when 1588 generating and using encryption keys, and when sending the I2 1589 packet. If the proposed alternatives are not acceptable to the 1590 system, it MAY either resend an I1 packet within the retry 1591 bounds or abandon the HIP base exchange. 1593 14. The system chooses one suitable transport format from the 1594 TRANSPORT_FORMAT_LIST and includes the respective transport 1595 format parameter in the subsequent I2 packet. 1597 15. The system initializes the remaining variables in the associated 1598 state, including Update ID counters. 1600 16. The system prepares and sends an I2 packet as described in 1601 Section 5.3.3. 1603 17. The system SHOULD start a timer whose timeout value SHOULD be 1604 larger than the worst-case anticipated RTT, and MUST increment a 1605 trial counter associated with the I2 packet. The sender SHOULD 1606 retransmit the I2 packet upon a timeout and restart the timer, 1607 up to a maximum of I2_RETRIES_MAX tries. 1609 18. If the system is in state I1-SENT, it SHALL transition to state 1610 I2-SENT. If the system is in any other state, it remains in the 1611 current state. 1613 Note that step 4 from the original processing rules of HIPv2 1614 (signature verification) has been removed in the above processing 1615 rules for HIP DEX. Moreover, step 7 of the original processing rules 1616 has been adapted in step 6 above to account for the fact that HIP DEX 1617 uses ECDH public keys as HIs. The considerations about malformed R1 1618 packets in Sections 6.8.1 of [RFC7401] also apply to HIP DEX. 1620 6.7. Processing Incoming I2 Packets 1622 The processing of I2 packets follows similar rules as HIPv2 (see 1623 Section 6.9 of [RFC7401]). The main differences to HIPv2 are that 1624 HIP DEX introduces a new session key exchange via the ENCRYPTED_KEY 1625 parameter as well as an I2 reception acknowledgement for 1626 retransmission purposes. Moreover, with HIP DEX the Initiator is 1627 responsible for triggering retransmissions, whereas the Responder 1628 merely replies to received I2 packets. 1630 The modified HIP DEX conceptual processing rules for responding to an 1631 I2 packet are: 1633 1. The system MAY perform checks to verify that the I2 packet 1634 corresponds to a recently sent R1 packet. Such checks are 1635 implementation dependent. See Appendix A in [RFC7401] for a 1636 description of an example implementation. 1638 2. The system MUST check that the Responder's HIT corresponds to 1639 one of its own HITs and MUST drop the packet otherwise. 1641 3. The system MUST further check that the Initiator's HIT Suite is 1642 supported. The Responder SHOULD silently drop I2 packets with 1643 unsupported Initiator HITs. 1645 4. If the system's state machine is in the R2-SENT state, the 1646 system MUST check to see if the newly received I2 packet is 1647 similar to the one that triggered moving to R2-SENT. If so, it 1648 MUST retransmit a previously sent R2 packet and reset the 1649 R2-SENT timer. The system SHOULD re-use the previously 1650 established state to re-create the corresponding R2 packet in 1651 order to prevent unnecessary computation overhead. 1653 5. If the system's state machine is in the I2-SENT state, the 1654 system MUST make a comparison between its local and sender's 1655 HITs (similarly as in Section 6.3). If the local HIT is smaller 1656 than the sender's HIT, it should drop the I2 packet, use the 1657 peer Diffie-Hellman key, ENCRYPTED_KEY keying material and nonce 1658 #I from the R1 packet received earlier, and get the local 1659 Diffie-Hellman key, ENCRYPTED_KEY keying material, and nonce #J 1660 from the I2 packet sent to the peer earlier. Otherwise, the 1661 system processes the received I2 packet and drops any previously 1662 derived Diffie-Hellman keying material Kij and ENCRYPTED_KEY 1663 keying material it might have generated upon sending the I2 1664 packet previously. The peer Diffie-Hellman key, ENCRYPTED_KEY, 1665 and the nonce #J are taken from the just arrived I2 packet. The 1666 local Diffie-Hellman key, ENCRYPTED_KEY keying material, and the 1667 nonce #I are the ones that were sent earlier in the R1 packet. 1669 6. If the system's state machine is in the I1-SENT state, and the 1670 HITs in the I2 packet match those used in the previously sent I1 1671 packet, the system uses this received I2 packet as the basis for 1672 the HIP association it was trying to form, and stops 1673 retransmitting I1 packets (provided that the I2 packet passes 1674 the additional checks below). 1676 7. If the system's state machine is in any state other than 1677 R2-SENT, the system SHOULD check that the echoed R1 generation 1678 counter in the I2 packet is within the acceptable range if the 1679 counter is included. Implementations MUST accept puzzles from 1680 the current generation and MAY accept puzzles from earlier 1681 generations. If the generation counter in the newly received I2 1682 packet is outside the accepted range, the I2 packet is stale 1683 (and perhaps replayed) and SHOULD be dropped. 1685 8. The system MUST validate the solution to the puzzle as described 1686 in Section 6.1. 1688 9. The I2 packet MUST have a single value in the HIP_CIPHER 1689 parameter, which MUST match one of the values offered to the 1690 Initiator in the R1 packet. 1692 10. The system MUST derive Diffie-Hellman keying material Kij based 1693 on the public value and Group ID in the HOST_ID parameter. This 1694 keying material is used to derive the keys of the Master Key SA 1695 as described in Section 6.3. If the Diffie-Hellman Group ID is 1696 unsupported, the I2 packet is silently dropped. If the 1697 processing time for the derivation of the Diffie-Hellman keying 1698 material Kij is likely to cause premature I2 retransmissions by 1699 the Initiator, the system MAY send a NOTIFY packet before 1700 starting the key derivation process. The NOTIFY packet contains 1701 a NOTIFICATION parameter with Notify Message Type 1702 I2_ACKNOWLEDGEMENT. The NOTIFICATION parameter indicates the 1703 anticipated remaining processing time for the I2 packet in 1704 milliseconds as two-octet Notification Data. 1706 11. The implementation SHOULD also verify that the Initiator's HIT 1707 in the I2 packet corresponds to the Host Identity sent in the I2 1708 packet. (Note: some middleboxes may not be able to make this 1709 verification.) 1711 12. The system MUST process the TRANSPORT_FORMAT_LIST parameter. 1712 Other documents specifying transport formats (e.g., [RFC7402]) 1713 contain specifications for handling any specific transport 1714 selected. 1716 13. The system MUST verify the HIP_MAC according to the procedures 1717 in Section 6.2. 1719 14. If the checks above are valid, then the system proceeds with 1720 further I2 processing; otherwise, it discards the I2 and its 1721 state machine remains in the same state. 1723 15. The I2 packet may have the A-bit set - in this case, the system 1724 MAY choose to refuse it by dropping the I2 and the state machine 1725 returns to state UNASSOCIATED. If the A-bit is set, the 1726 Initiator's HIT is anonymous and MUST NOT be stored permanently. 1728 16. The system MUST decrypt the keying material from the 1729 ENCRYPTED_KEY parameter. This keying material is a partial 1730 input to the key derivation process for the Pair-wise Key SA 1731 (see Section 6.3). 1733 17. The system initializes the remaining variables in the associated 1734 state, including Update ID counters. 1736 18. Upon successful processing of an I2 packet when the system's 1737 state machine is in state UNASSOCIATED, I1-SENT, I2-SENT, or 1738 R2-SENT, an R2 packet is sent as described in Section 5.3.4 and 1739 the system's state machine transitions to state R2-SENT. 1741 19. Upon successful processing of an I2 packet when the system's 1742 state machine is in state ESTABLISHED, the old HIP association 1743 is dropped and a new one is installed, an R2 packet is sent as 1744 described in Section 5.3.4, and the system's state machine 1745 transitions to R2-SENT. 1747 20. Upon the system's state machine transitioning to R2-SENT, the 1748 system starts a timer. The state machine transitions to 1749 ESTABLISHED if some data has been received on the incoming HIP 1750 association, or an UPDATE packet has been received (or some 1751 other packet that indicates that the peer system's state machine 1752 has moved to ESTABLISHED). If the timer expires (allowing for a 1753 maximal amount of retransmissions of I2 packets), the state 1754 machine transitions to ESTABLISHED. 1756 Note that steps 11 (encrypted HOST_ID) and 15 (signature 1757 verification) from the original processing rules of HIPv2 have been 1758 removed in the above processing rules for HIP DEX. Moreover, step 10 1759 of the HIPv2 processing rules has been adapted to account for 1760 optional extension of the retransmission mechanism. Step 16 has been 1761 added to the processing rules in this document. The considerations 1762 about malformed I2 packets in Sections 6.9.1 of [RFC7401] also apply 1763 to HIP DEX. 1765 6.8. Processing Incoming R2 Packets 1767 R2 packets in HIP DEX are handled identically to HIPv2 (see 1768 Section 6.10 of [RFC7401]) with the following exceptions: HIP DEX 1769 introduces a new session key exchange via the ENCRYPTED_KEY parameter 1770 and does not employ signatures. 1772 The modified conceptual processing rules for responding to an R2 1773 packet are as follows: 1775 1. If the system is in any other state than I2-SENT, the R2 packet 1776 is silently dropped. 1778 2. The system MUST verify that the HITs in use correspond to the 1779 HITs that were received in the R1 packet that caused the 1780 transition to the I2-SENT state. 1782 3. The system MUST verify the HIP_MAC according to the procedures in 1783 Section 6.2. 1785 4. The system MUST re-evaluate the DH_GROUP_LIST, HIP_CIPHER, 1786 HIT_SUITE_LIST, and TRANSPORT_FORMAT_LIST parameters in the R2 1787 packet and compare the results against the chosen suites. 1789 5. If any of the checks above fail, there is a high probability of 1790 an ongoing man-in-the-middle or other security attack. The 1791 system SHOULD act accordingly, based on its local policy. 1793 6. The system MUST decrypt the keying material from the 1794 ENCRYPTED_KEY parameter. This keying material is a partial input 1795 to the key derivation process for the Pair-wise Key SA (see 1796 Section 6.3). 1798 7. Upon successful processing of the R2 packet, the state machine 1799 transitions to state ESTABLISHED. 1801 Note that step 4 (signature verification) from the original 1802 processing rules of HIPv2 has been replaced with a negotiation re- 1803 evaluation in the above processing rules for HIP DEX. Moreover, step 1804 6 has been added to the processing rules. 1806 6.9. Processing Incoming NOTIFY Packets 1808 Processing of NOTIFY packets is OPTIONAL. If processed, any errors 1809 in a received NOTIFICATION parameter SHOULD be logged. Received 1810 errors MUST be considered only as informational, and the receiver 1811 SHOULD NOT change its HIP state purely based on the received NOTIFY 1812 packet. 1814 If a NOTIFY packet is received in state I2-SENT, this packet is an I2 1815 reception acknowledgement of the optional retransmission mechanism 1816 extension and SHOULD be processed. The following steps define the 1817 conceptual processing rules for such incoming NOTIFY packets in state 1818 I2-SENT: 1820 1. The system MUST verify that the HITs in use correspond to the 1821 HITs that were received in the R1 packet that caused the 1822 transition to the I2-SENT state. If this check fails, the NOTIFY 1823 packet MUST be dropped silently. 1825 2. If the NOTIFY packet contains a NOTIFICATION parameter with 1826 Notify Message Type I2_ACKNOWLEDGEMENT, the system SHOULD set the 1827 I2 retransmission timer to the I2 processing time indicated in 1828 the NOTIFICATION parameter plus half the RTT-based timeout value. 1829 The system MUST NOT set the retransmission timeout to a higher 1830 value than allowed by a local policy. Moreover, the system 1831 SHOULD reset the I2 retransmission timer to the RTT-based timeout 1832 value after the next I2 retransmission. 1834 6.10. Processing UPDATE, CLOSE, and CLOSE_ACK Packets 1836 UPDATE, CLOSE, and CLOSE_ACK packets are handled similarly in HIP DEX 1837 as in HIPv2 (see Sections 6.11, 6.12, 6.14, and 6.15 of [RFC7401]). 1838 The only difference is the that the HIP_SIGNATURE is never present 1839 and, therefore, is not required to be processed by the receiving 1840 party. 1842 [RFC7402] specifies the rekeying of an existing HIP SA using the 1843 UPDATE message. This rekeying procedure can also be used with HIP 1844 DEX. However, where rekeying involves a new Diffie-Hellman key 1845 exchange, HIP DEX peers MUST establish a new HIP association in order 1846 to create a new Pair-wise Key SA due to the use of static ECDH key- 1847 pairs with HIP DEX. 1849 6.11. Handling State Loss 1851 Implementors MAY choose to use non-volatile, secure storage for HIP 1852 states in order for them to survive a system reboot. If no secure 1853 storage capabilities are available, the system SHOULD delete the 1854 corresponding HIP state, including the keying material. If the 1855 implementation does drop the state (as RECOMMENDED), it MUST also 1856 drop the peer's R1 generation counter value, unless a local policy 1857 explicitly defines that the value of that particular host is stored. 1858 Such storing of the R1 generation counter values MUST be configured 1859 by explicit HITs. 1861 7. HIP Policies 1863 There are a number of variables that will influence the HIP exchanges 1864 that each host must support. The value of puzzle difficulty K used 1865 in the HIP R1 must be chosen with care. Values for the K that are 1866 too high will exclude clients with weak CPUs because these devices 1867 cannot solve the puzzle within a reasonable amount of time. The K 1868 value should only be raised if a Responder is under high load, i.e., 1869 it cannot process all incoming HIP handshakes any more. 1871 If a Responder is not under high load, K SHOULD be 0. 1873 All HIP DEX implementations SHOULD provide for an Access Control List 1874 (ACL), representing for which hosts they accept HIP diet exchanges, 1875 and the preferred transport format and local lifetimes. Wildcarding 1876 SHOULD be supported for such ACLs. 1878 8. Interoperability between HIP DEX and HIPv2 1880 HIP DEX and HIPv2 both use the same protocol number and packet 1881 formats. Hence, an implementation that either supports HIP DEX or 1882 HIPv2 has to be able to detect the dialect that the peer is speaking. 1883 This section outlines how a HIP DEX implementation can achieve such 1884 detection for the two relevant cases where: 1886 1. the Initiator supports HIP DEX and the Responder supports HIP 1887 BEX, 1889 2. the Initiator supports HIP BEX and the Responder supports HIP 1890 DEX. 1892 In the first case, the HIP DEX implementation (Initiator) inspects 1893 the Responder's HIT prior to sending the I1 packet. If the OGA ID 1894 field of this HIT does not indicate the HIP DEX HIT Suite ID, the HIP 1895 DEX implementation cancels the handshake. If the Responder is 1896 unknown prior to sending the I1 packet (i.e., opportunistic mode), 1897 the HIP DEX implementation performs the above check on reception of 1898 the R1 packet and cancels the handshake in case of a negative result. 1899 In both failure scenarios, the implementation should report an error 1900 to the user via appropriate means. 1902 In the second case, the HIP DEX implementation (Responder) inspects 1903 the Initiator's HIT on reception of an I1 packet. If the OGA ID 1904 field of this HIT does not indicate the HIP DEX HIT Suite ID, the HIP 1905 DEX implementation cancels the handshake and sends an ICMP packet 1906 with type Parameter Problem, with the Pointer pointing to the source 1907 HIT, to the Initiator. As an off-path adversary could also send such 1908 an ICMP packet with the aim to prevent the HIP DEX handshake from 1909 completing, the Initiator SHOULD NOT react to an ICMP message before 1910 retransmission counter reaches I1_RETRIES_MAX in its state machine 1911 (see Table 3 in [RFC7401]). 1913 9. Security Considerations 1915 HIP DEX closely resembles HIPv2. As such, the security 1916 considerations discussed in Section 8 of [RFC7401] similarly apply to 1917 HIP DEX. HIP DEX, however, replaces the SIGMA-based authenticated 1918 Diffie-Hellman key exchange of HIPv2 with an exchange of random 1919 keying material that is encrypted with a Diffie-Hellman derived key. 1920 Both the Initiator and Responder contribute to this keying material. 1921 As a result, the following additional security considerations apply 1922 to HIP DEX: 1924 o The strength of the keys for the Pair-wise Key SA is based on the 1925 quality of the random keying material generated by the Initiator 1926 and the Responder. As either peer may be a sensor or an actuator 1927 device, there is a natural concern about the quality of its random 1928 number generator. 1930 o HIP DEX lacks the Perfect Forward Secrecy (PFS) property of HIPv2. 1931 Consequently, if an HI is compromised, all previous HIP 1932 connections protected with that HI are compromised as explained in 1933 Section 1. 1935 o The puzzle mechanism using CMAC explained in Section 4.1.1 may 1936 need further study regarding the level of difficulty in order to 1937 establish best practices with current generation of constrained 1938 devices. 1940 o The HIP DEX HIT generation may present new attack opportunities. 1941 Hence, HIP DEX HITs MUST NOT be used as the only means to identify 1942 a peer in an ACL. Instead, the use of the peer's HI is 1943 recommended as explained in Section 3. 1945 o The R1 packet is unauthenticated and offers an adversary a new 1946 attack vector against the Initiator. This is mitigated by only 1947 processing a received R1 packet when the Initiator has previously 1948 sent a corresponding I1 packet. Moreover, the Responder repeats 1949 the DH_GROUP_LIST, HIP_CIPHER, HIT_SUITE_LIST, and 1950 TRANSPORT_FORMAT_LIST parameters in the R2 packet in order to 1951 enable the Initiator to verify that these parameters have not been 1952 modified by an attacker in the unprotected R1 packet as explained 1953 in Section 6.8. 1955 o Contrary to HIPv2, HIP DEX does not provide for end-point 1956 anonymity for the Initiator or Responder. Thus, any signaling 1957 that indicates such anonymity should be ignored as explained in 1958 Section 1.1. 1960 The optional retransmission extension of HIP DEX is based on a NOTIFY 1961 packet that the Responder can use to inform the Initiator about the 1962 reception of an I2 packet. The Responder, however, cannot protect 1963 the authenticity of this packet as it did not yet set up the Master 1964 Key SA. Hence, an eavesdropping adversary may send spoofed reception 1965 acknowledgments for an overheard I2 packet and signal an arbitrary I2 1966 processing time to the Initiator. The adversary can, e.g., indicate 1967 a lower I2 processing time than actually required by the Responder in 1968 order to cause premature retransmissions. To protect against this 1969 attack, the Initiator SHOULD set the NOTIFY-based timeout value to 1970 the maximum indicated packet processing time in case of conflicting 1971 NOTIFY packets. This allows the legitimate Responder to extend the 1972 retransmission timeout to the intended length. The adversary, 1973 however, can still arbitrarily delay the protocol handshake beyond 1974 the Responder's actual I2 processing time. To limit the extend of 1975 such a maliciously induced handshake delay, this specification 1976 additionally requires the Initiator not to set the NOTIFY-based 1977 timeout value higher than allowed by a local policy. 1979 Section 5.3.1 mentions that implementations need to be able to handle 1980 storms of I1 packets. Contrary to HIPv2, R1 packets cannot be pre- 1981 computated in HIP DEX and also the state machine does not include an 1982 "R1_SENT" state (that would enable caching of R1 packets). 1983 Therefore, an implementation has to cache information (e.g., at least 1984 the HITs) from incoming I1 packets and rate control the incoming I1 1985 packets to avoid unnecessary packet processing during I1 packet 1986 storms. 1988 10. IANA Considerations 1990 The following changes to the "Host Identity Protocol (HIP) 1991 Parameters" registries have been made: 1993 HIT Suite ID This document defines the new HIT Suite "ECDH/FOLD" 1994 without four-bit ID of 8 and eight-bit encoding of 0x80 (see 1995 Section 5.2.4). 1997 Parameter Type This document defines the new HIP parameter 1998 "ENCRYPTED_KEY" with type number 643 (see Section 5.2.5). 2000 HIP Cipher ID This document defines the new HIP Cipher ID "AES- 2001 128-CTR" with type number 5 (see Section 5.2.2). 2003 HI Algorithm This document defines the new HI Algorithm "ECDH" with 2004 type number 11 (see Section 5.2.3). 2006 ECC Curve Label This document specifies a new algorithm-specific 2007 subregistry named "ECDH Curve Label". The values for this 2008 subregistry are defined in Section 5.2.1. 2010 11. Acknowledgments 2012 The drive to put HIP on a cryptographic 'Diet' came out of a number 2013 of discussions with sensor vendors at IEEE 802.15 meetings. David 2014 McGrew was very helpful in crafting this document. Special thanks to 2015 Miika Komu for reviewing this document in the context of Convince 2016 Celtic+ project. 2018 12. Changelog 2020 This section summarizes the changes made from draft-moskowitz-hip-rg- 2021 dex-05, which was the first stable version of the draft. Note that 2022 the draft was renamed after draft-moskowitz-hip-rg-dex-06. 2024 The draft was then renamed from draft-moskowitz-hip-dex to draft- 2025 ietf-hip-dex. 2027 12.1. Changes in draft-ietf-hip-dex-09 2029 o Fixed values for 2031 * DH_GROUP_LIST 2033 * HIT_SUITE_LIST 2035 to match [RFC7401]. 2037 12.2. Changes in draft-ietf-hip-dex-05 2039 o Clarified main differences between HIP BEX and HIP DEX in 2040 Section 1. 2042 o Addressed MitM attack in Section 8. 2044 o Minor editorial changes. 2046 12.3. Changes in draft-ietf-hip-dex-04 2048 o Added new paragraph on rekeying procedure with HIP DEX. 2050 o Updated references. 2052 o Editorial changes. 2054 12.4. Changes in draft-ietf-hip-dex-03 2056 o Added new section on HIP DEX/HIPv2 interoperability 2058 o Added reference to RFC4493 for CMAC. 2060 o Added reference to RFC5869 for CKDF. 2062 o Added processing of NOTIFY message in I2-SENT of state diagram. 2064 o Editorial changes. 2066 12.5. Changes in draft-ietf-hip-dex-02 2068 o Author address change. 2070 12.6. Changes in draft-ietf-hip-dex-01 2072 o Added the new ECDH groups of Curve25519 and Curve448 from RFC 2073 7748. 2075 12.7. Changes in draft-ietf-hip-dex-00 2077 o The Internet Draft was adopted by the HIP WG. 2079 12.8. Changes in draft-moskowitz-hip-rg-dex-06 2081 o A major change in the ENCRYPT parameter to use AES-CTR rather than 2082 AES-CBC. 2084 12.9. Changes in draft-moskowitz-hip-dex-00 2086 o Draft name change. HIPRG ended in IRTF, HIP DEX is now individual 2087 submission. 2089 o Added the change section. 2091 o Added a Definitions section. 2093 o Changed I2 and R2 packets to reflect use of AES-CTR for 2094 ENCRYPTED_KEY parameter. 2096 o Cleaned up KEYMAT Generation text. 2098 o Added Appendix with C code for the ECDH shared secret generation 2099 on an 8 bit processor. 2101 12.10. Changes in draft-moskowitz-hip-dex-01 2103 o Numerous editorial changes. 2105 o New retransmission strategy. 2107 o New HIT generation mechanism. 2109 o Modified layout of ENCRYPTED_KEY parameter. 2111 o Clarify to use puzzle difficulty of zero under normal network 2112 conditions. 2114 o Align inclusion directive of R1_COUNTER with HIPv2 (from SHOULD to 2115 MUST). 2117 o Align inclusion of TRANSPORT_FORMAT_LIST with HIPv2 (added to R1 2118 and I2). 2120 o HIP_CIPHER, HIT_SUITE_LIST, and TRANSPORT_FORMAT_LIST must now be 2121 echoed in R2 packet. 2123 o Added new author. 2125 12.11. Changes in draft-moskowitz-hip-dex-02 2127 o Introduced formal definition of FOLD function. 2129 o Clarified use of CMAC for puzzle computation in section "Solving 2130 the Puzzle". 2132 o Several editorial changes. 2134 12.12. Changes in draft-moskowitz-hip-dex-03 2136 o Addressed HI crypto agility. 2138 o Clarified purpose of secret exchanged via ENCRYPTED_KEY parameter. 2140 o Extended the IV in the ENCRYPTED_KEY parameter. 2142 o Introduced forward-references to HIP DEX KEYMAT process and 2143 improved KEYMAT section. 2145 o Replaced Appendix A on "C code for ECC point multiplication" with 2146 short discussion in introduction. 2148 o Updated references. 2150 o Further editorial changes. 2152 12.13. Changes in draft-moskowitz-hip-dex-04 2154 o Improved retransmission extension. 2156 o Updated and strongly revised packet processing rules. 2158 o Updated security considerations. 2160 o Updated IANA considerations. 2162 o Move the HI Algorithm for ECDH to a value of 11. 2164 o Many editorial changes. 2166 13. References 2168 13.1. Normative References 2170 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2171 Requirement Levels", BCP 14, RFC 2119, 2172 DOI 10.17487/RFC2119, March 1997, 2173 . 2175 [RFC2410] Glenn, R. and S. Kent, "The NULL Encryption Algorithm and 2176 Its Use With IPsec", RFC 2410, DOI 10.17487/RFC2410, 2177 November 1998, . 2179 [RFC3686] Housley, R., "Using Advanced Encryption Standard (AES) 2180 Counter Mode With IPsec Encapsulating Security Payload 2181 (ESP)", RFC 3686, DOI 10.17487/RFC3686, January 2004, 2182 . 2184 [RFC4443] Conta, A., Deering, S., and M. Gupta, Ed., "Internet 2185 Control Message Protocol (ICMPv6) for the Internet 2186 Protocol Version 6 (IPv6) Specification", STD 89, 2187 RFC 4443, DOI 10.17487/RFC4443, March 2006, 2188 . 2190 [RFC6261] Keranen, A., "Encrypted Signaling Transport Modes for the 2191 Host Identity Protocol", RFC 6261, DOI 10.17487/RFC6261, 2192 May 2011, . 2194 [RFC7343] Laganier, J. and F. Dupont, "An IPv6 Prefix for Overlay 2195 Routable Cryptographic Hash Identifiers Version 2 2196 (ORCHIDv2)", RFC 7343, DOI 10.17487/RFC7343, September 2197 2014, . 2199 [RFC7401] Moskowitz, R., Ed., Heer, T., Jokela, P., and T. 2200 Henderson, "Host Identity Protocol Version 2 (HIPv2)", 2201 RFC 7401, DOI 10.17487/RFC7401, April 2015, 2202 . 2204 [RFC7402] Jokela, P., Moskowitz, R., and J. Melen, "Using the 2205 Encapsulating Security Payload (ESP) Transport Format with 2206 the Host Identity Protocol (HIP)", RFC 7402, 2207 DOI 10.17487/RFC7402, April 2015, 2208 . 2210 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2211 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2212 May 2017, . 2214 13.2. Informative References 2216 [DH76] Diffie, W. and M. Hellman, "New Directions in 2217 Cryptography", IEEE Transactions on Information 2218 Theory vol. IT-22, number 6, pages 644-654, Nov 1976. 2220 [HWZ13] Hummen, R., Wirtz, H., Ziegeldorf, J., Hiller, J., and K. 2221 Wehrle, "Tailoring End-to-End IP Security Protocols to the 2222 Internet of Things", in Proceedings of IEEE International 2223 Conference on Network Protocols (ICNP 2013), October 2013. 2225 [I-D.ietf-hip-rfc4423-bis] 2226 Moskowitz, R. and M. Komu, "Host Identity Protocol 2227 Architecture", draft-ietf-hip-rfc4423-bis-20 (work in 2228 progress), February 2019. 2230 [IEEE.802-11.2007] 2231 Engineers, I. O. E. A. E., "Information technology - 2232 Telecommunications and information exchange between 2233 systems - Local and metropolitan area networks - Specific 2234 requirements - Part 11: Wireless LAN Medium Access Control 2235 (MAC) and Physical Layer (PHY) Specifications", 2236 IEEE Standard 802.11, June 2007, 2237 . 2240 [IEEE.802-15-4.2011] 2241 Engineers, I. O. E. A. E., "Information technology - 2242 Telecommunications and information exchange between 2243 systems - Local and metropolitan area networks - Specific 2244 requirements - Part 15.4: Wireless Medium Access Control 2245 (MAC) and Physical Layer (PHY) Specifications for Low-Rate 2246 Wireless Personal Area Networks (WPANs)", IEEE Standard 2247 802.15.4, September 2011, 2248 . 2251 [LN08] Liu, A. and H. Ning, "TinyECC: A Configurable Library for 2252 Elliptic Curve Cryptography in Wireless Sensor Networks", 2253 in Proceedings of International Conference on Information 2254 Processing in Sensor Networks (IPSN 2008), April 2008. 2256 [RFC4493] Song, JH., Poovendran, R., Lee, J., and T. Iwata, "The 2257 AES-CMAC Algorithm", RFC 4493, DOI 10.17487/RFC4493, June 2258 2006, . 2260 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 2261 Key Derivation Function (HKDF)", RFC 5869, 2262 DOI 10.17487/RFC5869, May 2010, 2263 . 2265 [RFC5903] Fu, D. and J. Solinas, "Elliptic Curve Groups modulo a 2266 Prime (ECP Groups) for IKE and IKEv2", RFC 5903, 2267 DOI 10.17487/RFC5903, June 2010, 2268 . 2270 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 2271 Curve Cryptography Algorithms", RFC 6090, 2272 DOI 10.17487/RFC6090, February 2011, 2273 . 2275 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 2276 Constrained-Node Networks", RFC 7228, 2277 DOI 10.17487/RFC7228, May 2014, 2278 . 2280 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 2281 Kivinen, "Internet Key Exchange Protocol Version 2 2282 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 2283 2014, . 2285 [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves 2286 for Security", RFC 7748, DOI 10.17487/RFC7748, January 2287 2016, . 2289 [SECG] SECG, "Recommended Elliptic Curve Domain Parameters", SEC 2290 2 , 2000, . 2292 Appendix A. Password-based two-factor authentication during the HIP DEX 2293 handshake 2295 HIP DEX allows to identify authorized connections based on a two- 2296 factor authentication mechanism. With two-factor authentication, 2297 devices that are authorized to communicate with each other are 2298 required to be pre-provisioned with a shared (group) key. The 2299 Initiator uses this pre-provisioned key to encrypt the 2300 ECHO_RESPONSE_UNSIGNED in the I2 packet. Upon reception of the I2, 2301 the Responder verifies that its challenge in the 2302 ECHO_REQUEST_UNSIGNED parameter in the R1 packet has been encrypted 2303 with the correct key. If verified successfully, the Responder 2304 proceeds with the handshake. Otherwise, it silently drops the I2 2305 packet. 2307 Note that there is no explicit signaling in the HIP DEX handshake for 2308 this behavior. Thus, knowledge of two-factor authentication must be 2309 configured externally prior to the handshake. 2311 Authors' Addresses 2313 Robert Moskowitz (editor) 2314 HTT Consulting 2315 Oak Park, MI 2316 USA 2318 EMail: rgm@htt-consult.com 2320 Rene Hummen 2321 Hirschmann Automation and Control 2322 Stuttgarter Strasse 45-51 2323 Neckartenzlingen 72654 2324 Germany 2326 EMail: rene.hummen@belden.com 2328 Miika Komu 2329 Ericsson Research, Finland 2330 Hirsalantie 11 2331 Jorvas 02420 2332 Finland 2334 EMail: miika.komu@ericsson.com