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
+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)