aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_new_handlers.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove CONFIG_IEEE80211W build parameterJouni Malinen2019-09-081-8/+0
| | | | | | | | | Hardcode this to be defined and remove the separate build options for PMF since this functionality is needed with large number of newer protocol extensions and is also something that should be enabled in all WPA2/WPA3 networks. Signed-off-by: Jouni Malinen <j@w1.fi>
* dbus: Document more possible BSS/RSA/KeyMgmt valuesLubomir Rintel2019-01-231-1/+6
| | | | | | | | | | This is probably not ideal, since it would be better if it ended up being autogenerated somehow, but at least it's somewhat of an improvement. Also added a comment that encourages keeping the docs in sync. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
* dbus: Expose support of SAE key management in BSS propertiesLubomir Rintel2019-01-221-1/+7
| | | | | | This is going to be useful for NetworkManager and likely others. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
* dbus: Fix build without CONFIG_WNM=yJouni Malinen2019-01-051-0/+4
| | | | | | | | wpa_s->bss_tm_status is within #ifdef CONFIG_WNM, so need to access it through matching condition. Fixes: 80d06d0ca9f3 ("dbus: Export BSS Transition Management status") Signed-off-by: Jouni Malinen <j@w1.fi>
* dbus: Expose authentication status to D-BusAlex Khouderchah2019-01-021-0/+21
| | | | | | | | | | | wpa_supplicant currently logs CTRL-EVENT-AUTH-FAILED errors when authentication fails, but doesn't expose any property to the D-Bus interface related to this. This change adds the "AuthStatusCode" property to the interface, which contains the IEEE 802.11 status code of the last authentication. Signed-off-by: Alex Khouderchah <akhouderchah@chromium.org>
* dbus: Export BSS Transition Management statusMatthew Wang2019-01-021-0/+22
| | | | | | | | Add new Interface properties "BSSTMStatus", which carries the status of the most recent BSS Transition Management request. This property will be logged in UMA to measure 802.11v success. Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
* dbus: Export roam time, roam complete, and session lengthMatthew Wang2019-01-021-0/+65
| | | | | | | | | | | Add new Interface properties "RoamTime", "RoamComplete", and "SessionLength". "RoamTime" carries the roam time of the most recent roam in milliseconds. "RoamComplete" carries True or False corresponding to the success status of the most recent roam. "SessionLength" carries the number of milliseconds corresponding to how long the connection to the last AP was before a roam or disconnect happened. Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
* wpa_supplicant: Fix build with !CONFIG_AP and CONFIG_CTRL_IFACE_DBUS_NEWMichal Privoznik2018-12-311-1/+32
| | | | | | | | | If the CONFIG_CTRL_IFACE_DBUS_NEW is enabled but CONFIG_AP is disabled the build fails. This is because dbus getters try to access ap_iface member of wpa_supplicant struct which is defined if and only if CONFIG_AP is enabled. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* dbus: Expose connected stations on D-BusAndrej Shadura2018-12-231-0/+287
| | | | | | | | | | | | | | | | Make it possible to list connected stations in AP mode over D-Bus, along with some of their properties: rx/tx packets, bytes, capabilities, etc. Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> Rebased by Julian Andres Klode <juliank@ubuntu.com> and updated to use the new getter API. Further modified by Andrej Shadura to not error out when not in AP mode and to send separate StationAdded/StationRemoved signals instead of changing signatures of existing StaAuthorized/StaDeauthorized signals. Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
* dbus: Expose availability of SHA384 on D-BusLubomir Rintel2018-11-241-2/+5
| | | | | | This lets us know whether we can attempt to use FT-EAP-SHA384. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
* dbus: Expose availability of FT on D-BusLubomir Rintel2018-11-241-2/+5
| | | | | | | This lets us know whether we can attempt to use FT-PSK, FT-EAP, FT-EAP-SHA384, FT-FILS-SHA256 or FT-FILS-SHA384. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
* Revert "D-Bus: Implement Pmf property"Lubomir Rintel2018-11-241-55/+0
| | | | | | | | | | | | | | | | | This reverts commit adf8f45f8af27a9ac9429ecde81776b19b6f9224. It is basically all wrong. The Pmf property did exist, with a signature of "s" as documented in doc/dbus.doxygen. It was synthesized from global_fields[]. The patch added a duplicate one, with a signature of "u", in violation of D-Bus specification and to bemusement of tools that are careful enough: $ busctl introspect fi.w1.wpa_supplicant1 /fi/w1/wpa_supplicant1/Interfaces/666 Duplicate property Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
* dbus: Add FILS to global capabilitiesMasashi Honma2018-04-021-1/+20
| | | | | | | If any of the interfaces supports FILS (and similarly for FILS-SK-PFS), include the "fils" (and "fils_sk_pfs") capability in D-Bus information. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* dbus: Add mesh to global capabilitiesSaurav Babu2018-04-011-1/+4
| | | | Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
* dbus: Add FILS key mgmt values into BSS security propertiesMasashi Honma2017-12-161-1/+11
| | | | Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* dbus: Add new interface property to get mesh groupSaurav Babu2017-09-091-0/+33
| | | | Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
* dbus: Add new interface property to get connected mesh peersSaurav Babu2017-09-091-0/+68
| | | | Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
* dbus: Add method to disable channel switching with a TDLS peerNishant Chaprana2017-05-071-0/+31
| | | | | | | | This patch adds "TDLSCancelChannelSwitch" dbus method on "fi.w1.wpa_supplicant1.Interface" interface to disable channel switching with a TDLS peer. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* dbus: Add method to enable channel switching with a TDLS peerNishant Chaprana2017-05-071-0/+119
| | | | | | | | This patch adds "TDLSChannelSwitch" dbus method on "fi.w1.wpa_supplicant1.Interface" interface to enable channel switching with a TDLS peer. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* dbus: Add AbortScan method to abort ongoing scanSaurav Babu2017-05-071-0/+21
| | | | Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
* Use os_memdup()Johannes Berg2017-03-071-4/+2
| | | | | | | | | | | | | | | | | | | | | | This leads to cleaner code overall, and also reduces the size of the hostapd and wpa_supplicant binaries (in hwsim test build on x86_64) by about 2.5 and 3.5KiB respectively. The mechanical conversions all over the code were done with the following spatch: @@ expression SIZE, SRC; expression a; @@ -a = os_malloc(SIZE); +a = os_memdup(SRC, SIZE); <... if (!a) {...} ...> -os_memcpy(a, SRC, SIZE); Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* D-Bus: Notify mesh capability if driver supports itSaurav Babu2017-02-261-0/+5
| | | | Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
* dbus: Set mode to mesh in bss properties when mesh is supportedSaurav Babu2017-02-201-1/+5
| | | | Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
* D-Bus: Add GroupMgmt entry into the interface Capabilities dictJouni Malinen2017-01-141-0/+22
| | | | | | | | | This can be used to determine whether the driver supports PMF and if so, with which group management cipher suites. In addition, add the missing pairwise and group cipher suite values to the documentation while adding this new entry there as well. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Add pmf to global capabilitiesStijn Tintel2017-01-141-0/+3
| | | | | | | This indicates that the wpa_supplicant binary has been compiled with PMF support. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* D-Bus: Implement Pmf propertyStijn Tintel2017-01-141-0/+55
| | | | | | | The Pmf property is documented in doc/dbus.doxygen, but does not exist, so implement it. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* D-Bus: Fix BSS Mode getter for invalid DMG BSSJouni Malinen2017-01-081-0/+3
| | | | | | | Previous version could have used uninitialized char* when a DMG with invalid capabilities were added to BSS table from scan results. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Use a helper function to get possibly NULL stringsJouni Malinen2016-12-231-30/+33
| | | | | | | This type of check is used in quite a few getter functions, so add a helper function to take care of it. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Add ConfigFile parameter into the interface propertiesJose Blanquicet2016-08-291-0/+24
| | | | | | | | | This patch aims to expose the configuration file path as an interface property, like is done with the driver and the bridge name. Doing so, higher layer programs become responsible to recreate interfaces with the correct configuration file path when programs need to remove them. Signed-off-by: Jose Blanquicet <blanquicet@gmail.com>
* Move network add/remove operations to a common functionRoshan Pius2016-08-181-24/+5
| | | | | | | | | All the 3 control interfaces: socket based, dbus & binder needs to perform the same sequence of steps for network add/remove. So, move these to a common utility method in |wpa_supplicant.c| instead of duplicating the code everywhere. Signed-off-by: Roshan Pius <rpius@google.com>
* Move disconnect command handling to a common placeRoshan Pius2016-08-131-4/+1
| | | | | | | | Move out the disconnect command handling from |ctrl_iface.c| to |wpa_supplicant.c| so that it can be reused across the different control interfaces (socket, dbus & binder). Signed-off-by: Roshan Pius <rpius@google.com>
* D-Bus: Make the CurrentAuthMode property getter more robustJouni Malinen2016-06-241-1/+3
| | | | | | | | Now that mesh sets wpa_s->wpa_state = WPA_COMPLETED, it looks like this getter can get called with wpa_s->current_ssid = NULL. That could result in NULL pointer dereference, so need to protect that specific case. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Check driver capability for IBSS in Modes property of CapabilitiesSaurav Babu2016-05-131-2/+3
| | | | | | | Instead of hardcoding "ad-hoc" in the array of supported capabilities, add this only if the driver indicates support for IBSS. Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
* D-Bus: Add association response status code property for failure casesNaveen Singh2016-03-061-0/+21
| | | | | | | | | | (Re)Association Response frame with status code other than 0 is now notified over DBUS as a part of PropertiesChanged signal. This can be used by application in case AP is denying association with status code 17 (band steering) so that it does not interfere in the BSSID selection logic of wpa_supplicant. Signed-off-by: Naveen Singh <nasingh@google.com>
* D-Bus: Fix p2p interface capability messageJohn Ernberg2016-02-051-0/+1
| | | | | | | | If the config file for the interface says "p2p_disabled=1", don't report p2p capabilities on this interface. This helps programs like Connman to not enable p2p when it's been disabled in wpa_supplicant. Signed-off-by: John Ernberg <john.ernberg@actia.se>
* dbus: Add support for vendor specific elementsAvichal Agarwal2015-12-061-0/+144
| | | | | | | | | | | | | | | | | | The new methods are 1. VendorElemAdd "i" "ay" i=integer ay=array of bytes 2. VendorElemGet "i" i=integer (output array of bytes) 3. VendorElemRem "i" "ay" i=integer ay=array of bytes These provide functionality similar to the control interface commands VENDOR_ELEM_ADD, VENDOR_ELEM_GET, and VENDOR_ELEM_REMOVE. Signed-off-by: Avichal Agarwal <avichal.a@samsung.com> Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com> Signed-off-by: Kyeong-Chae Lim <kcya.lim@samsung.com> Signed-off-by: Mayank Haarit <mayank.h@samsung.com> Signed-off-by: Dilshad Ahmad <dilshad.a@samsung.com> [VendorElemGet to return array of bytes instead of string; cleanup] Signed-off-by: Jouni Malinen <j@w1.fi>
* dbus: Do not use pointer arithmetic with a void pointerSamuel Tan2015-11-151-1/+2
| | | | | | | This failed to compile on x86 gcc due to pointer arithmetic on a void pointer. Signed-off-by: Samuel Tan <samueltan@google.com>
* dbus: Add SaveConfig to update configuration filePurushottam Kushwaha2015-11-151-0/+29
| | | | | | | | This is similar to SAVE_CONFIG on control interface, which allow users to update the configuration file. Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com> Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
* dbus: Fix a copy-paste error in debug printPurushottam Kushwaha2015-11-151-1/+1
| | | | Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
* dbus: Expose interface globals via D-Bus propertiesDan Williams2015-10-281-0/+73
| | | | | | | All interface globals are now exposed as D-Bus properties of type string, and parsed via the normal interface global parsing functions. Signed-off-by: Dan Williams <dcbw@redhat.com>
* dbus: Pass property description to getters/settersDan Williams2015-10-281-133/+161
| | | | | | We'll use it later for global interface properties. Signed-off-by: Dan Williams <dcbw@redhat.com>
* D-Bus: Add a dbus handler for expected disconnectionNingyuan Wang2015-10-121-0/+21
| | | | | | | | | | | Add a global D-Bus handler ExpectDisconnect for setting wpa_s->own_disconnect_req flag. This flag will prevent wpa_supplicant from adding blacklists and requesting incomplete scan upon the incoming disconnection. This is mainly meant for a case where suspend/resume is used and some external component knows about that and can provide the information to wpa_supplicant before the disconnection happens. Signed-off-by: Ningyuan Wang <nywang@google.com>
* D-Bus: Set last_scan_req to MANUAL_SCAN_REQ on Scan() trigger pathsJouni Malinen2015-08-111-0/+2
| | | | | | | | | | | | | The D-Bus Scan() handler was setting wpa_s->scan_req = MANUAL_SCAN_REQ on the code path that used wpa_supplicant_req_scan(). However, it did not do anything similar for the cases where wpa_supplicant_trigger_scan() is called directly. This could result in unexpected wpa_s->last_scan_req value and incorrect behavior especially when using ap_scan=2 and running a scan while operating in AP mode. Fix this by explicitly setting wpa_s->last_scan_req = MANUAL_SCAN_REQ when using wpa_supplicant_trigger_scan() from the Scan() handler. Signed-off-by: Jouni Malinen <j@w1.fi>
* Do not check unsigned size is less than zeroJouni Malinen2015-06-231-1/+1
| | | | | | | The variables here are unsigned and as such, cannot have a negative value. Use == 0 instead of <= 0 to make this cleaner. Signed-off-by: Jouni Malinen <j@w1.fi>
* dbus: Add Reconnect command to D-Bus InterfaceMAYANK HAARIT2015-06-141-0/+24
| | | | | | | This has same behavior as the ctrl_iface RECONNECT command. Signed-off-by: Mayank Haarit <mayank.h@samsung.com> Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com>
* dbus: Stop ongoing scheduled scan when scan is requestedAvraham Stern2015-05-031-7/+25
| | | | Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* D-Bus: Fix operations when P2P management interface is usedJouni Malinen2015-04-291-20/+40
| | | | | | | | | | | | | | | | | | | Commit 21efc940f6e7f07b84b7e5c5867f3d81594c4fb0 ('wpa_supplicant: Do not register a P2P management interface on DBus') hides the special P2P management interface from D-Bus. However, it did not take into account the possibility of wpa_s->dbus_path and wpa_s->dbus_new_path being NULL in such cases on number of code paths within the D-Bus handlers. This could result in invalid arguments (NULL path) being provided to D-Bus functions (mainly, dbus_message_iter_append_basic) and NULL pointer dereference when iterating over all interfaces. Either of these could make wpa_supplicant process terminate. Fix this by explicitly checking that the interface-specific D-Bus path has been registered before using it anywhere with D-Bus handlers. In addition, find the correct wpa_s instance to fix P2P operations through D-Bus when the P2P Device interface is used. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Replace MAX_SSID_LEN with SSID_MAX_LENJouni Malinen2015-04-221-2/+2
| | | | | | | | This makes source code more consistent. The use within Android driver interface is left as-is to avoid changes in the old PNO interface definition. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* dbus: Fix WPS property of fi.w1.wpa_supplicant1.BSS interfaceFloris Bos2015-04-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | The dbus interface documentation says the following about the WPS property of the fi.w1.wpa_supplicant1.BSS interface: == WPS information of the BSS. Empty dictionary indicates no WPS support. Dictionary entries are: Type s "pbc", "pin", "" == However the implementation returns "type" => "" for BSSes that do not support WPS. Fix the implementation to match the documentation. Return empty dictionary if there is no WPS support. And "type" => "" if WPS is supported, but is not in progress right now. Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
* P2P: Fix interface deinit for failed group interface initializationJouni Malinen2015-03-011-1/+1
| | | | | | | | | | | wpa_supplicant_deinit_iface() ends up removing all P2P groups if the removed interface is the parent interface. This is correct behavior in general, but this resulted in issues in the new group interface initialization error path since wpa_s->parent was not assigned before hitting this check. Fix this by assigning wpa_s->parent as part of wpa_supplicant_add_iface(). Signed-off-by: Jouni Malinen <j@w1.fi>