Browse Source

WPS: Added parsing of Request Type and Response Type attributes

Jouni Malinen 16 years ago
parent
commit
76603ad4c8
2 changed files with 18 additions and 0 deletions
  1. 16 0
      src/wps/wps_common.c
  2. 2 0
      src/wps/wps_i.h

+ 16 - 0
src/wps/wps_common.c

@@ -314,6 +314,22 @@ static int wps_set_attr(struct wps_parse_attr *attr, u16 type,
 		}
 		attr->selected_registrar = pos;
 		break;
+	case ATTR_REQUEST_TYPE:
+		if (len != 1) {
+			wpa_printf(MSG_DEBUG, "WPS: Invalid Request Type "
+				   "length %u", len);
+			return -1;
+		}
+		attr->request_type = pos;
+		break;
+	case ATTR_RESPONSE_TYPE:
+		if (len != 1) {
+			wpa_printf(MSG_DEBUG, "WPS: Invalid Response Type "
+				   "length %u", len);
+			return -1;
+		}
+		attr->request_type = pos;
+		break;
 	case ATTR_MANUFACTURER:
 		attr->manufacturer = pos;
 		attr->manufacturer_len = len;

+ 2 - 0
src/wps/wps_i.h

@@ -112,6 +112,8 @@ struct wps_parse_attr {
 	const u8 *key_prov_auto; /* 1 octet (Bool) */
 	const u8 *dot1x_enabled; /* 1 octet (Bool) */
 	const u8 *selected_registrar; /* 1 octet (Bool) */
+	const u8 *request_type; /* 1 octet */
+	const u8 *response_type; /* 1 octet */
 
 	/* variable length fields */
 	const u8 *manufacturer;