]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix CONFIG_NO_WPA compile/link errors related to RSNXE
authorMatthew Wang <matthewmwang@chromium.org>
Tue, 17 Sep 2024 16:33:39 +0000 (16:33 +0000)
committerJouni Malinen <j@w1.fi>
Sun, 22 Dec 2024 16:11:36 +0000 (18:11 +0200)
Enabling CONFIG_NO_WPA causes some errors. Fix them.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c

index a7c56f771dd9cb9294c52c7d31e10262039bd004..03364e3f7af69753fe21f9c6267ddf7f5f6f978d 100644 (file)
@@ -3427,7 +3427,10 @@ static int wpa_supplicant_use_own_rsne_params(struct wpa_supplicant *wpa_s,
 static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
                                          union wpa_event_data *data)
 {
-       int l, len, found = 0, found_x = 0, wpa_found, rsn_found;
+       int l, len, found = 0, wpa_found, rsn_found;
+#ifndef CONFIG_NO_WPA
+       int found_x = 0;
+#endif /* CONFIG_NO_WPA */
        const u8 *p, *ie;
        u8 bssid[ETH_ALEN];
        bool bssid_known;
@@ -3530,18 +3533,22 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
                        wpa_find_assoc_pmkid(wpa_s,
                                             data->assoc_info.authorized);
                }
+#ifndef CONFIG_NO_WPA
                if (!found_x && p[0] == WLAN_EID_RSNX) {
                        if (wpa_sm_set_assoc_rsnxe(wpa_s->wpa, p, len))
                                break;
                        found_x = 1;
                }
+#endif /* CONFIG_NO_WPA */
                l -= len;
                p += len;
        }
        if (!found && data->assoc_info.req_ies)
                wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0);
+#ifndef CONFIG_NO_WPA
        if (!found_x && data->assoc_info.req_ies)
                wpa_sm_set_assoc_rsnxe(wpa_s->wpa, NULL, 0);
+#endif /* CONFIG_NO_WPA */
 
        rsn_override = RSN_OVERRIDE_NOT_USED;
        ie = get_vendor_ie(data->assoc_info.req_ies,
index 534d9821d5fccdf121863b68e80e413fc8277d51..cfa66da08bbbc3b61b99dd273751a453c4af6eba 100644 (file)
@@ -420,7 +420,9 @@ void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
        wpa_sm_set_ap_rsne_override_2(wpa_s->wpa, NULL, 0);
        wpa_sm_set_ap_rsnxe_override(wpa_s->wpa, NULL, 0);
        wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0);
+#ifndef CONFIG_NO_WPA
        wpa_sm_set_assoc_rsnxe(wpa_s->wpa, NULL, 0);
+#endif /* CONFIG_NO_WPA */
        wpa_s->rsnxe_len = 0;
        wpa_s->pairwise_cipher = WPA_CIPHER_NONE;
        wpa_s->group_cipher = WPA_CIPHER_NONE;
@@ -2278,6 +2280,7 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
                        return -1;
                }
 
+#ifndef CONFIG_NO_WPA
                wpa_s->rsnxe_len = sizeof(wpa_s->rsnxe);
                if (wpa_sm_set_assoc_rsnxe_default(wpa_s->wpa, wpa_s->rsnxe,
                                                   &wpa_s->rsnxe_len)) {
@@ -2285,6 +2288,7 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
                                "RSN: Failed to generate RSNXE");
                        return -1;
                }
+#endif /* CONFIG_NO_WPA */
        }
 
        if (0) {
@@ -4455,7 +4459,9 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
        /* Starting new association, so clear the possibly used WPA IE from the
         * previous association. */
        wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0);
+#ifndef CONFIG_NO_WPA
        wpa_sm_set_assoc_rsnxe(wpa_s->wpa, NULL, 0);
+#endif /* CONFIG_NO_WPA */
        wpa_s->rsnxe_len = 0;
 #ifndef CONFIG_NO_ROBUST_AV
        wpa_s->mscs_setup_done = false;