diff options
author | Jouni Malinen <j@w1.fi> | 2010-04-07 10:31:06 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2010-04-07 10:31:06 +0300 |
commit | d9a27b04558ccbb5e5d45e10baa22db47e2b8e45 (patch) | |
tree | e2b8b1ac4cec73c79b35baa0c59f3c99a88cd988 | |
parent | 68532a9cebbb52177566a5ccfe989ad4b3ba670f (diff) | |
download | external_wpa_supplicant_8_ti-d9a27b04558ccbb5e5d45e10baa22db47e2b8e45.zip external_wpa_supplicant_8_ti-d9a27b04558ccbb5e5d45e10baa22db47e2b8e45.tar.gz external_wpa_supplicant_8_ti-d9a27b04558ccbb5e5d45e10baa22db47e2b8e45.tar.bz2 |
Fix SME to update WPA/RSN IE for rsn_supp module based on AssocReq
When using wpa_supplicant SME (i.e., using nl80211), the rsn_supp
module was not informed of the WPA/RSN IE that was used in
(Re)Association Request frame. This broke roaming between APs that
use different security policy (e.g., changing between WPA/TKIP and
WPA2/CCMP APs) or when using PMKSA caching.
-rw-r--r-- | wpa_supplicant/sme.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index f3bd3bb..f04295a 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -16,6 +16,7 @@ #include "common.h" #include "common/ieee802_11_defs.h" +#include "common/ieee802_11_common.h" #include "eapol_supp/eapol_supp_sm.h" #include "common/wpa_common.h" #include "rsn_supp/wpa.h" @@ -294,6 +295,7 @@ void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode, const u8 *bssid, u16 auth_type) { struct wpa_driver_associate_params params; + struct ieee802_11_elems elems; os_memset(¶ms, 0, sizeof(params)); params.bssid = bssid; @@ -321,6 +323,20 @@ void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode, wpa_supplicant_set_state(wpa_s, WPA_ASSOCIATING); + if (ieee802_11_parse_elems(params.wpa_ie, params.wpa_ie_len, &elems, 0) + < 0) { + wpa_printf(MSG_DEBUG, "SME: Could not parse own IEs?!"); + os_memset(&elems, 0, sizeof(elems)); + } + if (elems.rsn_ie) + wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, elems.rsn_ie - 2, + elems.rsn_ie_len + 2); + else if (elems.wpa_ie) + wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, elems.wpa_ie - 2, + elems.wpa_ie_len + 2); + else + wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0); + if (wpa_drv_associate(wpa_s, ¶ms) < 0) { wpa_msg(wpa_s, MSG_INFO, "Association request to the driver " "failed"); |