aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/eap_sim/eap_sim_server.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2012-07-06 08:57:18 +0200
committerMartin Willi <martin@revosec.ch>2012-07-16 14:53:33 +0200
commit86d2cdc1edd26598ddc990b4e081db0ab828d461 (patch)
treeac9912601ecfa4d53b6d594edc59f4b5fdb16ed2 /src/libcharon/plugins/eap_sim/eap_sim_server.c
parent2e96de60a8e943a9c0d08e14428aa881789dc7c4 (diff)
downloadstrongswan-86d2cdc1edd26598ddc990b4e081db0ab828d461.tar.bz2
strongswan-86d2cdc1edd26598ddc990b4e081db0ab828d461.tar.xz
Add a return value to simaka_crypto_t.derive_keys_*()
Diffstat (limited to 'src/libcharon/plugins/eap_sim/eap_sim_server.c')
-rw-r--r--src/libcharon/plugins/eap_sim/eap_sim_server.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libcharon/plugins/eap_sim/eap_sim_server.c b/src/libcharon/plugins/eap_sim/eap_sim_server.c
index a88ce5706..fd4f4c02b 100644
--- a/src/libcharon/plugins/eap_sim/eap_sim_server.c
+++ b/src/libcharon/plugins/eap_sim/eap_sim_server.c
@@ -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,