Dears,
In RFC 2409 "The Internet Key Exchange (IKE)", its mentioned there are four available authentication methods for IKE, there are different calculations for SKEYID for each method and hence we get HASH_I & HASH_R which seems it has one calculation way but the SKEYID gets engaged on its calculation.
Referring to the RFC 2409:
SKEYID is a string derived DH exchanged
SKEYID_e (encryption key, for the phase 1 messages)
SKEYID_a (for authenticating phase 1messages)
SKEYID_d (to protect "encryption & authentication" phase 2 messages)
The value SKEYID is computed separately for each authentication method.
For signatures: SKEYID = prf(Ni_b | Nr_b, g^xy)
For public key encryption: SKEYID = prf(hash(Ni_b | Nr_b), CKY-I | CKY-R)
For pre-shared keys: SKEYID = prf(pre-shared-key, Ni_b | Nr_b) ===> let's focus on pre-shared key
PRF or HMAC (if no prf negotiated)
The result is the three groups of keying material:
SKEYID_d = prf(SKEYID, g^xy | CKY-I | CKY-R | 0)
SKEYID_a = prf(SKEYID, SKEYID_d | g^xy | CKY-I | CKY-R | 1)
SKEYID_e = prf(SKEYID, SKEYID_a | g^xy | CKY-I | CKY-R | 2)
HASH_I and HASH_R are generated by each party in order to authentication each others:
HASH_I = prf(SKEYID, g^xi | g^xr | CKY-I | CKY-R | SAi_b | IDii_b )
HASH_R = prf(SKEYID, g^xr | g^xi | CKY-R | CKY-I | SAi_b | IDir_b )
Question #1: I don't see SKEYID_a got engaged in the calculation of HASH_I, where it should get engaged in the authentication process? Question #2: when the responder receives the packet with the HASH_I? what does it do to verify the authenticity of the initiator?