Add a return value to simaka_crypto_t.derive_keys_*()

This commit is contained in:
Martin Willi
2012-07-16 14:53:33 +02:00
parent 2e96de60a8
commit 86d2cdc1ed
6 changed files with 84 additions and 46 deletions
+10 -4
View File
@@ -180,9 +180,12 @@ static status_t reauthenticate(private_eap_sim_server_t *this,
counter = htons(counter);
this->counter = chunk_clone(chunk_create((char*)&counter, sizeof(counter)));
this->crypto->derive_keys_reauth(this->crypto, mkc);
this->msk = this->crypto->derive_keys_reauth_msk(this->crypto,
this->reauth, this->counter, this->nonce, mkc);
if (!this->crypto->derive_keys_reauth(this->crypto, mkc) ||
!this->crypto->derive_keys_reauth_msk(this->crypto,
this->reauth, this->counter, this->nonce, mkc, &this->msk))
{
return FAILED;
}
message = simaka_message_create(TRUE, this->identifier++, EAP_SIM,
SIM_REAUTHENTICATION, this->crypto);
@@ -406,7 +409,10 @@ static status_t process_start(private_eap_sim_server_t *this,
{
id = this->pseudonym;
}
this->msk = this->crypto->derive_keys_full(this->crypto, id, data, &mk);
if (!this->crypto->derive_keys_full(this->crypto, id, data, &mk, &this->msk))
{
return FAILED;
}
/* build response with AT_MAC, built over "EAP packet | NONCE_MT" */
message = simaka_message_create(TRUE, this->identifier++, EAP_SIM,