WPS: Cleanup UUID and MAC address configuration

No need to configure these separately for each Enrollee in wps_config
since wps_context is now used both for Registrar and Enrollee.
This commit is contained in:
Jouni Malinen 2009-01-01 22:56:02 +02:00
parent e834272f73
commit 84f5b41fc1
4 changed files with 5 additions and 10 deletions

View File

@ -162,7 +162,6 @@ static void * eap_wsc_init(struct eap_sm *sm)
cfg.authenticator = 0;
cfg.wps = wps;
cfg.registrar = registrar ? data->wps_ctx->registrar : NULL;
cfg.enrollee_mac_addr = registrar ? NULL : wps->dev.mac_addr;
phase1 = eap_get_config_phase1(sm);
if (phase1 == NULL) {
@ -192,7 +191,6 @@ static void * eap_wsc_init(struct eap_sm *sm)
return NULL;
}
cfg.uuid = registrar ? NULL : wps->uuid;
data->wps = wps_init(&cfg);
if (data->wps == NULL) {
os_free(data);

View File

@ -28,11 +28,11 @@ struct wps_data * wps_init(const struct wps_config *cfg)
data->authenticator = cfg->authenticator;
data->wps = cfg->wps;
data->registrar = cfg->registrar;
if (cfg->enrollee_mac_addr)
os_memcpy(data->mac_addr_e, cfg->enrollee_mac_addr, ETH_ALEN);
if (cfg->uuid) {
os_memcpy(cfg->registrar ? data->uuid_r : data->uuid_e,
cfg->uuid, WPS_UUID_LEN);
if (cfg->registrar) {
os_memcpy(data->uuid_r, cfg->wps->uuid, WPS_UUID_LEN);
} else {
os_memcpy(data->mac_addr_e, cfg->wps->dev.mac_addr, ETH_ALEN);
os_memcpy(data->uuid_e, cfg->wps->uuid, WPS_UUID_LEN);
}
if (cfg->pin) {
data->dev_pw_id = DEV_PW_DEFAULT;

View File

@ -55,11 +55,9 @@ struct wps_config {
int authenticator;
struct wps_context *wps;
struct wps_registrar *registrar; /* NULL for Enrollee */
const u8 *enrollee_mac_addr; /* NULL for Registrar */
const u8 *pin; /* Enrollee Device Password (NULL for Registrar or PBC)
*/
size_t pin_len;
const u8 *uuid; /* 128-bit Enrollee UUID (NULL for Registrar) */
int pbc;
const struct wpabuf *assoc_wps_ie; /* (Re)AssocReq WPS IE (in AP) */
};

View File

@ -980,7 +980,6 @@ static struct wpabuf * wps_build_m2(struct wps_data *wps)
return NULL;
wpa_hexdump(MSG_DEBUG, "WPS: Registrar Nonce",
wps->nonce_r, WPS_NONCE_LEN);
os_memcpy(wps->uuid_r, wps->wps->uuid, WPS_UUID_LEN);
wpa_hexdump(MSG_DEBUG, "WPS: UUID-R", wps->uuid_r, WPS_UUID_LEN);
wpa_printf(MSG_DEBUG, "WPS: Building Message M2");