idnits 2.17.1 draft-ietf-ipsec-ikev2-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-26) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 69 longer pages, the longest (page 2) being 60 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 2692 has weird spacing: '... The equati...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The exact meaning of the all-uppercase expression 'NOT REQUIRED' is not defined in RFC 2119. If it is intended as a requirements expression, it should be rewritten using one of the combinations defined in RFC 2119; otherwise it should not be all-uppercase. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: A fully-qualified domain name string. An example of a ID_FQDN is, "lounge.org". The string MUST not contain any terminators (e.g. NULL, CR, etc.). == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: A fully-qualified RFC822 email address string, An example of a ID_RFC822_ADDR is, "lizard@lounge.org". The string MUST not contain any terminators. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: The Vendor ID payload is not an announcement from the sender that it will send private payload types but rather an announcement of the sort of private payloads it is willing to accept. The implementation sending the Vendor ID MUST not make any assumptions about private payloads that it may send unless a Vendor ID of like stature is received as well. Multiple Vendor ID payloads MAY be sent. An implementation is NOT REQUIRED to send any Vendor ID payload at all. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (April 2002) is 8047 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) == Missing Reference: 'RFC 2522' is mentioned on line 533, but not defined == Missing Reference: 'CERTREQ' is mentioned on line 907, but not defined == Missing Reference: 'CERT' is mentioned on line 906, but not defined == Missing Reference: 'IDr' is mentioned on line 908, but not defined == Missing Reference: 'KEi' is mentioned on line 1038, but not defined == Missing Reference: 'KEr' is mentioned on line 1051, but not defined == Missing Reference: 'P' is mentioned on line 1710, but not defined == Unused Reference: 'CAST' is defined on line 2853, but no explicit reference was found in the text == Unused Reference: 'BLOW' is defined on line 2856, but no explicit reference was found in the text == Unused Reference: 'Ble98' is defined on line 2865, but no explicit reference was found in the text == Unused Reference: 'BR94' is defined on line 2869, but no explicit reference was found in the text == Unused Reference: 'DES' is defined on line 2873, but no explicit reference was found in the text == Unused Reference: 'DH' is defined on line 2877, but no explicit reference was found in the text == Unused Reference: 'DSS' is defined on line 2881, but no explicit reference was found in the text == Unused Reference: 'IDEA' is defined on line 2885, but no explicit reference was found in the text == Unused Reference: 'Ker01' is defined on line 2889, but no explicit reference was found in the text == Unused Reference: 'KBC96' is defined on line 2892, but no explicit reference was found in the text == Unused Reference: 'SKEME' is defined on line 2896, but no explicit reference was found in the text == Unused Reference: 'MD5' is defined on line 2900, but no explicit reference was found in the text == Unused Reference: 'MSST98' is defined on line 2903, but no explicit reference was found in the text == Unused Reference: 'PKCS1' is defined on line 2913, but no explicit reference was found in the text == Unused Reference: 'PK01' is defined on line 2916, but no explicit reference was found in the text == Unused Reference: 'Pip98' is defined on line 2920, but no explicit reference was found in the text == Unused Reference: 'RC5' is defined on line 2923, but no explicit reference was found in the text == Unused Reference: 'RSA' is defined on line 2926, but no explicit reference was found in the text == Unused Reference: 'Sch96' is defined on line 2930, but no explicit reference was found in the text == Unused Reference: 'SHA' is defined on line 2933, but no explicit reference was found in the text == Unused Reference: 'TIGER' is defined on line 2937, but no explicit reference was found in the text ** Downref: Normative reference to an Informational RFC: RFC 2144 (ref. 'CAST') -- Possible downref: Non-RFC (?) normative reference: ref. 'BLOW' -- Possible downref: Non-RFC (?) normative reference: ref. 'Ble98' -- Possible downref: Non-RFC (?) normative reference: ref. 'BR94' -- Possible downref: Non-RFC (?) normative reference: ref. 'DES' -- Possible downref: Non-RFC (?) normative reference: ref. 'DH' -- Possible downref: Non-RFC (?) normative reference: ref. 'DSS' -- Possible downref: Non-RFC (?) normative reference: ref. 'IDEA' -- No information found for draft-keronytis-ike-id - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'Ker01' ** Downref: Normative reference to an Informational RFC: RFC 2104 (ref. 'KBC96') -- Possible downref: Non-RFC (?) normative reference: ref. 'SKEME' ** Downref: Normative reference to an Informational RFC: RFC 1321 (ref. 'MD5') ** Obsolete normative reference: RFC 2408 (ref. 'MSST98') (Obsoleted by RFC 4306) ** Downref: Normative reference to an Informational RFC: RFC 2412 (ref. 'Orm96') ** Downref: Normative reference to an Informational RFC: RFC 2367 (ref. 'PFKEY') -- Possible downref: Non-RFC (?) normative reference: ref. 'PKCS1' -- Possible downref: Non-RFC (?) normative reference: ref. 'PK01' ** Obsolete normative reference: RFC 2407 (ref. 'Pip98') (Obsoleted by RFC 4306) -- Possible downref: Non-RFC (?) normative reference: ref. 'RC5' -- Possible downref: Non-RFC (?) normative reference: ref. 'RSA' -- Possible downref: Non-RFC (?) normative reference: ref. 'Sch96' -- Possible downref: Non-RFC (?) normative reference: ref. 'SHA' -- Possible downref: Non-RFC (?) normative reference: ref. 'TIGER' Summary: 12 errors (**), 0 flaws (~~), 35 warnings (==), 21 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IPSEC Working Group Dan Harkins 3 INTERNET-DRAFT Charlie Kaufman 4 Steve Kent 5 Tero Kivinen 6 Radia Perlman 7 editors 8 draft-ietf-ipsec-ikev2-02.txt April 2002 10 Proposal for the IKEv2 Protocol 11 13 Status of this Memo 15 This document is an Internet Draft and is in full conformance with 16 all provisions of Section 10 of RFC2026 [Bra96]. Internet Drafts are 17 working documents of the Internet Engineering Task Force (IETF), its 18 areas, and working groups. Note that other groups may also distribute 19 working documents as Internet Drafts. 21 Internet Drafts are draft documents valid for a maximum of six months 22 and may be updated, replaced, or obsoleted by other documents at any 23 time. It is inappropriate to use Internet Drafts as reference 24 material or to cite them other than as "work in progress." 26 The list of current Internet-Drafts can be accessed at 27 http://www.ietf.org/1id-abstracts.html 29 The list of Internet-Draft Shadow Directories can be accessed at 30 http://www.ietf.org/shadow.html 32 Abstract 34 This document describes version 2 of the IKE (Internet Key Exchange) 35 protocol. IKE performs mutual authentication and establishes an IKE 36 security association that can be used to efficiently establish SAs 37 for ESP, AH and/or IPcomp. This version greatly simplifies IKE by 38 replacing the 8 possible phase 1 exchanges with a single exchange 39 based on either public signature keys or shared secret keys. The 40 single exchange provides identity hiding, yet works in 2 round trips 41 (all the identity hiding exchanges in IKE v1 required 3 round trips). 42 Latency of setup of an IPsec SA is further reduced from IKEv1 by 43 allowing setup of an SA for ESP, AH, and/or IPcomp to be piggybacked 44 on the initial IKE exchange. It also improves security by allowing 45 the Responder to be stateless until it can be assured that the 46 Initiator can receive at the claimed IP source address. This version 47 also presents the entire protocol in a single self-contained 48 document, in contrast to IKEv1, in which the protocol was described 49 in ISAKMP (RFC 2408), IKE (RFC 2409), and the DOI (RFC 2407) 50 documents. 52 Table of Contents 54 1. Introduction..............................................3 55 1.1 The IKE Protocol.........................................3 56 1.2 Change History...........................................4 57 1.3 Requirements Terminology.................................7 58 2 Protocol Overview..........................................7 59 2.1 Use of Retransmission Timers.............................8 60 2.2 Use of Sequence Numbers for Message ID...................8 61 2.3 Window Size for overlapping requests.....................9 62 2.4 State Synchronization and Connection Timeouts............9 63 2.5 Version Numbers and Forward Compatibility................11 64 2.6 Cookies..................................................12 65 2.7 Cryptographic Algorithm Negotiation......................16 66 2.8 Rekeying.................................................17 67 2.9 Traffic Selector Negotiation.............................18 68 2.10 Nonces..................................................18 69 2.11 Address and Port Agility................................19 70 2.12 Reuse of Diffie-Hellman Exponentials....................19 71 3 The Phase 1 Exchange.......................................20 72 3.1 Generating Keying Material for the IKE-SA................21 73 3.2 Authentication of the IKE-SA.............................22 74 4 The CREATE-CHILD-SA (Phase 2) Exchange.....................23 75 4.1 Generating Keying Material for Child-SAs.................24 76 4.2 Generating Keying Material for IKE-SAs during rollover...25 77 5 Informational (Phase 2) Exchange...........................26 78 6 Error Handling.............................................27 79 7 Header and Payload Formats.................................28 80 7.1 The IKE Header...........................................28 81 7.2 Generic Payload Header...................................30 82 7.3 Security Association Payload.............................32 83 7.3.1 Proposal Substructure..................................34 84 7.3.2 Transform Substructure.................................36 85 7.3.3 Mandatory Transform Types..............................39 86 7.3.4 Mandatory Transform-IDs................................39 87 7.3.5 Transform Attributes...................................40 88 7.3.6 Attribute Negotiation..................................41 89 7.4 Key Exchange Payload.....................................41 90 7.5 Identification Payload...................................42 91 7.6 Certificate Payload......................................44 92 7.7 Certificate Request Payload..............................45 93 7.8 Authentication Payload...................................46 94 7.9 Nonce Payload............................................47 95 7.10 Notify Payload..........................................48 96 7.10.1 Notify Message Types..................................49 97 7.11 Delete Payload..........................................53 98 7.12 Vendor ID Payload.......................................54 99 7.13 Traffic Selector Payload................................55 100 7.13.1 Traffic Selector Substructure.........................56 101 7.14 Other Payload types.....................................58 102 8 Diffie-Hellman Groups......................................58 103 9 Security Considerations....................................60 104 10 IANA Considerations.......................................61 105 10.1 Transform Types and Attribute Values....................61 106 10.2 Exchange Types..........................................59 107 10.3 Payload Types...........................................63 108 11 Acknowledgements..........................................63 109 12 References................................................63 110 Appendix A: Attribute Assigned Numbers.......................66 111 Appendix B: Cryptographic Protection of IKE Data.............68 112 Authors' Addresses...........................................70 114 1. Introduction 116 IP Security (IPsec) provides confidentiality, data integrity, and 117 data source authentication to IP datagrams. These services are 118 provided by maintaining shared state between the source and the sink 119 of an IP datagram. This state defines, among other things, the 120 specific services provided to the datagram, which cryptographic 121 algorithms will be used to provide the services, and the keys used as 122 input to the cryptographic algorithms. 124 Establishing this shared state in a manual fashion does not scale 125 well. Therefore a protocol to establish this state dynamically is 126 needed. This memo describes such a protocol-- the Internet Key 127 Exchange (IKE). This is version 2 of IKE. Version 1 of IKE was 128 defined in RFCs 2407, 2408, and 2409. This single document is 129 intended to replace all three of those RFCs. 131 1.1 The IKE Protocol 133 IKE performs mutual authentication between two parties and 134 establishes an IKE security association that includes shared secret 135 information that can be used to efficiently establish SAs for ESP 136 (RFC 2406), AH (RFC 2402) and/or IPcomp (RFC 2393). We call the IKE 137 SA an "IKE-SA", and the SAs for ESP, AH, and/or IPcomp that get set 138 up through that IKE-SA we call "child-SA"s. 140 We call the setup of the IKE-SA "phase 1" and subsequent IKE 141 exchanges "phase 2" even though setup of a child-SA can be 142 piggybacked on the initial phase 1 exchange. The phase 1 exchange is 143 two request/response pairs. A phase 2 exchange is one 144 request/response pair, and can be used to create or delete a child- 145 SA, rekey or delete the IKE-SA, or give information such as error 146 conditions. 148 IKE message flow always consists of a request followed by a response. 149 It is the responsibility of the requester to ensure reliability. If 150 the response is not received within a timeout interval, the requester 151 retransmits the request. 153 The first request/response of a phase 1 exchange, which we'll call 154 IKE_SA_init, negotiates security parameters for the IKE-SA, and sends 155 Diffie-Hellman values. We call the response IKE_SA_init_response. 157 The second request/response, which we'll call IKE_auth, transmits 158 identities, proves knowledge of the private signature key, and sets 159 up an SA for the first (and often only) AH and/or ESP and/or IPcomp. 160 We call the response IKE_auth_response. 162 If the Responder feels it is under attack, and wishes to use a 163 stateless cookie (see section on cookies). it can respond to an 164 IKE_SA_init with an IKE_SA_init_reject with a cookie value that must 165 be sent with a subsequent IKE_SA_init_request. The Initiator then 166 sends another IKE_SA_init, but this time including the Responder's 167 cookie value. 169 Phase 2 exchanges each consist of a single request/response pair. The 170 types of exchanges are CREATE_CHILD_SA (creates a child-SA), or an 171 informational exchange which deletes a child-SA or the IKE-SA or 172 informs the other side of some error condition. All these messages 173 require a response, so an informational message with no payloads can 174 serve as a check for liveness. 176 1.2 Change History 178 1.2.1 Changes from IKEv1 to IKEv2-00 November 2001 180 The goals of this revision to IKE are: 182 1) To define the entire IKE protocol in a single document, rather 183 than three that cross reference one another; 185 2) To simplify IKE by eliminating the Aggressive Mode option and all 186 but one of the authentication algorithms making phase 1 a single 187 exchange (based on public signature keys); 188 3) To remove the Domain of Interpretation (DOI), Situation (SIT), and 189 Labeled Domain Identifier fields, and the Commit and Authentication 190 only bits; 192 4) To decrease IKE's latency by making the initial exchange be 2 193 round trips (4 messages), and allowing the ability to piggyback setup 194 of a Child-SA on that exchange; 196 5) To replace the cryptographic algorithms for protecting the IKE 197 messages themselves with one based closely on ESP to simplify 198 implementation and security analysis; 200 6) To reduce the number of possible error states by making the 201 protocol reliable (all messages are acknowledged) and sequenced. This 202 allows shortening Phase 2 exchanges from 3 messages to 2; 204 7) To increase robustness by allowing the Responder, if under attack, 205 to require return of a cookie before the Responder commits any state 206 to the exchange; 208 8) To fix bugs such as the hash problem documented in [draft-ietf- 209 ipsec-ike-hash-revised-02.txt]; 211 9) To specify Traffic Selectors in their own payload type rather then 212 overloading ID payloads, and making more flexible the Traffic 213 Selectors that may be specified; 215 10) To avoid unnecessary exponential explosion of space in attribute 216 negotiation, by allowing choices when multiple algorithms of one type 217 (say, encryption) can work with any of a number of acceptable 218 algorithms of another type (say, integrity protection); 220 11) To specify required behavior under certain error conditions or 221 when data that is not understood is received in order to make it 222 easier to make future revisions in a way that does not break 223 backwards compatibility; 225 12) To simplify and clarify how shared state is maintained in the 226 presence of network failures and Denial of Service attacks; and 228 13) To maintain existing syntax and magic numbers to the extent 229 possible to make it likely that implementations of IKEv1 can be 230 enhanced to support IKEv2 with minimum effort. 232 1.2.2 Changes from IKEv2-00 to IKEv2-01 February 2002 234 1) Changed Appendix B to specify the encryption and authentication 235 processing for IKE rather than referencing ESP. Simplified the format 236 by removing idiosyncracies not needed for IKE. 238 2) Added option for authentication via a shared secret key. 240 3) Specified different keys in the two directions of IKE messages. 241 Removed requirement of different cookies in the two directions since 242 now no longer required. 244 4) Change the quantities signed by the two ends in AUTH fields to 245 assure the two parties sign different quantities. 247 5) Changed reference to AES to AES_128. 249 6) Removed requirement that Diffie-Hellman be repeated when rekeying 250 IKE SA. 252 7) Fixed typos. 254 8) Clarified requirements around use of port 500 at the remote end in 255 support of NAT. 257 9) Clarified required ordering for payloads. 259 10) Suggested mechanisms for avoiding DoS attacks. 261 11) Removed claims in some places that the first phase 2 piggybacked 262 on phase 1 was optional. 264 1.2.3 Changes from IKEv2-01 to IKEv2-02 April 2002 266 1) Moved the Initiator CERTREQ payload from message 1 to message 3. 268 2) Added a second optional ID payload in message 3 for the Initiator 269 to name a desired Responder to support the case where multiple named 270 identities are served by a single IP address. 272 3) Deleted the optimization whereby the Diffie-Hellman group did not 273 need to be specified in phase 2 if it was the same as in phase 1 (it 274 complicated the design with no meaningful benefit). 276 4) Added a section on the implications of reusing Diffie-Hellman 277 expontentials 279 5) Changed the specification of sequence numbers to being at 0 in 280 both directions. 282 6) Many editorial changes and corrections, the most significant being 283 a global replace of "byte" with "octet". 285 1.3 Requirements Terminology 287 Keywords "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT" and 288 "MAY" that appear in this document are to be interpreted as described 289 in [Bra97]. 291 2 Protocol Overview 293 IKE runs over UDP port 500. Since UDP is a datagram (unreliable) 294 protocol, IKE includes in its definition recovery from transmission 295 errors, including packet loss, packet replay, and packet forgery. IKE 296 is designed to function so long as at least one of a series of 297 retransmitted packets reaches its destination before timing out and 298 the channel is not so full of forged and replayed packets so as to 299 exhaust the network or CPU capacities of either endpoint. Even in the 300 absence of those minimum performance requirements, IKE is designed to 301 fail cleanly (as though the network were broken). 303 2.1 Use of Retransmission Timers 305 All messages in IKE exist in pairs: a request and a response. The 306 setup of an IKE SA normally consists of two request/response pairs. 307 Once the IKE SA is set up, either end of a security association may 308 initiate requests at any time, and there can be many requests and 309 responses "in flight" at any given moment. But each message is 310 labelled as either a request or a response and for each pair one end 311 of the security association is the Initiator and the other is the 312 Responder. 314 For every pair of messages, the Initiator is responsible for 315 retransmission in the event of a timeout. The Responder will never 316 retransmit a response unless it receives a retransmission of the 317 request. In that event, the Responder MUST either ignore the 318 retransmitted request except insofar as it triggers a retransmission 319 of the response OR if processing the request a second time has no 320 adverse effects, the Responder may choose to process the request 321 again and send a semantically equivalent reply. 323 IKE is a reliable protocol, in the sense that the Initiator MUST 324 retransmit a request until either it receives a corresponding reply 325 OR it deems the IKE security association to have failed and it 326 discards all state associated with the IKE-SA and any Child-SAs 327 negotiated using that IKE-SA. 329 2.2 Use of Sequence Numbers for Message ID 331 Every IKE message contains a Message ID as part of its fixed header. 332 This Message ID is used to match up requests and responses, and to 333 identify retransmissions of messages. 335 The Message ID is a 32 bit quantity, which is zero for the first IKE 336 request in each direction. The IKE SA initial setup messages will 337 always be numbered 0 and 1. Each endpoint in the IKE Security 338 Association maintains two "current" Message IDs: the next one to be 339 used for a request it initiates and the next one it expects to see 340 from the other end. These counters increment as requests are 341 generated and received. Responses always contain the same message ID 342 as the corresponding request. That means that after the initial 343 exchange, each integer n will appear as the message ID in four 344 distinct messages: The nth request from the original IKE Initiator, 345 the corresponding response, the nth request from the original IKE 346 Responder, and the corresponding response. If the two ends make very 347 different numbers of requests, the Message IDs in the two directions 348 can be very different. There is no ambiguity in the messages, 349 however, because each packet contains enough information to determine 350 which of the four messages a particular one is. 352 In the case where the IKE_SA_init is rejected (e.g. in order to 353 require a cookie), the second IKE_SA_init message will begin the 354 sequence over with Message #0. 356 2.3 Window Size for overlapping requests 358 In order to maximize IKE throughput, an IKE endpoint MAY issue 359 multiple requests before getting a response to any of them. For 360 simplicity, an IKE implementation MAY choose to process requests 361 strictly in order and/or wait for a response to one request before 362 issuing another. Certain rules must be followed to assure 363 interoperability between implementations using different strategies. 365 After an IKE-SA is set up, either end can initiate one or more 366 requests. These requests may pass one another over the network. An 367 IKE endpoint MUST be prepared to accept and process a request while 368 it has a request outstanding in order to avoid a deadlock in this 369 situation. An IKE endpoint SHOULD be prepared to accept and process 370 multiple requests while it has a request outstanding. 372 An IKE endpoint MUST NOT exceed the peer's stated window size (see 373 section 7.3.2) for transmitted IKE requests. In other words, if Bob 374 stated his window size is N, then when Alice needs to make a request 375 X, she MUST wait until she has received responses to all requests up 376 through request X-N. An IKE endpoint MUST keep a copy of (or be able 377 to regenerate exactly) each request it has sent until it receives the 378 corresponding response. An IKE endpoint MUST keep a copy of (or be 379 able to regenerate with semantic equivalence) the number of previous 380 responses equal to its contracted window size in case its response 381 was lost and the Initiator requests its retransmission by 382 retransmitting the request. 384 An IKE endpoint SHOULD be capable of processing incoming requests out 385 of order to maximize performance in the event of network failures or 386 packet reordering. 388 2.4 State Synchronization and Connection Timeouts 390 An IKE endpoint is allowed to forget all of its state associated with 391 an IKE-SA and the collection of corresponding child-SAs at any time. 392 This is the anticipated behavior in the event of an endpoint crash 393 and restart. It is important when an endpoint either fails or 394 reinitializes its state that the other endpoint detect those 395 conditions and not continue to waste network bandwidth by sending 396 packets over those SAs and having them fall into a black hole. 398 Since IKE is designed to operate in spite of Denial of Service (DoS) 399 attacks from the network, an endpoint MUST NOT conclude that the 400 other endpoint has failed based on any routing information (e.g. ICMP 401 messages) or IKE messages that arrive without cryptographic 402 protection (e.g., notify messages complaining about unknown SPIs). An 403 endpoint MUST conclude that the other endpoint has failed only when 404 repeated attempts to contact it have gone unanswered for a timeout 405 period. An endpoint SHOULD suspect that the other endpoint has failed 406 based on routing information and initiate a request to see whether 407 the other endpoint is alive. To check whether the other side is 408 alive, IKE provides a null query notify message that requires an 409 acknowledgment. If a cryptographically protected message has been 410 received from the other side recently, unprotected notifications MAY 411 be ignored. Implementations MUST limit the rate at which they 412 generate responses to unprotected messages. 414 Numbers of retries and lengths of timeouts are not covered in this 415 specification because they do not affect interoperability. It is 416 suggested that messages be retransmitted at least a dozen times over 417 a period of at least several minutes before giving up on an SA, but 418 different environments may require different rules. An exception to 419 this rule is that a Responder who has not received a 420 cryptographically protected message on an IKE-SA MUST eventually time 421 it out and delete it. Note that consuming state on an IKE Responder 422 by setting up large numbers of half-open IKE-SAs is a likely denial 423 of service attack, so the policy for timing these out and limiting 424 the resources they consume should be considered carefully. 426 There is a Denial of Service attack on the Initiator of an IKE SA 427 that can be avoided if the Initiator takes the proper care. Since the 428 first two messages of an SA setup are not cryptographically 429 protected, an attacker could respond to the Initiator's message 430 before the genuine Responder and poison the connection setup attempt. 431 To prevent this, the Initiator SHOULD be willing to accept multiple 432 responses to its first message, treat each as potentially legitimate, 433 respond to it, and then discard all the invalid half open connections 434 when she receives a valid cryptographically protected response to any 435 one of her responses. 437 Note that with these rules, there is no reason to negotiate and agree 438 upon an SA lifetime. If IKE presumes the partner is dead, based on 439 repeated lack of acknowledgment to an IKE message, then the IKE SA 440 and all child-SAs set up through that IKE-SA are deleted. 442 An IKE endpoint MAY delete inactive Child-SAs to recover resources 443 used to hold their state. If an IKE endpoint chooses to do so, it 444 MUST send Delete payloads to the other end notifying it of the 445 deletion. It MAY similarly time out the IKE-SA. Closing the IKE-SA 446 implicitly closes all associated Child-SAs. An IKE endpoint SHOULD 447 send a Delete payload indicating that it has closed the IKE-SA. 449 2.5 Version Numbers and Forward Compatibility 451 This document describes version 2.0 of IKE, meaning the major version 452 number is 2 and the minor version number is zero. It is likely that 453 some implementations will want to support both version 1.0 and 454 version 2.0, and in the future, other versions. 456 The major version number should only be incremented if the packet 457 formats or required actions have changed so dramatically that an 458 older version node would not be able to interoperate with a newer 459 version node if it simply ignored the fields it did not understand 460 and took the actions specified in the older specification. The minor 461 version number indicates new capabilities, and MUST be ignored by a 462 node with a smaller minor version number, but used for informational 463 purposes by the node with the larger minor version number. For 464 example, it might indicate the ability to process a newly defined 465 notification message. The node with the larger minor version number 466 would simply note that its correspondent would not be able to 467 understand that message and therefore would not send it. 469 If you receive a message with a higher major version number, you MUST 470 drop the message and SHOULD send an unauthenticated notification 471 message containing the highest version number you support. If you 472 support major version n, and major version m, you MUST support all 473 versions between n and m. If you receive a message with a major 474 version that you support, you MUST respond with that version number. 475 In order to prevent two nodes from being tricked into corresponding 476 with a lower major version number than the maximum that they both 477 support, IKE has a flag that indicates that the node is capable of 478 speaking a higher major version number. 480 Thus the major version number in the IKE header indicates the version 481 number of the message, not the highest version number that the 482 transmitter supports. If A is capable of speaking versions n, n+1, 483 and n+2, and B is capable of speaking versions n and n+1, then they 484 will negotiate speaking n+1, where A will set the flag indicating 485 ability to speak a higher version. If they mistakenly (perhaps 486 through an active attacker sending error messages) negotiate to 487 version n, then both will notice that the other side can support a 488 higher version number, and they MUST break the connection and 489 reconnect using version n+1. 491 Note that v1 does not follow these rules, because there is no way in 492 v1 of noting that you are capable of speaking a higher version 493 number. So an active attacker can trick two v2-capable nodes into 494 speaking v1. Given the design of v1, there is no way of preventing 495 this, but this version number discipline will prevent such problems 496 in future versions. When a v2-capable node negotiates down to v1, it 497 SHOULD note that fact in its logs. 499 ISSUE: The SSLv2 to SSLv3 upgrade handled this issue in a very clever 500 way, and we could copy it. SSLv3 specified that certain octets that 501 in v2 were randomly generated values be set to a constant when a v3 502 capable node negotiated down to v2. We could, for example, choose a 503 constant value for part of the IKEv1 cookie to indicate IKEv2 504 capability. Alternatively, we could define a new IKEv1 cipher suite 505 that no IKEv1 implementation could accept but which could be used as 506 such a flag. 508 Also for forward compatibility, all fields marked RESERVED MUST be 509 set to zero by a version 2.0 implementation and their content MUST be 510 ignored by a version 2.0 implementation ("Be conservative in what you 511 send and liberal in what you receive"). In this way, future versions 512 of the protocol can use those fields in a way that is guaranteed to 513 be ignored by implementations that do not understand them. 514 Similarly, payload types that are not defined are reserved for future 515 use and implementations of version 2.0 MUST skip over those payloads 516 and ignore their contents. 518 IKEv2 adds a "critical" flag to each payload header for further 519 flexibility for forward compatibility. If the critical flag is set 520 and the payload type is unsupported, the message MUST be rejected and 521 the response to the IKE request containing that payload MUST include 522 a notify payload UNSUPPORTED-CRITICAL-PAYLOAD, indicating an 523 unsupported critical payload was included. If the critical flag is 524 not set and the payload type is unsupported, that payload is simply 525 skipped. While new payload types may be added in the future and may 526 appear interleaved with the fields defined in this specification, 527 implementations MUST send the payloads defined in this specification 528 in the stated order and implementations SHOULD reject as invalid a 529 message with payloads in an unexpected order. 531 2.6 Cookies 533 The term "cookies" originates with Karn and Simpson [RFC 2522] in 534 Photurus, an early proposal for key managment with IPsec. It has 535 persisted because the IETF has never rejected an offer involving 536 cookies. In IKEv2, the cookies serve two purposes. First, they are 537 used as IKE-SA identifiers in the headers of IKE messages. As with 538 ESP and AH, in IKEv2 the recipient of a message chooses an IKE-SA 539 identifier that uniquely defines that SA to that recipient. For this 540 purpose (IKE-SA identifiers), it might be convenient for the cookie 541 value to be chosen so as to be a table index for fast lookups of SAs. 542 But this conflicts with the second purpose of the cookies (to be 543 explained shortly). 545 Unlike ESP and AH where only the recipient's SA identifier appears in 546 the message, in IKE, the sender's IKE SA identifier is also sent in 547 every message. In IKEv1 the IKE-SA identifier consisted of the pair 548 (Initiator cookie, Responder cookie), whereas in IKEv2, the SA is 549 uniquely defined by the recipient's SA identifier even though both 550 are included in the IKEv2 header. 552 The second use of cookies in IKEv2 is for a limited protection from 553 denial of service attacks. Receipt of a request to start an SA can 554 consume substantial resources. A likely denial of service attack 555 against IKE is to overwhelm a system with large numbers of SA 556 requests from forged IP addresses. This can consume CPU resources 557 doing the crypto, and memory resources remembering the state of the 558 "half open" connections until they time out. A robust design would 559 limit the resources it is willing to devote to new connection 560 establishment, but even so the denial of service attack could 561 effectively prevent any new connections. 563 This attack can be rendered more difficult by requiring that the 564 Responder to an SA request do minimal computation and allocate no 565 memory until the Initiator has proven that it can receive messages at 566 the address it claims to be sending from. This is done in a stateless 567 way by computing the cookie in a way that the Responder can recompute 568 the same value, but the Initiator can't guess it. A recommended 569 strategy is to compute the cookie as a cryptographic hash of the 570 Initiator's IP address, the Initiator's cookie value (its chosen IKE 571 security identifier), and a secret known only to the Responder. That 572 secret should be changed periodically to prevent the "cookie jar" 573 attack where an attacker accumulates lots of cookies from lots of IP 574 addresses over time and then replays them all at once to overwhelm 575 the Responder. 577 In ISAKMP and IKEv1, the term cookie was used for the connection 578 identifier, but the protocol did not permit their use against this 579 particular denial of service attack. To avoid the cookie exchange 580 adding extra messages to the protocol in the common case where the 581 Responder is not under attack, IKEv2 goes back to the approach in 582 Oakley (RFC 2412) where the cookie challenge is optional. Upon 583 receipt of an IKE_SA_init, a Responder may either proceed with 584 setting up the SA or may tell the Initiator to send another 585 IKE_SA_init, this time providing a supplied cookie. 587 It may be convenient for the IKE-SA identifier to be an index into a 588 table. It is not difficult for the Initiator to choose an IKE-SA 589 identifier that is convenient as a table identifier, since the 590 Initiator does not need to use it as an anti-clogging token, and is 591 keeping state. IKEv2 allows the Responder to initially choose a 592 stateless anti-clogging type cookie by responding to an IKE_SA_init 593 with a cookie request, and then upon receipt of an IKE_SA_init with a 594 valid cookie, change his cookie value from the computed anti-clogging 595 token to a more convenient value, by sending a different value for 596 his cookie in the IKE_SA_init_response. This will not confuse the 597 Initiator (Alice), because she will have chosen a unique cookie value 598 A, so if her SA state for the partially set up IKE-SA says that Bob's 599 cookie for the SA that Alice knows as "A" is B, and she receives a 600 response from Bob with cookies (A,C), that means that Bob wants to 601 change his value from B to C for the SA that Alice knows uniquely as 602 "A". 604 Another reason why Bob might want to change his cookie value is that 605 it is possible (though unlikely) that Bob will choose the same cookie 606 for multiple SAs if the hash of the Initiator cookie, Initiator IP 607 address, and whatever other information might be included happens to 608 hash to the same value. 610 In IKEv2, like IKEv1, both 8-octet cookies appear in the message, but 611 in IKEv2 (unlike v1), the value chosen by the message recipient 612 always appears first in the message. This change eliminates a flaw in 613 IKEv1, as well as having other advantages (allowing the recipient to 614 look up the SA based on a small, conveniently chosen value rather 615 than a 16-octet pseudorandom value.) 617 The flaw in IKEv1 is that it was possible (though unlikely) for two 618 connections to have the same set of cookies. For instance, if Alice 619 chose A as the Initiator cookie when initiating a connection to Bob, 620 she might subsequently receive a connection request from Carol, and 621 Carol might also have chosen A as the Initiator cookie. Whatever 622 value Alice responds to Carol, say B, might be selected as the 623 Responder cookie by Bob for the Alice-Bob SA. Then Alice would be 624 involved in two IKE sessions, both of which had Initiator cookie=A 625 and Responder cookie=B. To minimize, but not eliminate, the 626 probability of this happening, version 1 IKE recommended that cookies 627 be chosen at random. 629 The cookies are one of the inputs into the function that computes the 630 keying material. If the Responder initially sends a stateless cookie 631 value in its IKE_SA_init_reject, and changes to a different value 632 when it sends its IKE_SA_init_response, it is the cookie value in the 633 IKE_SA_init_response that is the input for generating the keying 634 material. 636 Note that one of the denial of service attacks that cookies are 637 designed to thwart is exhaustion of state at the target by creating 638 half-open connections. This defense would be ineffective if there 639 were another equally easy way for an attacker to consume state at the 640 target. IKE runs over UDP, and may send messages sufficiently large 641 that they must be fragmented. But accumulating fragments of UDP 642 packets consumes state at the target, so if an IKE responder were 643 required to accept and reassemble UDP packets from unknown sources, 644 another equally easy denial of service attack would be possible. 646 To thwart the UDP reassembly buffer attack, the IKE responder SHOULD, 647 when it detects that it is under attack, have a mechanism to inform 648 IP reassembly to only accept UDP fragments from IP addresses from 649 which it has received a valid cookie and to refuse to accept UDP 650 fragments from all other IP addresses. To faccilitate this, the 651 IKE_SA_init message SHOULD be kept under 500 octets and responders 652 MAY reject fragmented IKE_SA_init messages. 654 2.7 Cryptographic Algorithm Negotiation 656 The payload type known as "SA" indicates a proposal for a set of 657 choices of protocols (e.g., IKE, ESP, AH, and/or IPcomp) for the SA 658 as well as cryptographic algorithms associated with each protocol. In 659 IKEv1 it was extremely complex, and required a separate proposal for 660 each possible combination. If there were n algorithms of one type 661 (say encryption) that were acceptable and worked with any one of m 662 algorithms of another type (say integrity protection), then it would 663 take space proportional to n*m to express all of the possibilities. 665 IKEv2 has simplified the format of the SA payload somewhat, but in 666 addition to simplifying the format, solves the exponential explosion 667 by allowing, within a proposal, multiple algorithms of the same type. 668 If more than one algorithm of the same type (say encryption) appears 669 in a proposal, that means that the sender of that SA proposal is 670 willing to accept the proposal with any of those choices, and the 671 recipient when it accepts the proposal selects exactly one of each of 672 the types of algorithms from the choices offered within that 673 proposal. 675 An SA consists of one or more proposals. Each proposal has a number 676 (so that the recipient can specify which proposal has been accepted), 677 and contains a protocol (IKE, ESP, AH, or IPcomp), a SPI to identify 678 the SA for ESP or AH or IPcomp, and set of transforms. Each transform 679 consists of a type (e.g., encryption, integrity protection, 680 authentication, Diffie-Hellman group, compression) and a transform ID 681 (e.g., DES, IDEA, HMAC-MD5). To negotiate an SA that does ESP, 682 IPcomp, and AH, the SA will contain three proposals with the same 683 proposal number, one proposing ESP, a 4 octet SPI to be used with 684 ESP, and a set of transforms; one proposing AH, a 4-octet SPI to be 685 used with AH, and a set of transforms; and one proposing IPcomp, a 686 2-octet SPI to be used with IPcomp, and a set of transforms. If the 687 recipient selects that proposal number, it means that SAs will be 688 created for all of ESP, AH, and IPcomp. 690 In IKEv2, since the Initiator sends her Diffie-Hellman value in the 691 IKE_SA_init, she must guess at the Diffie-Hellman group that Bob will 692 select from her list of supported groups. Her guess MUST be the first 693 in the list to allow Bob to unambiguously identify which group the 694 accompanying KE payload is from. If her guess is incorrect then Bob's 695 response informs her of the group he would choose, and notifies her 696 that her offer is invalid because the KE payload is not from the 697 desired group. In this case Alice will send a new IKE_SA_init, with 698 the same original choices in the list (this is important to prevent 699 an active attacker from tricking them into using a weaker group than 700 they would have agreed upon) but with Bob's preferred group first, 701 and a KE payload containing an exponential from that group. 703 If none of Alice's options are acceptable, then Bob notifies her 704 accordingly. 706 2.8 Rekeying 708 Security associations negotiated in both phase 1 and phase 2 contain 709 secret keys which may only be used for a limited amount of time. This 710 determines the lifetime of the entire security association. When the 711 lifetime of a security association expires the security association 712 MUST NOT be used. If there is demand, new security associations can 713 be established. Reestablishment of security associations to take the 714 place of ones which expire is referred to as "rekeying". 716 To rekey a child-SA, create a new, equivalent SA (see section 4 and 717 4.1 below), and when the new one is established, delete the old one. 718 To rekey an IKE-SA, establish a new equivalent IKE-SA (see section 4 719 and 4.2 below) with the peer to whom the old IKE-SA is shared using a 720 Phase 2 negotiation within the existing IKE-SA. An IKE-SA so created 721 inherits all of the original IKE-SA's child SAs. Use the new IKE-SA 722 for all control messages needed to maintain the child-SAs created by 723 the old IKE-SA, and delete the old IKE-SA. 725 SAs SHOULD be rekeyed proactively, i.e., the new SA should be 726 established before the old one expires and becomes unusable. Enough 727 time should elapse between the time the new SA is established and the 728 old one becomes unusable so that traffic can be switched over to the 729 new SA. 731 A difference between IKEv1 and IKEv2 is that in IKEv1 SA lifetimes 732 were negotiated. In IKEv2, each end of the SA is responsible for 733 enforcing its own lifetime policy on the SA and rekeying the SA when 734 necessary. If the two ends have different lifetime policies, the end 735 with the shorter lifetime will end up always being the one to request 736 the rekeying. 738 If the two ends have the same lifetime policies, it is possible that 739 both will initiate a rekeying at the same time (which will result in 740 redundant SAs). To reduce the probability of this happening, the 741 timing of rekeying requests should be jittered (delayed by a random 742 amount of time). 744 This form of rekeying will temporarily result in multiple similar SAs 745 between the same pairs of nodes. When there are two SAs eligible to 746 receive packets, a node MUST accept incoming packets through either 747 SA. The node that initiated the rekeying SHOULD delete the older SA 748 after the new one is established. 750 2.9 Traffic Selector Negotiation 752 When an IP packet is received by an RFC2401 compliant IPsec subsystem 753 and matches a "protect" selector in its SPD, the subsystem MUST 754 protect that packet with IPsec. When no SA exists yet it is the task 755 of IKE to create it. Information about the traffic that needs 756 protection is transmitted to the IKE subsystem in a manner outside 757 the scope of this document (see [PFKEY] for an example). This 758 information is negotiated between the two IKE endpoints using TS 759 (Traffic Selector) payloads. 761 The TS payload consists of a set of individual traffic selectors. 762 The selector from the SPD has "source" and "destination" components 763 and these are represented in IKE as a pair of TS payloads, TSi 764 (traffic selector-initiator) and TSr (traffic selector-responder). 765 TSi describes the addresses and ports that the Initiator will send 766 from over the SA and which it will accept packets for. TSr describes 767 the addresses and ports that the Initiator will sent to over the SA 768 and which it will accept packets from. 770 The Responder is allowed to narrow the choices by selecting a subset 771 of the traffic, for instance by eliminating one or more members of 772 the set of traffic selectors provided the set does not become the 773 NULL set. 775 Note that the traffic selectors apply to both child-SAs (from the 776 Initiator to the Responder and from the Responder to the Initiator), 777 but the Responder does not change the order of the TS payloads. An 778 address within the selector of TSi would appear as a source address 779 in the child-SA from the Initiator, and would appear as a destination 780 address in traffic on the child-SA to the Initiator (from the 781 Responder). 783 IKEv2 is more flexible than IKEv1. IKEv2 allows sets of ranges of 784 both addresses and ports, and allows the Responder to choose a subset 785 of the requested traffic rather than simply responding "not 786 acceptable". 788 2.10 Nonces 790 The IKE_SA_init_request and the IKE_SA_init_response each contain a 791 nonce. These nonces are used as inputs to cryptographic functions. 792 The child-create-request and the child-create-response also contain a 793 nonce. These nonces are used to add freshness to the key derivation 794 technique used to obtain keys for child SAs. Nonces used in IKEv2 795 MUST therefore have strong pseudo-random properties (see RFC1715). 797 2.11 Address and Port Agility 799 IKE runs over UDP port 500, and implicitly sets up ESP, AH, and 800 IPcomp associations for the same IP addresses it runs over. The IP 801 addresses and ports in the outer header are, however, not themselves 802 cryptographically protected, and IKE is designed to work even through 803 Network Address Translation (NAT) boxes. An implementation MUST 804 accept incoming connection requests even if not received from UDP 805 port 500, and should respond to the address and port from which the 806 request was received. An implementation MUST, however, accept 807 incoming requests only on UDP port 500 and send all responses from 808 UDP port 500. IKE functions identically over IPv4 or IPv6. 810 2.12 Reuse of Diffie-Hellman Exponentials 812 IKE generates keying material using an ephemeral Diffie-Hellman 813 exchange in order to gain the property of "perfect forward secrecy". 814 This means that once a connection is closed and its corresponding 815 keys are forgotten, even someone who has recorded all of the data 816 from the connection and gets access to all of the long term keys of 817 the two endpoints cannot reconstruct the keys used to protect the 818 conversation. 820 Achieving perfect forward secrecy requires that when a connection is 821 closed, each endpoint must forget not only the keys used by the 822 connection but any information that could be used to recompute those 823 keys. In particular, it must forget the secrets used in the Diffie- 824 Hellman calculation and any state that may persist in the state of a 825 pseudo-random number generater that could be used to recompute the 826 Diffie-Hellman secrets. 828 Since the computing of Diffie-Hellman exponentials is computationally 829 expensive, an endpoint may find it advantageous to reuse those 830 exponentials for multiple connection setups. There are several 831 reasonable strategies for doing this. An endpoint could choose a new 832 exponential periodically though this could result in less-than- 833 perfect forward secrecy if some connection lasts for less than the 834 lifetime of the exponential. Or it could keep track of which 835 exponential was used for each connection and delete the information 836 associated with the exponential only when some corresponding 837 connection was closed. This would allow the exponential to be reused 838 without losing perfect forward secrecy at the cost of maintaining 839 more state. 841 Decisions as to whether and when to reuse Diffie-Hellman exponentials 842 is a private decision in the sense that it will not affect 843 interoperability. An implementation that reuses exponentials may 844 choose to remember the exponential used by the other endpoint on past 845 exchanges and if one is reused to avoid the second half of the 846 calculation. 848 3 The Phase 1 Exchange 850 The base Phase 1 exchange is a four message exchange (two 851 request/response pairs). The first pair of messages, the IKE_SA_init 852 exchange, negotiate cryptographic algorithms, (optionally) indicate 853 trusted CA names, exchange nonces, and do a Diffie-Hellman exchange. 854 This pair might be repeated if the response indicates that none of 855 the cryptographic proposals are acceptable, or the Diffie-Hellman 856 group chosen by the Initiator for sending her Diffie-Hellman value is 857 not the group that the Responder would have chosen, of if the 858 Responder is under attack and will only answer IKE_SA_init requests 859 containing a valid returned cookie value. 861 The second pair of messages, the IKE_auth and the IKE_auth_response, 862 authenticate the previous messages, exchange identities and 863 certificates, and establish the first child_SA. This pair of messages 864 is encrypted with a key established through the IKE_SA_init exchange, 865 so the identities are hidden from eavesdroppers. 867 In the following description, the payloads contained in the message 868 are indicated by names such as SA. The details of the contents of 869 each payload are described later. Payloads which may optionally 870 appear will be shown in brackets, such as [CERTREQ], would indicate 871 that optionally a certificate request payload can be included. 873 The Phase 1 exchange is as follows: 875 Initiator Responder 876 ----------- ----------- 877 HDR, SAi1, KEi, Ni --> 879 The SAi1 payload states the cryptographic algorithms the Initiator 880 supports for the IKE SA. The KE payload sends the Initiator's 881 Diffie-Hellman value. Ni is the Initiator's nonce. 883 <-- HDR, SAr1, KEr, Nr, [CERTREQ] 885 The Responder chooses among the Initiator's cryptographic algorithms 886 and expresses that choice in the SAr1 payload, completes the Diffie- 887 Hellman exchange with the KEr payload, and sends its nonce in the Nr 888 payload. 890 At this point in time each party generates SKEYSEED and its 891 derivatives. The following two messages, the SA_auth and 892 SA_auth_response, are encrypted and integrity protected (as indicated 893 by the '*' following the IKE header) and the encryption bit in the 894 IKE header is set. The keys used for the encryption and integrity 895 protection are derived from SK_a and SK_e as described below. 897 HDR*, IDi, [CERT,] [CERTREQ,] [IDr,] AUTH, 898 SAi2, TSi, TSr --> 900 The Initiator identifies herself with the IDi payload and 901 authenticates herself to the Responder with the AUTH payload, and 902 begins negotiation of a child-SA using the SAi2 payload. The fields 903 starting with SAi2 are described in the description of Phase 2. 905 There are optional fields where the Initiator can provide 906 certificates [CERT] the Responder might find useful in validating 907 AUTH, her list of preferred root certifiers [CERTREQ], and the name 908 of the entity with which she is trying to open a connection [IDr] 909 (for the case where multiple named entities exist at a single IP 910 address). 912 <-- HDR*, IDr, [CERT,] AUTH, 913 SAr2, TSi, TSr 915 The Responder identifies himself with an ID payload optionally sends 916 one or more certificates, authenticates himself with the AUTH 917 payload, and completes negotiation of a child-SA with the additional 918 fields described below in the phase 2 exchange. 920 3.1 Generating Keying Material for the IKE-SA 922 The shared secret information is computed as follows. A quantity 923 called SKEYSEED is calculated from the nonces exchanged during the 924 IKE_SA_init exchange, and the Diffie-Hellman shared secret 925 established during that exchange. SKEYSEED is used to calculate 926 three other secrets: SK_d used for deriving new keys for the child- 927 SAs established with this IKE-SA; SK_a used for authenticating the 928 component messages of subsequent exchanges; and SK_e used for 929 encrypting (and of course decrypting) all subsequent exchanges. 930 SKEYSEED and its derivatives are computed as follows: 932 SKEYSEED = prf(Ni | Nr, g^ir) 933 SK_d = prf(SKEYSEED, g^ir | Ni | Nr | CKY-I | CKY-R | 0) 934 SK_a = prf(SKEYSEED, SK_d | g^ir | Ni | Nr | CKY-I | CKY-R | 1) 935 SK_e = prf(SKEYSEED, SK_a | g^ir | Ni | Nr | CKY-I | CKY-R | 2) 937 CKY-I and CKY-R are the Initiator's and Responder's cookies, 938 respectively, from the IKE header. g^ir is the shared secret from the 939 ephemeral Diffie-Hellman exchange. Ni and Nr are the nonces, 940 stripped of any headers. 0, 1, and 2 are represented by a single 941 octet containing the value 0, 1, or 2 (the values, not the ASCII 942 representation of the digits). prf is the "pseudo-random" 943 cryptographic function negotiated in the IKE-SA-init exchange. 945 The two directions of flow use different keys. Keys used to protect 946 messages from the original initiator are taken from the first bits of 947 SK_a and SK_e. Keys used to protect messages in the other direction 948 are taken from subsequent bits. Each algorithm takes a fixed number 949 of bits of keying material, which is specified as part of the 950 algorithm. If the total number of key bits needed is greater than the 951 size of the output of the prf function, the keying material must be 952 expanded. 954 For situations where the amount of keying material desired is greater 955 than that supplied by the prf, KEYMAT is expanded by feeding the 956 results of the prf back into itself and concatenating results until 957 the required keying material has been reached. In other words, 959 KEYMAT = K1 | K2 | K3 | ... 960 where: 961 K1 = prf(SK_x, 0) 962 K2 = prf(SK_x, K1) 963 K3 = prf(SK_x, K2) 964 etc. 966 where 0 is represented by a single octet containing the value 0 (the 967 value, not the ASCII representation of the digit), and SK_x is either 968 SK_e or SK_a depending on which keying material needs expansion. 970 3.2 Authentication of the IKE-SA 972 The peers are authenticated by having each sign (or MAC using a 973 shared secret as the key) the concatenation of their own first 974 message and the other peer's nonce. The octets to be signed start 975 with the first octet of the header and end with the last octet of the 976 last payload. The octets of the nonce are only the content and not 977 the header. 979 Note that all of payloads of the peer's own first message are 980 included under the signature, including payload types not defined in 981 this document. It is possible that some other payloads defined in 982 the future might appropriately be zeroed before signing, but such a 983 possibility is not supported by this version of IKE. 985 Optionally, messages 3 and 4 MAY include a certificate, or 986 certificate chain providing evidence that the key used to compute a 987 digital signature belongs to the name in the ID payload. The 988 signature or MAC will be computed using algorithms dictated by the 989 type of key used by the signer, an RSA-signed PKCS1-padded-SHA1-hash 990 for an RSA digital signature, a DSS-signed SHA1-hash for a DSA 991 digital signature, or the negotiated PRF function for a pre-shared 992 key. There is no requirement that the Initiator and Responder sign 993 with the same cryptographic algorithms. The choice of cryptographic 994 algorithms depends on the type of key each has. This type is either 995 indicated in the certificate supplied or, if the keys were exchanged 996 out of band, the key types must have been similarly learned. It will 997 commonly be the case, but it is not required that if a shared secret 998 is used for authentication that the same key is used in both 999 directions. In particular, the initiator may be using a shared key 1000 derived from a password while the responder may have a public 1001 signature key and certificate. 1003 4 The CREATE-CHILD-SA (Phase 2) Exchange 1005 A phase 2 exchange is one request/response pair, and can be used to 1006 create or delete a child-SA, delete or rekey the IKE-SA, check the 1007 liveness of the IKE-SA, or deliver information such as error 1008 conditions. It is encrypted and integrity protected using the keys 1009 negotiated during the creation of the IKE-SA. 1011 Messages are cryptographically protected using the cryptographic 1012 algorithms and keys negotiated in the first two messages of the IKE 1013 exchange using a syntax described in Appendix B. Encryption uses 1014 keys derived from SK_e, one in each direction; Integrity uses keys 1015 derived from SK_a, one in each direction. 1017 Either endpoint may initiate a phase 2 exchange, so in this section 1018 the term Initiator refers to the endpoint initiating this exchange. 1019 When relevant, the Initiator of the IKE SA will be referred to as 1020 such. 1022 A child-SA is created by sending a CREATE_CHILD_SA request. If PFS 1023 for the child-SA is desired, the CREATE_CHILD_SA request contains KE 1024 payloads for an additional Diffie-Hellman exchange. The keying 1025 material for the child-SA is a function of SK_d established during 1026 the establishment of the IKE-SA, the nonces exchanged during the 1027 CREATE_CHILD_SA exchange, and the Diffie-Hellman value (if KE 1028 payloads are included in the CREATE_CHILD_SA exchange). 1030 In the child-SA created as part of the phase 1 exchange, a second KE 1031 payload MUST NOT be used, and the Nonces are not transmitted but are 1032 assumed to be the same as the phase 1 nonces. 1034 The CREATE_CHILD_SA request contains: 1036 Initiator Responder 1037 ----------- ----------- 1038 HDR*, SA, Ni, [KEi], 1039 TSi, TSr --> 1041 The Initiator sends SA offer(s) in the SA payload(s), a nonce in the 1042 Ni payload, optionally a Diffie-Hellman value in the KE payload, and 1043 the proposed traffic selectors in the TSi and TSr payloads. 1045 The message past the header is encrypted and the message including 1046 the header is integrity protected using the cryptographic algorithms 1047 negotiated in Phase 1. 1049 The CREATE_CHILD_SA response contains: 1051 <-- HDR*, SA, Nr, [KEr], 1052 TSi, TSr 1054 The Responder replies (using the same Message ID to respond) with the 1055 accepted offer in an SA payload, a Diffie-Hellman value in the KE 1056 payload if and only if the Initiator included one, and the traffic 1057 selectors for traffic to be sent on that SA in the TS payloads, which 1058 may be a subset of what the Initiator of the child-SA proposed. 1060 4.1 Generating Keying Material for IPsec SAs 1062 Child-SAs are created either by being piggybacked on the phase 1 1063 exchange, or in a phase 2 CREATE_CHILD_SA exchange. Keying material 1064 for them is generated as follows: 1066 KEYMAT = prf(SK_d, protocol | SPI | Nin | Nout ) 1068 For phase 2 exchanges with PFS the keying material is defined as: 1070 KEYMAT = prf(SK_d, g(p2)^ir | protocol | SPI | Nin | Nout ) 1072 where g(p2)^ir is the shared secret from the ephemeral Diffie-Hellman 1073 exchange of this phase 2 exchange, 1075 In either case, "protocol", and "SPI", are from the SA payload that 1076 contained the negotiated (and accepted) proposal, Nin is the body of 1077 the sender's (inbound using thie SPI) nonce payload minus the generic 1078 header, and Nout is the body of the destination's (outbound using 1079 this SPI) nonce payload minus the generic header. 1081 A single child-SA negotiation results in two security associations-- 1082 one inbound and one outbound. Different Nonces and SPIs for each SA 1083 (one chosen by the Initiator, the other by the Responder) guarantee a 1084 different key for each direction. The SPI chosen by the destination 1085 of the SA and the Nonces (ordered source followed by destination) are 1086 used to derive KEYMAT for that SA. 1088 This keying material (whether with PFS or without) MUST be used with 1089 the negotiated SA. In the case of an ESP SA needing two keys for 1090 encryption and authentication, the encryption key is taken from the 1091 first octets of KEYMAT and the authentication key is taken from the 1092 next octets. Each cryptographic algorithm takes a fixed number of 1093 bits of keying material specified as part of the algorithm. 1095 For situations where the amount of keying material desired is greater 1096 than that supplied by the prf, KEYMAT is expanded by feeding the 1097 results of the prf back into itself and concatenating results until 1098 the required keying material has been reached. In other words, 1100 KEYMAT = K1 | K2 | K3 | ... 1101 where: 1102 K1 = prf(SK_d, [ g(p2)^ir | ] protocol | SPI | Nin | Nout) 1103 K2 = prf(SK_d, K1 | [ g(p2)^ir | ] protocol | SPI | Nin | Nout) 1104 K3 = prf(SK_d, K2 | [ g(p2)^ir | ] protocol | SPI | Nin | Nout) 1105 etc. 1107 4.2 Generating Keying Material for IKE-SAs from a create-child exchange 1109 The create-child exchange can be used to re-key an existing IKE-SA 1110 (see section 2.8). New Initiator and Responder cookies are supplied 1111 in the SPI fields. The ID and TS payloads are omitted when rekeying 1112 an IKE-SA. SKEYSEED for the new IKE-SA is computed using SK_d from 1113 the existing IKE-SA as follows: 1115 SKEYSEED = prf(SK_d (old), [g(p2)^ir] | 0 | CKY-I | CKY-R | Ni | 1116 Nr) 1118 where g(p2)^ir is the shared secret from the ephemeral Diffie-Hellman 1119 exchange of this phase 2 exchange, CKY-I is the 8-octet "SPI" from 1120 the SA payload in the CREATE_CHILD_SA request, CKY-R is the 8-octet 1121 "SPI" from the SA payload in the CREATE_CHILD_SA response, and Ni and 1122 Nr are the two nonces stripped of any headers. "0" is a single octet 1123 containing the value zero (the protocol ID of IKE). 1125 The new IKE SA MUST reset its message counters to 1. 1127 SK_d, SK_a, and SK_e are computed from SKEYSEED as specified in 1128 section 3.1. 1130 5 Informational (Phase 2) Exchange 1132 At various points during an IKE-SA, peers may desire to convey 1133 control messages to each other regarding errors or notifications of 1134 certain events. To accomplish this IKE defines a (reliable) 1135 Informational exchange. Usually Informational exchanges happen 1136 during phase 2 and are cryptographically protected with the IKE 1137 exchange. 1139 Control messages that pertain to an IKE-SA MUST be sent under that 1140 IKE-SA. Control messages that pertain to Child-SAs MUST be sent under 1141 the protection of the IKE-SA which generated them (or its successor 1142 if the IKE-SA keys are rolled over). 1144 There are two cases in which there is no IKE-SA to protect the 1145 information. One is in the response to an IKE_SA_init_request to 1146 request a cookie or to refuse the SA proposal. This would be conveyed 1147 in a Notify payload of the IKE_SA_init_response. 1149 The other case in which there is no IKE-SA to protect the information 1150 is when a packet is received with an unknown SPI. In that case the 1151 notification of this condition will be sent in an informational 1152 exchange that is cryptographically unprotected. 1154 Messages in an Informational Exchange contain zero or more 1155 Notification or Delete payloads. The Recipient of an Informational 1156 Exchange request MUST send some response (else the Sender will assume 1157 the message was lost in the network and will retransmit it). That 1158 response can be a message with no payloads. Actually, the request 1159 message in an Informational Exchange can also contain no payloads. 1160 This is the expected way an endpoint can ask the other endpoint to 1161 verify that it is alive. 1163 ESP, AH, and IPcomp SAs always exist in pairs, with one SA in each 1164 direction. When an SA is closed, both members of the pair MUST be 1165 closed. When SAs are nested, as when data is encapsulated first with 1166 IPcomp, then with ESP, and finally with AH between the same pair of 1167 endpoints, all of the SAs (up to six) must be deleted together. To 1168 delete an SA, an Informational Exchange with one or more delete 1169 payloads is sent listing the SPIs (as known to the recipient) of the 1170 SAs to be deleted. The recipient MUST close the designated SAs. 1171 Normally, the reply in the Informational Exchange will contain delete 1172 payloads for the paired SAs going in the other direction. There is 1173 one exception. If by chance both ends of a set of SAs independently 1174 decide to close them, each may send a delete payload and the two 1175 requests may cross in the network. If a node receives a delete 1176 request for SAs that it has already issued a delete request for, it 1177 MUST delete the incoming SAs while processing the request and the 1178 outgoing SAs while processing the response. In that case, the 1179 responses MUST NOT include delete payloads for the deleted SAs, since 1180 that would result in duplicate deletion and could in theory delete 1181 the wrong SA. 1183 A node SHOULD regard half open connections as anomalous and audit 1184 their existence should they persist. Note that this specification 1185 nowhere specifies time periods, so it is up to individual endpoints 1186 to decide how long to wait. A node MAY refuse to accept incoming data 1187 on half open connections but MUST NOT unilaterally close them and 1188 reuse the SPIs. If connection state becomes sufficiently messed up, a 1189 node MAY close the IKE-SA which will implicitly close all SAs 1190 negotiated under it. It can then rebuild the SA's it needs on a clean 1191 base under a new IKE-SA. 1193 The Informational Exchange is defined as: 1195 Initiator Responder 1196 ----------- ----------- 1197 HDR*, N, ..., D, ... --> 1198 <-- HDR*, N, ..., D, ... 1200 The processing of an Informational Exchange is determined by its 1201 component payloads. 1203 6 Error Handling 1205 There are many kinds of errors that can occur during IKE processing. 1206 If a request is received that is badly formatted or unacceptable for 1207 reasons of policy (e.g. no matching cryptographic algorithms), the 1208 response MUST contain a Notify payload indicating the error. If an 1209 error occurs outside the context of an IKE request (e.g. the node is 1210 getting ESP messages on a non-existent SPI), the node SHOULD initiate 1211 an Informational Exchange with a Notify payload describing the 1212 problem. 1214 Errors that occur before a cryptographically protected IKE-SA is 1215 established must be handled very carefully. There is a trade-off 1216 between wanting to be helpful in diagnosing a problem and responding 1217 to it and wanting to avoid being a dupe in a denial of service attack 1218 based on forged messages. 1220 If a node receives a message on UDP port 500 outside the context of 1221 an IKE-SA (and not a request to start one), it may be the result of a 1222 recent crash. If the message is marked as a response, the node MAY 1223 audit the suspicious event but MUST NOT respond. If the message is 1224 marked as a request, the node MAY audit the suspicious event and MAY 1225 send a response. If a response is sent, the response MUST be sent to 1226 the IP address and port from whence it came with the IKE cookies 1227 reversed in the header and the Message ID copied. The response MUST 1228 NOT be cryptographically protected and MUST contain a notify payload 1229 indicating INVALID-COOKIE. 1231 A node receiving such a message MUST NOT respond and MUST NOT change 1232 the state of any existing SAs. The message might be a forgery or 1233 might be a response the genuine correspondent was tricked into 1234 sending. A node SHOULD treat such a message (and also a network 1235 message like ICMP destination unreachable) as a hint that there might 1236 be problems with SAs to that IP address and SHOULD initiate a 1237 liveness test for any such IKE-SA. An implementation SHOULD limit the 1238 frequency of such tests to avoid being tricked into participating in 1239 a denial of service attack. 1241 A node receiving a suspicious message from an IP address with which 1242 it has an IKE-SA MAY send an IKE notify payload in an IKE 1243 Informational exchange over that SA. The recipient MUST NOT change 1244 the state of any SA's as a result but SHOULD audit the event to aid 1245 in diagnosing malfunctions. A node MUST limit the rate at which it 1246 will send messages in response to unprotected messages. 1248 7 Header and Payload Formats 1250 7.1 The IKE Header 1252 IKE messages use UDP port 500, with one IKE message per UDP datagram. 1253 Information from the UDP header is largely ignored except that the IP 1254 addresses and UDP ports from the headers are reversed and used for 1255 return packets. Each IKE message begins with the IKE header, denoted 1256 HDR in this memo. Following the header are one or more IKE payloads 1257 each identified by a "Next Payload" field in the preceding payload. 1258 Payloads are processed in the order in which they appear in an IKE 1259 message by invoking the appropriate processing routine according to 1260 the "Next Payload" field in the IKE header and subsequently according 1261 to the "Next Payload" field in the IKE payload itself until a "Next 1262 Payload" field of zero indicates that no payloads follow. 1264 The Recipient SPI in the header identifies an instance of an IKE 1265 security association. It is therefore possible for a single instance 1266 of IKE to multiplex distinct sessions with multiple peers. 1268 The format of the IKE header is shown in Figure 1. 1269 1 2 3 1270 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 1271 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1272 ! Recipient ! 1273 ! SPI (aka Cookie) ! 1274 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1275 ! Sender ! 1276 ! SPI (aka Cookie) ! 1277 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1278 ! Next Payload ! MjVer ! MnVer ! Exchange Type ! Flags ! 1279 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1280 ! Message ID ! 1281 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1282 ! Length ! 1283 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1284 ~ Initialization Vector ~ 1285 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1287 Figure 1: IKE Header Format 1289 o Recipient SPI (aka Cookie) (8 octets) - A value chosen by the 1290 recipient to identify a unique IKE security association. 1291 [NOTE: this is a deviation from ISAKMP and IKEv1, where the 1292 cookies were always sent with the Initiator of the IKE-SA's 1293 cookie first and the Responder's second. See section 2.6.] 1295 o Sender SPI (aka Cookie) (8 octets) - A value chosen by the 1296 sender to identify a unique IKE security association. 1298 o Next Payload (1 octet) - Indicates the type of payload that 1299 immediately follows the header. The format and value of each 1300 payload is defined below. 1302 o Major Version (4 bits) - indicates the major version of the IKE 1303 protocol in use. Implementations based on this version of IKE 1304 MUST set the Major Version to 2. Implementations based on 1305 previous versions of IKE and ISAKMP MUST set the Major Version 1306 to 1. Implementations based on this version of IKE MUST reject 1307 (or ignore) messages containing a version number greater than 1308 2. 1310 o Minor Version (4 bits) - indicates the minor version of the 1311 IKE protocol in use. Implementations based on this version of 1312 IKE MUST set the Minor Version to 0. They MUST ignore the minor 1313 version number of received messages. 1315 o Exchange Type (1 octet) - indicates the type of exchange being 1316 used. This dictates the payloads sent in each message and 1317 message orderings in the exchanges. 1319 Exchange Type Value 1321 RESERVED 0 1322 Reserved for ISAKMP 1 - 31 1323 Reserved for IKEv1 32 - 33 1324 Phase One 34 1325 CREATE-CHILD-SA 35 1326 Informational 36 1327 Reserved for IKEv2+ 37-239 1328 Reserved for private use 240-255 1330 o Flags (1 octet) - indicates specific options that are set for 1331 the message. Presence of options are indicated by the 1332 appropriate bit in the flags field being set. The bits are 1333 defined LSB first, so bit 0 would be the least significant 1334 bit of the Flags octet. In the description below, a bit 1335 being 'set' means its value is '1', while 'cleared' means 1336 its value is '0'. 1338 -- E(ncryption) (bit 0 of Flags) - If set, all payloads 1339 following the header are encrypted and integrity 1340 protected using the algorithms negotiated during 1341 session establishment and a key derived during the key 1342 exchange portion of IKE. If cleared, the payloads are 1343 not protected. All payloads MUST be protected if a key 1344 has been negotiated and any unprotected payload may 1345 only be used to establish a new session or indicate a 1346 problem. 1348 -- C(ommit) (bit 1 of Flags) - This bit is defined by 1349 ISAKMP but not used by IKEv2. Implementations of IKEv2 1350 MUST clear this bit when sending and SHOULD ignore 1351 it in incoming messages. 1353 -- A(uthentication Only) (bit 2 of Flags) - This bit is 1354 defined by ISAKMP but not used by IKEv2. Implementations 1355 of IKEv2 MUST clear this bit when sending and SHOULD 1356 ignore it in incoming messages. 1358 -- I(nitiator) (bit 3 of Flags) - This bit MUST be set in 1359 messages sent by the original Initiator of the IKE 1360 exchange and MUST be cleared in messages sent 1361 by the original Responder. It is 1362 used by the recipient to determine whether the message 1363 number should be interpreted in the context of its 1364 initiating state or its responding state. 1366 -- V(ersion) (bit 4 of Flags) - This bit indicates that 1367 the transmitter is capable of speaking a higher major 1368 version number of the protocol than the one indicated 1369 in the major version number field. 1371 -- R(eserved) (bits 5-7 of Flags) - These bit MUST be 1372 cleared in messages sent and received messages with 1373 these bits set MUST be rejected. 1375 o Message ID (4 octets) - Message identifier used to control 1376 retransmission of lost packets and matching of requests and 1377 responses. See section 2.2. In the first message of a Phase 1 1378 negotiation, the value MUST be set to 0. The response to that 1379 message MUST also have a Message ID of 0. 1381 o Length (4 octets) - Length of total message (header + payloads) 1382 in octets. Session encryption can expand the size of an IKE 1383 message and that is reflected in the total length of the 1384 message. 1386 o Initialization Vector (variable) - random octets used to 1387 provide 1388 initialization to an encryption mode-- e.g. 1389 cipher block chaining (CBC) mode. This field MUST be present 1390 when the encryption bit is set in the flags field (see below) 1391 and MUST NOT be present otherwise. The length of the 1392 Initialization Vector is cipher and mode dependent. 1394 7.2 Generic Payload Header 1396 Each IKE payload defined in sections 7.3 through 7.13 begins with a 1397 generic header, shown in Figure 2. Figures for each payload below 1398 will include the generic payload header but for brevity a repeat of 1399 the description of each field will be omitted. The construction and 1400 processing of the generic payload header is identical for each 1401 payload and will similarly be omitted. 1403 1 2 3 1404 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 1405 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1406 ! Next Payload !C! RESERVED ! Payload Length ! 1407 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1409 Figure 2: Generic Payload Header 1411 The Generic Payload Header fields are defined as follows: 1413 o Next Payload (1 octet) - Identifier for the payload type of the 1414 next payload in the message. If the current payload is the last 1415 in the message, then this field will be 0. This field provides 1416 a "chaining" capability whereby additional payloads can be 1417 added to a message by appending it to the end of the message 1418 and setting the "Next Payload" field of the preceding payload 1419 to indicate the new payload's type. 1421 o Critical (1 bit) - MUST be set to zero if the sender wants 1422 the recipient to skip this payload if he does not 1423 understand the payload type code. MUST be set to one if the 1424 sender wants the recipient to reject this entire message 1425 if he does not understand this payload type. MUST be ignored 1426 by recipient if the recipient understands the payload type 1427 code. MUST be set to zero for payload types defined in this 1428 document. Note that the critical bit applies to the current 1429 payload rather than the "next" payload whose type code 1430 appears in the first octet. The reasoning behind not setting 1431 the critical bit for payloads defined in this document is 1432 that all implementations MUST understand all payload types 1433 defined in this document and therefore must ignore its value. 1435 o RESERVED (7 bits) - MUST be sent as zero; MUST be ignored. 1437 o Payload Length (2 octets) - Length in octets of the current 1438 payload, including the generic payload header. 1440 7.3 Security Association Payload 1442 The Security Association Payload, denoted SA in this memo, is used to 1443 negotiate attributes of a security association. Assembly of Security 1444 Association Payloads requires great peace of mind. An SA may contain 1445 multiple proposals. Each proposal may contain multiple protocols 1446 (where a protocol is IKE, ESP, AH, or IPCOMP), each protocol may 1447 contain multiple transforms, and each transform may contain multiple 1448 attributes. When parsing an SA, an implementation MUST check that the 1449 total Payload Length is consistent with the payload's internal 1450 lengths and counts. Proposals, Transforms, and Attributes each have 1451 their own variable length encodings. They are nested such that the 1452 Payload Length of an SA includes the combined contents of the SA, 1453 Proposal, Transform, and Attribute information. The length of a 1454 Proposal includes the lengths of all Transforms and Attributes it 1455 contains. The length of a Transform includes the lengths of all 1456 Attributes it contains. 1458 The syntax of Security Associations, Proposals, Transforms, and 1459 Attributes is based on ISAKMP, however the semantics are somewhat 1460 different. The reason for the complexity and the hierarchy is to 1461 allow for multiple possible combinations of algorithms to be encoded 1462 in a single SA. Sometimes there is a choice of multiple algorithms, 1463 while other times there is a combination of algorithms. For example, 1464 an Initiator might want to propose using (AH w/MD5 and ESP w/3DES) OR 1465 (ESP w/MD5 and 3DES). 1467 One of the reasons the semantics of the SA payload has changed from 1468 ISAKMP and IKEv1 is to make the encodings more compact in common 1469 cases. 1471 The Proposal structure contains within it a Proposal # and a 1472 Protocol-id. Each structure MUST have the same Proposal # as the 1473 previous one or one greater. The first Proposal MUST have a Proposal 1474 # of one. If two successive structures have the same Proposal number, 1475 it means that the proposal consists of the first structure AND the 1476 second. So a proposal of AH AND ESP would have two proposal 1477 structures, one for AH and one for ESP and both would have Proposal 1478 #1. A proposal of AH OR ESP would have two proposal structures, one 1479 for AH with proposal #1 and one for ESP with proposal #2. 1481 Each Proposal/Protocol structure is followed by one or more transform 1482 structures. The number of different transforms is generally 1483 determined by the Protocol. AH generally has a single transform: an 1484 integrity check algorithm. ESP generally has two: an encryption 1485 algorithm AND an integrity check algorithm. IKE generally has five 1486 transforms: a Diffie-Hellman group, an authentication algorithm, an 1487 integrity check algorithm, a PRF algorithm, and an encryption 1488 algorithm. For each Protocol, the set of permissible transforms are 1489 assigned transform ID numbers, which appear in the header of each 1490 transform. 1492 If there are multiple transforms with the same Transform Type, the 1493 proposal is an OR of those transforms. If there are multiple 1494 Transforms with different Transform Types, the proposal is an AND of 1495 the different groups. For example, to propose ESP with (3DES or IDEA) 1496 and (HMAC-MD5 or HMAC-SHA), the ESP proposal would contain two 1497 Transform Type 1 candidates (one for 3DES and one for IDEA) and two 1498 Transform Type 2 candidates (one for HMAC-MD5 and one for HMAC-SHA). 1499 This effectively proposes four combinations of algorithms. If the 1500 Initiator wanted to propose only a subset of those - say (3DES and 1501 HMAC-MD5) or (IDEA and HMAC-SHA), there is no way to encode that as 1502 multiple transforms within a single Proposal/Protocol. Instead, the 1503 Initiator would have to construct two different Proposals, each with 1504 two transforms. 1506 A given transform MAY have one or more Attributes. Attributes are 1507 necessary when the transform can be used in more than one way, as 1508 when an encryption algorithm has a variable key size. The transform 1509 would specify the algorithm and the attribute would specify the key 1510 size. Most transforms do not have attributes. 1512 Note that the semantics of Transforms and Attributes are quite 1513 different than in IKEv1. In IKEv1, a single Transform carried 1514 multiple algorithms for a protocol with one carried in the Transform 1515 and the others carried in the Attributes. 1517 1 2 3 1518 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 1519 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1520 ! Next Payload !C! RESERVED ! Payload Length ! 1521 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1522 ! ! 1523 ~ ~ 1524 ! ! 1525 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1527 Figure 3: Security Association Payload 1529 o Proposals (variable) - one or more proposal substructures. 1531 The payload type for the Security Association Payload is one (1). 1533 7.3.1 Proposal Substructure 1535 1 2 3 1536 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 1537 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1538 ! 0 (last) or 2 ! RESERVED ! Proposal Length ! 1539 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1540 ! Proposal # ! Protocol-Id ! SPI Size !# of Transforms! 1541 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1542 ~ SPI (variable) ~ 1543 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1544 ! ! 1545 ~ ~ 1546 ! ! 1547 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1549 Figure 4: Proposal Substructure 1551 o 0 (last) or 2 (more) (1 octet) - Specifies whether this is the 1552 last Proposal Substructure in the SA. This syntax is inherited 1553 from ISAKMP, but is unnecessary because the last Proposal 1554 could be identified from the length of the SA. The value (2) 1555 corresponds to a Payload Type of Proposal, and the first 1556 four octets of the Proposal structure are designed to look 1557 somewhat like the header of a Payload. 1559 o RESERVED (1 octet) - MUST be sent as zero; MUST be ignored. 1561 o Proposal Length (2 octets) - Length of this proposal, 1562 including all transforms and attributes that follow. 1564 o Proposal # (1 octet) - When a proposal is made, the first 1565 proposal in an SA MUST be #1, and subsequent proposals 1566 MUST either be the same as the previous proposal (indicating 1567 an AND of the two proposals) or one more than the previous 1568 proposal (indicating an OR of the two proposals). When a 1569 proposal is accepted, all of the proposal numbers in the 1570 SA must be the same and must match the number on the 1571 proposal sent that was accepted. 1573 o Protocol-Id (1 octet) - Specifies the protocol identifier 1574 for the current negotiation. During phase 1 negotiation 1575 this field MUST be zero (0). During phase 2 it will be the 1576 protocol of the SA being established as assigned by IANA, 1577 for example, 50 for ESP, 51 for AH, and 108 for IPComp. 1579 o SPI Size (1 octet) - During phase 1 negotiation this field 1580 MUST be zero. During phase 2 negotiation it is equal to the 1581 size, in octets, of the SPI of the corresponding protocol 1582 (8 for IKE, 4 for ESP and AH, 2 for IPcomp). 1584 o # of Transforms (1 octet) - Specifies the number of 1585 transforms in this proposal. 1587 o SPI (variable) - The sending entity's SPI. Even if the SPI 1588 Size is not a multiple of 4 octets, there is no padding 1589 applied to the payload. When the SPI Size field is zero, 1590 this field is not present in the Security Association 1591 payload. This case occurs when negotiating the IKE-SA 1592 (but not during the rekeying of an IKE-SA). 1594 o Transforms (variable) - one or more transform substructures. 1596 7.3.2 Transform Substructure 1598 1 2 3 1599 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 1600 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1601 ! 0 (last) or 3 ! RESERVED ! Transform Length ! 1602 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1603 !Transform Type ! RESERVED ! Transform ID ! 1604 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1605 ! ! 1606 ~ Transform Attributes ~ 1607 ! ! 1608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1610 Figure 5: Transform Substructure 1612 o 0 (last) or 3 (more) (1 octet) - Specifies whether this is the 1613 last Transform Substructure in the Proposal. This syntax is 1614 inherited from ISAKMP, but is unnecessary because the last 1615 Proposal could be identified from the length of the SA. The 1616 value (3) corresponds to a Payload Type of Transform, and 1617 the first four octets of the Transform structure are designed 1618 to look somewhat like the header of a Payload. 1620 o RESERVED - MUST be sent as zero; MUST be ignored. 1622 o Transform Length - The length (in octets) of the Transform 1623 Substructure including Header and Attributes. 1625 o Transform Type (1 octet) - The type of transform being specified 1626 in this transform. Different protocols support different 1627 transform types. For some protocols, some of the transforms 1628 may be optional. 1630 o Transform-ID (1 octet) - The specific instance of the transform 1631 type being proposed. 1633 Transform Type Values 1635 Transform Used In 1636 Type 1637 Encryption Algorithm 1 (IKE and ESP) 1638 Pseudo-random Function 2 (IKE) 1639 Authentication Method 3 (IKE) 1640 Integrity Algorithm 4 (IKE, AH, and optional in ESP) 1641 Diffie-Hellman Group 5 (IKE and optional in AH and ESP) 1642 Compression 6 (IPcomp) 1643 Window Size 7 (IKE) 1645 values 8-240 are reserved to IANA. Values 241-255 are for 1646 private use among mutually consenting parties. 1648 For Transform Type 1 (Encryption Algorithm), defined Transform-IDs 1649 are: 1651 Name Number Defined In 1652 RESERVED 0 1653 ENCR_DES_IV64 1 (RFC1827) 1654 ENCR_DES 2 (RFC2405) 1655 ENCR_3DES 3 (RFC2451) 1656 ENCR_RC5 4 (RFC2451) 1657 ENCR_IDEA 5 (RFC2451) 1658 ENCR_CAST 6 (RFC2451) 1659 ENCR_BLOWFISH 7 (RFC2451) 1660 ENCR_3IDEA 8 (RFC2451) 1661 ENCR_DES_IV32 9 1662 ENCR_RC4 10 1663 ENCR_NULL 11 (RFC2410) 1664 ENCR_AES_128 12 1666 values 12-240 are reserved to IANA. Values 241-255 are for 1667 private use among mutually consenting parties. 1669 For Transform Type 2 (Pseudo-random Function), defined Transform-IDs 1670 are: 1672 Name Number Defined In 1673 RESERVED 0 1674 PRF_HMAC_MD5 1 (RFC2104) 1675 PRF_HMAC_SHA 2 (RFC2104) 1676 PRF_HMAC_TIGER 3 (RFC2104) 1678 values 3-240 are reserved to IANA. Values 241-255 are for 1679 private use among mutually consenting parties. 1681 For Transform Type 3 (Authentication Method), defined Transform-IDs 1682 are: 1684 Name Number Defined In 1685 RESERVED 0 1686 RESERVED for IKEv1 1 - 5 (RFC2409) 1687 Authenticated Diffie-Hellman 6 (this memo) 1689 values 7-240 are reserved to IANA. Values 241-255 are for 1690 private use among mutually consenting parties. 1692 For Transform Type 4 (Integrity Algorithm), defined Transform-IDs 1693 are: 1695 Name Number Defined In 1696 RESERVED 0 1697 AUTH_HMAC_MD5 1 (RFC2403) 1698 AUTH_HMAC_SHA 2 (RFC2404) 1699 AUTH_DES_MAC 3 1700 AUTH_KPDK_MD5 4 (RFC1826) 1702 For Transform Type 5 (Diffie-Hellman Group), defined Transform-IDs 1703 are: 1705 Name Number 1706 RESERVED 0 1707 Pre-defined (see section 8) 1 - 5 1708 RESERVED 6 - 200 1709 MODP (exponentiation) 201 (w/attributes) 1710 ECP (elliptic curve over GF[P] 202 (w/attributes) 1711 EC2N (elliptic curve over GF[2^N]) 203 (w/attributes) 1713 values 6-200 are reserved to IANA for new MODP, ECP or EC2N 1714 groups. Values 204-255 are for private use among mutually 1715 consenting parties. Specification of values 201, 202 or 203 1716 allow peers to define a new Diffie-Hellman group in-line as 1717 part of the exchange. Private use of values 204-255 may entail 1718 complete definition of a group or may require attributes to 1719 accompany them. Attributes MUST NOT accompany groups using 1720 values between 6 and 200. 1722 For Transform Type 6 (Compression), defined Transform-IDs are: 1724 Name Number Defined In 1725 RESERVED 0 1726 IPCOMP_OUI 1 (w/attributes) 1727 IPCOMP_DEFLATE 2 1728 (RFC2394) 1729 IPCOMP_LZS 3 1730 (RFC2395) 1732 values 4-240 are reserved to IANA. Values 241-255 are for 1733 private use among mutually consenting parties. 1735 For Transform Type 7 (Window Size), the Transform-ID specifies the 1736 window size a peer is contracting to support to handle overlapping 1737 requests (see section 2.3). 1739 7.3.3 Mandatory Transform Types 1741 The number and type of transforms that accompany an SA payload are 1742 dependent on the protocol in the SA itself. An SA payload proposing 1743 the establishment of an SA has the following mandatory and optional 1744 transform types. A compliant implementation MUST support all 1745 mandatory and optional types for each protocol it supports. Whether 1746 the optional types are present in a particular proposal depends 1747 solely on the discretion of the sender. 1749 Protocol Mandatory Types Optional Types 1750 IKE 1, 2, 3, 5, 7 1751 ESP 1 4, 5 1752 AH 4 5 1753 IPCOMP 6 1755 7.3.4 Mandatory Transform-IDs 1757 Each transform type has corresponding transform IDs to specify the 1758 specific transform. Some transforms are mandatory to support and 1759 others are optional to support. The mandatory transform IDs for AH, 1760 ESP, and IPCOMP are left to their respective RFCs, RFC2402, RFC2406, 1761 and RFC2393. The transform IDs that are mandatory to support for 1762 IKEv2 are: 1764 Name TransType Mandatory Transform-ID 1765 Encryption Algorithm 1 12 (ENCR_AES_128) 1766 Pseudo-Random Function 2 2 (PRF_HMAC_SHA) 1767 Authentication Method 3 6 (signed D-H) 1768 Diffie-Hellman Group 5 5 (1536 bit MODP) 1769 Window Size 7 1 1770 All other transform-IDs for a given transform type are optional to 1771 support. While implementations MUST support a window size of 1, they 1772 SHOULD support a window size of at least 10 and MAY support larger 1773 window sizes. 1775 7.3.5 Transform Attributes 1777 Each transform in a Security Association payload may include 1778 attributes that modify or complete the specification of the 1779 transform. These attributes are type/value pairs and are defined in 1780 Appendix A. For example, if an encryption algorithm has a variable 1781 length key, the key length to be used may be specified as an 1782 attribute. Attributes can have a value with a fixed two octet length 1783 or a variable length value. For the latter the attribute is the form 1784 of type/length/value. 1786 1 2 3 1787 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 1788 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1789 !A! Attribute Type ! AF=0 Attribute Length ! 1790 !F! ! AF=1 Attribute Value ! 1791 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1792 ! AF=0 Attribute Value ! 1793 ! AF=1 Not Transmitted ! 1794 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1796 Figure 6: Data Attributes 1798 o Attribute Type (2 octets) - Unique identifier for each type of 1799 attribute. The identifiers for IKE are defined in Appendix A. 1801 The most significant bit of this field is the Attribute Format 1802 bit (AF). It indicates whether the data attributes follow the 1803 Type/Length/Value (TLV) format or a shortened Type/Value (TV) 1804 format. If the AF bit is zero (0), then the Data Attributes 1805 are of the Type/Length/Value (TLV) form. If the AF bit is a 1806 one (1), then the Data Attributes are of the Type/Value form. 1808 o Attribute Length (2 octets) - Length in octets of the Attribute 1809 Value. When the AF bit is a one (1), the Attribute Value is 1810 only 2 octets and the Attribute Length field is not present. 1812 o Attribute Value (variable length) - Value of the Attribute 1813 associated with the Attribute Type. If the AF bit is a 1814 zero (0), this field has a variable length defined by the 1815 Attribute Length field. If the AF bit is a one (1), the 1816 Attribute Value has a length of 2 octets. 1818 7.3.6 Attribute Negotiation 1820 During security association negotiation Initiators present offers to 1821 Responders. Responders MUST select a single complete set of 1822 parameters from the offers (or reject all offers if none are 1823 acceptable). If there are multiple proposals, the Responder MUST 1824 choose a single proposal number and return all of the Proposal 1825 substructures with that Proposal number. If there are multiple 1826 Transforms with the same type the Responder MUST choose a single one. 1827 Any attributes of a selected transform MUST be returned unmodified. 1828 The Initiator of an exchange MUST check that the accepted offer is 1829 consistent with one of its proposals, and if not that response MUST 1830 be rejected. 1832 Negotiating Diffie-Hellman groups presents some special challenges. 1833 Diffie-Hellman groups are specified either using a defined group 1834 description (section 5) or by defining all attributes of a group (see 1835 Appendix A) in an IKE policy offer. Group attributes, such as group 1836 type or prime number MUST NOT be offered in conjunction with a 1837 previously defined group. SA offers include proposed attributes and a 1838 Diffie-Hellman public number (KE) in the same message. If the 1839 Initiator offers to use one of several Diffie-Hellman groups, it 1840 SHOULD pick the one the Responder is most likely to accept and 1841 include a KE corresponding to that group. If the guess turns out to 1842 be wrong, the Responder will indicate the correct group in the 1843 response and the Initiator SHOULD start over this time using a 1844 different group (see section 2.7). 1846 Implementation Note: 1848 Certain negotiable attributes can have ranges or could have 1849 multiple acceptable values. These are the Diffie-Hellman group and 1850 the key length of a variable key length symmetric cipher. To 1851 further interoperability and to support upgrading endpoints 1852 independently, implementers of this protocol SHOULD accept values 1853 which they deem to supply greater security. For instance if a peer 1854 is configured to accept a variable lengthed cipher with a key 1855 length of X bits and is offered that cipher with a larger key 1856 length an implementation SHOULD accept the offer. 1858 Support of this capability allows an implementation to express a 1859 concept of "at least" a certain level of security-- "a key length 1860 of _at least_ X bits for cipher foo". 1862 7.4 Key Exchange Payload 1864 The Key Exchange Payload, denoted KE in this memo, is used to 1865 exchange Diffie-Hellman public numbers as part of a Diffie-Hellman 1866 key exchange. The Key Exchange Payload consists of the IKE generic 1867 header followed by the Diffie-Hellman public value itself. 1869 1 2 3 1870 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 1871 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1872 ! Next Payload !C! RESERVED ! Payload Length ! 1873 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1874 ! ! 1875 ~ Key Exchange Data ~ 1876 ! ! 1877 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1879 Figure 7: Key Exchange Payload Format 1881 A key exchange payload is constructed by copying one's Diffie-Hellman 1882 public value into the "Key Exchange Data" portion of the payload. 1883 The length of the Diffie-Hellman public value MUST be equal to the 1884 length of the prime modulus over which the exponentiation was 1885 performed, prepending zero bits to the value if necessary. 1887 A key exchange payload is processed by first checking whether the 1888 length of the key exchange data (the "Payload Length" from the 1889 generic header minus the size of the generic header) is equal to the 1890 length of the prime modulus over which the exponentiation was 1891 performed. 1893 The payload type for the Key Exchange payload is four (4). 1895 7.5 Identification Payload 1897 The Identification Payload, denoted ID in this memo, allows peers to 1898 identify themselves to each other. In Phase 1, the ID Payload names 1899 the identity to be authenticated with the signature. In Phase 2, the 1900 ID Payload is optional and if present names an identity asserted to 1901 be responsible for this SA. An example use would be a shared computer 1902 opening an IKE-SA to a server and asserting the name of its logged in 1903 user for the Phase 2 SA. If missing, this defaults to the Phase 1 1904 identity. 1906 NOTE: In IKEv1, two ID payloads were used in each direction in Phase 1907 2 to hold Traffic Selector information for data passing over the SA. 1908 In IKEv2, this information is carried in Traffic Selector (TS) 1909 payloads (see section 7.13). 1911 The Identification Payload consists of the IKE generic header 1912 followed by identification fields as follows: 1914 1 2 3 1915 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 1916 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1917 ! Next Payload !C! RESERVED ! Payload Length ! 1918 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1919 ! ID Type ! RESERVED | 1920 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1921 ! ! 1922 ~ Identification Data ~ 1923 ! ! 1924 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1926 Figure 8: Identification Payload Format 1928 o ID Type (1 octet) - Specifies the type of Identification being 1929 used. 1931 o RESERVED - MUST be sent as zero; MUST be ignored. 1933 o Identification Data (variable length) - Value, as indicated by 1934 the Identification Type. The length of the Identification Data 1935 is computed from the size in the ID payload header. 1937 The payload type for the Identification Payload is five (5). 1939 The following table lists the assigned values for the Identification 1940 Type field, followed by a description of the Identification Data 1941 which follows: 1943 ID Type Value 1944 ------- ----- 1945 RESERVED 0 1947 ID_IPV4_ADDR 1 1949 A single four (4) octet IPv4 address. 1951 ID_FQDN 2 1953 A fully-qualified domain name string. An example of a 1954 ID_FQDN is, "lounge.org". The string MUST not contain any 1955 terminators (e.g. NULL, CR, etc.). 1957 ID_RFC822_ADDR 3 1959 A fully-qualified RFC822 email address string, An example of 1960 a ID_RFC822_ADDR is, "lizard@lounge.org". The string MUST 1961 not contain any terminators. 1963 ID_IPV6_ADDR 5 1965 A single sixteen (16) octet IPv6 address. 1967 ID_DER_ASN1_DN 9 1969 The binary DER encoding of an ASN.1 X.500 Distinguished Name 1970 [X.501]. 1972 ID_DER_ASN1_GN 10 1974 The binary DER encoding of an ASN.1 X.500 GeneralName 1975 [X.509]. 1977 ID_KEY_ID 11 1979 An opaque octet stream which may be used to pass vendor- 1980 specific information necessary to do certain proprietary 1981 forms of identification. 1983 7.6 Certificate Payload 1985 The Certificate Payload, denoted CERT in this memo, provides a means 1986 to transport certificates or other certificate-related information 1987 via IKE. Certificate payloads SHOULD be included in an exchange if 1988 certificates are available to the sender. 1990 The Certificate Payload is defined as follows: 1992 1 2 3 1993 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 1994 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1995 ! Next Payload !C! RESERVED ! Payload Length ! 1996 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1997 ! Cert Encoding ! ! 1998 +-+-+-+-+-+-+-+-+ ! 1999 ~ Certificate Data ~ 2000 ! ! 2001 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2003 Figure 9: Certificate Payload Format 2005 o Certificate Encoding (1 octet) - This field indicates the type 2006 of certificate or certificate-related information contained 2007 in the Certificate Data field. 2009 Certificate Encoding Value 2010 -------------------- ----- 2011 NONE 0 2012 PKCS #7 wrapped X.509 certificate 1 2013 PGP Certificate 2 2014 DNS Signed Key 3 2015 X.509 Certificate - Signature 4 2016 Kerberos Token 6 2017 Certificate Revocation List (CRL) 7 2018 Authority Revocation List (ARL) 8 2019 SPKI Certificate 9 2020 X.509 Certificate - Attribute 10 2021 RESERVED 11 - 255 2023 o Certificate Data (variable length) - Actual encoding of 2024 certificate data. The type of certificate is indicated 2025 by the Certificate Encoding field. 2027 The payload type for the Certificate Payload is six (6). 2029 7.7 Certificate Request Payload 2031 The Certificate Request Payload, denoted CERTREQ in this memo, 2032 provides a means to request preferred certificates via IKE and can 2033 appear in the first, second, or third message of Phase 1. 2034 Certificate Request payloads SHOULD be included in an exchange 2035 whenever the peer may have multiple certificates, some of which might 2036 be trusted while others are not. If multiple root CA's are trusted, 2037 then multiple Certificate Request payloads SHOULD be transmitted. 2039 Empty (zero length) CA names MUST NOT be generated and SHOULD be 2040 ignored. 2042 The Certificate Request Payload is defined as follows: 2044 1 2 3 2045 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 2046 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2047 ! Next Payload !C! RESERVED ! Payload Length ! 2048 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2049 ! Cert Encoding ! ! 2050 +-+-+-+-+-+-+-+-+ ! 2051 ~ Certification Authority ~ 2052 ! ! 2053 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2055 Figure 10: Certificate Request Payload Format 2056 o Certificate Encoding (1 octet) - Contains an encoding of the type 2057 of certificate requested. Acceptable values are listed in 2058 section 7.6. 2060 o Certification Authority (variable length) - Contains an encoding 2061 of an acceptable certification authority for the type of 2062 certificate requested. 2064 The payload type for the Certificate Request Payload is seven (7). 2066 The Certificate Request Payload is constructed by setting the "Cert 2067 Encoding" field to be the type of certificate being desired and the 2068 "Certification Authority" field to a proper encoding of a 2069 certification authority for the specified certificate. For example, 2070 for an X.509 certificate this field would contain the Distinguished 2071 Name encoding of the Issuer Name of an X.509 certification authority 2072 acceptable to the sender of this payload. 2074 The Certificate Request Payload is processed by inspecting the "Cert 2075 Encoding" field to determine whether the processor has any 2076 certificates of this type. If so the "Certification Authority" field 2077 is inspected to determine if the processor has any certificates which 2078 can be validated up to the specified certification authority. This 2079 can be a chain of certificates. If a certificate exists which 2080 satisfies the criteria specified in the Certificate Request Payload 2081 it MUST be sent back to the certificate requestor; if a certificate 2082 chain exists which goes back to the certification authority specified 2083 in the request the entire chain SHOULD be sent back to the 2084 certificate requestor. If no certificates exist then no further 2085 processing is performed-- this is not an error condition of the 2086 protocol. There may be cases where there is a preferred CA, but an 2087 alternate might be acceptable (perhaps after prompting a human 2088 operator). 2090 7.8 Authentication Payload 2092 The Authentication Payload, denoted AUTH in this memo, contains data 2093 used for authentication purposes. The only authentication method 2094 defined in this memo is digital signatures and therefore the contents 2095 of this payload when used with this memo will be the output generated 2096 by a digital signature function. 2098 The Authentication Payload is defined as follows: 2100 1 2 3 2101 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 2102 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2103 ! Next Payload !C! RESERVED ! Payload Length ! 2104 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2105 ! ! 2106 ~ Authentication Data ~ 2107 ! ! 2108 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2110 Figure 11: Authentication Payload Format 2112 o Authentication Data (variable length) - Data that results from 2113 applying the digital signature function to the IKE state 2114 (see section 3). 2116 The payload type for the Authentication Payload is nine (9). 2118 The Authentication Payload is constructed by computing a digital 2119 signature (or secret key MAC) over the concatenation of the sender's 2120 first IKE message and the other peer's nonce. The result is placed 2121 in the "Authentication Data" portion of the payload. The encoding 2122 depends on the type of key being used to authenticate (see section 2123 3.2). The payload length is the size of the generic header plus the 2124 size of the "Authentication Data" portion of the payload which 2125 depends on the specific authentication method being used. 2127 The Authentication Payload is processed by extracting the 2128 "Authentication Data" from the payload and verifying it according to 2129 the specific authentication method being used. If authentication 2130 fails a NOTIFY Error message of AUTHENTICATION-FAILED MUST be sent 2131 back to the peer and the connection closed. 2133 7.9 Nonce Payload 2135 The Nonce Payload, denoted Ni and Nr in this memo for the Initiator's 2136 and Responder's nonce respectively, contains random data used to 2137 guarantee liveness during an exchange and protect against replay 2138 attacks. 2140 The Nonce Payload is defined as follows: 2142 1 2 3 2143 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 2144 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2145 ! Next Payload !C! RESERVED ! Payload Length ! 2146 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2147 ! ! 2148 ~ Nonce Data ~ 2149 ! ! 2150 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2152 Figure 12: Nonce Payload Format 2154 o Nonce Data (variable length) - Contains the random data generated 2155 by the transmitting entity. 2157 The payload type for the Nonce Payload is ten (10). 2159 The Nonce Payload is constructed by computing a pseudo-random value 2160 and copying it into the "Nonce Data" field. The size of a Nonce MUST 2161 be between 8 and 256 octets inclusive. 2163 7.10 Notify Payload 2165 The Notify Payload, denoted N in this document, is used to transmit 2166 informational data, such as error conditions and state transitions to 2167 an IKE peer. A Notify Payload may appear in a response message 2168 (usually specifying why a request was rejected), or in an 2169 Informational Exchange (to report an error not in an IKE request). 2171 The Notify Payload is defined as follows: 2173 1 2 3 2174 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 2175 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2176 ! Next Payload !C! RESERVED ! Payload Length ! 2177 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2178 ! Protocol-ID ! SPI Size ! Notify Message Type ! 2179 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2180 ! ! 2181 ~ Security Parameter Index (SPI) ~ 2182 ! ! 2183 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2184 ! ! 2185 ~ Notification Data ~ 2186 ! ! 2187 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2188 Figure 13: Notification Payload Format 2190 o Protocol-Id (1 octet) - Specifies the protocol about which 2191 this notification is being sent. For phase 1 notifications, 2192 this field MUST be zero (0). For phase 2 notifications 2193 concerning IPsec SAs this field will contain an IPsec 2194 protocol (either ESP, AH, or IPcomp). For notifications 2195 for which no protocol ID is relevant, this field MUST be 2196 sent as zero and MUST be ignored. 2198 o SPI Size (1 octet) - Length in octets of the SPI as defined by 2199 the Protocol-Id or zero if no SPI is applicable. For phase 1 2200 notification concerning the IKE-SA, the SPI Size MUST be zero. 2202 o Notify Message Type (2 octets) - Specifies the type of 2203 notification message. 2205 o SPI (variable length) - Security Parameter Index. 2207 o Notification Data (variable length) - Informational or error data 2208 transmitted in addition to the Notify Message Type. Values for 2209 this field are message specific, see below. 2211 The payload type for the Notification Payload is eleven (11). 2213 7.10.1 Notify Message Types 2215 Notification information can be error messages specifying why an SA 2216 could not be established. It can also be status data that a process 2217 managing an SA database wishes to communicate with a peer process. 2218 For example, a secure front end or security gateway may use the 2219 Notify message to synchronize SA communication. The table below 2220 lists the Notification messages and their corresponding values. 2222 NOTIFY MESSAGES - ERROR TYPES Value 2223 ----------------------------- ----- 2224 UNSUPPORTED-CRITICAL-PAYLOAD 1 2226 Sent if the payload has the "critical" bit set and the 2227 payload type is not recognised. Notification Data contains 2228 the one octet payload type. 2230 INVALID-COOKIE 4 2232 Indicates an IKE message was received with an unrecognized 2233 destination cookie. This usually indicates that the 2234 recipient has rebooted and forgotten the existence of an 2235 IKE-SA. 2237 INVALID-MAJOR-VERSION 5 2239 Indicates the recipient cannot handle the version of IKE 2240 specified in the header. The closest version number that the 2241 recipient can support will be in the reply header. 2243 INVALID-EXCHANGE-TYPE 7 2245 Notification Data contains the one octet Exchange Type. 2247 INVALID-FLAGS 8 2249 Notification Data contains one octet with the unacceptable 2250 flag bits set. 2252 INVALID-MESSAGE-ID 9 2254 Sent when an IKE MESSAGE-ID outside the negotiated window is 2255 received. This Notify MUST NOT be sent in a response; the 2256 invalid request MUST NOT be acknowledged. Instead, inform 2257 the other side by initiating an Informational exchange with 2258 Notification data containing the four octet invalid MESSAGE- 2259 ID. 2261 INVALID-PROTOCOL-ID 10 2263 Notification Data contains the one octet invalid protocol 2264 ID. 2266 INVALID-SPI 11 2268 MAY be sent in an IKE Informational Exchange when a node 2269 receives an ESP or AH packet with an invalid SPI. address 2270 as the source address in the invalid packet. This usually 2271 indicates a node has rebooted and forgotten an SA. This 2272 Informational Message is sent outside the context of an IKE- 2273 SA, and therefore should only be used by the recipient as a 2274 "hint" that something might be wrong (because it could 2275 easily be forged). 2277 INVALID-TRANSFORM-ID 12 2279 Notification Data contains the one octet invalid transform 2280 ID. 2282 ATTRIBUTES-NOT-SUPPORTED 13 2284 The "Notification Data" for this type are the attribute or 2285 attributes that are not supported. 2287 NO-PROPOSAL-CHOSEN 14 2289 BAD-PROPOSAL-SYNTAX 15 2291 PAYLOAD-MALFORMED 16 2293 INVALID-KEY-INFORMATION 17 2295 The KE field is the wrong length. 2297 INVALID-ID-INFORMATION 18 2299 INVALID-CERT-ENCODING 19 2301 The "Notification Data" for this type are the "Cert 2302 Encoding" field from a Certificate Payload or Certificate 2303 Request Payload. 2305 INVALID-CERTIFICATE 20 2307 The "Notification Data" for this type are the "Certificate 2308 Data" field from a Certificate Payload. 2310 INVALID-CERT-AUTHORITY 22 2312 The "Notification Data" for this type are the "Cert 2313 Encoding" field from a Certificate Payload or Certificate 2314 Request Payload. 2316 AUTHENTICATION-FAILED 24 2318 INVALID-SIGNATURE 25 2320 UNSUPPORTED-EXCHANGE-TYPE 29 2322 The "Notification Data" for this type are the Exchange Type 2323 field from the IKE header. 2325 UNEQUAL-PAYLOAD-LENGTHS 30 2327 The "Notification Data" for this type are the entire message 2328 in which the unequal lengths were observed. 2330 UNSUPPORTED-NOTIFY-TYPE 31 2332 The "Notification Data" for this type is the two octet 2333 Notify Type that was not supported. 2335 IKE-SA-INIT-REJECT 32 2337 This notification is sent in an IKE-SA-RESPONSE to request 2338 that the Initiator retry the request with the supplied 2339 cookie (and optionally the supplied Diffie-Hellman group). 2340 This is not really an error, but is processed like one in 2341 that it indicates that the connection request was rejected. 2342 The Notification Data, if present, contains the Transform 2343 Substructure describing the preferred Diffie-Hellman group. 2345 SINGLE-PAIR-REQUIRED 34 2347 This error indicates that a Phase 2 SA request is 2348 unacceptable because the Responder requires a separate SA 2349 for each source / destination address pair. The Initiator is 2350 expected to respond by requesting an SA for only the 2351 specific traffic he is trying to forward. 2353 RESERVED - Errors 35 - 8191 2355 Private Use - Errors 8192 - 16383 2357 NOTIFY MESSAGES - STATUS TYPES Value 2358 ------------------------------ ----- 2360 RESERVED 16384 - 24577 2362 INITIAL-CONTACT 24578 2364 This notification asserts that this IKE-SA is the only IKE- 2365 SA currently active between the authenticated identities. It 2366 MAY be sent when an IKE-SA is established after a crash, and 2367 the recipient MAY use this information to delete any other 2368 IKE-SAs it has to the same authenticated identity without 2369 waiting for a timeout if those IKE-SAs reside at the IP 2370 address from which this notification arrived. This 2371 notification MUST NOT be sent by an entity that may be 2372 replicated (e.g. a roaming user's credentials where the user 2373 is allowed to connect to the corporate firewall from two 2374 remote systems at the same time). 2376 RESERVED 24578 - 40959 2378 Private Use - STATUS 40960 - 65535 2379 7.11 Delete Payload 2381 The Delete Payload, denoted D in this memo, contains a protocol- 2382 specific security association identifier that the sender has removed 2383 from its security association database and is, therefore, no longer 2384 valid. Figure 14 shows the format of the Delete Payload. It is 2385 possible to send multiple SPIs in a Delete payload, however, each SPI 2386 MUST be for the same protocol. Mixing of Protocol Identifiers MUST 2387 NOT be performed with the Delete payload. It is permitted, however, 2388 to include multiple Delete payloads in a single Informational 2389 Exchange where each Delete payload lists SPIs for a different 2390 protocol. 2392 Deletion of the IKE-SA is indicated by a Protocol-Id of 0 (IKE) but 2393 no SPIs. Deletion of a Child-SA, such as ESP or AH, will contain the 2394 Protocol-Id of that protocol (e.g. ESP, AH) and the SPI is the 2395 receiving entity's SPI(s). 2397 NOTE: What's the deal with IPcomp SAs. This mechanism is probably not 2398 appropriate for deleting them!! 2400 The Delete Payload is defined as follows: 2402 1 2 3 2403 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 2404 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2405 ! Next Payload !C! RESERVED ! Payload Length ! 2406 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2407 ! Protocol-Id ! SPI Size ! # of SPIs ! 2408 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2409 ! ! 2410 ~ Security Parameter Index(es) (SPI) ~ 2411 ! ! 2412 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2414 Figure 14: Delete Payload Format 2416 o Protocol-Id (1 octet) - Must be zero for an IKE-SA, 50 for 2417 ESP, 51 for AH, and 108 for IPcomp. 2419 o SPI Size (1 octet) - Length in octets of the SPI as defined by 2420 the Protocol-Id. Zero for IKE (SPI is in message header), 2421 four for AH and ESP, two for IPcomp. 2423 o # of SPIs (2 octets) - The number of SPIs contained in the Delete 2424 payload. The size of each SPI is defined by the SPI Size field. 2426 o Security Parameter Index(es) (variable length) - Identifies the 2427 specific security association(s) to delete. 2428 The length of this field is 2429 determined by the SPI Size and # of SPIs fields. 2431 The payload type for the Delete Payload is twelve (12). 2433 7.12 Vendor ID Payload 2435 The Vendor ID Payload contains a vendor defined constant. The 2436 constant is used by vendors to identify and recognize remote 2437 instances of their implementations. This mechanism allows a vendor 2438 to experiment with new features while maintaining backwards 2439 compatibility. 2441 The Vendor ID payload is not an announcement from the sender that it 2442 will send private payload types but rather an announcement of the 2443 sort of private payloads it is willing to accept. The implementation 2444 sending the Vendor ID MUST not make any assumptions about private 2445 payloads that it may send unless a Vendor ID of like stature is 2446 received as well. Multiple Vendor ID payloads MAY be sent. An 2447 implementation is NOT REQUIRED to send any Vendor ID payload at all. 2449 A Vendor ID payload may be sent as part of any message. Reception of 2450 a familiar Vendor ID payload allows an implementation to make use of 2451 Private USE numbers described throughout this memo-- private 2452 payloads, private exchanges, private notifications, etc. Unfamiliar 2453 Vendor ID's MUST be ignored. 2455 Writers of Internet-Drafts who wish to extend this protocol MUST 2456 define a Vendor ID payload to announce the ability to implement the 2457 extension in the Internet-Draft. It is expected that Internet-Drafts 2458 which gain acceptance and are standardized will be given "magic 2459 numbers" out of the Future Use range by IANA and the requirement to 2460 use a Vendor ID will go away. 2462 The Vendor ID Payload fields are defined as follows: 2464 1 2 3 2465 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 2466 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2467 ! Next Payload !C! RESERVED ! Payload Length ! 2468 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2469 ! ! 2470 ~ Vendor ID (VID) ~ 2471 ! ! 2472 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2474 Figure 15: Vendor ID Payload Format 2476 o Vendor ID (variable length) - It is the responsibility of 2477 the person choosing the Vendor ID to assure its uniqueness 2478 in spite of the absence of any central registry for IDs. 2479 Good practice is to include a company name, a person name 2480 or some such. If you want to show off, you might include 2481 the latitude and longitude and time where you were when 2482 you chose the ID and some random input. A message digest 2483 of a long unique string is preferable to the long unique 2484 string itself. 2486 The payload type for the Vendor ID Payload is thirteen (13). 2488 7.13 Traffic Selector Payload 2490 The Traffic Selector Payload, denoted TS in this memo, allows peers 2491 to identify packet flows for processing by IPsec security services. 2492 The Traffic Selector Payload consists of the IKE generic header 2493 followed by selector information fields as follows: 2495 1 2 3 2496 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 2497 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2498 ! Next Payload !C! RESERVED ! Payload Length ! 2499 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2500 ! Number of TSs ! RESERVED ! 2501 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2502 ! ! 2503 ~ ~ 2504 ! ! 2505 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2507 Figure 16: Traffic Selectors Payload Format 2508 o Number of TSs (1 octet) - Number of traffic selectors 2509 being provided. 2511 o RESERVED - This field MUST be sent as zero and MUST be ignored. 2513 o Traffic Selectors (variable length) - one or more traffic 2514 selector substructures. 2516 The length of the Traffic Selector payload includes the TS header and 2517 all the traffic selector substructures. 2518 The payload type for the Traffic Selector payload is fourteen (14). 2520 7.13.1 Traffic Selector Substructure 2522 1 2 3 2523 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 2524 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2525 ! TS Type ! Protocol ID | Selector Length | 2526 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2527 | Start-Port | End-Port | 2528 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2529 ! ! 2530 ~ Address Selector Data ~ 2531 ! ! 2532 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2534 Figure 17: Traffic Selector Substructure 2536 o TS Type (one octet) - Specifies the type of traffic selector. 2538 o Protocol ID (1 octet) - Value specifying an associated IP 2539 protocol ID (e.g. UDP/TCP). A value of zero means that the 2540 Protocol ID is not relevant to this traffic selector-- 2541 the SA can carry all protocols. 2543 o Selector Length - Specifies the length of this Traffic 2544 Selector Substructure including the header. 2546 o Start-Port (2 octets) - Value specifying the smallest port 2547 number allowed by this Traffic Selector. For protocols for 2548 which port is undefined, or if all ports are allowed by 2549 this Traffic Selector, this field MUST be zero. 2551 o End-Port (2 octets) - Value specifying the largest port 2552 number allowed by this Traffic Selector. For protocols for 2553 which port is undefined, or it all ports are allowed by 2554 this Traffic Selector, this field MUST be 65535. 2556 o Address Selector Data - a specification of one or more 2557 addresses included in this Traffic Selector with format 2558 determined by TS type. 2560 The following table lists the assigned values for the Traffic 2561 Selector Type field and the corresponding Address Selector Data. 2563 TS Type Value 2564 ------- ----- 2565 RESERVED 0 2567 TS_IPV4_ADDR 1 2569 A four (4) octet IPv4 address 2571 TS_IPV4_ADDR_SUBNET 4 2573 An IPv4 subnet represented by a pair of four (4) octet 2574 values. The first value is an IPv4 address. The second is 2575 an IPv4 network mask. Note that ones (1s) in the network 2576 mask indicate that the corresponding bit in the address is 2577 fixed, while zeros (0s) indicate a "wildcard" bit. 2579 TS_IPV6_ADDR 5 2581 A sixteen (16) octet IPv6 address 2583 TS_IPV6_ADDR_SUBNET 6 2585 An IPv6 subnet represented by a pair sixteen (16) octet 2586 values. The first value is an IPv6 address. The second is 2587 an IPv6 network mask. Note that ones (1s) in the network 2588 mask indicate that the corresponding bit in the address is 2589 fixed, while zeros (0s) indicate a "wildcard" bit. 2591 TS_IPV4_ADDR_RANGE 7 2593 A range of IPv4 addresses, represented by two four (4) octet 2594 values. The first value is the beginning IPv4 address 2595 (inclusive) and the second value is the ending IPv4 address 2596 (inclusive). All addresses falling between the two specified 2597 addresses are considered to be within the list. 2599 TS_IPV6_ADDR_RANGE 8 2601 A range of IPv6 addresses, represented by two sixteen (16) 2602 octet values. The first value is the beginning IPv6 address 2603 (inclusive) and the second value is the ending IPv6 address 2604 (inclusive). All addresses falling between the two specified 2605 addresses are considered to be within the list. 2607 7.14 Other Payload Types 2609 Payload type values 15-127 are reserved to IANA for future assignment 2610 in IKEv2 (see section 10). Payload type values 128-255 are for 2611 private use among mutually consenting parties. 2613 8 Diffie-Hellman Groups 2615 There are 5 groups different Diffie-Hellman groups defined for use in 2616 IKE. These groups were generated by Richard Schroeppel at the 2617 University of Arizona. Properties of these primes are described in 2618 [Orm96]. 2620 The strength supplied by group one may not be sufficient for the 2621 mandatory-to-implement encryption algorithm and is here for historic 2622 reasons. 2624 8.1 Group 1 - 768 Bit MODP 2626 IKE implementations MAY support a MODP group with the following prime 2627 and generator. This group is assigned id 1 (one). 2629 The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 } 2630 Its hexadecimal value is: 2632 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 2633 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 2634 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9 2635 A63A3620 FFFFFFFF FFFFFFFF 2637 The generator is 2. 2639 8.2 Group 2 - 1024 Bit MODP 2641 IKE implementations SHOULD support a MODP group with the following 2642 prime and generator. This group is assigned id 2 (two). 2644 The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }. 2645 Its hexadecimal value is: 2647 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 2648 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 2649 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9 2650 A637ED6B 0BFF5CB6 F406B7ED EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 2651 49286651 ECE65381 FFFFFFFF FFFFFFFF 2653 The generator is 2. 2655 8.3 Group 3 - 155 Bit EC2N 2657 IKE implementations MAY support a EC2N group with the following 2658 characteristics. This group is assigned id 3 (three). The curve is 2659 based on the Galois Field GF[2^155]. The field size is 155. The 2660 irreducible polynomial for the field is: 2661 u^155 + u^62 + 1. 2662 The equation for the elliptic curve is: 2663 y^2 + xy = x^3 + ax^2 + b. 2665 Field Size: 155 2666 Group Prime/Irreducible Polynomial: 2667 0x0800000000000000000000004000000000000001 2668 Group Generator One: 0x7b 2669 Group Curve A: 0x0 2670 Group Curve B: 0x07338f 2671 Group Order: 0x0800000000000000000057db5698537193aef944 2673 The data in the KE payload when using this group is the value x from 2674 the solution (x,y), the point on the curve chosen by taking the 2675 randomly chosen secret Ka and computing Ka*P, where * is the 2676 repetition of the group addition and double operations, P is the 2677 curve point with x coordinate equal to generator 1 and the y 2678 coordinate determined from the defining equation. The equation of 2679 curve is implicitly known by the Group Type and the A and B 2680 coefficients. There are two possible values for the y coordinate; 2681 either one can be used successfully (the two parties need not agree 2682 on the selection). 2684 8.4 Group 4 - 185 Bit EC2N 2686 IKE implementations MAY support a EC2N group with the following 2687 characteristics. This group is assigned id 4 (four). The curve is 2688 based on the Galois Field GF[2^185]. The field size is 185. The 2689 irreducible polynomial for the field is: 2690 u^185 + u^69 + 1. 2692 The equation for the elliptic curve is: 2693 y^2 + xy = x^3 + ax^2 + b. 2695 Field Size: 185 2696 Group Prime/Irreducible Polynomial: 2697 0x020000000000000000000000000000200000000000000001 2698 Group Generator One: 0x18 2699 Group Curve A: 0x0 2700 Group Curve B: 0x1ee9 2701 Group Order: 0x01ffffffffffffffffffffffdbf2f889b73e484175f94ebc 2703 The data in the KE payload when using this group will be identical to 2704 that as when using Oakley Group 3 (three). 2706 8.5 Group 5 - 1536 Bit MODP 2708 IKE implementations MUST support a MODP group with the following 2709 prime and generator. This group is assigned id 5 (five). 2711 The prime is 2^1536 - 2^1472 - 1 + 2^64 * {[2^1406 pi] + 741804}. 2712 Its hexadecimal value is 2714 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 2715 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 2716 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9 2717 A637ED6B 0BFF5CB6 F406B7ED EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 2718 49286651 ECE45B3D C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 2719 FD24CF5F 83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D 2720 670C354E 4ABC9804 F1746C08 CA237327 FFFFFFFF FFFFFFFF 2722 The generator is 2. 2724 9 Security Considerations 2726 Repeated re-keying using Phase 2 without PFS can consume the entropy 2727 of the Diffie-Hellman shared secret. Implementers should take note of 2728 this fact and set a limit on Phase 2 Exchanges between 2729 exponentiations. This memo does not prescribe such a limit. 2731 The strength of a key derived from a Diffie-Hellman exchange using 2732 any of the groups defined here depends on the inherent strength of 2733 the group, the size of the exponent used, and the entropy provided by 2734 the random number generator used. Due to these inputs it is difficult 2735 to determine the strength of a key for any of the defined groups. 2736 Diffie-Hellman group number two when used with a strong random number 2737 generator and an exponent no less than 160 bits is sufficient to use 2738 for 3DES. Groups three through five provide greater security. Group 2739 one is for historic purposes only and does not provide sufficient 2740 strength to the required cipher (although it is sufficient for use 2741 with DES, which is also for historic use only). Implementations 2742 should make note of these conservative estimates when establishing 2743 policy and negotiating security parameters. 2745 Note that these limitations are on the Diffie-Hellman groups 2746 themselves. There is nothing in IKE which prohibits using stronger 2747 groups nor is there anything which will dilute the strength obtained 2748 from stronger groups. In fact, the extensible framework of IKE 2749 encourages the definition of more groups; use of elliptical curve 2750 groups will greatly increase strength using much smaller numbers. 2752 It is assumed that the Diffie-Hellman exponents in this exchange are 2753 erased from memory after use. In particular, these exponents MUST NOT 2754 be derived from long-lived secrets like the seed to a pseudo-random 2755 generator that is not erased after use. 2757 The security of this protocol is critically dependent on the 2758 randomness of the Diffie-Hellman exponents, which should be generated 2759 by a strong random or properly seeded pseudo-random source (see 2760 RFC1715). While the protocol was designed to be secure even if the 2761 Nonces and other values specified as random are not strongly random, 2762 they should similarly be generated from a strong random source as 2763 part of a conservative design. 2765 10 IANA Considerations 2767 This document contains many "magic numbers" to be maintained by the 2768 IANA. This section explains the criteria to be used by the IANA to 2769 assign additional numbers in each of these lists. 2771 10.1 Transform Types and Attribute Values 2773 10.1.1 Attributes 2775 Transform attributes are uses to modify or complete the specification 2776 of a particular transform. Requests for new transform attributes MUST 2777 be accompanied by an RFC which defines the transform which it 2778 modifies or completes and the method in which it does so. 2780 10.1.2 Encryption Algorithm Transform Type 2782 Values of the Encryption Algorithm define an encryption algorithm to 2783 use when called for in this document. Requests for assignment of new 2784 encryption algorithm values must be accompanied by a reference to an 2785 RFC that describes how to use this algorithm with ESP. 2787 10.1.3 Pseudo-random function Transform Type 2789 Values for the pseudo-random function define which pseudo-random 2790 function is used in IKE for key generation and expansion. Requests 2791 for assignment of a new pseudo-random function MUST be accompanied by 2792 a reference to an RFC describing this function. 2794 10.1.4 Authentication Method Transform Type 2796 The only Authentication method defined in the memo is for digital 2797 signatures. Other methods of authentication are possible and MUST be 2798 accompanied by an RFC which defines the following: 2800 - the cryptographic method of authentication. 2801 - content of the Authentication Data in the Authentication 2802 Payload. 2803 - new payloads, their construction and processing, if needed. 2804 - additions of payloads to any messages, if needed. 2806 10.1.5 Diffie-Hellman Groups 2808 Values of the Diffie-Hellman Group Transform types define a group in 2809 which a Diffie-Hellman key exchange can be completed. Requests for 2810 assignment of a new Diffie-Hellman group type MUST be accompanied by 2811 a reference to an RFC which fully defines the group. 2813 10.2 Exchange Types 2815 This memo defines three exchange types for use with IKEv2. Requests 2816 for assignment of new exchange types MUST be accompanied by an RFC 2817 which defines the following: 2819 - the purpose of and need for the new exchange. 2820 - the payloads (mandatory and optional) that accompany 2821 messages in the exchange. 2822 - the phase of the exchange. 2823 - requirements the new exchange has on existing 2824 exchanges which have assigned numbers. 2826 10.3 Payload Types 2828 Payloads are defined in this memo to convey information between 2829 peers. New payloads may be required when defining a new 2830 authentication method or exchange. Requests for new payload types 2831 MUST be accompanied by an RFC which defines the physical layout of 2832 the payload and the fields it contains. All payloads MUST use the 2833 same generic header defined in Figure 2. 2835 11 Acknowledgements 2837 We would like to thank the many members of the IPsec working group 2838 that provided helpful and constructive suggestions on improving IKE. 2839 Special thanks go to those of you who've implemented it! 2841 This protocol is built on the shoulders of many designers who came 2842 before. While they have not necessarily reviewed or endorsed this 2843 version and should not be blamed for any defects, they deserve much 2844 of the credit for its design. We would like to acknowledge Oakley, 2845 SKEME and their authors, Hilarie Orman (Oakley), Hugo Krawczyk 2846 (SKEME). Without the hard work of Doug Maughan, Mark Schertler, Mark 2847 Schneider, Jeff Turner, Dave Carrel, and Derrell Piper, this memo 2848 would not exist. Their contributions to the IPsec WG have been 2849 considerable and critical. 2851 12 References 2853 [CAST] Adams, C., "The CAST-128 Encryption Algorithm", RFC 2144, 2854 May 1997. 2856 [BLOW] Schneier, B., "The Blowfish Encryption Algorithm", Dr. 2857 Dobb's Journal, v. 19, n. 4, April 1994. 2859 [Bra96] Bradner, S., "The Internet Standards Process -- Revision 3", 2860 BCP 9, RFC 2026, October 1996. 2862 [Bra97] Bradner, S., "Key Words for use in RFCs to indicate 2863 Requirement Levels", BCP 14, RFC 2119, March 1997. 2865 [Ble98] Bleichenbacher, D., "Chosen Ciphertext Attacks against 2866 Protocols Based on RSA Encryption Standard PKCS#1", Advances 2867 in Cryptology Eurocrypt '98, Springer-Verlag, 1998. 2869 [BR94] Bellare, M., and Rogaway P., "Optimal Asymmetric 2870 Encryption", Advances in Cryptology Eurocrypt '94, 2871 Springer-Verlag, 1994. 2873 [DES] ANSI X3.106, "American National Standard for Information 2874 Systems-Data Link Encryption", American National Standards 2875 Institute, 1983. 2877 [DH] Diffie, W., and Hellman M., "New Directions in 2878 Cryptography", IEEE Transactions on Information Theory, V. 2879 IT-22, n. 6, June 1977. 2881 [DSS] NIST, "Digital Signature Standard", FIPS 186, National 2882 Institute of Standards and Technology, U.S. Department of 2883 Commerce, May, 1994. 2885 [IDEA] Lai, X., "On the Design and Security of Block Ciphers," ETH 2886 Series in Information Processing, v. 1, Konstanz: Hartung- 2887 Gorre Verlag, 1992 2889 [Ker01] Keronytis, A., Sommerfeld, B., "The 'Suggested ID' Extension 2890 for IKE", draft-keronytis-ike-id-00.txt, 2001 2892 [KBC96] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 2893 Hashing for Message Authentication", RFC 2104, February 2894 1997. 2896 [SKEME] Krawczyk, H., "SKEME: A Versatile Secure Key Exchange 2897 Mechanism for Internet", from IEEE Proceedings of the 1996 2898 Symposium on Network and Distributed Systems Security. 2900 [MD5] Rivest, R., "The MD5 Message Digest Algorithm", RFC 1321, 2901 April 1992. 2903 [MSST98] Maughhan, D., Schertler, M., Schneider, M., and J. Turner, 2904 "Internet Security Association and Key Management Protocol 2905 (ISAKMP)", RFC 2408, November 1998. 2907 [Orm96] Orman, H., "The Oakley Key Determination Protocol", RFC 2908 2412, November 1998. 2910 [PFKEY] McDonald, D., Metz, C., and Phan, B., "PFKEY Key Management 2911 API, Version 2", RFC2367, July 1998. 2913 [PKCS1] Kaliski, B., and J. Staddon, "PKCS #1: RSA Cryptography 2914 Specifications Version 2", September 1998. 2916 [PK01] Perlman, R., and Kaufman, C., "Analysis of the IPsec key 2917 exchange Standard", WET-ICE Security Conference, MIT, 2001, 2918 http://sec.femto.org/wetice-2001/papers/radia-paper.pdf. 2920 [Pip98] Piper, D., "The Internet IP Security Domain Of 2921 Interpretation for ISAKMP", RFC 2407, November 1998. 2923 [RC5] Rivest, R., "The RC5 Encryption Algorithm", Dr. Dobb's 2924 Journal, v. 20, n. 1, January 1995. 2926 [RSA] Rivest, R., Shamir, A., and Adleman, L., "A Method for 2927 Obtaining Digital Signatures and Public-Key Cryptosystems", 2928 Communications of the ACM, v. 21, n. 2, February 1978. 2930 [Sch96] Schneier, B., "Applied Cryptography, Protocols, Algorithms, 2931 and Source Code in C", 2nd edition. 2933 [SHA] NIST, "Secure Hash Standard", FIPS 180-1, National Institute 2934 of Standards and Technology, U.S. Department of Commerce, 2935 May 1994. 2937 [TIGER] Anderson, R., and Biham, E., "Fast Software Encryption", 2938 Springer LNCS v. 1039, 1996. 2940 Appendix A 2942 Attribute Assigned Numbers 2944 Certain transforms negotiated in an SA payload can have associated 2945 attributes. Attribute types can be either Basic (B) or Variable- 2946 length (V). Encoding of these attributes is defined as Type/Value 2947 (Basic) and Type/Length/Value (Variable). See section 7.3.3. 2949 Attributes described as basic MUST NOT be encoded as variable. 2950 Variable length attributes MUST NOT be encoded as basic even if their 2951 value can fit into two octets. NOTE: This is a change from IKEv1, 2952 where increased flexibility may have simplified the composer of 2953 messages but certainly complicated the parser. 2955 Attribute Classes 2957 class value type 2958 -------------------------------------------------------------- 2959 RESERVED 0-5 2960 Group Prime/Irreducible Polynomial 6 V 2961 Group Generator One 7 V 2962 Group Generator Two 8 V 2963 Group Curve A 9 V 2964 Group Curve B 10 V 2965 RESERVED 11-13 2966 Key Length 14 B 2967 Field Size 15 B 2968 Group Order 16 V 2969 Block Size 17 B 2971 values 0-5, 11-13, and 18-16383 are reserved to IANA. Values 2972 16384-32767 are for private use among mutually consenting parties. 2974 - Group Prime/Irreducible Polynomial 2976 The prime number of a MODP Diffie-Hellman group or the irreducible 2977 polynomial of an elliptic curve when specifying a private Diffie- 2978 Hellman group. 2980 - Generator One, Generator Two 2982 The X- and Y-coordinate of a point on an elliptic curve. When the 2983 Y-coordinate (generator two) is not given it can be computed with 2984 the X-coordinate and the definition of the curve. 2986 - Curve A, Curve B 2987 Coefficients from the definition of an elliptic curve: 2989 y^2 + xy = x^3 + (curve A)x^2 + (curve B) 2991 - Key Length 2993 When using an Encryption Algorithm that has a variable length key, 2994 this attribute specifies the key length in bits. (MUST use network 2995 byte order). This attribute MUST NOT be used when the specified 2996 Encryption Algorithm uses a fixed length key. 2998 - Field Size 3000 The field size, in bits, of a Diffie-Hellman group. 3002 - Group Order 3004 The group order of an elliptic curve group. Note the length of 3005 this attribute depends on the field size. 3007 - Block Size 3009 The number of bits per block of a cipher with a variable block 3010 length. 3012 Appendix B: Cryptographic Protection of IKE Data 3014 With the exception of the IKE-SA-INIT-REQUEST, IKE-SA-INIT-RESPONSE, 3015 and Informational Exchange error notifications when no IKE-SA exists, 3016 all IKE messages are encrypted and integrity protected. The 3017 algorithms for encryption and integrity protection are negotiated 3018 during IKE-SA setup, and the keys are computed as specified in 3019 sections 3 and 4.2. 3021 The encryption and integrity protection algorithms are modelled after 3022 the ESP algorithms described in RFCs 2104, 2406, 2451. This appendix 3023 completely specifies the cryptographic processing of IKE data, but 3024 those documents should be consulted for design rationale. This 3025 appendix assumes a block cipher with a fixed block size and an 3026 integrity check algorithm that computes a fixed length checksum over 3027 a variable size message. The mandatory to implement algorithms are 3028 AES-128 and HMAC-SHA1. 3030 The format of an IKE message is shown in Figure 18. 3031 1 2 3 3032 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 3033 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3034 ! Fixed IKE Header - 28 octets ! 3035 ! (including cookies, message ID, Length) ! 3036 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3037 ! Initialization Vector ! 3038 ! (length is block size for encryption algorithm) ! 3039 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3040 ! IKE Payloads ! 3041 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3042 ! ! Padding (0-255 octets) ! 3043 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ 3044 ! ! Pad Length ! 3045 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3046 ~ Authentication Data ~ 3047 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3049 Figure 18: IKE message with cryptographic protection 3051 o Initialization Vector - A randomly chosen value whose length 3052 is equal to the block length of the underlying encryption 3053 algorithm. Recipients MUST accept any value. Senders SHOULD 3054 either pick this value pseudo-randomly and independently for 3055 each message or use the final ciphertext block of the previous 3056 message sent. Senders MUST NOT use the same value for each 3057 message, use a sequence of values with low hamming distance 3058 (e.g. a sequence number), or use ciphertext from a received 3059 message. 3061 o IKE Payloads are as specified in Section 7. This field is 3062 encrypted with the negotiated cipher. 3064 o Padding may contain any value chosen by the sender, and must 3065 have a length that makes the combination of the Payloads, the 3066 Padding, and the Pad Length to be a multiple of the encryption 3067 block size. This field is encrypted with the negotiated 3068 cipher. 3070 o Pad Length is the length of the Padding field. The sender 3071 SHOULD set the Pad Length to the minimum value that makes 3072 the combination of the Payloads, the Padding, and the Pad 3073 Length a multiple of the block size, but the recipient MUST 3074 accept any length that results in proper alignment. This 3075 field is encrypted with the negotiated cipher. 3077 o Authentication Data is the cryptographic checksum of the 3078 entire message starting with the Fixed IKE Header through 3079 the Pad Length. The checksum MUST be computed over the 3080 encrypted message. 3082 Authors' Addresses 3084 Dan Harkins 3085 dharkins@trpz.com 3086 Trapeze Networks 3088 Charlie Kaufman 3089 ckaufman@iris.com 3090 IBM 3092 Steve Kent 3093 kent@bbn.com 3094 BBN Technologies 3096 Tero Kivinen 3097 kivinen@ssh.com 3098 SSH Communications Security 3100 Radia Perlman 3101 radia.perlman@sun.com 3102 Sun Microsystems