]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Multi-AP: WPS support for different Multi-AP profiles
authorManoj Sekar <quic_sekar@quicinc.com>
Mon, 26 Feb 2024 12:59:13 +0000 (18:29 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 19 Mar 2024 17:24:29 +0000 (19:24 +0200)
Update EAP-WSC parameters to include Multi-AP profile info to pass the
profile information through the provisioning steps. This is needed for
provisioning the STA configuration when different profiles are used.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
src/eap_peer/eap_wsc.c
src/wps/wps.c
src/wps/wps.h
src/wps/wps_i.h
wpa_supplicant/wps_supplicant.c

index a1e7bff196c686e1e3a8815feffcf33d9b0e70e2..fe61c83e74e285a6b8cdd50bda5f782f737db484 100644 (file)
@@ -255,8 +255,18 @@ static void * eap_wsc_init(struct eap_sm *sm)
                cfg.new_ap_settings = &new_ap_settings;
        }
 
-       if (os_strstr(phase1, "multi_ap=1"))
-               cfg.multi_ap_backhaul_sta = 1;
+       pos = os_strstr(phase1, "multi_ap=");
+       if (pos) {
+               u16 id = atoi(pos + 9);
+
+               if (id != 0) {
+                       cfg.multi_ap_backhaul_sta = 1;
+                       cfg.multi_ap_profile = id;
+               } else {
+                       wpa_printf(MSG_DEBUG,
+                                  "EAP-WSC: Invalid multi_ap setting");
+               }
+       }
 
        data->wps = wps_init(&cfg);
        if (data->wps == NULL) {
index 7cfebfabc7d16e8887d11cc65ff300d7c38c4a90..fd5bd931eeed47921fa889b33ff63c5791d990a9 100644 (file)
@@ -146,6 +146,7 @@ struct wps_data * wps_init(const struct wps_config *cfg)
        }
 
        data->multi_ap_backhaul_sta = cfg->multi_ap_backhaul_sta;
+       data->multi_ap_profile = cfg->multi_ap_profile;
 
        return data;
 }
index fed3e284895fe5761e4b82ac32fdb81ed1000253..b99ae949933e40e27157d986a6968214da492b5b 100644 (file)
@@ -195,6 +195,11 @@ struct wps_config {
         * enrollee
         */
        int multi_ap_backhaul_sta;
+
+       /*
+        * multi_ap_profile - Get the Multi-AP Profile
+        */
+       int multi_ap_profile;
 };
 
 struct wps_data * wps_init(const struct wps_config *cfg);
index 2cf22d4b7a636890e8a262de9531cef70d8e73fe..5486e2a1c2ea9fa58402d174915649b8e93290d2 100644 (file)
@@ -127,6 +127,7 @@ struct wps_data {
        struct wps_nfc_pw_token *nfc_pw_token;
 
        int multi_ap_backhaul_sta;
+       int multi_ap_profile;
 };
 
 
index 2c08401b3b001eb5a60f90b50f4af873a224235c..8cd355f6b3b5c8f198338f1ddbac3dd191d94793 100644 (file)
@@ -1208,14 +1208,19 @@ int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
                }
        }
 #endif /* CONFIG_P2P */
-       os_snprintf(phase1, sizeof(phase1), "pbc=1%s",
-                   multi_ap_backhaul_sta ? " multi_ap=1" : "");
+       if (multi_ap_backhaul_sta)
+               os_snprintf(phase1, sizeof(phase1), "pbc=1 multi_ap=%d",
+                           multi_ap_backhaul_sta);
+       else
+               os_snprintf(phase1, sizeof(phase1), "pbc=1");
        if (wpa_config_set_quoted(ssid, "phase1", phase1) < 0)
                return -1;
        if (wpa_s->wps_fragment_size)
                ssid->eap.fragment_size = wpa_s->wps_fragment_size;
-       if (multi_ap_backhaul_sta)
+       if (multi_ap_backhaul_sta) {
                ssid->multi_ap_backhaul_sta = 1;
+               ssid->multi_ap_profile = multi_ap_backhaul_sta;
+       }
        wpa_s->supp_pbc_active = true;
        wpa_s->wps_overlap = false;
        wpa_supplicant_wps_event(wpa_s, WPS_EV_PBC_ACTIVE, NULL);