aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2013-08-31 13:11:48 (GMT)
committerJouni Malinen <j@w1.fi>2013-08-31 13:11:48 (GMT)
commiteb324600295a570199a5e25eb64e60781a04fb74 (patch)
treefdffd795111c185b9d05e7cbd9eacbd744c84050 /wpa_supplicant/events.c
parentf2b3f4de49606a6e21c46fb6d85e262ad3ce88a7 (diff)
downloadhostap-eb324600295a570199a5e25eb64e60781a04fb74.zip
hostap-eb324600295a570199a5e25eb64e60781a04fb74.tar.gz
hostap-eb324600295a570199a5e25eb64e60781a04fb74.tar.bz2
Fix switching from EAP-SIM to EAP-AKA/AKA'
Switching EAP method from EAP-SIM to EAP-AKA fails. wpa_cli commands are below. ------------------ sudo wpa_cli add_network sudo wpa_cli set_network 0 ssid '"eap-sim"' sudo wpa_cli set_network 0 key_mgmt WPA-EAP sudo wpa_cli set_network 0 eap SIM sudo wpa_cli set_network 0 pin '"1234"' sudo wpa_cli set_network 0 pcsc '""' sudo wpa_cli select_network 0 sudo wpa_cli disable_network 0 sudo wpa_cli disconnect sudo wpa_cli remove_network 0 sudo wpa_cli add_network sudo wpa_cli set_network 0 ssid '"eap-sim"' sudo wpa_cli set_network 0 key_mgmt WPA-EAP sudo wpa_cli set_network 0 eap AKA sudo wpa_cli set_network 0 pin '"1234"' sudo wpa_cli set_network 0 pcsc '""' sudo wpa_cli select_network 0 ------------------ Then EAP-AKA connection resulted in fail. wpa_supplicant log is below. ------------------ wlan0: CTRL-EVENT-EAP-METHOD EAP vendor 0 method 23 (AKA) selected SCARD: Non-USIM card - cannot do UMTS auth EAP-AKA: UMTS authentication failed (AUTN) wlan0: CTRL-EVENT-EAP-FAILURE EAP authentication failed ------------------ This occurs because on the first EAP-SIM authentication, the SIM/USIM card in the device was recognized as SIM card even if it is USIM card. So this patch changes it to recognize as USIM card even if EAP-SIM authentication was required. I have tested these switching cases. EAP-SIM -> EAP-AKA EAP-SIM -> EAP-AKA' EAP-AKA -> EAP-SIM EAP-AKA -> EAP-AKA' EAP-AKA' -> EAP-SIM EAP-AKA' -> EAP-AKA Signed-hostap: Masashi Honma <masashi.honma@gmail.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 8d6c234..e9399fe 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -273,7 +273,7 @@ int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
{
#ifdef IEEE8021X_EAPOL
#ifdef PCSC_FUNCS
- int aka = 0, sim = 0, type;
+ int aka = 0, sim = 0;
if (ssid->eap.pcsc == NULL || wpa_s->scard != NULL)
return 0;
@@ -312,14 +312,9 @@ int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
wpa_dbg(wpa_s, MSG_DEBUG, "Selected network is configured to use SIM "
"(sim=%d aka=%d) - initialize PCSC", sim, aka);
- if (sim && aka)
- type = SCARD_TRY_BOTH;
- else if (aka)
- type = SCARD_USIM_ONLY;
- else
- type = SCARD_GSM_SIM_ONLY;
- wpa_s->scard = scard_init(type, NULL);
+ wpa_s->scard = scard_init((!sim && aka) ? SCARD_USIM_ONLY :
+ SCARD_TRY_BOTH, NULL);
if (wpa_s->scard == NULL) {
wpa_msg(wpa_s, MSG_WARNING, "Failed to initialize SIM "
"(pcsc-lite)");