merged changes from eap-aka trunk
This commit is contained in:
@@ -62,8 +62,8 @@ struct private_eap_authenticator_t {
|
||||
};
|
||||
|
||||
extern chunk_t build_shared_key_signature(chunk_t ike_sa_init, chunk_t nonce,
|
||||
chunk_t secret, identification_t *id,
|
||||
prf_t *prf);
|
||||
chunk_t secret, identification_t *id,
|
||||
prf_t *prf_skp, prf_t *prf);
|
||||
|
||||
/**
|
||||
* Implementation of authenticator_t.verify.
|
||||
@@ -73,10 +73,10 @@ static status_t verify(private_eap_authenticator_t *this, chunk_t ike_sa_init,
|
||||
{
|
||||
chunk_t auth_data, recv_auth_data;
|
||||
identification_t *other_id = this->ike_sa->get_other_id(this->ike_sa);
|
||||
prf_t *prf = this->ike_sa->get_auth_verify(this->ike_sa);
|
||||
|
||||
auth_data = build_shared_key_signature(ike_sa_init, my_nonce, this->msk,
|
||||
other_id, prf);
|
||||
other_id, this->ike_sa->get_auth_verify(this->ike_sa),
|
||||
this->ike_sa->get_prf(this->ike_sa));
|
||||
|
||||
recv_auth_data = auth_payload->get_data(auth_payload);
|
||||
if (!chunk_equals(auth_data, recv_auth_data))
|
||||
@@ -105,8 +105,9 @@ static status_t build(private_eap_authenticator_t *this, chunk_t ike_sa_init,
|
||||
DBG1(DBG_IKE, "authentication of '%D' (myself) with %N",
|
||||
my_id, auth_method_names, AUTH_EAP);
|
||||
|
||||
auth_data = build_shared_key_signature(ike_sa_init, other_nonce,
|
||||
this->msk, my_id, prf);
|
||||
auth_data = build_shared_key_signature(ike_sa_init, other_nonce, this->msk,
|
||||
my_id, this->ike_sa->get_auth_build(this->ike_sa),
|
||||
this->ike_sa->get_prf(this->ike_sa));
|
||||
|
||||
*auth_payload = auth_payload_create();
|
||||
(*auth_payload)->set_auth_method(*auth_payload, AUTH_PSK);
|
||||
|
||||
@@ -78,11 +78,11 @@ chunk_t build_tbs_octets(chunk_t ike_sa_init, chunk_t nonce,
|
||||
*/
|
||||
chunk_t build_shared_key_signature(chunk_t ike_sa_init, chunk_t nonce,
|
||||
chunk_t secret, identification_t *id,
|
||||
prf_t *prf)
|
||||
prf_t *prf_skp, prf_t *prf)
|
||||
{
|
||||
chunk_t key_pad, key, auth_data, octets;
|
||||
|
||||
octets = build_tbs_octets(ike_sa_init, nonce, id, prf);
|
||||
octets = build_tbs_octets(ike_sa_init, nonce, id, prf_skp);
|
||||
/* AUTH = prf(prf(Shared Secret,"Key Pad for IKEv2"), <msg octets>) */
|
||||
key_pad.ptr = IKEV2_KEY_PAD;
|
||||
key_pad.len = IKEV2_KEY_PAD_LENGTH;
|
||||
@@ -121,9 +121,9 @@ static status_t verify(private_psk_authenticator_t *this, chunk_t ike_sa_init,
|
||||
return status;
|
||||
}
|
||||
|
||||
auth_data = build_shared_key_signature(ike_sa_init, my_nonce,
|
||||
shared_key, other_id,
|
||||
this->ike_sa->get_auth_verify(this->ike_sa));
|
||||
auth_data = build_shared_key_signature(ike_sa_init, my_nonce, shared_key,
|
||||
other_id, this->ike_sa->get_auth_verify(this->ike_sa),
|
||||
this->ike_sa->get_prf(this->ike_sa));
|
||||
chunk_free(&shared_key);
|
||||
|
||||
recv_auth_data = auth_payload->get_data(auth_payload);
|
||||
@@ -164,9 +164,9 @@ static status_t build(private_psk_authenticator_t *this, chunk_t ike_sa_init,
|
||||
return status;
|
||||
}
|
||||
|
||||
auth_data = build_shared_key_signature(ike_sa_init,
|
||||
other_nonce, shared_key, my_id,
|
||||
this->ike_sa->get_auth_build(this->ike_sa));
|
||||
auth_data = build_shared_key_signature(ike_sa_init, other_nonce, shared_key,
|
||||
my_id, this->ike_sa->get_auth_build(this->ike_sa),
|
||||
this->ike_sa->get_prf(this->ike_sa));
|
||||
DBG2(DBG_IKE, "successfully created shared key MAC");
|
||||
chunk_free(&shared_key);
|
||||
*auth_payload = auth_payload_create();
|
||||
|
||||
Reference in New Issue
Block a user