path: root/wpa_supplicant/wpa_priv.c
Commit message (Collapse)AuthorAgeFilesLines
* privsep: Add key_flag to set_key()Alexander Wetzel2020-03-011-0/+1
| | | | | | Pass through the new key_flag to wpa_priv. Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
* Fix VERSION_STR printf() calls in case the postfix strings include %Didier Raboud2020-02-171-2/+3
| | | | | | | Do not use VERSION_STR directly as the format string to printf() since it is possible for that string to contain '%'. Signed-off-by: Didier Raboud <odyx@debian.org>
* driver: Move set_key() parameters into a structJouni Malinen2020-01-081-8/+13
| | | | | | | | This makes it more convenient to add, remove, and modify the parameters without always having to update every single driver_*.c implementation of this callback function. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* wpa_supplicant: Fix arithmetic on void pointerJesus Fernandez Manzano2019-10-251-2/+3
| | | | | | | | | | When using void pointers in calculations, the behavior is undefined. Arithmetic operations on 'void *' is a GNU C extension, which defines the 'sizeof(void)' to be 1. This change improves portability of the code. Signed-off-by: Jesus Fernandez Manzano <jesus.manzano@galgus.net>
* Remove all PeerKey functionalityJouni Malinen2017-10-151-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | This was originally added to allow the IEEE 802.11 protocol to be tested, but there are no known fully functional implementations based on this nor any known deployments of PeerKey functionality. Furthermore, PeerKey design in the IEEE Std 802.11-2016 standard has already been marked as obsolete for DLS and it is being considered for complete removal in REVmd. This implementation did not really work, so it could not have been used in practice. For example, key configuration was using incorrect algorithm values (WPA_CIPHER_* instead of WPA_ALG_*) which resulted in mapping to an invalid WPA_ALG_* value for the actual driver operation. As such, the derived key could not have been successfully set for the link. Since there are bugs in this implementation and there does not seem to be any future for the PeerKey design with DLS (TDLS being the future for DLS), the best approach is to simply delete all this code to simplify the EAPOL-Key handling design and to get rid of any potential issues if these code paths were accidentially reachable. Signed-off-by: Jouni Malinen <j@w1.fi>
* Update copyright notices for the new year 2017Jouni Malinen2017-01-031-1/+1
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* privsep: Support frequency list for scan requestsJouni Malinen2016-12-031-0/+12
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* privsep: Support multiple scan SSIDsJouni Malinen2016-12-031-5/+18
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* privsep: Fix scan result fetching with Beacon frame IEsJouni Malinen2016-12-031-1/+1
| | | | | | | | | wpa_priv did not yet support Beacon frame IEs (res->beacon_ie_len) which resulted in invalid scan data being accepted in driver_privsep.c. Add support for res->beacon_ie_len and also fix the validation step to take this new variable length field into account. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Handler driver global_deinit() on termination pathJouni Malinen2016-12-031-2/+6
| | | | | | | This avoids a theoretical resource leak on exit path if wpa_priv is killed while there is a wpa_supplicant process using it. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Explicitly clear padding in message structuresJouni Malinen2016-12-031-1/+2
| | | | | | | This avoids some valgrind warnings about use of uninitialized memory in cases where a struct may have padding octets between the fields. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Use fromlen instead sizeof(struct sockaddr_un)Jouni Malinen2016-12-031-38/+45
| | | | | | | | | This gets rid of some dependencies on how extra octets at the end of the struct sockaddr_un get "uninitialized" consistently by only using the exact length of the address data from the recvfrom() call. This resolves number of valgrind warnings about use of uninitialized memory. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Add support for multiple l2_packet connectionsJouni Malinen2016-12-031-38/+92
| | | | | | | | This is needed to be able to work with many wpa_supplicant use cases, e.g., due to use of TDLS or RSN pre-authentication needing a separate l2_packet socket. Signed-off-by: Jouni Malinen <j@w1.fi>
* Rename sae_data to more generic auth_dataJouni Malinen2016-10-221-4/+4
| | | | | | | This makes it cleaner for the FILS implementation to use the same design for setting Authentication frame elements as was already done with SAE. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Find correct driver for interface additions/removalsRoy Marples2016-03-221-7/+50
| | | | | | | | | Interface additions/removals are not guaranteed to be for the driver listening to the kernel events. As such, send the events to wpa_supplicant_event_global() which can then pick the correct interface registered with wpa_supplicant to send the event to. Signed-off-by: Roy Marples <roy@marples.name>
* eloop: Add eloop_sock_requeue()Roy Marples2016-02-071-1/+1
| | | | | | | This function can be used to re-build eloop socket tables after forking for eloop implementations that need this. Signed-off-by: Roy Marples <roy@marples.name>
* Update copyright notices for the new year 2016Jouni Malinen2016-01-011-1/+1
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Add authentication command and eventJouni Malinen2015-09-051-0/+88
| | | | | | These are needed to work with nl80211 driver interface. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Add support for EVENT_SCAN_STARTEDJouni Malinen2015-09-051-0/+4
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Print unsupported driver event name in debug logJouni Malinen2015-09-051-2/+2
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Clear extended_capa pointersJouni Malinen2015-09-051-0/+4
| | | | | | | | | For now, there is no support for passing extended_capa pointers through the driver_privsep.c interface from wpa_priv. Avoid leaving bogus pointers by explicitly clearing these on both wpa_priv and wpa_supplicant sides. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Add support for global driver interface contextJouni Malinen2015-09-051-3/+26
| | | | | | | This is needed with driver_nl80211.c to be able to use the newer wpa_driver_ops::init2() alternative. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: allow l2_packet to be opened for ethertype 0x890dJouni Malinen2015-09-051-1/+2
| | | | | | This is needed to initialize TDLS functionality. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Add -c argument to usage textJouni Malinen2015-09-051-2/+3
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Fix early exit pathJouni Malinen2015-09-051-4/+6
| | | | | | | eloop_destroy() cannot be called before eloop_init() have been called successfully. Signed-off-by: Jouni Malinen <j@w1.fi>
* Declare all read only data structures as constMikael Kanstrup2015-04-251-1/+1
| | | | | | | | By analysing objdump output some read only structures were found in .data section. To help compiler further optimize code declare these as const. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* Use SSID_MAX_LEN define instead of value 32 when comparing SSID lengthJouni Malinen2015-04-221-3/+3
| | | | | | This makes the implementation easier to understand. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Clean up debug prints to use wpa_printf()Jouni Malinen2014-12-261-11/+14
| | | | | | | This converts most of the remaining perror() and printf() calls from hostapd and wpa_supplicant to use wpa_printf(). Signed-off-by: Jouni Malinen <j@w1.fi>
* privsep: Fix compilation due to associate() parameter updatesJouni Malinen2014-12-251-1/+3
| | | | | | | | struct wpa_driver_associate_params moved to using struct hostapd_freq_params instead of just frequency. Need to update wpa_priv to do same. Signed-off-by: Jouni Malinen <j@w1.fi>
* Declare wpa_debug_* variables in src/utils/wpa_debug.hJouni Malinen2013-12-311-2/+0
| | | | | | | | | These were somewhat more hidden to avoid direct use, but there are now numerous places where these are needed and more justification to make the extern int declarations available from wpa_debug.h. In addition, this avoids some warnings from sparse. Signed-hostap: Jouni Malinen <j@w1.fi>
* Declare wpa_drivers in src/drivers/driver.hJouni Malinen2013-12-311-2/+0
| | | | | | This avoids some warnings from sparse. Signed-hostap: Jouni Malinen <j@w1.fi>
* Add dup_binstr() to help common binary string tasksJouni Malinen2013-04-271-3/+1
| | | | | | | | There are quite a few places in the current implementation where a nul terminated string is generated from binary data. Add a helper function to simplify the code a bit. Signed-hostap: Jouni Malinen <j@w1.fi>
* Make bind failure messages uniqueBen Greear2012-04-061-1/+1
| | | | | | This helps someone know which part of the code is complaining. Signed-hostap: Ben Greear <greearb@candelatech.com>
* Remove the GPL notification from files contributed by Jouni MalinenJouni Malinen2012-02-111-8/+2
| | | | | | | Remove the GPL notification text from the files that were initially contributed by myself. Signed-hostap: Jouni Malinen <j@w1.fi>
* wpa_priv: Update function arguments to fix compilationAndrii Bordunov2011-10-221-2/+2
* Replace wpa_supplicant_sta_rx() call with driver eventJouni Malinen2010-01-031-29/+0
| | | | | | | Get rid of wpa_supplicant_sta_rx() and add a new driver event that is marked to be used only with driver_test.c. In addition, remove this functionality from privsep wrapper. This is only use for client mode MLME testing with driver_test.c.
* eloop: Remove global user data pointerJouni Malinen2009-12-191-1/+1
| | | | | This is not really needed since all signal handlers can use a context pointer provided during signal handler registration.
* Fix wpa_priv compilation after driver_ops changesJouni Malinen2009-12-031-118/+13
* Fix wpa_priv memory leak in wpa_priv_get_scan_results2()Dmitry Shmidt2009-12-031-2/+2
| | | | | I suspect that new scan results format demands more complex free procedure.
* Remove src/common from default header file pathJouni Malinen2009-11-291-3/+3
| | | | | | | | | | This makes it clearer which files are including header from src/common. Some of these cases should probably be cleaned up in the future not to do that. In addition, src/common/nl80211_copy.h and wireless_copy.h were moved into src/drivers since they are only used by driver wrappers and do not need to live in src/common.
* Remove deprecated driver_ops handlersJouni Malinen2009-11-231-21/+0
| | | | | | This gets rid of previously deprecated driver_ops handlers set_wpa, set_drop_unencrypted, set_auth_alg, set_mode. The same functionality can be achieved by using the init/deinit/associate handlers.
* Move definitions away from hostapd_defs.hJouni Malinen2009-11-231-8/+0
| | | | | Clean up definitions to reduce need to include header files from the hostapd directory into files under the src subdirectories.
* Use common get_hw_feature_data for hostapd and wpa_supplicantJouni Malinen2009-04-091-17/+0
| | | | | | This merges the driver wrapper implementations to use the same implementation both for hostapd and wpa_supplicant operations to avoid code duplication.
* Merge wpa_supplicant and hostapd driver wrapper implementationsJouni Malinen2009-04-091-4/+4
| | | | | | | | This commit merges the driver_ops structures and implementations from hostapd/driver*.[ch] into src/drivers. This is only an initial step and there is room for number of cleanups to share code between the hostapd and wpa_supplicant parts of the wrappers to avoid unnecessary source code duplication.
* Fix couple of forgotten wpa_hw_modes -> hostapd_hw_modesJouni Malinen2009-04-061-1/+1
| | | | | Some build configurations resulted in failure due to missed structure rename.
* Allow the privsep driver to pass the set_country to the real driverDaniel Mierswa2009-02-151-1/+19
* Fix privsep build with CONFIG_CLIENT_MLME=yJouni Malinen2009-02-071-2/+50
| | | | | Add wpa_supplicant_sta_free_hw_features() and wpa_supplicant_sta_rx() for driver wrappers in wpa_priv.
* Added set_mode() handler for privsepJouni Malinen2008-09-291-0/+14
* Re-initialize hostapd/wpa_supplicant git repository based on 0.6.3 releaseJouni Malinen2008-02-281-0/+1140