aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-11-15 20:23:49 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 19:32:14 (GMT)
commitf2a382c901ac49765a8338da8c22bf26d8e42cfd (patch)
treee824de0b16f11583a410fd4554770d19184565c8
parent159396c7ec4a0779896b8f8fe7d0d1fab76ce666 (diff)
downloadhostap-06-f2a382c901ac49765a8338da8c22bf26d8e42cfd.zip
hostap-06-f2a382c901ac49765a8338da8c22bf26d8e42cfd.tar.gz
hostap-06-f2a382c901ac49765a8338da8c22bf26d8e42cfd.tar.bz2
WPS: Determine the OpCode based on message type attribute (UPnP)
This allows WSC_ACK and WSC_NACK to be processed correctly in the AP when operating as an Enrollee with an ER over UPnP transport. (cherry picked from commit 82b857ec0b78a28a080792a921cae785850dd470)
-rw-r--r--src/wps/wps_enrollee.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wps/wps_enrollee.c b/src/wps/wps_enrollee.c
index 6fa8791..fcb3103 100644
--- a/src/wps/wps_enrollee.c
+++ b/src/wps/wps_enrollee.c
@@ -1155,6 +1155,17 @@ enum wps_process_res wps_enrollee_process_msg(struct wps_data *wps,
"op_code=%d)",
(unsigned long) wpabuf_len(msg), op_code);
+ if (op_code == WSC_UPnP) {
+ /* Determine the OpCode based on message type attribute */
+ struct wps_parse_attr attr;
+ if (wps_parse_msg(msg, &attr) == 0 && attr.msg_type) {
+ if (*attr.msg_type == WPS_WSC_ACK)
+ op_code = WSC_ACK;
+ else if (*attr.msg_type == WPS_WSC_NACK)
+ op_code = WSC_NACK;
+ }
+ }
+
switch (op_code) {
case WSC_MSG:
case WSC_UPnP: