Add a return value to crypter_t.set_key()

This commit is contained in:
Martin Willi
2012-07-16 14:53:38 +02:00
parent 3b96189a2a
commit ce73fc19db
23 changed files with 87 additions and 57 deletions
+16 -2
View File
@@ -225,7 +225,14 @@ static bool derive_ike_traditional(private_keymat_v2_t *this, u_int16_t enc_alg,
return FALSE;
}
DBG4(DBG_IKE, "Sk_ei secret %B", &key);
crypter_i->set_key(crypter_i, key);
if (!crypter_i->set_key(crypter_i, key))
{
crypter_i->destroy(crypter_i);
crypter_r->destroy(crypter_r);
signer_i->destroy(signer_i);
signer_r->destroy(signer_r);
return FALSE;
}
chunk_clear(&key);
if (!prf_plus->allocate_bytes(prf_plus, key_size, &key))
@@ -237,7 +244,14 @@ static bool derive_ike_traditional(private_keymat_v2_t *this, u_int16_t enc_alg,
return FALSE;
}
DBG4(DBG_IKE, "Sk_er secret %B", &key);
crypter_r->set_key(crypter_r, key);
if (!crypter_r->set_key(crypter_r, key))
{
crypter_i->destroy(crypter_i);
crypter_r->destroy(crypter_r);
signer_i->destroy(signer_i);
signer_r->destroy(signer_r);
return FALSE;
}
chunk_clear(&key);
if (this->initiator)