summaryrefslogtreecommitdiff
path: root/wpa_supplicant
Commit message (Collapse)AuthorAgeFilesLines
* P2P: Add D-Bus signal GroupFormationFailureNishant Chaprana2015-09-055-0/+63
| | | | | | | This is similar to the control interface event P2P-GROUP-FORMATION-FAILURE. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* RSN IBSS: Fix segfault on error pathJouni Malinen2015-09-051-1/+2
| | | | | | | If wpa_init() fails, wpa_deinit(NULL) must not be called to avoid hitting a NULL pointer dereference. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Fix memory leak on error pathMasashi Honma2015-09-051-0/+1
| | | | Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* mesh: Fix segfault on error pathMasashi Honma2015-09-051-1/+2
| | | | | | | | When wpa_init() in __mesh_rsn_auth_init() failed, empty rsn->auth caused segmentation fault due to NULL pointer dereference when wpa_deinit() was called. Fix this by checking the pointer before executing deinit steps. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* mesh: Add RSN IE to Mesh Peering Open/Confirm framesMasashi Honma2015-09-051-0/+6
| | | | | | | | | | The RSN IE is required by IEEE Std 802.11-2012 on SAE use case: Table 8-262 Mesh Peering Open frame Action field format Table 8-263 Mesh Peering Confirm frame Action field format Add the RSN IE to these frames. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* mesh: Rename IE field to clarify its useMasashi Honma2015-09-052-6/+6
| | | | | | This is used only for RSNE. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* Add BSS operating frequency to more debug messagesJouni Malinen2015-09-052-4/+8
| | | | | | | This makes it easier to analyze debug logs when figuring out channel related issues. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_gui: Increase control interface message buffer for LIST_NETWORKSJouni Malinen2015-09-051-1/+1
| | | | | | | | Double the buffer length from 2048 to 4096 to match the length used currently in wpa_supplicant. This allows wpa_gui to retrieve information for more networks than previously. Signed-off-by: Jouni Malinen <j@w1.fi>
* Indicate CTRL-EVENT-AUTH-REJECT event on authentication rejectionJouni Malinen2015-09-051-2/+16
| | | | | | | | This allows control interface monitors to get more detailed information in cases where wpa_supplicant-based SME receives an Authentication frame with non-zero status code. 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>
* Make it clearer that ap_scan=2 mode should not be used with nl80211Jouni Malinen2015-09-054-1/+23
| | | | | | | Add more details into configuration comments and a runtime info message if ap_scan=2 is used with the nl80211 driver interface. Signed-off-by: Jouni Malinen <j@w1.fi>
* Allow wpa_cli/hostapd_cli client socket directory to be specifiedManikandan Mohan2015-09-011-4/+17
| | | | | | | | | This adds a new helper function wpa_ctrl_open2() that can be used instead of wpa_ctrl_open() to override the default client socket directory. Add optional -s<directory path> argument to hostapd_cli and wpa_cli to allow the client socket directory to be specified. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Allow BSS to return information for AP that uses an invalid WSC IEJouni Malinen2015-08-301-2/+3
| | | | | | | | | Previously, the BSS command returned an error if the WSC IE(s) in scan results could not be parsed. This may be not ideal for all cases, to instead of rejecting the command completely, return all other information apart from the WPS information in such a case. Signed-off-by: Jouni Malinen <j@w1.fi>
* dbus: Fix a typo in function commentMAYANK HAARIT2015-08-281-1/+1
| | | | | Signed-off-by: Mayank Haarit <mayank.h@samsung.com> Signed-off-by: Dilshad Ahmad <dilshad.a@samsung.com>
* dbus: Do not quote scan_freq and freq_list in dbus_old_handlers.cJiří Klimeš2015-08-281-1/+1
| | | | | | | | | | | | scan_freq and freq_list are not parsed correctly by wpa_config_parse_int_array() if quoted. Patch for dbus_old_handlers.c, the same change as done by Robert Shade <robert.shade@gmail.com> for dbus_new_handlers.c in commit 99276998fa26d4299825eeafb6386fe1c51f6287 ('dbus: Do not quote scan_freq and freq_list'). Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
* Fix key derivation for Suite B 192-bit AKM to use SHA384Jouni Malinen2015-08-272-0/+2
| | | | | | | | | While the EAPOL-Key MIC derivation was already changed from SHA256 to SHA384 for the Suite B 192-bit AKM, KDF had not been updated similarly. Fix this by using HMAC-SHA384 instead of HMAC-SHA256 when deriving PTK from PMK when using the Suite B 192-bit AKM. Signed-off-by: Jouni Malinen <j@w1.fi>
* Make sure configuration is saved to storage deviceMitchell Wills2015-08-271-0/+2
| | | | | | | | | | | | Config file is written to a temp file and then it is renamed to the original config file. However, it is possible that the rename operation will be commited to storage while file data will be still in cache causing original config file to be empty or partially written in case of a system reboot without a clean shutdown. Make this less likely to occur by forcing the data to be written to the storage device before renaming the file. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* Do not mark BSS entry in use if SSID has changedJingxiang Ge2015-08-261-4/+12
| | | | | | | | | | | This allows a BSS entry to be expired if the AP has changed its SSID while maintaining the same BSSID and we are associated with the BSS. Previously, the same BSSID was enough to mark all BSS entries from the BSSID as in use regardless of the SSID and as such, they could remain in the wpa_supplicant BSS table indefinitely as long as the association remaining. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Remove unnecessary NULL check from LOG_LEVEL handlerJouni Malinen2015-08-221-1/+1
| | | | | | | cmd cannot be NULL here, so there is no need to check it before calling os_strlen(). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Request fresh scan results after GO NegotiationJouni Malinen2015-08-221-4/+8
| | | | | | | | | | | | The P2P group is not yet operating when going through GO Negotiation exchange. Previously, an old cached scan result could be used to skip the scan immediately after the GO Negotiation. While this is quite unlikely to happen in practice, we can easily force a scan here now with the generic scan_min_time mechanism. Do that to avoid any corner cases that a previous instance of the group could have if found in cached scan results. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Require fresh scan results for persistent group re-invocationJouni Malinen2015-08-226-10/+33
| | | | | | | | | | | | | | | | | | 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>
* eapol_test: Add an example controller script for RADIUS testingJouni Malinen2015-08-221-0/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new script can be used as an example of load testing for RADIUS authentication servers. It can control multiple eapol_test processes over the control interface to run EAP-TLS authentication. As an example, the following commands would run eight instances of eapol_test concurrently: for i in 0 1 2 3 4 5 6 7; do ./eapol_test -T /tmp/eapol_test -i $i > eapol_test.log$i & done time ./eapol_test.py --ctrl /tmp/eapol_test --num 8 --iter 100 0: PASS 100 1: PASS 100 2: PASS 100 3: PASS 100 4: PASS 100 5: PASS 100 6: PASS 100 7: PASS 100 real 0m0.339s time ./eapol_test.py --ctrl /tmp/eapol_test --num 8 --iter 100 --no-fast-reauth 0: PASS 100 1: PASS 100 2: PASS 100 3: PASS 100 4: PASS 100 5: PASS 100 6: PASS 100 7: PASS 100 real 0m1.876s Signed-off-by: Jouni Malinen <j@w1.fi>
* eapol_test: Add a new operation mode for control interface useJouni Malinen2015-08-211-10/+106
| | | | | | | | | | | The -T<ctrl_iface> command line argument can now be used to start eapol_test in mode where the configuration file is not needed and the authentication operations are started through the control interface. Network profile is also managed through the control interface in this case. This can be used to provide more control for scripted RADIUS authentication server testing. Signed-off-by: Jouni Malinen <j@w1.fi>
* eapol_test: Allow interface name to be specifiedJouni Malinen2015-08-201-5/+9
| | | | | | | | | The new -i<ifname> command line argument can be used to specify the name of the interface to use. This is mainly to allow unique control interface names to be defined without having to use multiple directories. Signed-off-by: Jouni Malinen <j@w1.fi>
* BoringSSL: Allow internal AES key wrap to be used with "OpenSSL" buildJouni Malinen2015-08-182-0/+10
| | | | | | | | | | | | It looks like BoringSSL has removed the AES_wrap_key(), AES_unwrap_key() API. This broke wpa_supplicant/hostapd build since those functions from OpenSSL were used to replace the internal AES key wrap implementation. Add a new build configuration option (CONFIG_OPENSSL_INTERNAL_AES_WRAP=y) to allow the internal implementation to be used with CONFIG_OPENSSL=y build to allow build against the latest BoringSSL version. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Set NORMAL_SCAN_REQ on SELECT_NETWORK/ENABLE_NETWORKJouni Malinen2015-08-171-2/+6
| | | | | | | | | | | wpa_s->scan_req needs to be set in these cases to get correct scanning behavior. This is mainly needed for starting of AP mode operation immediately in ap_scan=2 case. This fixes an issue that was found with mac80211_hwsim test cases in the following sequence: dbus_autoscan dbus_ap_scan_2_ap_mode_scan Signed-off-by: Jouni Malinen <j@w1.fi>
* P2PS: Consider WPS P2PS method when joining a groupAndrei Otcheretianski2015-08-141-0/+3
| | | | | | | | | If P2PS PD concludes to use default P2PS method wpas_p2p_scan_res_join() ignores this value and tries to perform a redundant legacy PD. Fix this by considering WPS_P2PS method too. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* systemd: Order wpa_supplicant before network.targetMike Gilbert2015-08-144-0/+8
| | | | | | | | | | | | Ordering the units before network.target causes them to be stopped after network.target on shutdown. This ensures that any network filesystems will be unmounted before wpa_supplicant is killed. Adding Wants=network.target ensures that network.target will be included in the active dependency graph. This is typical of units which are involved in networking setup functions. Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* Add debug prints for wpa_supplicant ctrl_iface socket send operationsJouni Malinen2015-08-141-0/+35
| | | | | | | | This makes it easier to track the output queue state on a control interface socket and determine what could be causing issues with running out of space in the buffer. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Do not stop ongoing PNO sched_scan on association/disconnectionMahesh A Saptasagar2015-08-132-2/+5
| | | | | | | | | | PNO was stopped by the wpa_supplicant during the connection attempts or while handling disassociation indication. External entities, mainly, the Android Wi-Fi framework, does not expects PNO to be stopped by other modules. Hence, do not stop the sched_scan in these scenarios if it is triggered externally for PNO. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Do not allow ap_scan=2 scan processing to stop AP mode operationJouni Malinen2015-08-111-0/+3
| | | | | | | | | | | wpa_supplicant_assoc_try() would result in the currently operating AP to get stopped if wpa_supplicant_scan() ends up getting triggered without MANUAL_SCAN_REQ while operating an AP. With ap_scan=2, this could resulted in unintentional stopping of AP mode operations, so check explicitly for that case and skip the wpa_supplicant_assoc_try() call if needed to avoid this. Signed-off-by: Jouni Malinen <j@w1.fi>
* 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>
* P2P: Support driver preferred freq list for invitation caseAhmad Kholaif2015-08-111-0/+1
| | | | | | | | When using P2P invitation to re-invoke a persistent P2P group without specifying the operating channel, query the driver for the preferred frequency list, and use it to select the operating channel of the group. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Drop connection attempt if network is disabled before radio work startsHu Wang2015-08-102-2/+4
| | | | | | | | | | | With the radio work design, it is possible for a network entry to get disabled (e.g., DISABLE_NETWORK <id>) during the time the connect or sme-connect radio work waits to start. Previously, only the validity of the BSS entry and BSSID/SSID was verified when starting the actual connection step. Add call to wpas_network_disabled() to those checks to catch the case where the network profile is disabled. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Support driver preferred freq list for Autonomous GO caseAhmad Kholaif2015-08-101-0/+32
| | | | | | | | When starting an autonomous GO without specifying the operating channel, query the driver for the preferred frequency list, and use it to select the operating channel of the GO (if supported). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2PS: Authorize any peer for P2PS method if interface address not knownAndrei Otcheretianski2015-08-063-22/+38
| | | | | | | | | | | | | | | | | When P2PS PD with default P2PS method is done, the peer that becomes GO should authorize the client. However, P2PS specification doesn't require the client to include its intended interface address in PD Request/Response. As a result, the P2P Client's interface address may not be known and any address may need to be authorized. Previously, client's P2P Device Address was used for authorization, which is not correct when a dedicated interface is used for P2P Client. This is not resulting in a connection failure, however it causes a significant delay (until WPS_PIN_TIME_IGNORE_SEL_REG elapses). Fix this by authorizing the intended interface address, if known; or any address, if not known. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* P2PS: Clean up intended interface address passing to p2ps_prov_completeJouni Malinen2015-08-061-2/+2
| | | | | | | | Use NULL to indicate if the address is not available instead of fixed 00:00:00:00:00:00. wpas_p2ps_prov_complete() already had code for converting NULL to that all zeros address for event messages. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2PS: Fix PD PIN event notificationsMax Stepanov2015-08-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change P2PS P2P-PROV-SHOW-PIN/P2P-PROV-ENTER-PIN event notifications on PD Request/Response handling to meet required P2PS behavior. The new implemented scheme: 1. For a legacy P2P provision discovery the event behavior remains without changes 2. P2PS PD, advertiser method: DISPLAY, autoaccept: TRUE: Advertiser: SHOW-PIN on PD request replied with a status SUCCESS Seeker: ENTER-PIN on PD response received with a status SUCCESS 3. P2PS PD, advertiser method: DISPLAY, autoaccept: FALSE: Advertiser: SHOW-PIN on PD request replied with a status INFO_CURRENTLY_UNAVAILABLE Seeker: ENTER-PIN on Follow-on PD request with a status SUCCESS_DEFERRED 4. P2PS PD, advertiser method: KEYPAD, autoaccept: TRUE/FALSE: Advertiser: ENTER-PIN on PD request replied with a status INFO_CURRENTLY_UNAVAILABLE Seeker: SHOW-PIN on PD response received with a status INFO_CURRENTLY_UNAVAILABLE This change in behavior breaks the existing test cases p2ps_connect_keypad_method_nonautoaccept and p2ps_connect_display_method_nonautoaccept. Those will be fixed in a followup commit. Signed-off-by: Max Stepanov <Max.Stepanov@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Fix P2P_FLUSH clearing of p2p_go_avoid_freqIlan Peer2015-08-041-0/+1
| | | | | | | | | | | P2P_FLUSH command did not cleanly clear the p2p_go_avoid_freq data structure, and left it in an inconsistent state, where the range field was NULL but the num field was not 0. This would have resulted in an invalid memory access in freq_range_list_includes(). Fix this. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Do not perform P2P GO CS in some casesIlan Peer2015-08-044-13/+48
| | | | | | | | | | | | A P2P GO channel switch should not be triggered in all cases that require channel list update. Specifically, a P2P GO CS should not be triggered in case that the P2P GO state changed or in case that that the P2P GO has just completed a CS. To fix this, add reason code to wpas_p2p_channel_list_update() and trigger CS flow only for the relevant cases. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Disallow GO CS immediately after GO Negotiation or invitationIlan Peer2015-08-041-0/+41
| | | | | | | | | | | | | | | A newly created GO might move to another channel before the client was able to connect to it. This creates a situation where the client searches the GO on the channel agreed upon during GO Negotiation or invitation signaling, while the GO is on another channel. This in turn might lead to delayed connection or connection failure and group removal. Fix this by disallowing a GO CS as long as there is some activity that should delay the switch. If a GO move is not allowed, set a timeout to re-attempt the move. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Consider channel optimizations for additional casesIlan Peer2015-08-041-52/+35
| | | | | | | | Re-factor the code, so channel optimizations would be also triggered upon the following changes: channel updates from the kernel, disallow_freq interface, etc. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* Refactor channel list update event in wpa_supplicantArik Nemtsov2015-08-041-17/+7
| | | | | | | | | Update hardware features for all interfaces inside the loop, don't treat the calling wpa_s instance specially. Perform the P2P channel list updates after the hardware features are updated. This will prevent P2P from relying on stale information. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>