aboutsummaryrefslogtreecommitdiffstats
path: root/src/eapol_supp
diff options
context:
space:
mode:
authorNaresh Jayaram <c_njayar@qti.qualcomm.com>2013-10-23 16:17:14 (GMT)
committerJouni Malinen <j@w1.fi>2013-10-23 17:51:39 (GMT)
commit07041c6f991d933d2361c8204433c09212f9fb0b (patch)
tree197067b1f65bf302843eeea650d220c224dcd97a /src/eapol_supp
parent47d986e6ffed45a4e2506646a5dbee2c0e1c6209 (diff)
downloadhostap-07041c6f991d933d2361c8204433c09212f9fb0b.zip
hostap-07041c6f991d933d2361c8204433c09212f9fb0b.tar.gz
hostap-07041c6f991d933d2361c8204433c09212f9fb0b.tar.bz2
eap_proxy: Confirm eap_proxy initialization before reading SIM info
Trying to access the SIM card details without checking if the eap_proxy layer has been initialized can results in a crash. Address this by sending the request for the IMSI through eapol_supp_sm.c which can verify that eap_proxy has been initialized. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/eapol_supp')
-rw-r--r--src/eapol_supp/eapol_supp_sm.c12
-rw-r--r--src/eapol_supp/eapol_supp_sm.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/eapol_supp/eapol_supp_sm.c b/src/eapol_supp/eapol_supp_sm.c
index 03ec2cb..d34df7c 100644
--- a/src/eapol_supp/eapol_supp_sm.c
+++ b/src/eapol_supp/eapol_supp_sm.c
@@ -2051,3 +2051,15 @@ int eapol_sm_failed(struct eapol_sm *sm)
return 0;
return !sm->eapSuccess && sm->eapFail;
}
+
+
+int eapol_sm_get_eap_proxy_imsi(struct eapol_sm *sm, char *imsi, size_t *len)
+{
+#ifdef CONFIG_EAP_PROXY
+ if (sm->eap_proxy == NULL)
+ return -1;
+ return eap_proxy_get_imsi(imsi, len);
+#else /* CONFIG_EAP_PROXY */
+ return -1;
+#endif /* CONFIG_EAP_PROXY */
+}
diff --git a/src/eapol_supp/eapol_supp_sm.h b/src/eapol_supp/eapol_supp_sm.h
index 6faf816..54e8a27 100644
--- a/src/eapol_supp/eapol_supp_sm.h
+++ b/src/eapol_supp/eapol_supp_sm.h
@@ -292,6 +292,7 @@ const char * eapol_sm_get_method_name(struct eapol_sm *sm);
void eapol_sm_set_ext_pw_ctx(struct eapol_sm *sm,
struct ext_password_data *ext);
int eapol_sm_failed(struct eapol_sm *sm);
+int eapol_sm_get_eap_proxy_imsi(struct eapol_sm *sm, char *imsi, size_t *len);
#else /* IEEE8021X_EAPOL */
static inline struct eapol_sm *eapol_sm_init(struct eapol_ctx *ctx)
{