From 329039869a36d36080ec7a7d53367e86f599ebde Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 22 Feb 2014 18:57:41 +0200 Subject: [PATCH] WPS: Fix UNSUBSCRIBE error returns if NT or CALLBACK header is used Signed-off-by: Jouni Malinen --- src/wps/wps_upnp_web.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/wps/wps_upnp_web.c b/src/wps/wps_upnp_web.c index 31963ffbc..2a3b63607 100644 --- a/src/wps/wps_upnp_web.c +++ b/src/wps/wps_upnp_web.c @@ -1171,7 +1171,6 @@ static void web_connection_parse_unsubscribe(struct upnp_wps_device_sm *sm, ..... } #endif - /* SID is only for renewal */ match = "SID:"; match_len = os_strlen(match); if (os_strncasecmp(h, match, match_len) == 0) { @@ -1194,6 +1193,20 @@ static void web_connection_parse_unsubscribe(struct upnp_wps_device_sm *sm, got_uuid = 1; continue; } + + match = "NT:"; + match_len = os_strlen(match); + if (os_strncasecmp(h, match, match_len) == 0) { + ret = HTTP_BAD_REQUEST; + goto send_msg; + } + + match = "CALLBACK:"; + match_len = os_strlen(match); + if (os_strncasecmp(h, match, match_len) == 0) { + ret = HTTP_BAD_REQUEST; + goto send_msg; + } } if (got_uuid) {