#include "eap_peer/eap.h"
#include "wpa_supplicant_i.h"
#include "eloop.h"
+#include "uuid.h"
#include "wpa_ctrl.h"
#include "eap_common/eap_wsc_common.h"
#include "wps/wps.h"
wps->dev.os_version = WPA_GET_BE32(wpa_s->conf->os_version);
wps->dev.rf_bands = WPS_RF_24GHZ | WPS_RF_50GHZ; /* TODO: config */
os_memcpy(wps->dev.mac_addr, wpa_s->own_addr, ETH_ALEN);
- os_memcpy(wps->uuid, wpa_s->conf->uuid, 16);
+ if (is_nil_uuid(wpa_s->conf->uuid)) {
+ uuid_gen_mac_addr(wpa_s->own_addr, wps->uuid);
+ wpa_hexdump(MSG_DEBUG, "WPS: UUID based on MAC address",
+ wps->uuid, WPS_UUID_LEN);
+ } else
+ os_memcpy(wps->uuid, wpa_s->conf->uuid, WPS_UUID_LEN);
wpa_s->wps = wps;
sel_uuid = wps_get_uuid_e(wps_ie);
else
sel_uuid = NULL;
- if (!sel_uuid) {
- wpa_printf(MSG_DEBUG, "WPS: UUID-E not available for PBC "
- "overlap detection");
- wpabuf_free(wps_ie);
- return 1;
- }
for (i = 0; i < wpa_s->scan_res->num; i++) {
struct wpa_scan_res *bss = wpa_s->scan_res->res[i];
continue;
}
uuid = wps_get_uuid_e(ie);
- if (uuid == NULL) {
- wpa_printf(MSG_DEBUG, "WPS: UUID-E not available for "
- "PBC overlap detection (other BSS)");
- ret = 1;
- wpabuf_free(ie);
- break;
- }
- if (os_memcmp(sel_uuid, uuid, 16) != 0) {
+ if (sel_uuid == NULL || uuid == NULL ||
+ os_memcmp(sel_uuid, uuid, 16) != 0) {
ret = 1; /* PBC overlap */
wpabuf_free(ie);
break;