Parcourir la source

WPS 2.0: Add device attributes into Probe Request

Add Manufacturer, Model Name, Model Number, and Device Name attributes
into the WSC IE in the Probe Request frames.
Jouni Malinen il y a 15 ans
Parent
commit
662bd57522
3 fichiers modifiés avec 12 ajouts et 7 suppressions
  1. 4 0
      src/wps/wps.c
  2. 4 7
      src/wps/wps_dev_attr.c
  3. 4 0
      src/wps/wps_dev_attr.h

+ 4 - 0
src/wps/wps.c

@@ -450,6 +450,10 @@ struct wpabuf * wps_build_probe_req_ie(int pbc, struct wps_device_data *dev,
 	    wps_build_dev_password_id(ie, pbc ? DEV_PW_PUSHBUTTON :
 				      DEV_PW_DEFAULT) ||
 	    wps_build_version2(ie) ||
+	    wps_build_manufacturer(dev, ie) ||
+	    wps_build_model_name(dev, ie) ||
+	    wps_build_model_number(dev, ie) ||
+	    wps_build_dev_name(dev, ie) ||
 	    (req_type == WPS_REQ_ENROLLEE &&
 	     wps_build_req_to_enroll(ie))) {
 		wpabuf_free(ie);

+ 4 - 7
src/wps/wps_dev_attr.c

@@ -19,8 +19,7 @@
 #include "wps_dev_attr.h"
 
 
-static int wps_build_manufacturer(struct wps_device_data *dev,
-				  struct wpabuf *msg)
+int wps_build_manufacturer(struct wps_device_data *dev, struct wpabuf *msg)
 {
 	size_t len;
 	wpa_printf(MSG_DEBUG, "WPS:  * Manufacturer");
@@ -42,8 +41,7 @@ static int wps_build_manufacturer(struct wps_device_data *dev,
 }
 
 
-static int wps_build_model_name(struct wps_device_data *dev,
-				struct wpabuf *msg)
+int wps_build_model_name(struct wps_device_data *dev, struct wpabuf *msg)
 {
 	size_t len;
 	wpa_printf(MSG_DEBUG, "WPS:  * Model Name");
@@ -65,8 +63,7 @@ static int wps_build_model_name(struct wps_device_data *dev,
 }
 
 
-static int wps_build_model_number(struct wps_device_data *dev,
-				  struct wpabuf *msg)
+int wps_build_model_number(struct wps_device_data *dev, struct wpabuf *msg)
 {
 	size_t len;
 	wpa_printf(MSG_DEBUG, "WPS:  * Model Number");
@@ -121,7 +118,7 @@ int wps_build_primary_dev_type(struct wps_device_data *dev, struct wpabuf *msg)
 }
 
 
-static int wps_build_dev_name(struct wps_device_data *dev, struct wpabuf *msg)
+int wps_build_dev_name(struct wps_device_data *dev, struct wpabuf *msg)
 {
 	size_t len;
 	wpa_printf(MSG_DEBUG, "WPS:  * Device Name");

+ 4 - 0
src/wps/wps_dev_attr.h

@@ -17,6 +17,10 @@
 
 struct wps_parse_attr;
 
+int wps_build_manufacturer(struct wps_device_data *dev, struct wpabuf *msg);
+int wps_build_model_name(struct wps_device_data *dev, struct wpabuf *msg);
+int wps_build_model_number(struct wps_device_data *dev, struct wpabuf *msg);
+int wps_build_dev_name(struct wps_device_data *dev, struct wpabuf *msg);
 int wps_build_device_attrs(struct wps_device_data *dev, struct wpabuf *msg);
 int wps_build_os_version(struct wps_device_data *dev, struct wpabuf *msg);
 int wps_build_rf_bands(struct wps_device_data *dev, struct wpabuf *msg);