aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-02-27 23:14:35 +0200
committerJouni Malinen <j@w1.fi>2012-02-27 23:14:35 +0200
commit360182ed7c0d1dd6807e6b6d8a84eeb595011cc2 (patch)
tree9a744c685636a2488e4960f96713b5c33ca7f908 /src/wps
parent78db55b800f0fe48ad5afcb4c7e0c58636a56e39 (diff)
downloadexternal_wpa_supplicant_8_ti-360182ed7c0d1dd6807e6b6d8a84eeb595011cc2.zip
external_wpa_supplicant_8_ti-360182ed7c0d1dd6807e6b6d8a84eeb595011cc2.tar.gz
external_wpa_supplicant_8_ti-360182ed7c0d1dd6807e6b6d8a84eeb595011cc2.tar.bz2
P2P: Advertise immediate availability of WPS credential
Use Device Password ID in WSC IE of Probe Request and Probe Response frames to advertise immediate availability of WPS credentials per P2P specification sections 3.1.2.1.1 (Listen State), 3.1.2.1.2 (Scan Phase), and 3.1.2.1.3 (Find Phase). For now, the Device Password ID is set only for the case where we are active GO Negotiation with a specific peer. In practice, this means that the Probe Response frames during pending GO Negotiation (whenever in Listen state) indicate availability of the credential. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/wps')
-rw-r--r--src/wps/wps.c8
-rw-r--r--src/wps/wps.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/wps/wps.c b/src/wps/wps.c
index 9422c71..64b80d8 100644
--- a/src/wps/wps.c
+++ b/src/wps/wps.c
@@ -431,7 +431,8 @@ struct wpabuf * wps_build_assoc_resp_ie(void)
/**
* wps_build_probe_req_ie - Build WPS IE for Probe Request
- * @pbc: Whether searching for PBC mode APs
+ * @pw_id: Password ID (DEV_PW_PUSHBUTTON for active PBC and DEV_PW_DEFAULT for
+ * most other use cases)
* @dev: Device attributes
* @uuid: Own UUID
* @req_type: Value for Request Type attribute
@@ -442,7 +443,7 @@ struct wpabuf * wps_build_assoc_resp_ie(void)
*
* The caller is responsible for freeing the buffer.
*/
-struct wpabuf * wps_build_probe_req_ie(int pbc, struct wps_device_data *dev,
+struct wpabuf * wps_build_probe_req_ie(u16 pw_id, struct wps_device_data *dev,
const u8 *uuid,
enum wps_request_type req_type,
unsigned int num_req_dev_types,
@@ -464,8 +465,7 @@ struct wpabuf * wps_build_probe_req_ie(int pbc, struct wps_device_data *dev,
wps_build_rf_bands(dev, ie) ||
wps_build_assoc_state(NULL, ie) ||
wps_build_config_error(ie, WPS_CFG_NO_ERROR) ||
- wps_build_dev_password_id(ie, pbc ? DEV_PW_PUSHBUTTON :
- DEV_PW_DEFAULT) ||
+ wps_build_dev_password_id(ie, pw_id) ||
#ifdef CONFIG_WPS2
wps_build_manufacturer(dev, ie) ||
wps_build_model_name(dev, ie) ||
diff --git a/src/wps/wps.h b/src/wps/wps.h
index 22e029f..18446cb 100644
--- a/src/wps/wps.h
+++ b/src/wps/wps.h
@@ -238,7 +238,7 @@ int wps_is_20(const struct wpabuf *msg);
struct wpabuf * wps_build_assoc_req_ie(enum wps_request_type req_type);
struct wpabuf * wps_build_assoc_resp_ie(void);
-struct wpabuf * wps_build_probe_req_ie(int pbc, struct wps_device_data *dev,
+struct wpabuf * wps_build_probe_req_ie(u16 pw_id, struct wps_device_data *dev,
const u8 *uuid,
enum wps_request_type req_type,
unsigned int num_req_dev_types,