Add a return value to keymat_v1_t.get_hash()
This commit is contained in:
@@ -76,9 +76,13 @@ METHOD(authenticator_t, build, status_t,
|
||||
|
||||
this->dh->get_my_public_value(this->dh, &dh);
|
||||
keymat = (keymat_v1_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||
hash = keymat->get_hash(keymat, this->initiator, dh, this->dh_value,
|
||||
if (!keymat->get_hash(keymat, this->initiator, dh, this->dh_value,
|
||||
this->ike_sa->get_id(this->ike_sa), this->sa_payload,
|
||||
this->id_payload);
|
||||
this->id_payload, &hash))
|
||||
{
|
||||
free(dh.ptr);
|
||||
return FAILED;
|
||||
}
|
||||
free(dh.ptr);
|
||||
|
||||
hash_payload = hash_payload_create(HASH_V1);
|
||||
@@ -106,9 +110,13 @@ METHOD(authenticator_t, process, status_t,
|
||||
|
||||
this->dh->get_my_public_value(this->dh, &dh);
|
||||
keymat = (keymat_v1_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||
hash = keymat->get_hash(keymat, !this->initiator, this->dh_value, dh,
|
||||
if (!keymat->get_hash(keymat, !this->initiator, this->dh_value, dh,
|
||||
this->ike_sa->get_id(this->ike_sa), this->sa_payload,
|
||||
this->id_payload);
|
||||
this->id_payload, &hash))
|
||||
{
|
||||
free(dh.ptr);
|
||||
return FAILED;
|
||||
}
|
||||
free(dh.ptr);
|
||||
if (chunk_equals(hash, hash_payload->get_hash(hash_payload)))
|
||||
{
|
||||
|
||||
@@ -96,9 +96,14 @@ METHOD(authenticator_t, build, status_t,
|
||||
|
||||
this->dh->get_my_public_value(this->dh, &dh);
|
||||
keymat = (keymat_v1_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||
hash = keymat->get_hash(keymat, this->initiator, dh, this->dh_value,
|
||||
if (!keymat->get_hash(keymat, this->initiator, dh, this->dh_value,
|
||||
this->ike_sa->get_id(this->ike_sa), this->sa_payload,
|
||||
this->id_payload);
|
||||
this->id_payload, &hash))
|
||||
{
|
||||
private->destroy(private);
|
||||
free(dh.ptr);
|
||||
return FAILED;
|
||||
}
|
||||
free(dh.ptr);
|
||||
|
||||
if (private->sign(private, scheme, hash, &sig))
|
||||
@@ -149,9 +154,13 @@ 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);
|
||||
keymat = (keymat_v1_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||
hash = keymat->get_hash(keymat, !this->initiator, this->dh_value, dh,
|
||||
if (!keymat->get_hash(keymat, !this->initiator, this->dh_value, dh,
|
||||
this->ike_sa->get_id(this->ike_sa), this->sa_payload,
|
||||
this->id_payload);
|
||||
this->id_payload, &hash))
|
||||
{
|
||||
free(dh.ptr);
|
||||
return FAILED;
|
||||
}
|
||||
free(dh.ptr);
|
||||
|
||||
sig = sig_payload->get_hash(sig_payload);
|
||||
|
||||
Reference in New Issue
Block a user