path: root/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
Commit message (Collapse)AuthorAgeFilesLines
* P2P: Add support for EDMG channelsAhmad Masri2019-12-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | This allows a P2P connection over P802.11ay EDMG channels to achieve the highest link speed that the standard allows for channel bonding (CB) up to CB4. Let each P2P peer add its EDMG channels to the Supported Channels IE advertised in P2P GO negotiation. Give EDMG channels priority when peers negotiate for operating channel. User may add 'edmg' parameter to p2p_connect, p2p_add_group, and p2p_invite commands to prefer an EDMG channel for the P2P link. User may also set p2p_go_edmg=1 in wpa_supplicant configuration file to prefer EDMG. When EDMG is used, P2P will try to find the highest channel bonding supported channel that matches the frequency parameter, if the devices do not support EDMG, the P2P connection will use a legacy (1-6) 60 GHz channel. Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
* D-Bus: Fix P2P NULL dereference after interface removalDavide Caratti2019-10-271-2/+67
| | | | | | | | | | | | | | When the P2P management interface is deleted, P2P is then disabled and global->p2p_init_wpa_s is set to NULL. After that, other interfaces can still trigger P2P functions (like wpas_p2p_find()) using D-Bus. This makes wpa_supplicant terminate with SIGSEGV, because it dereferences a NULL pointer. Fix this by adding proper checks, like it's done with wpa_cli. CC: Beniamino Galvani <bgalvani@redhat.com> CC: Benjamin Berg <benjamin@sipsolutions.net> Reported-by: Vladimir Benes <vbenes@redhat.com> Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
* D-Bus: Fix P2P DeleteService dict iterationJouni Malinen2019-02-041-35/+17
| | | | | | | | | The previous implementation assumed the first entry coming out from the dict is always service_type. That may not be the case, so properly iterate over all dict entries in one loop instead of assuming what the first entry is. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix a memory leak in DeleteService handlerJouni Malinen2019-02-041-1/+2
| | | | | | | If the service_type string entry is not included, the dict entry was not cleared. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix P2P Flush method to clear pending Action framesAmit Khatri2019-01-211-0/+1
| | | | | | | | If we call p2p_flush from ctrl_iface, before calling p2p_flush() it calls wpas_p2p_stop_find(). Add the same call to the matching D-Bus method to clear all pending operations. Signed-off-by: Amit Khatri <amit7861234@gmail.com>
* P2P: Add 802.11ax support for P2P GOPeng Xu2019-01-121-4/+5
| | | | | | | | An optional parameter "he" is added to p2p_connect, p2p_group_add, and p2p_invite to enable 11ax HE support. The new p2p_go_he=1 configuration parameter can be used to request this to be enabled by default. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* dbus: Add vendor specific information element in peer propertiesNishant Chaprana2019-01-021-0/+24
| | | | | | | | Make vendor specific information elements (VSIE) available in peer properties, so that VSIE of a specific peer can be retrieved using peer's object path. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* Check snprintf result to avoid compiler warningsJouni Malinen2018-12-241-1/+7
| | | | | | | | | These do not really get truncated in practice, but it looks like some newer compilers warn about the prints, so silence those by checking the result and do something a bit more useful if the output would actually get truncated. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Report error on starting P2P findVasyl Vavrychuk2018-02-031-2/+5
| | | | Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
* D-Bus: Use a helper function to get possibly NULL stringsJouni Malinen2016-12-231-8/+1
| | | | | | | 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 'freq' option to P2P Find method to specify starting channelAmit Purwar2016-12-191-1/+6
| | | | | | | | This allows user to start P2P Find/Scan on a particular frequency and then move to scanning social channels. This support is already present on control socket. Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
* D-Bus: Add getter and setter for P2P IP address config parametersNishant Chaprana2016-11-201-0/+61
| | | | | | | | | | This patch adds setter and getter for P2P IP address config parameters: 1. ip_addr_go 2. ip_addr_mask 3. ip_addr_start 4. ip_addr_end Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* dbus: Restrict DeviceName size to 32 characters in setterPurushottam Kushwaha2016-01-151-1/+2
| | | | | | | The maximum WPS Device Name length is 32 characters and that limit was already enforced for the control interface and configuration files. Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com>
* P2P: Provide group SSID, if specified, to P2P Client join stepJouni Malinen2015-12-301-1/+1
| | | | | | | | | At least one of the wpas_p2p_connect() callers (NFC join case) already had access to the Group SSID. Pass that information through wpas_p2p_connect() to wpas_p2p_join() so that the join operation can filter out incorrect groups more easily. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Add support for VHT 80+80 MHz and 160 MHzAhmad Kholaif2015-11-251-5/+6
| | | | | | | | | The new max_oper_chwidth and freq2 arguments to P2P_CONNECT, P2P_INVITE, and P2P_GROUP_ADD control interface commands can be used to request larger VHT operating channel bandwidth to be used than the previously used maximum 80 MHz. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* dbus: Pass property description to getters/settersDan Williams2015-10-281-88/+99
| | | | | | We'll use it later for global interface properties. Signed-off-by: Dan Williams <dcbw@redhat.com>
* dbus: Fix a typo in function commentMAYANK HAARIT2015-08-271-1/+1
| | | | | Signed-off-by: Mayank Haarit <mayank.h@samsung.com> Signed-off-by: Dilshad Ahmad <dilshad.a@samsung.com>
* P2P: Require fresh scan results for persistent group re-invocationJouni Malinen2015-08-211-1/+1
| | | | | | | | | | | | | | | | | | The P2P group is not yet operating when going through invitation exchange for re-invocation. Previously, an old cached scan result could be used to skip the scan immediately after the invitation exchange. While this may result in the fastest possible connection, it does have some issues with cases where the GO takes some time to start up. It would also be at least theoretically possible for some of the BSS parameters to be different, so having a fresh scan result from the new GO instance may be desired in any case. Add a mechanism to skip scan results that have been last updated before a specific point in time and as the first user for this mechanism, require chan results to be more recent than the invitation message exchange for the P2P Client role in persistent group re-invocation case. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* dbus: Add RemoveClient method to remove a client from local GOPurushottam Kushwaha2015-06-191-0/+58
| | | | | | | | | | | | This is equivalent to the P2P_REMOVE_CLIENT command on control interface. This can be used to remove the specified client [as object path or string format interface address] from all groups (operating and persistent) from the local GO. Argument(s): peer[object path] OR iface[string format MAC address] Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com> Signed-off-by: Jijo Jacob <jijo.jacob@samsung.com>
* P2P: Add ModelNumber and SerialNumber info into D-Bus peer interfaceAmit Khatri2015-06-101-0/+74
| | | | | Signed-off-by: Amit Khatri <amit.khatri@samsung.com> Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
* P2P: Add ModelName info into D-Bus peer interfaceAmit Khatri2015-06-101-0/+37
| | | | | Signed-off-by: Amit Khatri <amit.khatri@samsung.com> Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
* P2P: Add manufacturer info into D-Bus peer interfaceAmit Khatri2015-05-291-0/+37
| | | | | | | | | | Allow the Manufacturer information for a found P2P peer device to be fetched through the D-Bus interface similarly to p2p_peer <mac address> on ctrl interface. Signed-off-by: Amit Khatri <amit.khatri@samsung.com> Signed-off-by: Rahul Jain <rahul.jain@samsung.com> Signed-off-by: Ashutosh Kaushik <k.ashutosh@samsung.com>
* P2P: Add P2P Cancel method over D-Bus interfaceNishant Chaprana2015-05-291-0/+20
| | | | | | | This patch adds P2P Cancel method over fi.w1.wpa_supplicant1.Interface.P2PDevice dbus interface. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* P2P: Use p2p_init_wpa_s for P2P command redirection over D-BusIlan Peer2015-05-251-36/+18
| | | | | | | | | | | | | D-Bus used the p2p_dev member in struct wpa_supplicant to track the interface used for P2P Device operations. However, this is not needed as the interface used for P2P Device operations is stored in struct wpa_global->p2p_init_wpa_s. Replace all the redirections to wpa_s->p2p_dev with redirections to wpa_s->global->p2p_init_wpa_s and removed this member as it is no longer needed. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Fix D-Bus PresenceRequest to use group interfaceJouni Malinen2015-05-251-3/+0
| | | | | | | | This command is for a specific P2P group, not for the P2P Device instance and as such, wpa_s pointer must not be replaced with the interface that is used for P2P Device management. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* D-Bus: Fix operations when P2P management interface is usedJouni Malinen2015-04-291-10/+36
| | | | | | | | | | | | | | | | | | | 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>
* P2P: Allow a specific channel to be specified in P2P_FINDDaisuke Niwa2015-02-281-1/+1
| | | | | | | | | The optional freq=<MHz> can now be used with the P2P_FIND command to specify a single channel to scan during the first round of P2P search. For example, this can be used to replace the full initial scan with a single channel scan of a known operation channel. Signed-off-by: Daichi Ueura <daichi.ueura@sonymobile.com>
* P2PS: Process P2PS provisioning commandsKrishna Vamsi2015-02-021-1/+1
| | | | | | | | This extends wpas_p2p_prov_disc() implementation to accept P2PS parameters. None of the callers are yet using this functionality; the following commit introduces a user. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2PS: Add option to specify seek strings into P2P_FINDBrian Gix2015-02-021-1/+1
| | | | | | | P2PS seek strings can now be specified in the P2P_FIND control interface command with one or more optional "seek=<str>" parameters. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* D-Bus: Make P2P Group Passphrase property getter available for P2P ClientJouni Malinen2015-01-021-8/+7
| | | | | | | | | There is no need to limit this property based on the role of the device in the group, so return the passphrase if it is available. It will be available in GO role and it may be available in P2P Client role based on whether the peer GO provided it during the WPS provisioning step. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix P2P Group PSK property getterJouni Malinen2015-01-021-8/+8
| | | | | | | | | | | This was returning a byte array of the pointer to the PSK, not the actual PSK, due to incorrect use of wpas_dbus_simple_array_property_getter(). In addition, there is no need to limit this property based on the role of the device in the group, so return the PSK if it is available (which it will be for both GO and P2P Client roles). Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Simplify out-of-memory reportingJouni Malinen2015-01-021-6/+3
| | | | | | | | | There is no need to have separate wpa_printf() and different error message strings for the unlikely out-of-error messages. Use a helper function, wpas_dbus_error_no_memory(), to get consistent behavior with a one-line call. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Coding style cleanupJouni Malinen2015-01-021-138/+139
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Simplify message building error pathsJouni Malinen2015-01-021-107/+43
| | | | | | | | | There is no need to have multiple separate return statements for error cases in a sequence of operations. In addition, there is not much point in "converting" boolean return values with "if (!res) return FALSE; return TRUE;" style constructions. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix GroupAdd, Invite, RemovePersistentGroup path validationJouni Malinen2015-01-021-3/+4
| | | | | | | | net_id_str can be NULL and that must be checked for to avoid NULL pointer dereference if an invalid persistent_group_object path is used with these methods. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix error message for Listen() failureJouni Malinen2015-01-021-3/+5
| | | | | | | DBUS_ERROR_NO_MEMORY does not look like the best option for the failure reason in case wpas_p2p_listen() fails. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Clean up wpas_dbus_new_decompose_object_path()Jouni Malinen2015-01-021-12/+15
| | | | | | | | | | | | | | | | | | None of the new D-Bus interface cases use the bssid_part in decompose_object_path (while the old interface ones do). As such, this is dead code and can be removed. In addition, the P2P addition here was pretty ugly extension. Replace these with a cleaner way of passing the separating string (e.g., "Networks") from the caller and returning the requested item. In addition, there is no need to allocate the returned item separately, so use a single allocation and a pointer to that allocated memory. This will make it easier for callers to have to free only a single allocation. This is also fixing a memory leak in P2P invitation persistent group case where the caller had missed the need to free the returned values. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Clean up parse_peer_object_path() usesJouni Malinen2015-01-021-14/+9
| | | | | | | | This helper function does not modify peer_path, so mark it const. In addition, there is no point in callers to check separately whether peer_path is NULL since that is taken care of by this helper function. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Remove useless wpa_s->conf checksJouni Malinen2015-01-021-9/+0
| | | | | | | | This cannot be NULL when an interface is in use. There is not much point in couple of functions checking this while large number of other places do not. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix ServiceDiscoveryResponse to accept int32 dialog_tokenJouni Malinen2014-12-311-1/+2
| | | | | | | | | | The ServiceDiscoveryRequest signal uses int32 for encoding dialog_token for some reason (even though this is a u8 field). ServiceDiscoveryResponse is supposed to accept the values from the signal as-is, so extend that to accept int32 in addition to the previously used uint32. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix memory leaks on AddService/DeleteService error pathsJouni Malinen2014-12-301-6/+10
| | | | | | | The query and service parameters need to be freed on all paths to avoid memory leaks in error cases. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix .Group Set(WPSVendorExtensions) formatJouni Malinen2014-12-301-1/+77
| | | | | | | | | | | | The earlier implementation seemed to require a strange extra encapsulation with a dictionary for setting the WPSVendorExtensions property while this was defined to have aay signature and the get operation did indeed return and array of array of bytes without that dictionary. Fix this to accept aay format for the setter as well. Keep support for the old dictionary encapsulation format for backwards compatibility. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix memory leak on P2P GO WPSVendorExtensionsJouni Malinen2014-12-301-0/+1
| | | | | | | | It was possible to add WPS vendor extensions through the D-Bus WPSVendorExtensions setter, but these extensions were not freed when the P2P GO was stopped or when replacing previously configured extensions. Signed-off-by: Jouni Malinen <j@w1.fi>
* dbus: Redirect P2P request to the managment device if presentTomasz Bursztyka2014-10-271-3/+47
| | | | | | | In case of a P2P management device being present, it will be up to that interface to handle P2P requests. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
* dbus: Do a full P2P find as it is in ctrl_iface.cTomasz Bursztyka2014-10-231-1/+1
| | | | | | So the behavior is consistent whatever interface is in use. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
* dbus: Add a global property to set or unset WFD IEsTomasz Bursztyka2014-09-281-0/+75
| | | | | | | This permits to set or unset the WiFi Display subelements from DBus, by providing the full WFD specific IE frame. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
* dbus: Close dbus dict just after appending dataEduardo Abinader2014-08-101-4/+4
| | | | | | | | Before fixing this issue, calling wpas_dbus_getter_p2p_device_config was causing early termination of dbus connection, due to writing values to an already closed dict. Signed-off-by: Eduardo Abinader <eduardo.abinader@openbossa.org>
* dbus: Clean up array-array-type property getterJouni Malinen2014-06-291-4/+6
| | | | | | | | | | The previously used design was a bit too complex for static analyzers (e.g., CID 68131, CID 68133) to understand which resulted in false warnings about uninitialized memory. Avoid this by explicitly initializing the pointer array to NULL and also skipping any invalid NULL entry in the helper function. Signed-off-by: Jouni Malinen <j@w1.fi>
* dbus: Remove GroupMember object type and use Peer insteadTomasz Bursztyka2014-06-291-2/+2
| | | | | | | GroupMember is unusable in itself and all the necessary informations are stored in Peer objects, thus replace the use of GroupMember by Peer. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
* dbus: Add a Groups property to a Peer object on which it belongsTomasz Bursztyka2014-06-291-0/+100
| | | | | | | If only the Peer is part of one or more group, this property will tell those via listing their object paths. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>