Add a return value to signer_t.set_key()

This commit is contained in:
Martin Willi
2012-07-16 14:53:33 +02:00
parent 9020f7d0b9
commit 2d56575d52
10 changed files with 56 additions and 20 deletions
@@ -526,9 +526,8 @@ eap_radius_dae_t *eap_radius_dae_create(eap_radius_accounting_t *accounting)
return NULL;
}
this->secret.len = strlen(this->secret.ptr);
this->signer->set_key(this->signer, this->secret);
if (!open_socket(this))
if (!this->signer->set_key(this->signer, this->secret) ||
!open_socket(this))
{
destroy(this);
return NULL;
+14 -2
View File
@@ -166,12 +166,24 @@ static bool derive_ike_traditional(private_keymat_v2_t *this, u_int16_t enc_alg,
prf_plus->allocate_bytes(prf_plus, key_size, &key);
DBG4(DBG_IKE, "Sk_ai secret %B", &key);
signer_i->set_key(signer_i, key);
if (!signer_i->set_key(signer_i, key))
{
signer_i->destroy(signer_i);
signer_r->destroy(signer_r);
chunk_clear(&key);
return FALSE;
}
chunk_clear(&key);
prf_plus->allocate_bytes(prf_plus, key_size, &key);
DBG4(DBG_IKE, "Sk_ar secret %B", &key);
signer_r->set_key(signer_r, key);
if (!signer_r->set_key(signer_r, key))
{
signer_i->destroy(signer_i);
signer_r->destroy(signer_r);
chunk_clear(&key);
return FALSE;
}
chunk_clear(&key);
/* SK_ei/SK_er used for encryption */