WPS: Pass device data into wps_enrollee_build_probe_req_ie()

Use configured device data instead of hardcoded values to generate WPS
IE for Probe Request.
This commit is contained in:
Jouni Malinen 2008-11-29 12:19:30 +02:00
parent eb76b7e3ff
commit 7d7c918d97
3 changed files with 8 additions and 10 deletions

View file

@ -131,6 +131,8 @@ void wps_registrar_probe_req_rx(struct wps_registrar *reg, const u8 *addr,
const struct wpabuf *wps_data);
struct wpabuf * wps_enrollee_build_assoc_req_ie(void);
struct wpabuf * wps_enrollee_build_probe_req_ie(int pbc, const u8 *uuid);
struct wpabuf * wps_enrollee_build_probe_req_ie(int pbc,
struct wps_device_data *dev,
const u8 *uuid);
#endif /* WPS_H */

View file

@ -1147,21 +1147,16 @@ struct wpabuf * wps_enrollee_build_assoc_req_ie(void)
}
struct wpabuf * wps_enrollee_build_probe_req_ie(int pbc, const u8 *uuid)
struct wpabuf * wps_enrollee_build_probe_req_ie(int pbc,
struct wps_device_data *dev,
const u8 *uuid)
{
struct wpabuf *ie;
u8 *len;
u16 methods;
struct wps_device_data dev;
wpa_printf(MSG_DEBUG, "WPS: Building WPS IE for Probe Request");
/* TODO: get device data from caller */
os_memset(&dev, 0, sizeof(dev));
dev.categ = WPS_DEV_COMPUTER;
dev.oui = WPS_DEV_OUI_WFA;
dev.sub_categ = WPS_DEV_COMPUTER_PC;
ie = wpabuf_alloc(200);
if (ie == NULL)
return NULL;
@ -1180,7 +1175,7 @@ struct wpabuf * wps_enrollee_build_probe_req_ie(int pbc, const u8 *uuid)
wps_build_req_type(ie, WPS_REQ_ENROLLEE) ||
wps_build_config_methods(ie, methods) ||
wps_build_uuid_e(ie, uuid) ||
wps_build_primary_dev_type(&dev, ie) ||
wps_build_primary_dev_type(dev, ie) ||
wps_build_rf_bands(NULL, ie) ||
wps_build_assoc_state(NULL, ie) ||
wps_build_config_error(NULL, ie) ||

View file

@ -176,6 +176,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
#ifdef CONFIG_WPS
if (wps) {
wps_ie = wps_enrollee_build_probe_req_ie(wps == 2,
&wpa_s->wps->dev,
wpa_s->conf->uuid);
if (wps_ie) {
extra_ie = wpabuf_head(wps_ie);