diffie-hellman: Add a bool return value to get_my_public_value()
This commit is contained in:
@@ -74,7 +74,10 @@ METHOD(authenticator_t, build, status_t,
|
||||
keymat_v1_t *keymat;
|
||||
chunk_t hash, dh;
|
||||
|
||||
this->dh->get_my_public_value(this->dh, &dh);
|
||||
if (!this->dh->get_my_public_value(this->dh, &dh))
|
||||
{
|
||||
return FAILED;
|
||||
}
|
||||
keymat = (keymat_v1_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||
if (!keymat->get_hash(keymat, this->initiator, dh, this->dh_value,
|
||||
this->ike_sa->get_id(this->ike_sa), this->sa_payload,
|
||||
@@ -108,7 +111,10 @@ METHOD(authenticator_t, process, status_t,
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
this->dh->get_my_public_value(this->dh, &dh);
|
||||
if (!this->dh->get_my_public_value(this->dh, &dh))
|
||||
{
|
||||
return FAILED;
|
||||
}
|
||||
keymat = (keymat_v1_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||
if (!keymat->get_hash(keymat, !this->initiator, this->dh_value, dh,
|
||||
this->ike_sa->get_id(this->ike_sa), this->sa_payload,
|
||||
|
||||
@@ -94,7 +94,11 @@ METHOD(authenticator_t, build, status_t,
|
||||
return NOT_FOUND;
|
||||
}
|
||||
|
||||
this->dh->get_my_public_value(this->dh, &dh);
|
||||
if (!this->dh->get_my_public_value(this->dh, &dh))
|
||||
{
|
||||
private->destroy(private);
|
||||
return FAILED;
|
||||
}
|
||||
keymat = (keymat_v1_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||
if (!keymat->get_hash(keymat, this->initiator, dh, this->dh_value,
|
||||
this->ike_sa->get_id(this->ike_sa), this->sa_payload,
|
||||
@@ -152,7 +156,10 @@ METHOD(authenticator_t, process, status_t,
|
||||
}
|
||||
|
||||
id = this->ike_sa->get_other_id(this->ike_sa);
|
||||
this->dh->get_my_public_value(this->dh, &dh);
|
||||
if (!this->dh->get_my_public_value(this->dh, &dh))
|
||||
{
|
||||
return FAILED;
|
||||
}
|
||||
keymat = (keymat_v1_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||
if (!keymat->get_hash(keymat, !this->initiator, this->dh_value, dh,
|
||||
this->ike_sa->get_id(this->ike_sa), this->sa_payload,
|
||||
|
||||
@@ -560,7 +560,10 @@ METHOD(keymat_v1_t, derive_ike_keys, bool,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dh->get_my_public_value(dh, &dh_me);
|
||||
if (!dh->get_my_public_value(dh, &dh_me))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
g_xi = this->initiator ? dh_me : dh_other;
|
||||
g_xr = this->initiator ? dh_other : dh_me;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user