eap-authenticator: Handle IntAuth data
This commit is contained in:
@@ -60,6 +60,11 @@ struct private_eap_authenticator_t {
|
|||||||
*/
|
*/
|
||||||
chunk_t sent_init;
|
chunk_t sent_init;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IntAuth data to include in AUTH calculation
|
||||||
|
*/
|
||||||
|
chunk_t int_auth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reserved bytes of ID payload
|
* Reserved bytes of ID payload
|
||||||
*/
|
*/
|
||||||
@@ -495,8 +500,9 @@ static bool verify_auth(private_eap_authenticator_t *this, message_t *message,
|
|||||||
|
|
||||||
other_id = this->ike_sa->get_other_id(this->ike_sa);
|
other_id = this->ike_sa->get_other_id(this->ike_sa);
|
||||||
keymat = (keymat_v2_t*)this->ike_sa->get_keymat(this->ike_sa);
|
keymat = (keymat_v2_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||||
if (!keymat->get_psk_sig(keymat, TRUE, init, nonce, chunk_empty, this->msk,
|
if (!keymat->get_psk_sig(keymat, TRUE, init, nonce, this->int_auth,
|
||||||
this->ppk, other_id, this->reserved, &auth_data))
|
this->msk, this->ppk, other_id, this->reserved,
|
||||||
|
&auth_data))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -541,8 +547,9 @@ static bool build_auth(private_eap_authenticator_t *this, message_t *message,
|
|||||||
DBG1(DBG_IKE, "authentication of '%Y' (myself) with %N",
|
DBG1(DBG_IKE, "authentication of '%Y' (myself) with %N",
|
||||||
my_id, auth_class_names, AUTH_CLASS_EAP);
|
my_id, auth_class_names, AUTH_CLASS_EAP);
|
||||||
|
|
||||||
if (!keymat->get_psk_sig(keymat, FALSE, init, nonce, chunk_empty, this->msk,
|
if (!keymat->get_psk_sig(keymat, FALSE, init, nonce, this->int_auth,
|
||||||
this->ppk, my_id, this->reserved, &auth_data))
|
this->msk, this->ppk, my_id, this->reserved,
|
||||||
|
&auth_data))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -554,7 +561,7 @@ static bool build_auth(private_eap_authenticator_t *this, message_t *message,
|
|||||||
|
|
||||||
if (this->no_ppk_auth)
|
if (this->no_ppk_auth)
|
||||||
{
|
{
|
||||||
if (!keymat->get_psk_sig(keymat, FALSE, init, nonce, chunk_empty,
|
if (!keymat->get_psk_sig(keymat, FALSE, init, nonce, this->int_auth,
|
||||||
this->msk, chunk_empty, my_id, this->reserved,
|
this->msk, chunk_empty, my_id, this->reserved,
|
||||||
&auth_data))
|
&auth_data))
|
||||||
{
|
{
|
||||||
@@ -768,6 +775,12 @@ METHOD(authenticator_t, use_ppk, void,
|
|||||||
this->no_ppk_auth = no_ppk_auth;
|
this->no_ppk_auth = no_ppk_auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
METHOD(authenticator_t, set_int_auth, void,
|
||||||
|
private_eap_authenticator_t *this, chunk_t int_auth)
|
||||||
|
{
|
||||||
|
this->int_auth = int_auth;
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(authenticator_t, destroy, void,
|
METHOD(authenticator_t, destroy, void,
|
||||||
private_eap_authenticator_t *this)
|
private_eap_authenticator_t *this)
|
||||||
{
|
{
|
||||||
@@ -794,6 +807,7 @@ eap_authenticator_t *eap_authenticator_create_builder(ike_sa_t *ike_sa,
|
|||||||
.build = _build_client,
|
.build = _build_client,
|
||||||
.process = _process_client,
|
.process = _process_client,
|
||||||
.use_ppk = _use_ppk,
|
.use_ppk = _use_ppk,
|
||||||
|
.set_int_auth = _set_int_auth,
|
||||||
.is_mutual = _is_mutual,
|
.is_mutual = _is_mutual,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
@@ -825,6 +839,7 @@ eap_authenticator_t *eap_authenticator_create_verifier(ike_sa_t *ike_sa,
|
|||||||
.build = _build_server,
|
.build = _build_server,
|
||||||
.process = _process_server,
|
.process = _process_server,
|
||||||
.use_ppk = _use_ppk,
|
.use_ppk = _use_ppk,
|
||||||
|
.set_int_auth = _set_int_auth,
|
||||||
.is_mutual = _is_mutual,
|
.is_mutual = _is_mutual,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user