From: Jouni Malinen Date: Sat, 7 Jun 2014 13:18:30 +0000 (+0300) Subject: Interworking: Reject EAP configuration with unsupported inner method X-Git-Tag: hostap_2_3~349 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c6c5589e043a517f3670ebcd3f499f46457bb0d;p=thirdparty%2Fhostap.git Interworking: Reject EAP configuration with unsupported inner method Instead of allowing the connection attempt to occur with an unsupported inner method, check for that explicitly at the time the network block is added and drop the network if the identified inner method is not supported. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c index 6d1539c64..bbee951bb 100644 --- a/wpa_supplicant/interworking.c +++ b/wpa_supplicant/interworking.c @@ -1515,6 +1515,7 @@ static int interworking_connect_helper(struct wpa_supplicant *wpa_s, u16 count, i; char buf[100]; int excluded = 0, *excl = allow_excluded ? &excluded : NULL; + const char *name; if (wpa_s->conf->cred == NULL || bss == NULL) return -1; @@ -1728,11 +1729,12 @@ static int interworking_connect_helper(struct wpa_supplicant *wpa_s, if (wpa_config_set(ssid, "pac_file", "\"blob://pac_interworking\"", 0) < 0) goto fail; - os_snprintf(buf, sizeof(buf), "\"auth=%s\"", - eap_get_name(EAP_VENDOR_IETF, - eap->inner_method ? - eap->inner_method : - EAP_TYPE_MSCHAPV2)); + name = eap_get_name(EAP_VENDOR_IETF, + eap->inner_method ? eap->inner_method : + EAP_TYPE_MSCHAPV2); + if (name == NULL) + goto fail; + os_snprintf(buf, sizeof(buf), "\"auth=%s\"", name); if (wpa_config_set(ssid, "phase2", buf, 0) < 0) goto fail; break;