From: Jouni Malinen Date: Wed, 13 Apr 2011 23:58:35 +0000 (+0300) Subject: WPS: Use strict validation of (Re)AssocReq only if IEs are known X-Git-Tag: hostap-1-bp~407 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e432d3f10340670a06bff2d306f17ca7a3c14b8;p=thirdparty%2Fhostap.git WPS: Use strict validation of (Re)AssocReq only if IEs are known --- diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 7bc8be294..02b7ecfb0 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -157,17 +157,20 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, } } else if (hapd->conf->wps_state) { #ifdef CONFIG_WPS_STRICT - struct wpabuf *wps; - wps = ieee802_11_vendor_ie_concat(ie, ielen, - WPS_IE_VENDOR_TYPE); - if (wps && wps_validate_assoc_req(wps) < 0) { - hostapd_drv_sta_disassoc(hapd, sta->addr, - WLAN_REASON_INVALID_IE); - ap_free_sta(hapd, sta); + if (ie) { + struct wpabuf *wps; + wps = ieee802_11_vendor_ie_concat(ie, ielen, + WPS_IE_VENDOR_TYPE); + if (wps && wps_validate_assoc_req(wps) < 0) { + hostapd_drv_sta_disassoc( + hapd, sta->addr, + WLAN_REASON_INVALID_IE); + ap_free_sta(hapd, sta); + wpabuf_free(wps); + return -1; + } wpabuf_free(wps); - return -1; } - wpabuf_free(wps); #endif /* CONFIG_WPS_STRICT */ if (ie && ielen > 4 && ie[0] == 0xdd && ie[1] >= 4 && os_memcmp(ie + 2, "\x00\x50\xf2\x04", 4) == 0) {