From: Jouni Malinen Date: Wed, 21 Jul 2010 05:07:52 +0000 (-0700) Subject: WPS 2.0: Use strict validation of NewWLANEventMAC only with WPS 2.0 X-Git-Tag: hostap-1-bp~1176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6e25d37a336d6a0dae593689bc2a2890ca7f61a;p=thirdparty%2Fhostap.git WPS 2.0: Use strict validation of NewWLANEventMAC only with WPS 2.0 This avoids some testing issues with WPS 1.0 implementations while maintaining strict validation for WPS 2.0 implementations. --- diff --git a/src/wps/wps_upnp_web.c b/src/wps/wps_upnp_web.c index 7e2d174c4..1a52798ff 100644 --- a/src/wps/wps_upnp_web.c +++ b/src/wps/wps_upnp_web.c @@ -524,9 +524,14 @@ web_process_put_wlan_response(struct upnp_wps_device_sm *sm, char *data, wpa_printf(MSG_DEBUG, "WPS UPnP: Invalid NewWLANEventMAC in " "PutWLANResponse: '%s'", val); #ifdef CONFIG_WPS_STRICT - wpabuf_free(msg); - os_free(val); - return UPNP_ARG_VALUE_INVALID; + { + struct wps_parse_attr attr; + if (wps_parse_msg(msg, &attr) < 0 || attr.version2) { + wpabuf_free(msg); + os_free(val); + return UPNP_ARG_VALUE_INVALID; + } + } #else /* CONFIG_WPS_STRICT */ if (hwaddr_aton2(val, macaddr) > 0) { /*