WPS: Make fragment size configurable for EAP-WSC peer
"wpa_cli set wps_fragment_size <val>" can now be used to configure the fragment size limit for EAP-WSC.
This commit is contained in:
parent
ecece754db
commit
42f50264c0
4 changed files with 11 additions and 0 deletions
|
@ -224,6 +224,8 @@ static void * eap_wsc_init(struct eap_sm *sm)
|
||||||
data->fragment_size = res;
|
data->fragment_size = res;
|
||||||
else
|
else
|
||||||
data->fragment_size = WSC_FRAGMENT_SIZE;
|
data->fragment_size = WSC_FRAGMENT_SIZE;
|
||||||
|
wpa_printf(MSG_DEBUG, "EAP-WSC: Fragment size limit %u",
|
||||||
|
(unsigned int) data->fragment_size);
|
||||||
|
|
||||||
if (registrar && cfg.pin) {
|
if (registrar && cfg.pin) {
|
||||||
wps_registrar_add_pin(data->wps_ctx->registrar, NULL, NULL,
|
wps_registrar_add_pin(data->wps_ctx->registrar, NULL, NULL,
|
||||||
|
|
|
@ -80,6 +80,8 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
|
||||||
} else if (os_strcasecmp(cmd, "dot11RSNAConfigSATimeout") == 0) {
|
} else if (os_strcasecmp(cmd, "dot11RSNAConfigSATimeout") == 0) {
|
||||||
if (wpa_sm_set_param(wpa_s->wpa, RSNA_SA_TIMEOUT, atoi(value)))
|
if (wpa_sm_set_param(wpa_s->wpa, RSNA_SA_TIMEOUT, atoi(value)))
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
} else if (os_strcasecmp(cmd, "wps_fragment_size") == 0) {
|
||||||
|
wpa_s->wps_fragment_size = atoi(value);
|
||||||
} else
|
} else
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
|
|
|
@ -437,6 +437,7 @@ struct wpa_supplicant {
|
||||||
|
|
||||||
int after_wps;
|
int after_wps;
|
||||||
unsigned int wps_freq;
|
unsigned int wps_freq;
|
||||||
|
int wps_fragment_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -673,6 +673,8 @@ int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid)
|
||||||
if (ssid == NULL)
|
if (ssid == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
wpa_config_set(ssid, "phase1", "\"pbc=1\"", 0);
|
wpa_config_set(ssid, "phase1", "\"pbc=1\"", 0);
|
||||||
|
if (wpa_s->wps_fragment_size)
|
||||||
|
ssid->eap.fragment_size = wpa_s->wps_fragment_size;
|
||||||
eloop_register_timeout(WPS_PBC_WALK_TIME, 0, wpas_wps_timeout,
|
eloop_register_timeout(WPS_PBC_WALK_TIME, 0, wpas_wps_timeout,
|
||||||
wpa_s, NULL);
|
wpa_s, NULL);
|
||||||
wpas_wps_reassoc(wpa_s, ssid);
|
wpas_wps_reassoc(wpa_s, ssid);
|
||||||
|
@ -698,6 +700,8 @@ int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
|
||||||
os_snprintf(val, sizeof(val), "\"pin=%08d\"", rpin);
|
os_snprintf(val, sizeof(val), "\"pin=%08d\"", rpin);
|
||||||
}
|
}
|
||||||
wpa_config_set(ssid, "phase1", val, 0);
|
wpa_config_set(ssid, "phase1", val, 0);
|
||||||
|
if (wpa_s->wps_fragment_size)
|
||||||
|
ssid->eap.fragment_size = wpa_s->wps_fragment_size;
|
||||||
eloop_register_timeout(WPS_PBC_WALK_TIME, 0, wpas_wps_timeout,
|
eloop_register_timeout(WPS_PBC_WALK_TIME, 0, wpas_wps_timeout,
|
||||||
wpa_s, NULL);
|
wpa_s, NULL);
|
||||||
wpas_wps_reassoc(wpa_s, ssid);
|
wpas_wps_reassoc(wpa_s, ssid);
|
||||||
|
@ -788,6 +792,8 @@ int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid,
|
||||||
if (res < 0 || res >= end - pos)
|
if (res < 0 || res >= end - pos)
|
||||||
return -1;
|
return -1;
|
||||||
wpa_config_set(ssid, "phase1", val, 0);
|
wpa_config_set(ssid, "phase1", val, 0);
|
||||||
|
if (wpa_s->wps_fragment_size)
|
||||||
|
ssid->eap.fragment_size = wpa_s->wps_fragment_size;
|
||||||
eloop_register_timeout(WPS_PBC_WALK_TIME, 0, wpas_wps_timeout,
|
eloop_register_timeout(WPS_PBC_WALK_TIME, 0, wpas_wps_timeout,
|
||||||
wpa_s, NULL);
|
wpa_s, NULL);
|
||||||
wpas_wps_reassoc(wpa_s, ssid);
|
wpas_wps_reassoc(wpa_s, ssid);
|
||||||
|
|
Loading…
Reference in a new issue