EAP-SIM/AKA crypto helper supports key derivation for fast reauthentication

This commit is contained in:
Martin Willi
2009-11-12 10:34:00 +01:00
parent e1a8729de0
commit 454b59c5fd
5 changed files with 119 additions and 27 deletions
+4 -2
View File
@@ -82,7 +82,7 @@ static status_t process_challenge(private_eap_aka_peer_t *this,
enumerator_t *enumerator;
simaka_attribute_t type;
sim_card_t *card;
chunk_t data, rand = chunk_empty, autn = chunk_empty;
chunk_t data, rand = chunk_empty, autn = chunk_empty, mk;
u_char res[AKA_RES_LEN], ck[AKA_CK_LEN], ik[AKA_IK_LEN], auts[AKA_AUTS_LEN];
status_t status = NOT_FOUND;
@@ -155,7 +155,9 @@ static status_t process_challenge(private_eap_aka_peer_t *this,
data = chunk_cata("cc", chunk_create(ik, AKA_IK_LEN),
chunk_create(ck, AKA_CK_LEN));
free(this->msk.ptr);
this->msk = this->crypto->derive_keys_full(this->crypto, this->peer, data);
this->msk = this->crypto->derive_keys_full(this->crypto, this->peer,
data, &mk);
free(mk.ptr);
/* verify EAP message MAC AT_MAC */
if (!in->verify(in, chunk_empty))
+4 -2
View File
@@ -98,7 +98,7 @@ static status_t initiate(private_eap_aka_server_t *this, eap_payload_t **out)
sim_provider_t *provider;
char rand[AKA_RAND_LEN], xres[AKA_RES_LEN];
char ck[AKA_CK_LEN], ik[AKA_IK_LEN], autn[AKA_AUTN_LEN];
chunk_t data;
chunk_t data, mk;
bool found = FALSE;
enumerator = charon->sim->create_provider_enumerator(charon->sim);
@@ -122,7 +122,9 @@ static status_t initiate(private_eap_aka_server_t *this, eap_payload_t **out)
data = chunk_cata("cc", chunk_create(ik, AKA_IK_LEN),
chunk_create(ck, AKA_CK_LEN));
free(this->msk.ptr);
this->msk = this->crypto->derive_keys_full(this->crypto, this->peer, data);
this->msk = this->crypto->derive_keys_full(this->crypto, this->peer,
data, &mk);
free(mk.ptr);
this->rand = chunk_clone(chunk_create(rand, AKA_RAND_LEN));
this->xres = chunk_clone(chunk_create(xres, AKA_RES_LEN));