RFC 9242: Intermediate Exchange in the Internet Key Exchange Protocol Version 2 (IKEv2)
- V. Smyslov
Abstract
This document defines a new exchange, called "Intermediate Exchange", for the Internet Key Exchange Protocol Version 2 (IKEv2). This exchange can be used for transferring large amounts of data in the process of IKEv2 Security Association (SA) establishment. An example of the need to do this is using key exchange methods resistant to Quantum Computers (QCs) for IKE SA establishment. The Intermediate Exchange makes it possible to use the existing IKE fragmentation mechanism (which cannot be used in the initial IKEv2 exchange), helping to avoid IP fragmentation of large IKE messages if they need to be sent before IKEv2 SA is established.¶
Status of This Memo
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
The Internet Key Exchange Protocol Version 2 (IKEv2) defined in [RFC7296] uses UDP as a transport for its messages. If the size of a message is larger than the Path MTU (PMTU), IP fragmentation takes place, which has been shown to cause operational challenges in certain network configurations and devices. The problem is described in more detail in [RFC7383], which also defines an extension to IKEv2 called "IKE fragmentation". This extension allows IKE messages to be fragmented at the IKE level, eliminating possible issues caused by IP fragmentation. However, IKE fragmentation cannot be used in the initial IKEv2 exchange (IKE_SA_INIT). In most cases, this limitation is not a problem, since the IKE_SA_INIT messages are usually small enough not to cause IP fragmentation.¶
However, the situation has been changing recently. One example of the need to transfer large amounts of data before an IKE SA is created is using the QC-resistant key exchange methods in IKEv2. Recent progress in quantum computing has led to concern that classical Diffie-Hellman key exchange methods will become insecure in the relatively near future and should be replaced with QC-resistant ones. Currently, most QC-resistant key exchange methods have large public keys. If these keys are exchanged in the IKE_SA_INIT exchange, then IP fragmentation will probably take place; therefore, all the problems caused by it will become inevitable.¶
A possible solution to this problem would be to use TCP as a transport for IKEv2, as defined in [RFC8229]. However, this approach has significant drawbacks and is intended to be a last resort when UDP transport is completely blocked by intermediate network devices.¶
This specification describes a way to transfer a large amount of data in IKEv2 using UDP transport.
For this purpose, the document defines a new exchange for IKEv2 called "Intermediate Exchange" or "IKE
The Intermediate Exchange can be used to transfer large public keys of QC-resistant key exchange methods,
but its application is not limited to this use case. This exchange can also be used
whenever some data needs to be transferred before the IKE_AUTH exchange and for some reason
the IKE_SA_INIT exchange is not suited for this purpose. This document defines the IKE
2. Terminology and Notation
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
It is expected that readers are familiar with the terms used in the IKEv2 specification [RFC7296]. Notation for the payloads contained in IKEv2 messages is defined in Section 1.2 of [RFC7296].¶
3. Intermediate Exchange Details
3.1. Support for Intermediate Exchange Negotiation
The initiator indicates its support for Intermediate Exchange by including a
notification of type INTERMEDIATE
The INTERMEDIATE
3.2. Using Intermediate Exchange
If both peers indicated their support for the Intermediate Exchange, the initiator may use one or more these exchanges to transfer additional data. Using the Intermediate Exchange is optional; the initiator may find it unnecessary even when support for this exchange has been negotiated.¶
The Intermediate Exchange is denoted as IKE
The initiator may use several IKE
The Message IDs for IKE
If the presence of NAT is detected in the IKE_SA_INIT exchange via NAT
The content of the IKE
Appendix A contains an example of using an IKE
3.3. The IKE_INTERMEDIATE Exchange Protection and Authentication
3.3.1. Protection of IKE_INTERMEDIATE Messages
The keys SK_e[i/r] and SK_a[i/r] for the protection of IKE
Every subsequent IKE
Once all the IKE
3.3.2. Authentication of IKE_INTERMEDIATE Exchanges
The IKE
The requirement to support this behavior makes authentication challenging: it is not appropriate to add
on-the-wire content of the IKE
If one or more IKE
The essence of this modification is that a new chunk called "IntAuth" is appended to the string of octets that is signed (or MACed) by the peers. IntAuth consists of three parts: IntAuth_iN, IntAuth_rN, and IKE_AUTH_MID.¶
The IKE_AUTH_MID chunk is a value of the Message ID field from the IKE Header of the first round of the IKE_AUTH exchange. It is represented as a four-octet integer in network byte order (in other words, exactly as it appears on the wire).¶
The IntAuth_iN and IntAuth_rN chunks represent the cumulative result of applying the negotiated Pseudorandom Function (PRF)
to all IKE
For the purpose of calculating the IntAuth_[i/r]* values, the content of the IKE
The IntAuth_[i/r]*A chunk consists of the sequence of octets from the first octet of the IKE Header (not including the prepended four octets of zeros, if UDP encapsulation or TCP encapsulation of ESP packets is used) to the last octet of the generic header of the Encrypted payload. The scope of IntAuth_[i/r]*A is identical to the scope of Associated Data defined for the use of AEAD algorithms in IKEv2 (see Section 5.1 of [RFC5282]), which is stressed by using the "A" suffix in its name. Note that calculation of IntAuth_[i/r]*A doesn't depend on whether an AEAD algorithm or a plain cipher is used in IKE SA.¶
The IntAuth_[i/r]*P chunk is present if the Encrypted payload is not empty. It consists of the content of the Encrypted payload that is fully formed but not yet encrypted. The Initialization Vector, Padding, Pad Length, and Integrity Checksum Data fields (see Section 3.14 of [RFC7296]) are not included into the calculation. In other words, the IntAuth_[i/r]*P chunk is the inner payloads of the Encrypted payload in plaintext form, which is stressed by using the "P" suffix in its name.¶
Figure 1 illustrates the layout of the IntAuth_[i/r]*A (denoted as A) and the IntAuth_[i/r]*P (denoted as P) chunks in case the Encrypted payload is not empty.¶
For the purpose of prf calculation, the Length field in the IKE Header and the Payload Length
field in the Encrypted payload header are adjusted so that they don't count the lengths
of Initialization Vector, Integrity Checksum Data, Padding, and Pad Length fields.
In other words, the Length field in the IKE Header (denoted as Adjusted Length in Figure 1)
is set to the sum of the lengths of IntAuth_[i/r]*A and Int
The prf calculations MUST be applied to whole messages only, before possible IKE fragmentation. This ensures that the IntAuth will be the same regardless of whether or not IKE fragmentation takes place. If the message was received in fragmented form, it MUST be reconstructed before calculating the prf as if it were received unfragmented. While reconstructing, the RESERVED field in the reconstructed Encrypted payload header MUST be set to the value of the RESERVED field in the Encrypted Fragment payload header from the first fragment (with the Fragment Number field set to 1).¶
Note that it is possible to avoid actual reconstruction of the message by incrementally calculating prf on decrypted (or ready to be encrypted) fragments. However, care must be taken to properly replace the content of the Next Header and the Length fields so that the result of computing the prf is the same as if it were computed on the reconstructed message.¶
Each calculation of IntAuth_[i/r]* uses its own keys SK_p[i/r]*, which are the most recently updated SK_p[i/r] keys
available before the corresponded IKE
3.4. Error Handling in the IKE_INTERMEDIATE Exchange
Since messages of the IKE
4. Interaction with Other IKEv2 Extensions
The IKE
5. Security Considerations
The data that is transferred by means of the IKE
The main application for the Intermediate Exchange is to transfer
large amounts of data before an IKE SA is set up, without causing IP
fragmentation. For that reason, it is expected that IKE fragmentation
will be employed in IKE
Since authentication of peers occurs only in the IKE_AUTH exchange, a malicious initiator
may use the Intermediate Exchange to mount a DoS attack on the responder. In this case, it
starts creating an IKE SA, negotiates using the Intermediate Exchanges, and transfers a lot
of data to the responder that may also require computationally expensive processing.
Then, it aborts the SA establishment before the IKE_AUTH exchange.
Specifications utilizing the Intermediate Exchange MUST NOT allow an unlimited number of these exchanges to take
place at the initiator's discretion. It is recommended that these
specifications be defined in such a way that the responder would
know (possibly via negotiation with the initiator) the exact
number of these exchanges that need to take place.
In other words, after the IKE_SA_INIT exchange is
complete, it is preferred that both the initiator and the responder
know the exact number of IKE
Note that if an attacker was able to break the key exchange in real time
(e.g., by means of a quantum computer), then the security of the IKE
6. IANA Considerations
This document defines a new Exchange Type in the "IKEv2 Exchange Types" registry:¶
This document also defines a new Notify Message Type in the "IKEv2 Notify Message Types - Status Types" registry:¶
7. References
7.1. Normative References
- [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC7296]
-
Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. Kivinen, "Internet Key Exchange Protocol Version 2 (IKEv2)", STD 79, RFC 7296, DOI 10
.17487 , , <https:///RFC7296 www >..rfc -editor .org /info /rfc7296 - [RFC7383]
-
Smyslov, V., "Internet Key Exchange Protocol Version 2 (IKEv2) Message Fragmentation", RFC 7383, DOI 10
.17487 , , <https:///RFC7383 www >..rfc -editor .org /info /rfc7383 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174
7.2. Informative References
- [RFC5282]
-
Black, D. and D. McGrew, "Using Authenticated Encryption Algorithms with the Encrypted Payload of the Internet Key Exchange version 2 (IKEv2) Protocol", RFC 5282, DOI 10
.17487 , , <https:///RFC5282 www >..rfc -editor .org /info /rfc5282 - [RFC5723]
-
Sheffer, Y. and H. Tschofenig, "Internet Key Exchange Protocol Version 2 (IKEv2) Session Resumption", RFC 5723, DOI 10
.17487 , , <https:///RFC5723 www >..rfc -editor .org /info /rfc5723 - [RFC6928]
-
Chu, J., Dukkipati, N., Cheng, Y., and M. Mathis, "Increasing TCP's Initial Window", RFC 6928, DOI 10
.17487 , , <https:///RFC6928 www >..rfc -editor .org /info /rfc6928 - [RFC8019]
-
Nir, Y. and V. Smyslov, "Protecting Internet Key Exchange Protocol Version 2 (IKEv2) Implementations from Distributed Denial
-of , RFC 8019, DOI 10-Service Attacks" .17487 , , <https:///RFC8019 www >..rfc -editor .org /info /rfc8019 - [RFC8229]
-
Pauly, T., Touati, S., and R. Mantha, "TCP Encapsulation of IKE and IPsec Packets", RFC 8229, DOI 10
.17487 , , <https:///RFC8229 www >..rfc -editor .org /info /rfc8229
Appendix A. Example of IKE_INTERMEDIATE Exchange
This appendix contains an example of the messages using IKE
In this example, there is one IKE_SA_INIT exchange and two IKE
At this point, peers calculate SK_* and store them as SK_*1.
SK_e[i/r]1 and SK_a[i/r]1 will be used to protect the first IKE
If the SK_*1 keys are updated (e.g., as a result of a new key exchange) after completing this IKE
If the SK_*2 keys are updated (e.g., as a result of a new key exchange) after completing the second IKE
In this example, two IKE
Acknowledgements
The idea to use an Intermediate Exchange between the IKE_SA_INIT and IKE_AUTH exchanges was first suggested by Tero Kivinen.
He also helped to write the example IKE