Interworking: Add support for using eap_proxy offload

Fetch IMSI through eap_proxy for Interworking network selection if
needed.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-06-19 18:42:17 +03:00 committed by Jouni Malinen
parent 4331263b73
commit ec7b97ab00
3 changed files with 24 additions and 4 deletions

View file

@ -1346,6 +1346,13 @@ static struct wpa_cred * interworking_credentials_available_3gpp(
goto compare;
}
#endif /* PCSC_FUNCS */
#ifdef CONFIG_EAP_PROXY
if (cred->pcsc && wpa_s->mnc_len > 0 && wpa_s->imsi[0]) {
imsi = wpa_s->imsi;
mnc_len = wpa_s->mnc_len;
goto compare;
}
#endif /* CONFIG_EAP_PROXY */
if (cred->imsi == NULL || !cred->imsi[0] ||
cred->milenage == NULL || !cred->milenage[0])
@ -1358,9 +1365,9 @@ static struct wpa_cred * interworking_credentials_available_3gpp(
mnc_len = sep - cred->imsi - 3;
imsi = cred->imsi;
#ifdef PCSC_FUNCS
#if defined(PCSC_FUNCS) || defined(CONFIG_EAP_PROXY)
compare:
#endif /* PCSC_FUNCS */
#endif /* PCSC_FUNCS || CONFIG_EAP_PROXY */
wpa_printf(MSG_DEBUG, "Interworking: Parsing 3GPP info from "
MACSTR, MAC2STR(bss->bssid));
ret = plmn_id_match(bss->anqp->anqp_3gpp, imsi, mnc_len);

View file

@ -17,6 +17,7 @@
#include "crypto/sha1.h"
#include "eapol_supp/eapol_supp_sm.h"
#include "eap_peer/eap.h"
#include "eap_peer/eap_proxy.h"
#include "eap_server/eap_methods.h"
#include "rsn_supp/wpa.h"
#include "eloop.h"
@ -3010,6 +3011,20 @@ next_driver:
if (wpa_bss_init(wpa_s) < 0)
return -1;
#ifdef CONFIG_EAP_PROXY
{
size_t len;
wpa_s->mnc_len = eap_proxy_get_imsi(wpa_s->imsi, &len);
if (wpa_s->mnc_len > 0) {
wpa_s->imsi[len] = '\0';
wpa_printf(MSG_DEBUG, "eap_proxy: IMSI %s (MNC length %d)",
wpa_s->imsi, wpa_s->mnc_len);
} else {
wpa_printf(MSG_DEBUG, "eap_proxy: IMSI not available");
}
}
#endif /* CONFIG_EAP_PROXY */
if (pcsc_reader_init(wpa_s) < 0)
return -1;

View file

@ -407,10 +407,8 @@ struct wpa_supplicant {
* previous association event */
struct scard_data *scard;
#ifdef PCSC_FUNCS
char imsi[20];
int mnc_len;
#endif /* PCSC_FUNCS */
unsigned char last_eapol_src[ETH_ALEN];