summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* WPS: Reduce struct wps_parse_attr sizeJouni Malinen2015-09-073-22/+26
| | | | | | | | | Use shorter variables for storing the attribute lengths and group these variables together to allow compiler to pack them more efficiently. This reduces the struct size from 960 bytes to 760 bytes in 64-bit builds. This reduces stack use in number of functions. Signed-off-by: Jouni Malinen <j@w1.fi>
* WPS: Reduce wps_ap_priority_compar() stack useJouni Malinen2015-09-071-6/+6
| | | | | | | | There is no need to maintain two concurrent instances of struct wps_parse_attr in this function. Share a single structure for parsing both IEs. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS and DISABLE/ENABLE APJouni Malinen2015-09-071-0/+7
| | | | | | | This is a regression test case for the issue fixed by the previous commit (hapd->num_probereq_cb not getting cleared on deinit). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Fix num_probereq_cb clearing on DISABLE to avoid segfaultChen, Yi2015-09-071-0/+1
| | | | | | | | | | | | | | | | | Reset hapd->num_probereq_cb to 0 on an interface deinit to avoid unexpected behavior if the same interface is enabled again without fully freeing the data structures. hostapd_register_probereq_cb() increments hapd->num_probereq_cb by one and leaves all old values unchanged. In this deinit+init case, that would result in the first entry in the list having an uninitialized pointer and the next Probe Request frame processing would likely cause the process to terminate on segmentation fault. This issue could be hit when hostapd was used with WPS enabled (non-zero wps_state configuration parameter) and control interface command DISABLE and ENABLE were used. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* tests: WPS ER learn OOMJouni Malinen2015-09-071-0/+50
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* WPS ER: Clean up WPS session on PutMessage error casesJouni Malinen2015-09-071-7/+20
| | | | | | | This is needed to allow new operation to be started after an error without having to wait for the AP entry to time out. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS ER SetSelectedRegistrar OOMJouni Malinen2015-09-071-0/+51
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS ER OOM in PutWLANResponse generationJouni Malinen2015-09-071-0/+12
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS ER OOM in STA addJouni Malinen2015-09-071-0/+34
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS ER and OOM in HTTP response generationJouni Malinen2015-09-071-1/+14
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Use sqlite3.Binary() with the log filesJouni Malinen2015-09-071-2/+10
| | | | | | | This is needed to avoid issues in some cases where 8-bit bytestrings may be present in the otherwise text debug log. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS ER subscribe OOMJouni Malinen2015-09-071-0/+39
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS ER caching AP settings (OOM)Jouni Malinen2015-09-071-0/+124
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS against external implementationJouni Malinen2015-09-071-2/+3246
| | | | | | | | | | This adds a Python-based minimal WSC protocol implementation to allow more testing coverage to be reached for various error cases in protected attributes. The wps_ext test case completes successful exchange in both the Enrollee and Registrar roles acting in the middle of AP and STA. The other test cases cover error cases. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS ER init failureJouni Malinen2015-09-071-0/+6
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS AP configured for special ap_setup_locked=2 modeJouni Malinen2015-09-071-0/+38
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: WPS AP and UPnP event subscription and many eventsJouni Malinen2015-09-061-0/+67
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Multiple WPS ERs adding a new enrollee using PINJouni Malinen2015-09-061-0/+57
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: D-Bus GroupFormationFailure signalJouni Malinen2015-09-051-4/+15
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Add D-Bus signal GroupFormationFailureNishant Chaprana2015-09-056-0/+73
| | | | | | | This is similar to the control interface event P2P-GROUP-FORMATION-FAILURE. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* tests: WPS config method update for WPS and P2PJouni Malinen2015-09-052-0/+44
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* WPS: Allow config_methods to be cleared with an empty stringJouni Malinen2015-09-051-1/+1
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: IBSS RSN OOM during wpa_initJouni Malinen2015-09-051-0/+9
| | | | | | | This is a regression test for a segfault that was fixed in the previous commit. Signed-off-by: Jouni Malinen <j@w1.fi>
* 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>
* tests: Secure mesh network setup failing due to wpa_init() OOMJouni Malinen2015-09-051-1/+12
| | | | | | | This is a regression test for incorrect error path behavior that was fixed in the previous commits. 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-053-8/+8
| | | | | | This is used only for RSNE. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* TDLS: Use proper IE parsing routine for non-EAPOL-Key casesJouni Malinen2015-09-051-6/+9
| | | | | | | | | | | | wpa_supplicant_parse_ies() was never supposed to be used as a generic IE parser, i.e., it is for the specific purpose of parsing EAPOL-Key Key Data IEs and KDEs. TDLS used this function for parsing generic AP IEs and while that works, it resulted in confusing "WPA: Unrecognized EAPOL-Key Key Data IE" debug messages. Clean this up by using ieee802_11_parse_elems() for the cases where generic IEs are being parsed. Signed-off-by: Jouni Malinen <j@w1.fi>
* 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>
* tests: AP and STA tracking with passive scanJouni Malinen2015-09-051-0/+57
| | | | | | | Verify that Public Action frame from a STA is used to add a tracking entry. Signed-off-by: Jouni Malinen <j@w1.fi>
* Add station tracking based on other management frame subtypesJouni Malinen2015-09-053-1/+5
| | | | | | | | This extends the previous tracking design to add a station entry based on other management frames than Probe Request frames. For example, this covers a case where the station is using passive scanning. 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>
* WPS: Merge identical error paths in ssdp_listener_open()Jouni Malinen2015-09-051-8/+5
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Dualband AP rejecting authentication from dualband STA on 2.4 GHzJouni Malinen2015-09-052-1/+115
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* Add option to reject authentication on 2.4 GHz from dualband STAJouni Malinen2015-09-058-7/+88
| | | | | | | | | | | | | | | | | | The new no_auth_if_seen_on=<ifname> parameter can now be used to configure hostapd to reject authentication from a station that was seen on another radio. This can be used with enabled track_sta_max_num configuration on another interface controlled by the same hostapd process to reject authentication attempts from a station that has been detected to be capable of operating on another band, e.g., to try to reduce likelihood of the station selecting a 2.4 GHz BSS when the AP operates both a 2.4 GHz and 5 GHz BSS concurrently. Note: Enabling this can cause connectivity issues and increase latency for connecting with the AP. Signed-off-by: Jouni Malinen <j@w1.fi>
* Indicate CTRL-EVENT-AUTH-REJECT event on authentication rejectionJouni Malinen2015-09-052-2/+18
| | | | | | | | 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>
* tests: Dualband AP not replying to probes from dualband STA on 2.4 GHzJouni Malinen2015-09-051-0/+35
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* Add option to ignore Probe Request frames on 2.4 GHz from dualband STAJouni Malinen2015-09-055-0/+57
| | | | | | | | | | | | | | | | | | | The new no_probe_resp_if_seen_on=<ifname> parameter can now be used to configure hostapd to not reply to group-addressed Probe Request from a station that was seen on another radio. This can be used with enabled track_sta_max_num configuration on another interface controlled by the same hostapd process to restrict Probe Request frame handling from replying to group-addressed Probe Request frames from a station that has been detected to be capable of operating on another band, e.g., to try to reduce likelihood of the station selecting a 2.4 GHz BSS when the AP operates both a 2.4 GHz and 5 GHz BSS concurrently. Note: Enabling this can cause connectivity issues and increase latency for discovering the AP. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Unconnected station trackingJouni Malinen2015-09-051-0/+79
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* hostapd: Add mechanism to track unconnected stationsJouni Malinen2015-09-059-0/+155
| | | | | | | | | | | hostapd can now be configured to track unconnected stations based on Probe Request frames seen from them. This can be used, e.g., to detect dualband capable station before they have associated. Such information could then be used to provide guidance on which colocated BSS to use in case of a dualband AP that operates concurrently on multiple bands under the control of a single hostapd process. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_priv: Add authentication command and eventJouni Malinen2015-09-053-0/+198
| | | | | | 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-053-0/+8
| | | | 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-052-0/+8
| | | | | | | | | 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>