aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer/eap_sim.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-09-01 21:39:48 (GMT)
committerJouni Malinen <j@w1.fi>2012-09-01 21:39:48 (GMT)
commit5d65ca514dfdac74eb6af72ffd30a578b9df4cfa (patch)
tree922e5b88a879c5577ed93355e436466af7790395 /src/eap_peer/eap_sim.c
parent31a3de8af3272f97e7e8b7e7cb2e7c976e6d24b0 (diff)
downloadhostap-5d65ca514dfdac74eb6af72ffd30a578b9df4cfa.zip
hostap-5d65ca514dfdac74eb6af72ffd30a578b9df4cfa.tar.gz
hostap-5d65ca514dfdac74eb6af72ffd30a578b9df4cfa.tar.bz2
EAP-SIM peer: Fix AT_COUNTER_TOO_SMALL use
The AT_NONCE_S value needs to be used in AT_MAC calculation for SIM/Re-authentication response even if re-authentication is rejected with AT_COUNTER_TOO_SMALL. Signed-hostap: Jouni Malinen <j@w1.fi> intended-for: hostap-1
Diffstat (limited to 'src/eap_peer/eap_sim.c')
-rw-r--r--src/eap_peer/eap_sim.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/eap_peer/eap_sim.c b/src/eap_peer/eap_sim.c
index fb4ae82..30614b9 100644
--- a/src/eap_peer/eap_sim.c
+++ b/src/eap_peer/eap_sim.c
@@ -432,7 +432,8 @@ static struct wpabuf * eap_sim_response_challenge(struct eap_sim_data *data,
static struct wpabuf * eap_sim_response_reauth(struct eap_sim_data *data,
- u8 id, int counter_too_small)
+ u8 id, int counter_too_small,
+ const u8 *nonce_s)
{
struct eap_sim_msg *msg;
unsigned int counter;
@@ -467,7 +468,7 @@ static struct wpabuf * eap_sim_response_reauth(struct eap_sim_data *data,
}
wpa_printf(MSG_DEBUG, " AT_MAC");
eap_sim_msg_add_mac(msg, EAP_SIM_AT_MAC);
- return eap_sim_msg_finish(msg, data->k_aut, data->nonce_s,
+ return eap_sim_msg_finish(msg, data->k_aut, nonce_s,
EAP_SIM_NONCE_S_LEN);
}
@@ -863,7 +864,7 @@ static struct wpabuf * eap_sim_process_reauthentication(
data->reauth_id = NULL;
data->reauth_id_len = 0;
os_free(decrypted);
- return eap_sim_response_reauth(data, id, 1);
+ return eap_sim_response_reauth(data, id, 1, eattr.nonce_s);
}
data->counter = eattr.counter;
@@ -894,7 +895,7 @@ static struct wpabuf * eap_sim_process_reauthentication(
eap_sim_clear_identities(data, CLEAR_REAUTH_ID | CLEAR_EAP_ID);
}
os_free(decrypted);
- return eap_sim_response_reauth(data, id, 0);
+ return eap_sim_response_reauth(data, id, 0, data->nonce_s);
}