|
@@ -59,43 +59,44 @@ struct wps_parse_attr {
|
|
|
|
|
|
/* variable length fields */
|
|
|
const u8 *manufacturer;
|
|
|
- size_t manufacturer_len;
|
|
|
const u8 *model_name;
|
|
|
- size_t model_name_len;
|
|
|
const u8 *model_number;
|
|
|
- size_t model_number_len;
|
|
|
const u8 *serial_number;
|
|
|
- size_t serial_number_len;
|
|
|
const u8 *dev_name;
|
|
|
- size_t dev_name_len;
|
|
|
const u8 *public_key;
|
|
|
- size_t public_key_len;
|
|
|
const u8 *encr_settings;
|
|
|
- size_t encr_settings_len;
|
|
|
const u8 *ssid; /* <= 32 octets */
|
|
|
- size_t ssid_len;
|
|
|
const u8 *network_key; /* <= 64 octets */
|
|
|
- size_t network_key_len;
|
|
|
const u8 *authorized_macs; /* <= 30 octets */
|
|
|
- size_t authorized_macs_len;
|
|
|
const u8 *sec_dev_type_list; /* <= 128 octets */
|
|
|
- size_t sec_dev_type_list_len;
|
|
|
const u8 *oob_dev_password; /* 38..54 octets */
|
|
|
- size_t oob_dev_password_len;
|
|
|
+ u16 manufacturer_len;
|
|
|
+ u16 model_name_len;
|
|
|
+ u16 model_number_len;
|
|
|
+ u16 serial_number_len;
|
|
|
+ u16 dev_name_len;
|
|
|
+ u16 public_key_len;
|
|
|
+ u16 encr_settings_len;
|
|
|
+ u16 ssid_len;
|
|
|
+ u16 network_key_len;
|
|
|
+ u16 authorized_macs_len;
|
|
|
+ u16 sec_dev_type_list_len;
|
|
|
+ u16 oob_dev_password_len;
|
|
|
|
|
|
/* attributes that can occur multiple times */
|
|
|
#define MAX_CRED_COUNT 10
|
|
|
- const u8 *cred[MAX_CRED_COUNT];
|
|
|
- size_t cred_len[MAX_CRED_COUNT];
|
|
|
- size_t num_cred;
|
|
|
-
|
|
|
#define MAX_REQ_DEV_TYPE_COUNT 10
|
|
|
- const u8 *req_dev_type[MAX_REQ_DEV_TYPE_COUNT];
|
|
|
- size_t num_req_dev_type;
|
|
|
|
|
|
+ unsigned int num_cred;
|
|
|
+ unsigned int num_req_dev_type;
|
|
|
+ unsigned int num_vendor_ext;
|
|
|
+
|
|
|
+ u16 cred_len[MAX_CRED_COUNT];
|
|
|
+ u16 vendor_ext_len[MAX_WPS_PARSE_VENDOR_EXT];
|
|
|
+
|
|
|
+ const u8 *cred[MAX_CRED_COUNT];
|
|
|
+ const u8 *req_dev_type[MAX_REQ_DEV_TYPE_COUNT];
|
|
|
const u8 *vendor_ext[MAX_WPS_PARSE_VENDOR_EXT];
|
|
|
- size_t vendor_ext_len[MAX_WPS_PARSE_VENDOR_EXT];
|
|
|
- size_t num_vendor_ext;
|
|
|
};
|
|
|
|
|
|
int wps_parse_msg(const struct wpabuf *msg, struct wps_parse_attr *attr);
|