Add a return value to keymat_v2_t.get_auth_octets()

This commit is contained in:
Martin Willi
2012-07-16 14:53:34 +02:00
parent 2baae8e3ea
commit bb1e0c59e1
5 changed files with 37 additions and 21 deletions
+6 -2
View File
@@ -237,8 +237,12 @@ static bool build_auth(private_pretend_auth_t *this,
return FALSE;
}
keymat = (keymat_v2_t*)ike_sa->get_keymat(ike_sa);
octets = keymat->get_auth_octets(keymat, TRUE, this->ike_init,
this->nonce, this->id, this->reserved);
if (!keymat->get_auth_octets(keymat, TRUE, this->ike_init,
this->nonce, this->id, this->reserved, &octets))
{
private->destroy(private);
return FALSE;
}
if (!private->sign(private, scheme, octets, &auth_data))
{
chunk_free(&octets);
+7 -2
View File
@@ -136,8 +136,13 @@ static bool rebuild_auth(private_rebuild_auth_t *this, ike_sa_t *ike_sa,
return FALSE;
}
keymat = (keymat_v2_t*)ike_sa->get_keymat(ike_sa);
octets = keymat->get_auth_octets(keymat, FALSE, this->ike_init,
this->nonce, id, reserved);
if (!keymat->get_auth_octets(keymat, FALSE, this->ike_init,
this->nonce, id, reserved, &octets))
{
private->destroy(private);
id->destroy(id);
return FALSE;
}
if (!private->sign(private, scheme, octets, &auth_data))
{
chunk_free(&octets);