If the initiator is configured to use a PPK with the responder (whether or not the use of the PPK is mandatory), then it
MUST include a notification USE_PPK in the IKE_SA_INIT request message as follows:
Initiator Responder
------------------------------------------------------------------
HDR, SAi1, KEi, Ni, N(USE_PPK) --->
N(USE_PPK) is a status notification payload with the type 16435; it has a protocol ID of 0, no Security Parameter Index (SPI), and no notification data associated with it.
If the initiator needs to resend this initial message with a COOKIE notification, then the resend would include the USE_PPK notification if the original message did (see
Section 2.6 of
RFC 7296).
If the responder does not support this specification or does not have any PPK configured, then it ignores the received notification (as defined in [
RFC 7296] for unknown status notifications) and continues with the IKEv2 protocol as normal. Otherwise, the responder replies with the IKE_SA_INIT message, including a USE_PPK notification in the response:
Initiator Responder
------------------------------------------------------------------
<--- HDR, SAr1, KEr, Nr, [CERTREQ,] N(USE_PPK)
When the initiator receives this reply, it checks whether the responder included the USE_PPK notification. If the responder did not include the USE_PPK notification and the flag mandatory_or_not indicates that using PPKs is mandatory for communication with this responder, then the initiator
MUST abort the exchange. This situation may happen in case of misconfiguration, i.e., when the initiator believes it has a mandatory-to-use PPK for the responder and the responder either doesn't support PPKs at all or doesn't have any PPK configured for the initiator. See
Section 6 for discussion of the possible impacts of this situation.
If the responder did not include the USE_PPK notification and using a PPK for this particular responder is optional, then the initiator continues with the IKEv2 protocol as normal, without using PPKs.
If the responder did include the USE_PPK notification, then the initiator selects a PPK, along with its identifier PPK_ID. Then, it computes this modification of the standard IKEv2 key derivation from
Section 2.14 of
RFC 7296:
SKEYSEED = prf(Ni | Nr, g^ir)
{SK_d' | SK_ai | SK_ar | SK_ei | SK_er | SK_pi' | SK_pr'}
= prf+ (SKEYSEED, Ni | Nr | SPIi | SPIr)
SK_d = prf+ (PPK, SK_d')
SK_pi = prf+ (PPK, SK_pi')
SK_pr = prf+ (PPK, SK_pr')
That is, we use the standard IKEv2 key derivation process, except that the three resulting subkeys SK_d, SK_pi, and SK_pr (marked with primes in the formula above) are then run through the prf+ again, this time using the PPK as the key. The result is the unprimed versions of these keys, which are then used as inputs to subsequent steps of the IKEv2 exchange.
Using a prf+ construction ensures that it is always possible to get the resulting keys of the same size as the initial ones, even if the underlying PRF has an output size different from its key size. Note that at the time of this writing, all PRFs defined for use in IKEv2 (see the "Transform Type 2 - Pseudorandom Function Transform IDs" subregistry [
IANA-IKEV2]) have an output size equal to the (preferred) key size. For such PRFs, only the first iteration of prf+ is needed:
SK_d = prf (PPK, SK_d' | 0x01)
SK_pi = prf (PPK, SK_pi' | 0x01)
SK_pr = prf (PPK, SK_pr' | 0x01)
Note that the PPK is used in SK_d, SK_pi, and SK_pr calculations only during the initial IKE SA setup. It
MUST NOT be used when these subkeys are calculated as result of IKE SA rekey, resumption, or other similar operations.
The initiator then sends the IKE_AUTH request message, including the PPK_ID value as follows:
Initiator Responder
------------------------------------------------------------------
HDR, SK {IDi, [CERT,] [CERTREQ,]
[IDr,] AUTH, SAi2,
TSi, TSr, N(PPK_IDENTITY, PPK_ID), [N(NO_PPK_AUTH)]} --->
PPK_IDENTITY is a status notification with the type 16436; it has a protocol ID of 0, no SPI, and notification data that consists of the identifier PPK_ID.
A situation may happen when the responder has some PPKs but doesn't have a PPK with the PPK_ID received from the initiator. In this case, the responder cannot continue with the PPK (in particular, it cannot authenticate the initiator), but the responder could be able to continue with the normal IKEv2 protocol if the initiator provided its authentication data computed as in the normal IKEv2 without using PPKs. For this purpose, if using PPKs for communication with this responder is optional for the initiator (based on the mandatory_or_not flag), then the initiator
MUST include a NO_PPK_AUTH notification in the above message. This notification informs the responder that PPKs are optional and allows for authenticating the initiator without using PPKs.
NO_PPK_AUTH is a status notification with the type 16437; it has a protocol ID of 0 and no SPI. The Notification Data field contains the initiator's authentication data computed using SK_pi', which has been computed without using PPKs. This is the same data that would normally be placed in the Authentication Data field of an AUTH payload. Since the Auth Method field is not present in the notification, the authentication method used for computing the authentication data
MUST be the same as the method indicated in the AUTH payload. Note that if the initiator decides to include the NO_PPK_AUTH notification, the initiator needs to perform authentication data computation twice, which may consume computation power (e.g., if digital signatures are involved).
When the responder receives this encrypted exchange, it first computes the values:
SKEYSEED = prf(Ni | Nr, g^ir)
{SK_d' | SK_ai | SK_ar | SK_ei | SK_er | SK_pi' | SK_pr'}
= prf+ (SKEYSEED, Ni | Nr | SPIi | SPIr)
The responder then uses the SK_ei/SK_ai values to decrypt/check the message and then scans through the payloads for the PPK_ID attached to the PPK_IDENTITY notification. If no PPK_IDENTITY notification is found and the peers successfully exchanged USE_PPK notifications in the IKE_SA_INIT exchange, then the responder
MUST send back an AUTHENTICATION_FAILED notification and then fail the negotiation.
If the PPK_IDENTITY notification contains a PPK_ID that is not known to the responder or is not configured for use for the identity from the IDi payload, then the responder checks whether using PPKs for this initiator is mandatory and whether the initiator included a NO_PPK_AUTH notification in the message. If using PPKs is mandatory or no NO_PPK_AUTH notification is found, then the responder
MUST send back an AUTHENTICATION_FAILED notification and then fail the negotiation. Otherwise (when a PPK is optional and the initiator included a NO_PPK_AUTH notification), the responder
MAY continue the regular IKEv2 protocol, except that it uses the data from the NO_PPK_AUTH notification as the authentication data (which usually resides in the AUTH payload) for the purpose of the initiator authentication. Note that the authentication method is still indicated in the AUTH payload.
Table 1 summarizes the above logic for the responder:
Received USE_PPK |
Received NO_PPK_AUTH |
Configured with PPK |
PPK is Mandatory |
Action |
No |
* |
No |
* |
Standard IKEv2 protocol |
No |
* |
Yes |
No |
Standard IKEv2 protocol |
No |
* |
Yes |
Yes |
Abort negotiation |
Yes |
No |
No |
* |
Abort negotiation |
Yes |
Yes |
No |
Yes |
Abort negotiation |
Yes |
Yes |
No |
No |
Standard IKEv2 protocol |
Yes |
* |
Yes |
* |
Use PPK |
Table 1
If a PPK is in use, then the responder extracts the corresponding PPK and computes the following values:
SK_d = prf+ (PPK, SK_d')
SK_pi = prf+ (PPK, SK_pi')
SK_pr = prf+ (PPK, SK_pr')
The responder then continues with the IKE_AUTH exchange (validating the AUTH payload that the initiator included) as usual and sends back a response, which includes the PPK_IDENTITY notification with no data to indicate that the PPK is used in the exchange:
Initiator Responder
------------------------------------------------------------------
<-- HDR, SK {IDr, [CERT,]
AUTH, SAr2,
TSi, TSr, N(PPK_IDENTITY)}
When the initiator receives the response, it checks for the presence of the PPK_IDENTITY notification. If it receives one, it marks the SA as using the configured PPK to generate SK_d, SK_pi, and SK_pr (as shown above); the content of the received PPK_IDENTITY (if any)
MUST be ignored. If the initiator does not receive the PPK_IDENTITY, it
MUST either fail the IKE SA negotiation sending the AUTHENTICATION_FAILED notification in the INFORMATIONAL exchange (if the PPK was configured as mandatory) or continue without using the PPK (if the PPK was not configured as mandatory and the initiator included the NO_PPK_AUTH notification in the request).
If the Extensible Authentication Protocol (EAP) is used in the IKE_AUTH exchange, then the initiator doesn't include the AUTH payload in the first request message; however, the responder sends back the AUTH payload in the first reply. The peers then exchange AUTH payloads after EAP is successfully completed. As a result, the responder sends the AUTH payload twice -- in the first and last IKE_AUTH reply message -- while the initiator sends the AUTH payload only in the last IKE_AUTH request. See more details about EAP authentication in IKEv2 in
Section 2.16 of
RFC 7296.
The general rule for using a PPK in the IKE_AUTH exchange, which covers the EAP authentication case too, is that the initiator includes a PPK_IDENTITY (and optionally a NO_PPK_AUTH) notification in the request message containing the AUTH payload. Therefore, in case of EAP, the responder always computes the AUTH payload in the first IKE_AUTH reply message without using a PPK (by means of SK_pr'), since PPK_ID is not yet known to the responder. Once the IKE_AUTH request message containing the PPK_IDENTITY notification is received, the responder follows the rules described above for the non-EAP authentication case.
Initiator Responder
----------------------------------------------------------------
HDR, SK {IDi, [CERTREQ,]
[IDr,] SAi2,
TSi, TSr} -->
<-- HDR, SK {IDr, [CERT,] AUTH,
EAP}
HDR, SK {EAP} -->
<-- HDR, SK {EAP (success)}
HDR, SK {AUTH,
N(PPK_IDENTITY, PPK_ID)
[, N(NO_PPK_AUTH)]} -->
<-- HDR, SK {AUTH, SAr2, TSi, TSr
[, N(PPK_IDENTITY)]}
Note that the diagram above shows both the cases when the responder uses a PPK and when it chooses not to use it (provided the initiator has included the NO_PPK_AUTH notification); thus, the responder's PPK_IDENTITY notification is marked as optional. Also, note that the IKE_SA_INIT exchange using a PPK is as described above (including exchange of the USE_PPK notifications), regardless of whether or not EAP is employed in the IKE_AUTH.