]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Try to set WPA-None key after IBSS-joined event
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 7 May 2013 15:14:56 +0000 (18:14 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 7 May 2013 15:14:56 +0000 (18:14 +0300)
cfg80211 rejects the set_key operations before the IBSS network has been
fully formed, so add one more attempt to set the key for WPA-None at
IBSS joined driver event.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index f0f5d1caf464c495bab53c25b40811a1290ce3f8..98ef1bf9c1cd9d7fbde1a2a874cedcf524e71511 100644 (file)
@@ -1777,6 +1777,16 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
            wpa_s->key_mgmt == WPA_KEY_MGMT_WPA_NONE ||
            (wpa_s->current_ssid &&
             wpa_s->current_ssid->mode == IEEE80211_MODE_IBSS)) {
+               if (wpa_s->key_mgmt == WPA_KEY_MGMT_WPA_NONE &&
+                   (wpa_s->drv_flags &
+                    WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE)) {
+                       /*
+                        * Set the key after having received joined-IBSS event
+                        * from the driver.
+                        */
+                       wpa_supplicant_set_wpa_none_key(wpa_s,
+                                                       wpa_s->current_ssid);
+               }
                wpa_supplicant_cancel_auth_timeout(wpa_s);
                wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
        } else if (!ft_completed) {
index 4c2e6ecf52452b1d16a8e7304c222ef68330a497..4b8d0d0f3f2ebf0792dae0ffc501a242a6baf650 100644 (file)
@@ -126,8 +126,8 @@ int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 }
 
 
-static int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
-                                          struct wpa_ssid *ssid)
+int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
+                                   struct wpa_ssid *ssid)
 {
        u8 key[32];
        size_t keylen;
index f96b245b721cd7af8e9f5fc27e142a3c713e9276..c53421de8f380eb84b8f778d45fad18fd525c246 100644 (file)
@@ -702,6 +702,8 @@ void wpa_supplicant_apply_vht_overrides(
        struct wpa_driver_associate_params *params);
 
 int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
+int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
+                                   struct wpa_ssid *ssid);
 
 int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);