diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2012-02-16 16:32:56 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-02-16 16:32:56 +0200 |
commit | 61b2ed701291e0240ec9172b75a50cd7e94e3508 (patch) | |
tree | 1567f487b4af115ef2db49d409e5cea4027ea39b | |
parent | 00bf219ddbc48343a5b26d229ef3ba4852f4735d (diff) | |
download | external_wpa_supplicant_8_ti-61b2ed701291e0240ec9172b75a50cd7e94e3508.zip external_wpa_supplicant_8_ti-61b2ed701291e0240ec9172b75a50cd7e94e3508.tar.gz external_wpa_supplicant_8_ti-61b2ed701291e0240ec9172b75a50cd7e94e3508.tar.bz2 |
Interworking: Use anonymous NAI in EAP-TTLS Phase 1
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r-- | wpa_supplicant/interworking.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c index 572e2ed..e3c7cc2 100644 --- a/wpa_supplicant/interworking.c +++ b/wpa_supplicant/interworking.c @@ -690,6 +690,31 @@ int interworking_connect(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) eap->method), 0) < 0) goto fail; + if (eap->method == EAP_TYPE_TTLS && + wpa_s->conf->home_username && wpa_s->conf->home_username[0]) { + const char *pos; + char *anon; + /* Use anonymous NAI in Phase 1 */ + pos = os_strchr(wpa_s->conf->home_username, '@'); + if (pos) { + size_t buflen = 9 + os_strlen(pos) + 1; + anon = os_malloc(buflen); + if (anon == NULL) + goto fail; + os_snprintf(anon, buflen, "anonymous%s", pos); + } else { + anon = os_strdup("anonymous"); + if (anon == NULL) + goto fail; + } + if (wpa_config_set_quoted(ssid, "anonymous_identity", anon) < + 0) { + os_free(anon); + goto fail; + } + os_free(anon); + } + if (wpa_s->conf->home_username && wpa_s->conf->home_username[0] && wpa_config_set_quoted(ssid, "identity", wpa_s->conf->home_username) < 0) |