path: root/wpa_supplicant/events.c
Commit message (Collapse)AuthorAgeFilesLines
* P2P: Remove WPA_DRIVER_FLAGS_P2P_MGMT optionJouni Malinen2013-12-291-65/+0
| | | | | | | | | | | | | The option of handling upper layer P2P management operations within the driver/firmware was originally planned to be used with wpa_supplicant, but this has not really happened and there is no clear sign of this being needed in the near term either. This functionality has not been completed and it is certainly not being kept up-to-date or tested. As such, it is best to remove it for now and if this or something similar is needed in the future, it can be brought back once a clear need for it has been demonstrated first. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Use shorter scan interval during pre-provisioning searchJouni Malinen2013-12-291-1/+1
| | | | | | | | Previously, the shorter scan interval was already in use for the connection following the provisioning step, but same optimization can also be used for the pre-provisioning scan. Signed-hostap: Jouni Malinen <j@w1.fi>
* Remove unnecessary EVENT_RX_ACTIONJouni Malinen2013-12-291-74/+89
| | | | | | | | | | | | This driver event was used separately for some Action frames, but all the driver wrappers converted to this from information that would have been enough to indicate an EVENT_RX_MGMT event. In addition, the received event was then converted back to a full IEEE 802.11 management frame for processing in most cases. This is unnecessary complexity, so get rid of the extra path and use EVENT_RX_MGMT for Action frames as well as other management frame subtypes. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Reduce scan wait time during WPS processingJouni Malinen2013-12-261-0/+10
| | | | | | | | Since the AP is expected to be available, there is no need to wait for the full five second wait between scans during WPS connection. This speeds up cases where the first scan misses the AP for some reason. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Do not use results from externally requested scan for network selectionJouni Malinen2013-12-261-0/+6
| | | | | | | | | | | It may not always be desirable to trigger reassociation or network change based on scan results from externally to wpa_supplicant trigger scan operations. Skip network selection and roaming determination if the received scan result is known to be triggered by something external to wpa_supplicant. The control interface SCAN command can be used to request wpa_supplicant to determine the best network. Signed-hostap: Jouni Malinen <j@w1.fi>
* Show timing information about scan requests in debug logJouni Malinen2013-12-261-1/+16
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* Optional scan id for ctrl_iface SCAN requestsJouni Malinen2013-12-261-2/+15
| | | | | | | | | | | | | | This allows users of wpa_supplicant control interface to figure out when their specific scan command has been started and completed. For example: CTRL-EVENT-SCAN-STARTED > scan freq=2412,2417 passive=1 use_id=1 3 CTRL-EVENT-SCAN-RESULTS CTRL-EVENT-SCAN-STARTED id=3 CTRL-EVENT-SCAN-RESULTS id=3 Signed-hostap: Jouni Malinen <j@w1.fi>
* Track whether scan was started by us or an external programJouni Malinen2013-12-261-1/+16
| | | | | | | This can be used to improve scan behavior in cases external programs request scans directly from the driver. Signed-hostap: Jouni Malinen <j@w1.fi>
* wpa_supplicant: Use monotonic time for last_scan checkJohannes Berg2013-12-241-3/+3
| | | | | | | | This just serves to check if there was a scan within the last 5 seconds, hence it should use monotonic time. While at it, also use os_reltime_expired(). Signed-hostap: Johannes Berg <johannes.berg@intel.com>
* wpa_supplicant: Use relative time for TKIP Michael MIC failuresJohannes Berg2013-12-241-5/+5
| | | | | | | | | The MMIC failure code should use monotonic time to check whether 60 seconds have elapsed or not. For type-safety, use struct os_reltime for the timestamp variable, and also convert to using os_reltime_expired(). Signed-hostap: Johannes Berg <johannes.berg@intel.com>
* wpa_supplicant: Use monotonic time for temp-disabled networksJohannes Berg2013-12-241-2/+2
| | | | | | | Temporarily disabled networks are disabled for a certain duration, so the code should use monotonic time. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
* wpa_supplicant: Use monotonic time for EAPOL RX workaroundJohannes Berg2013-12-241-3/+3
| | | | | | | The EAPOL RX workaround checks that the events are less than 100 ms apart, so only uses relative times and should use monotonic time. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
* nl80211/hostapd: Extend channel switch notify handlingJanusz Dziedzic2013-12-081-1/+4
| | | | | | | Adds support for VHT by parsing bandwidth and center_freq{1,2}. Signed-hostap: Michal Kazior <michal.kazior@tieto.com> Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>
* Use wpa_radio data for channel list updatesJouni Malinen2013-11-241-18/+4
| | | | | | This replaces the now unnecessary iteration of get_radio_name() calls. Signed-hostap: Jouni Malinen <j@w1.fi>
* Use wpa_radio data for scan result updatesJouni Malinen2013-11-241-18/+4
| | | | | | This replaces the now unnecessary iteration of get_radio_name() calls. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Handle INTERFACE_DISABLED event on a P2P GO interfaceIlan Peer2013-11-241-0/+14
| | | | | | | | | | | | | | | | An INTERFACE_DISABLED event received on an interface that is currently operating a P2P GO means that the group session ended. In such a case, if the interface was dynamically added remove it, and if not, remove all the network blocks that are temporary, assuming that if needed a new session will be started by an external entity. The use case was triggering rfkill (both SW and HW). This case popped up as part of a testing cycle, where after a toggle in the rfkill state, the result was that the interface was not deleted, but on the other hand the wpa_supplicant did not configure the kernel to re-start the AP functionality again. Signed-hostap: Ilan Peer <ilan.peer@intel.com>
* Restore scan_req if sta scan is rescheduled in the scan results eventLoic Poulain2013-11-241-0/+1
| | | | | | | | | | | | | | | | | | | On scan results event if a concurrent P2P scan was triggered previously, scan results processing is canceled, p2p_find executed, and a new sta scan is triggered (pending scan). However, this new sta scan does not restore the scan_req value of the previous scan (whose scan result has been canceled). If we are currently connected to an AP and use ap_scan=2, the new triggered scan will cause an associtation-without-scan in wpa_supplicant_scan: (ap_scan == 2 & scan_req != MANUAL_SCAN_REQ) => wpa_supplicant_assoc_try() causing an association error and a disconnection. This patch fixes this issue by restoring the previous scan_req value. Signed-off-by: Loic Poulain <loicx.poulain@intel.com>
* P2P: Short scan wait to speed up the group re-invocationRashmi Ramanna2013-11-201-2/+4
| | | | | | | | | The shorter 250 ms wait for the next scan request can be used also for the case of persistent group re-invocation instead of just formation of a new group. This speeds up the process and makes this more robust especially in cases where the GO is using MCC. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix QoS Map Configure frame useJouni Malinen2013-11-201-4/+7
| | | | | | | | | The QoS Map Set element was passed in full to the driver instead of just the payload of the element. This resulted in the updated QoS Map being rejected. Validate the element id/len and send only the payload to the driver. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* SCARD: Clean up SIM/USIM selectionMasashi Honma2013-11-171-2/+1
| | | | | | | | Commit eb324600295a570199a5e25eb64e60781a04fb74 left an unneeded sim_type argument to scard_init(). Remove that unnecessary argument to clean up the implementation. Signed-hostap: Masashi Honma <masashi.honma@gmail.com>
* Request new scan only for the original interfaceJithu Jance2013-11-171-5/+10
| | | | | | | | Request new scan only for the interface for which the original scan request and results has come. Otherwise while sharing scan results along with P2P interfaces, the new scan will be requested on P2P interfaces. Signed-hostap: Jithu Jance <jithu@broadcom.com>
* P2P: Allow GO P2P Device Address to be used for scan result matchingJouni Malinen2013-11-071-0/+26
| | | | | | | | This is a better way of matching P2P groups based on the unique P2P Device Address (e.g., from P2P Group ID) and SSID pair instead of using the not necessarily unique P2P Interface Address. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Update regulatory change to all virtual interface for the phyVinay Krishna Eranna2013-10-291-10/+47
| | | | | | | | | | | | | | | | | | wpas_p2p_setup_channels function uses the per interface information (wpa_s->hw.modes) for setting up the available channel list for P2P operation, but if a separate P2P interface is used (e.g., p2p0 on Android), the wpa_s instance for that interface may not get an updated channel list. This can result in some operations, like "P2P_SET disallow_freq", using old channel list information (e.g., world roaming information with passive-scan/no-ibss flags) which was initialized during the start-up. This could result in P2P functionality using conflicting or obsolete channel information. To resolve this issue, update channel list information on regulatory change events to all of the virtual interfaces sharing the same phy for which the event is received. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* EAP peer: Add framework for external SIM/USIM processingJouni Malinen2013-10-201-1/+2
| | | | | | | | | | | | | | The new configuration parameter external_sim=<0/1> can now be used to configure wpa_supplicant to use external SIM/USIM processing (e.g., GSM authentication for EAP-SIM or UMTS authentication for EAP-AKA). The requests and responses for such operations are sent over the ctrl_iface CTRL-REQ-SIM and CTRL-RSP-SIM commands similarly to the existing password query mechanism. Changes to the EAP methods to use this new mechanism will be added in separate commits. Signed-hostap: Jouni Malinen <j@w1.fi>
* Interworking: Add support for QoS Mapping functionality for the STAJouni Malinen2013-10-181-0/+54
| | | | | | | | | | | Indicate support for QoS Mapping and configure driver to update the QoS Map if QoS Map Set elements is received from the AP either in (Re)Association Response or QoS Map Configure frame. This commit adds support for receiving the frames with nl80211 drivers, but the actual QoS Map configuration command is still missing. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Do not allow P2P client connection without P2P IE from GOJouni Malinen2013-10-141-0/+7
| | | | | | | | | | | P2P-GROUP-STARTED event depends on having enough information about the group available. To avoid incomplete information from being delivered to upper layers, do not accept scan results without P2P IE (e.g., from a non-P2P scan) for P2P client association process. This can be of use for some join-a-group cases where non-P2P scans have generated the BSS entry for the GO. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Show p2p flag in debug info for scan resultsJouni Malinen2013-10-141-2/+5
| | | | | | | This makes it easier to confirm that P2P capabilities for a GO has been discovered properly. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* TDLS: Clean up wpa_tdls_teardown_link() usesSunil Dutt2013-09-301-2/+6
| | | | | | | | Making this function be used only for external setup case simplifies the implementation and makes core wpa_supplicant calls in ctrl_iface.c and events.c consistent. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Add event messages for possible PSK failures on P2P groupsJouni Malinen2013-09-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | It is possible for the GO of a persistent group to change the PSK or remove a client when per-client PSKs are used and this can happen without the SSID changing (i.e., the group is still valid, but just not for a specific client). If the client side of such persistent group ends up trying to use an invalidated persistent group information, the connection will fail in 4-way handshake. A new WPS provisioning step is needed to recover from this. Detect this type of case based on two 4-way handshake failures when acting as a P2P client in a persistent group. A new "P2P-PERSISTENT-PSK-FAIL id=<persistent group id>" event is used to indicate when this happens. This makes it easier for upper layers to remove the persistent group information with "REMOVE_NETWORK <persistent group id>" if desired (e.g., based on user confirmation). In addition to indicating the error cases for persistent groups, all this type of PSK failures end up in the client removing the group with the new reason=PSK_FAILURE information in the P2P-GROUP-REMOVED event. Signed-hostap: Jouni Malinen <j@w1.fi>
* Fix switching from EAP-SIM to EAP-AKA/AKA'Masashi Honma2013-08-311-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switching EAP method from EAP-SIM to EAP-AKA fails. wpa_cli commands are below. ------------------ sudo wpa_cli add_network sudo wpa_cli set_network 0 ssid '"eap-sim"' sudo wpa_cli set_network 0 key_mgmt WPA-EAP sudo wpa_cli set_network 0 eap SIM sudo wpa_cli set_network 0 pin '"1234"' sudo wpa_cli set_network 0 pcsc '""' sudo wpa_cli select_network 0 sudo wpa_cli disable_network 0 sudo wpa_cli disconnect sudo wpa_cli remove_network 0 sudo wpa_cli add_network sudo wpa_cli set_network 0 ssid '"eap-sim"' sudo wpa_cli set_network 0 key_mgmt WPA-EAP sudo wpa_cli set_network 0 eap AKA sudo wpa_cli set_network 0 pin '"1234"' sudo wpa_cli set_network 0 pcsc '""' sudo wpa_cli select_network 0 ------------------ Then EAP-AKA connection resulted in fail. wpa_supplicant log is below. ------------------ wlan0: CTRL-EVENT-EAP-METHOD EAP vendor 0 method 23 (AKA) selected SCARD: Non-USIM card - cannot do UMTS auth EAP-AKA: UMTS authentication failed (AUTN) wlan0: CTRL-EVENT-EAP-FAILURE EAP authentication failed ------------------ This occurs because on the first EAP-SIM authentication, the SIM/USIM card in the device was recognized as SIM card even if it is USIM card. So this patch changes it to recognize as USIM card even if EAP-SIM authentication was required. I have tested these switching cases. EAP-SIM -> EAP-AKA EAP-SIM -> EAP-AKA' EAP-AKA -> EAP-SIM EAP-AKA -> EAP-AKA' EAP-AKA' -> EAP-SIM EAP-AKA' -> EAP-AKA Signed-hostap: Masashi Honma <masashi.honma@gmail.com>
* P2P: Immediate group removal in GC in case of deauthenticationSreenath Sharma2013-08-311-1/+1
| | | | | | | | | | | | | | Right now in case of deauthentication from GO, immediate group removal will happen in GC only if the deauthentication packet has a valid IE. However, the IE in deauthentication packet is mandated only for managed P2P group. So in normal P2P group the group removal is delayed and will happen later only in group idle timeout. This fixes a regression from commit d7df0fa727a2a79d7b22df6c68961220349ab2e3 that changed the previous check for data->deauth_info != NULL to data->deauth_info->ie != NULL. Signed-hostap: Sreenath Sharma <sreenats@broadcom.com>
* Clear EAPOL supplicant configuration info on current_ssid changesJouni Malinen2013-08-251-0/+1
| | | | | | | | | | | | There were some code paths that allowed obsolete configuration data pointer to be maintained within EAPOL supplicant in case a network was removed while not connection to it (i.e., wpa_s->current_ssid not pointing to the network that was removed). This could result in use of freed memory, e.g., from eap_sm_notify_ctrl_attached() when a new control interface connected prior to the EAPOL supplicant configuration pointer got updated. Signed-hostap: Jouni Malinen <j@w1.fi>
* Change WEP network selection to reject WPA/WPA2 APsJouni Malinen2013-08-231-7/+24
| | | | | | | | | | | | | | | | Previously, wpa_supplicant behavior in WEP configuration was to try to mimic a device that is not aware of WPA/WPA2 and as such, it tried to connect to a WPA/WPA2 AP with the assumption that the AP could be providing support for both WEP and WPA/WPA2 stations in the same BSS. Such APs could have been used during transition from WEP to more secure options, but that type of deployment have not been used in large number and are not really of much use anymore taken into account that more or less all new devices support WPA/WPA2. That combined with the preference to deprecate WEP justifies removing this use case and making WEP networking matching more strict by using the knowledge of AP advertising WPA/WPA2 as an indication of WEP not being supported. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Clean up wpa_supplicant_event() with deauth/disassoc helper functionsJouni Malinen2013-07-211-104/+136
| | | | | | | wpa_supplicant_event() has grown overly large, so it is useful to split it into smaller pieces. Signed-hostap: Jouni Malinen <j@w1.fi>
* Remove unnecessary nested ifdef CONFIG_APJouni Malinen2013-07-211-2/+0
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* IBSS RSN: Add peer restart detectionAntonio Quartulli2013-07-211-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | To better support the IBSS/RSN mechanism, wpa_supplicant has to be able to detect a possible peer reboot and in this case it should start a new EAPOL handshake. To perform such reboot detection wpa_supplicant has to perform an Open Authentication by sending an Authentication frame and then replying to it. IF an Authentication frame is received when the key have already been exchanged, wpa_supplicant understands that the peer has rebooted and can reset its state machine. Whenever a new peer is added to the IBSS wpa_supplicant will start the Open Authentication and only after having accomplished it will start the key exchange. If the driver does not support Authentication frame exchange initiated from user space, this step is skipped to maintain previous behavior (just go through EAPOL-Key frame processing). The Open Authentication was partly supported by the Linux kernel but now wpa_supplicant can register for Authentication frames, handle it in userspace and so avoid any possible race condition. Signed-hostap: Nicolas Cavallari <cavallar@lri.fr> Signed-hostap: Antonio Quartulli <antonio@open-mesh.com>
* wpa_supplicant: Add support for VHT BSS membership selectorMichal Kazior2013-07-201-0/+30
| | | | | | | | | | | This allows wpa_supplicant to associate to an AP that has VHT BSS membership selector set to indicate VHT support is required for the BSS. Without the patch it was impossible to connect to, e.g., hostapd-based AP that has require_vht=1. wpa_supplicant was complaining with: hardware does not support required rate 63.0 Mbps Signed-hostap: Michal Kazior <michal.kazior@tieto.com>
* Remove compiler warnings with CONFIG_NO_SCAN_PROCESSINGJouni Malinen2013-06-071-0/+6
| | | | Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix already-associated detection with driver-based BSS selectionJouni Malinen2013-05-221-10/+18
| | | | | | | | | | wpa_s->pending_bssid is all zeros during connection attempt when driver-based BSS selection is used. Take this into account when determining whether new scan results should trigger a connection based on wpa_s->current_ssid, i.e., a connection attempt with the selected network instead of selected BSS. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Do not try auto connect mechanism in disconnected stateJouni Malinen2013-05-121-2/+3
| | | | | | | | This cleans up debug log by not requesting the auto connect on dissassociation event if we are already in disconnected state and would not try to connect anyway. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Try to set WPA-None key after IBSS-joined eventJouni Malinen2013-05-071-0/+10
| | | | | | | | 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>
* Use cached driver capabilities instead of new fetch for each operationJouni Malinen2013-05-071-3/+2
| | | | | | | There is no need to repeat the driver capability fetch for each operation since we already cache driver flags in wpa_s->drv_flags. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* FT: Reset FT flag upon STA deauthenticationDeepthi Gowri2013-04-261-0/+1
| | | | | | | | Reset ft_completed if STA receives deauthentication between FT reassoc success and the subsequent initial mobility authentication and association. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* RSN: Update preauth scan results only based on new scan resultsJouni Malinen2013-04-231-7/+12
| | | | | | | | | The fast-connect optimization to skip a new scan did not update how the RSN preauthentication callback is used. There is no point in trying to add preauthentication candidates from cases where scan was skipped, so skip this call, too, in such cases. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Skip rescanning after provisioning if AP was configuredMasashi Honma2013-03-311-3/+2
| | | | | | | | | If WPS provisioning step is completed with an AP that is in WPS configured state, we can skip a second scan after the provisioning step since the AP is unlikely to change its configuration in such a case. This can speed up WPS connection a bit by removing an unneeded scan. Signed-hostap: Masashi Honma <masashi.honma@gmail.com>
* Use special scan result processing steps only on requesting interfaceJouni Malinen2013-03-181-5/+8
| | | | | | | | | | Scan result events are shared between all virtual interfaces sharing the same radio. However, some of the steps are not really appropriate on virtual interfaces that did not issue the scan request. Fix this by making these steps conditional on the scan results being processed on the interface that requested them. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Use common function for re-starting P2P scan after station scanJouni Malinen2013-03-181-12/+3
| | | | | | | | Make the implementation more consistent and cleaner by using a single function for addressing all the cases where completion of a station mode scan operation allows a P2P operation (search) to be re-started. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix compiler warning when CONFIG_IEEE80211R is not includedJouni Malinen2013-03-131-0/+2
| | | | | | | | Commit 6a1ce39599c857e6e612d8dd81e892ec5ca36c7c moved the bssid variable declaration to be outside CONFIG_IEEE80211R block and triggered a compiler warning about unused variable. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* FT: Add support for IEEE 802.11r with driver-based SMEDeepthi Gowri2013-03-121-1/+18
| | | | | | | | | | Add NL80211_CMD_UPDATE_FT_IES to support update of FT IEs to the WLAN driver. Add NL80211_CMD_FT_EVENT to send FT event from the WLAN driver. This will carry the target AP's MAC address along with the relevant Information Elements. This event is used to report received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE). Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
* Add 'SCAN TYPE=ONLY' functionalityDmitry Shmidt2013-02-071-1/+2
| | | | | | | | Usual manual scan request may cause reassociation due to several reasons. New command is intended to perform pure scan without taking any automatic action based on the results. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>