diff options
author | Jouni Malinen <j@w1.fi> | 2008-11-22 14:06:58 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2008-11-22 14:06:58 +0200 |
commit | a532c108bd5b2cb92e0da31b71aeb1d96fb47477 (patch) | |
tree | fed58026fee7f308281ef20f4f95bdb32bc0bb19 /src | |
parent | fe2c5241b58ce1e62f224ac56e47e12b16a752ed (diff) | |
download | external_wpa_supplicant_8_ti-a532c108bd5b2cb92e0da31b71aeb1d96fb47477.zip external_wpa_supplicant_8_ti-a532c108bd5b2cb92e0da31b71aeb1d96fb47477.tar.gz external_wpa_supplicant_8_ti-a532c108bd5b2cb92e0da31b71aeb1d96fb47477.tar.bz2 |
Add more verbose debug output for GSM-Milenage use (RAND,SRES,Kc)
Diffstat (limited to 'src')
-rw-r--r-- | src/eap_peer/eap_sim.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/eap_peer/eap_sim.c b/src/eap_peer/eap_sim.c index b0523eb..a7e49f8 100644 --- a/src/eap_peer/eap_sim.c +++ b/src/eap_peer/eap_sim.c @@ -171,6 +171,7 @@ static int eap_sim_gsm_auth(struct eap_sm *sm, struct eap_sim_data *data) if (conf->password) { u8 opc[16], k[16]; const char *pos; + size_t i; wpa_printf(MSG_DEBUG, "EAP-SIM: Use internal GSM-Milenage " "implementation for authentication"); if (conf->password_len < 65) { @@ -189,16 +190,20 @@ static int eap_sim_gsm_auth(struct eap_sm *sm, struct eap_sim_data *data) if (hexstr2bin(pos, opc, 16)) return -1; - if (gsm_milenage(opc, k, data->rand[0], - data->sres[0], data->kc[0]) || - gsm_milenage(opc, k, data->rand[1], - data->sres[1], data->kc[1]) || - (data->num_chal > 2 && - gsm_milenage(opc, k, data->rand[2], - data->sres[2], data->kc[2]))) { - wpa_printf(MSG_DEBUG, "EAP-SIM: GSM-Milenage " - "authentication could not be completed"); - return -1; + for (i = 0; i < data->num_chal; i++) { + if (gsm_milenage(opc, k, data->rand[i], + data->sres[i], data->kc[i])) { + wpa_printf(MSG_DEBUG, "EAP-SIM: " + "GSM-Milenage authentication " + "could not be completed"); + return -1; + } + wpa_hexdump(MSG_DEBUG, "EAP-SIM: RAND", + data->rand[i], GSM_RAND_LEN); + wpa_hexdump_key(MSG_DEBUG, "EAP-SIM: SRES", + data->sres[i], EAP_SIM_SRES_LEN); + wpa_hexdump_key(MSG_DEBUG, "EAP-SIM: Kc", + data->kc[i], EAP_SIM_KC_LEN); } return 0; } |