Add a return value to aead_t.set_key()

This commit is contained in:
Martin Willi
2012-07-16 14:53:32 +02:00
parent e2ed7bfd22
commit ad08730a4b
7 changed files with 30 additions and 9 deletions
+2 -1
View File
@@ -204,10 +204,11 @@ METHOD(aead_t, get_key_size, size_t,
return this->crypter->get_key_size(this->crypter);
}
METHOD(aead_t, set_key, void,
METHOD(aead_t, set_key, bool,
private_aead_t *this, chunk_t key)
{
this->crypter->set_key(this->crypter, key);
return TRUE;
}
METHOD(aead_t, aead_destroy, void,
+10 -2
View File
@@ -112,12 +112,20 @@ static bool derive_ike_aead(private_keymat_v2_t *this, u_int16_t alg,
prf_plus->allocate_bytes(prf_plus, key_size, &key);
DBG4(DBG_IKE, "Sk_ei secret %B", &key);
aead_i->set_key(aead_i, key);
if (!aead_i->set_key(aead_i, key))
{
chunk_clear(&key);
return FALSE;
}
chunk_clear(&key);
prf_plus->allocate_bytes(prf_plus, key_size, &key);
DBG4(DBG_IKE, "Sk_er secret %B", &key);
aead_r->set_key(aead_r, key);
if (!aead_r->set_key(aead_r, key))
{
chunk_clear(&key);
return FALSE;
}
chunk_clear(&key);
if (this->initiator)