eap-aka: support for synchronization error

If the SQN in AUTN is incorrect the simauth module will return
the AUTS parameter, which is sent back to the server and the
servers SQN number is updated.
This commit is contained in:
James Prestwood 2017-12-13 14:29:13 -08:00 committed by Denis Kenzior
parent 3de239ed9e
commit 5f3bf1dbac
1 changed files with 19 additions and 0 deletions

View File

@ -37,6 +37,7 @@
* EAP-AKA specific values
*/
#define EAP_AKA_AUTN_LEN 16
#define EAP_AKA_AUTS_LEN 14
#define EAP_AKA_RES_LEN 8
#define EAP_AKA_K_RE_LEN 32
@ -163,6 +164,24 @@ static void check_milenage_cb(const uint8_t *res, const uint8_t *ck,
uint8_t ik_p[EAP_AKA_IK_LEN];
uint8_t ck_p[EAP_AKA_CK_LEN];
if (auts) {
/*
* If AUTS is non NULL then the SQN was not correct, send AUTS
* to server which will update the SQN and send another
* challenge packet.
*/
l_free(aka->chal_pkt);
pos += eap_sim_build_header(eap, aka->type,
EAP_AKA_ST_SYNC_FAILURE, pos, 24);
pos += eap_sim_add_attribute(pos, EAP_SIM_AT_AUTS,
EAP_SIM_PAD_NONE, auts, EAP_AKA_AUTS_LEN);
eap_send_response(eap, aka->type, response, 24);
return;
}
if (!res || !ck || !ik) {
l_free(aka->chal_pkt);
goto chal_error;