SAE: Clear keys from memory on disassociation
[mech_eap.git] / wpa_supplicant / events.c
index e078c70..7fe92ea 100644 (file)
@@ -202,20 +202,12 @@ void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s)
        bssid_changed = !is_zero_ether_addr(wpa_s->bssid);
        os_memset(wpa_s->bssid, 0, ETH_ALEN);
        os_memset(wpa_s->pending_bssid, 0, ETH_ALEN);
-#ifdef CONFIG_SME
-       wpa_s->sme.prev_bssid_set = 0;
-#endif /* CONFIG_SME */
+       sme_clear_on_disassoc(wpa_s);
 #ifdef CONFIG_P2P
        os_memset(wpa_s->go_dev_addr, 0, ETH_ALEN);
 #endif /* CONFIG_P2P */
        wpa_s->current_bss = NULL;
        wpa_s->assoc_freq = 0;
-#ifdef CONFIG_IEEE80211R
-#ifdef CONFIG_SME
-       if (wpa_s->sme.ft_ies)
-               sme_update_ft_ies(wpa_s, NULL, NULL, 0);
-#endif /* CONFIG_SME */
-#endif /* CONFIG_IEEE80211R */
 
        if (bssid_changed)
                wpas_notify_bssid_changed(wpa_s);
@@ -228,6 +220,8 @@ void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s)
        wpa_s->current_ssid = NULL;
        eapol_sm_notify_config(wpa_s->eapol, NULL, NULL);
        wpa_s->key_mgmt = 0;
+
+       wpas_rrm_reset(wpa_s);
 }
 
 
@@ -1314,6 +1308,9 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
                return 0;
        }
 
+       if (wnm_scan_process(wpa_s, 1) > 0)
+               goto scan_work_done;
+
        if (sme_proc_obss_scan(wpa_s) > 0)
                goto scan_work_done;
 
@@ -2780,7 +2777,8 @@ static void wpa_supplicant_update_channel_list(
 
 
 static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
-                                     const u8 *frame, size_t len, int freq)
+                                     const u8 *frame, size_t len, int freq,
+                                     int rssi)
 {
        const struct ieee80211_mgmt *mgmt;
        const u8 *payload;
@@ -2799,6 +2797,11 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
                " Category=%u DataLen=%d freq=%d MHz",
                MAC2STR(mgmt->sa), category, (int) plen, freq);
 
+       if (category == WLAN_ACTION_WMM) {
+               wmm_ac_rx_action(wpa_s, mgmt->da, mgmt->sa, payload, plen);
+               return;
+       }
+
 #ifdef CONFIG_IEEE80211R
        if (category == WLAN_ACTION_FT) {
                ft_rx_action(wpa_s, payload, plen);
@@ -2856,6 +2859,20 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
        }
 #endif /* CONFIG_INTERWORKING */
 
+       if (category == WLAN_ACTION_RADIO_MEASUREMENT &&
+           payload[0] == WLAN_RRM_NEIGHBOR_REPORT_RESPONSE) {
+               wpas_rrm_process_neighbor_rep(wpa_s, payload + 1, plen - 1);
+               return;
+       }
+
+       if (category == WLAN_ACTION_RADIO_MEASUREMENT &&
+           payload[0] == WLAN_RRM_LINK_MEASUREMENT_REQUEST) {
+               wpas_rrm_handle_link_measurement_request(wpa_s, mgmt->sa,
+                                                        payload + 1, plen - 1,
+                                                        rssi);
+               return;
+       }
+
        wpas_p2p_rx_action(wpa_s, mgmt->da, mgmt->sa, mgmt->bssid,
                           category, payload, plen, freq);
        if (wpa_s->ifmsh)
@@ -3085,10 +3102,24 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                }
                break;
        case EVENT_AUTH_TIMED_OUT:
+               /* It is possible to get this event from earlier connection */
+               if (wpa_s->current_ssid &&
+                   wpa_s->current_ssid->mode == WPAS_MODE_MESH) {
+                       wpa_dbg(wpa_s, MSG_DEBUG,
+                               "Ignore AUTH_TIMED_OUT in mesh configuration");
+                       break;
+               }
                if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)
                        sme_event_auth_timed_out(wpa_s, data);
                break;
        case EVENT_ASSOC_TIMED_OUT:
+               /* It is possible to get this event from earlier connection */
+               if (wpa_s->current_ssid &&
+                   wpa_s->current_ssid->mode == WPAS_MODE_MESH) {
+                       wpa_dbg(wpa_s, MSG_DEBUG,
+                               "Ignore ASSOC_TIMED_OUT in mesh configuration");
+                       break;
+               }
                if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)
                        sme_event_assoc_timed_out(wpa_s, data);
                break;
@@ -3242,7 +3273,8 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                                wpas_event_rx_mgmt_action(
                                        wpa_s, data->rx_mgmt.frame,
                                        data->rx_mgmt.frame_len,
-                                       data->rx_mgmt.freq);
+                                       data->rx_mgmt.freq,
+                                       data->rx_mgmt.ssi_signal);
                                break;
                        }