]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Replace "dummy" with "stub" in wps_testing_dummy_cred
authorArowa Suliman <arowa@chromium.org>
Sun, 19 Sep 2021 06:24:29 +0000 (23:24 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 11 Oct 2021 17:52:21 +0000 (20:52 +0300)
Replace the word "dummy" with the inclusive word "stub".

Signed-off-by: Arowa Suliman <arowa@chromium.org>
hostapd/ctrl_iface.c
hostapd/hostapd_cli.c
src/wps/wps.c
src/wps/wps_defs.h
src/wps/wps_registrar.c
tests/hwsim/test_ap_wps.py
tests/hwsim/test_p2p_autogo.py
wpa_supplicant/ctrl_iface.c

index 4a2d60627070fd76b8a0ab0543dcfd8bb8e6d658..280e94fec66bc7b767015099d86e9fc0c24f7c73 100644 (file)
@@ -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 */
 
index eaa628ad0676cc0e8962df69242cdd98ede505f0..0e7fdd6bccfb1874d5c427009523f2c9722f5f17 100644 (file)
@@ -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
index 484df262c3ca2f8c79ec5a8f4f4cb56a9d5c0f81..1fe38063b2534eccf0aa882aa0c2ff612c3f78e1 100644 (file)
@@ -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;
index 9fccb4eeb5c102f68fd544233f82b9b838f8e4b4..ddaeda56d317d49e0b71eaf302e822a6cf1a33f8 100644 (file)
@@ -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;
index 173fbbd68aa080ce4a88468b6aeee747e0a5b557..9587293d0f887497c8f0376f2c8ab4346eec508d 100644 (file)
@@ -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));
index 4a5083bef49d137bb8e7fbd4d6fd84074f0af1ea..e5e2f0fd96f93eae4a3943ac8bf8d9b64c89cc10 100644 (file)
@@ -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"""
index 91d68eaf2836edfdc58d590ba4ea5c4f59049209..d857c9025b3f9c85f416de9b868f690c0806c2eb 100644 (file)
@@ -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)
index f9ce1d2d4515d73f4ab6e9cd4b62263c6eed5a29..9875b22e77b9c54c1858148f842ef6313f198172 100644 (file)
@@ -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;