Replace "dummy" with "stub" in wps_testing_dummy_cred
Replace the word "dummy" with the inclusive word "stub". Signed-off-by: Arowa Suliman <arowa@chromium.org>
This commit is contained in:
parent
77dd712432
commit
3955d2af73
8 changed files with 31 additions and 31 deletions
|
@ -1455,10 +1455,10 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
|
|||
wps_version_number & 0x0f);
|
||||
hostapd_wps_update_ie(hapd);
|
||||
}
|
||||
} else if (os_strcasecmp(cmd, "wps_testing_dummy_cred") == 0) {
|
||||
wps_testing_dummy_cred = atoi(value);
|
||||
wpa_printf(MSG_DEBUG, "WPS: Testing - dummy_cred=%d",
|
||||
wps_testing_dummy_cred);
|
||||
} else if (os_strcasecmp(cmd, "wps_testing_stub_cred") == 0) {
|
||||
wps_testing_stub_cred = atoi(value);
|
||||
wpa_printf(MSG_DEBUG, "WPS: Testing - stub_cred=%d",
|
||||
wps_testing_stub_cred);
|
||||
} else if (os_strcasecmp(cmd, "wps_corrupt_pkhash") == 0) {
|
||||
wps_corrupt_pkhash = atoi(value);
|
||||
wpa_printf(MSG_DEBUG, "WPS: Testing - wps_corrupt_pkhash=%d",
|
||||
|
@ -4470,7 +4470,7 @@ static void hostapd_ctrl_iface_flush(struct hapd_interfaces *interfaces)
|
|||
{
|
||||
#ifdef CONFIG_WPS_TESTING
|
||||
wps_version_number = 0x20;
|
||||
wps_testing_dummy_cred = 0;
|
||||
wps_testing_stub_cred = 0;
|
||||
wps_corrupt_pkhash = 0;
|
||||
#endif /* CONFIG_WPS_TESTING */
|
||||
|
||||
|
|
|
@ -1048,7 +1048,7 @@ static char ** hostapd_complete_set(const char *str, int pos)
|
|||
int arg = get_cmd_arg_num(str, pos);
|
||||
const char *fields[] = {
|
||||
#ifdef CONFIG_WPS_TESTING
|
||||
"wps_version_number", "wps_testing_dummy_cred",
|
||||
"wps_version_number", "wps_testing_stub_cred",
|
||||
"wps_corrupt_pkhash",
|
||||
#endif /* CONFIG_WPS_TESTING */
|
||||
#ifdef CONFIG_INTERWORKING
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#ifdef CONFIG_WPS_TESTING
|
||||
int wps_version_number = 0x20;
|
||||
int wps_testing_dummy_cred = 0;
|
||||
int wps_testing_stub_cred = 0;
|
||||
int wps_corrupt_pkhash = 0;
|
||||
int wps_force_auth_types_in_use = 0;
|
||||
u16 wps_force_auth_types = 0;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#ifdef CONFIG_WPS_TESTING
|
||||
|
||||
extern int wps_version_number;
|
||||
extern int wps_testing_dummy_cred;
|
||||
extern int wps_testing_stub_cred;
|
||||
extern int wps_corrupt_pkhash;
|
||||
extern int wps_force_auth_types_in_use;
|
||||
extern u16 wps_force_auth_types;
|
||||
|
|
|
@ -1785,23 +1785,23 @@ int wps_build_cred(struct wps_data *wps, struct wpabuf *msg)
|
|||
|
||||
use_provided:
|
||||
#ifdef CONFIG_WPS_TESTING
|
||||
if (wps_testing_dummy_cred)
|
||||
if (wps_testing_stub_cred)
|
||||
cred = wpabuf_alloc(200);
|
||||
else
|
||||
cred = NULL;
|
||||
if (cred) {
|
||||
struct wps_credential dummy;
|
||||
wpa_printf(MSG_DEBUG, "WPS: Add dummy credential");
|
||||
os_memset(&dummy, 0, sizeof(dummy));
|
||||
os_memcpy(dummy.ssid, "dummy", 5);
|
||||
dummy.ssid_len = 5;
|
||||
dummy.auth_type = WPS_AUTH_WPA2PSK;
|
||||
dummy.encr_type = WPS_ENCR_AES;
|
||||
os_memcpy(dummy.key, "dummy psk", 9);
|
||||
dummy.key_len = 9;
|
||||
os_memcpy(dummy.mac_addr, wps->mac_addr_e, ETH_ALEN);
|
||||
wps_build_credential(cred, &dummy);
|
||||
wpa_hexdump_buf(MSG_DEBUG, "WPS: Dummy Credential", cred);
|
||||
struct wps_credential stub;
|
||||
wpa_printf(MSG_DEBUG, "WPS: Add stub credential");
|
||||
os_memset(&stub, 0, sizeof(stub));
|
||||
os_memcpy(stub.ssid, "stub", 5);
|
||||
stub.ssid_len = 5;
|
||||
stub.auth_type = WPS_AUTH_WPA2PSK;
|
||||
stub.encr_type = WPS_ENCR_AES;
|
||||
os_memcpy(stub.key, "stub psk", 9);
|
||||
stub.key_len = 9;
|
||||
os_memcpy(stub.mac_addr, wps->mac_addr_e, ETH_ALEN);
|
||||
wps_build_credential(cred, &stub);
|
||||
wpa_hexdump_buf(MSG_DEBUG, "WPS: Stub Credential", cred);
|
||||
|
||||
wpabuf_put_be16(msg, ATTR_CRED);
|
||||
wpabuf_put_be16(msg, wpabuf_len(cred));
|
||||
|
|
|
@ -10131,8 +10131,8 @@ def test_ap_wps_tkip(dev, apdev):
|
|||
if "FAIL" not in hapd.request("WPS_PBC"):
|
||||
raise Exception("WPS unexpectedly enabled")
|
||||
|
||||
def test_ap_wps_conf_dummy_cred(dev, apdev):
|
||||
"""WPS PIN provisioning with configured AP using dummy cred"""
|
||||
def test_ap_wps_conf_stub_cred(dev, apdev):
|
||||
"""WPS PIN provisioning with configured AP using stub cred"""
|
||||
ssid = "test-wps-conf"
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{"ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
|
@ -10142,7 +10142,7 @@ def test_ap_wps_conf_dummy_cred(dev, apdev):
|
|||
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
|
||||
dev[0].dump_monitor()
|
||||
try:
|
||||
hapd.set("wps_testing_dummy_cred", "1")
|
||||
hapd.set("wps_testing_stub_cred", "1")
|
||||
dev[0].request("WPS_PIN " + apdev[0]['bssid'] + " 12345670")
|
||||
for i in range(1, 3):
|
||||
ev = dev[0].wait_event(["WPS-CRED-RECEIVED"], timeout=15)
|
||||
|
@ -10150,7 +10150,7 @@ def test_ap_wps_conf_dummy_cred(dev, apdev):
|
|||
raise Exception("WPS credential %d not received" % i)
|
||||
dev[0].wait_connected(timeout=30)
|
||||
finally:
|
||||
hapd.set("wps_testing_dummy_cred", "0")
|
||||
hapd.set("wps_testing_stub_cred", "0")
|
||||
|
||||
def test_ap_wps_rf_bands(dev, apdev):
|
||||
"""WPS and wps_rf_bands configuration"""
|
||||
|
|
|
@ -378,7 +378,7 @@ def test_autogo_chan_switch_group_iface(dev):
|
|||
@remote_compatible
|
||||
def test_autogo_extra_cred(dev):
|
||||
"""P2P autonomous GO sending two WPS credentials"""
|
||||
if "FAIL" in dev[0].request("SET wps_testing_dummy_cred 1"):
|
||||
if "FAIL" in dev[0].request("SET wps_testing_stub_cred 1"):
|
||||
raise Exception("Failed to enable test mode")
|
||||
autogo(dev[0], freq=2412)
|
||||
connect_cli(dev[0], dev[1], social=True, freq=2412)
|
||||
|
|
|
@ -568,10 +568,10 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
|
|||
(wps_version_number & 0xf0) >> 4,
|
||||
wps_version_number & 0x0f);
|
||||
}
|
||||
} else if (os_strcasecmp(cmd, "wps_testing_dummy_cred") == 0) {
|
||||
wps_testing_dummy_cred = atoi(value);
|
||||
wpa_printf(MSG_DEBUG, "WPS: Testing - dummy_cred=%d",
|
||||
wps_testing_dummy_cred);
|
||||
} else if (os_strcasecmp(cmd, "wps_testing_stub_cred") == 0) {
|
||||
wps_testing_stub_cred = atoi(value);
|
||||
wpa_printf(MSG_DEBUG, "WPS: Testing - stub_cred=%d",
|
||||
wps_testing_stub_cred);
|
||||
} else if (os_strcasecmp(cmd, "wps_corrupt_pkhash") == 0) {
|
||||
wps_corrupt_pkhash = atoi(value);
|
||||
wpa_printf(MSG_DEBUG, "WPS: Testing - wps_corrupt_pkhash=%d",
|
||||
|
@ -8447,7 +8447,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
|
|||
|
||||
#ifdef CONFIG_WPS_TESTING
|
||||
wps_version_number = 0x20;
|
||||
wps_testing_dummy_cred = 0;
|
||||
wps_testing_stub_cred = 0;
|
||||
wps_corrupt_pkhash = 0;
|
||||
wps_force_auth_types_in_use = 0;
|
||||
wps_force_encr_types_in_use = 0;
|
||||
|
|
Loading…
Reference in a new issue