]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
8 years agoChange version information for the 2.5 release hostap_2_5
Jouni Malinen [Sun, 27 Sep 2015 17:48:25 +0000 (20:48 +0300)] 
Change version information for the 2.5 release

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd ChangeLog entries for v2.5
Jouni Malinen [Sun, 27 Sep 2015 17:13:59 +0000 (20:13 +0300)] 
Add ChangeLog entries for v2.5

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Add test for hostapd cli ordering
Johannes Berg [Tue, 15 Sep 2015 15:09:22 +0000 (17:09 +0200)] 
tests: Add test for hostapd cli ordering

When the 'SET wpa 2' command is executed last, it seems to somehow
reset parts of the settings, causing hostapd to beacon with the
pairwise cipher suite selector set to 00-0F-AC:0 (none/use-group).
This is not permitted and should be rejected; wpa_supplicant also
cannot connect.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoDo not clear RSN parameters before full configuration
Jouni Malinen [Sun, 27 Sep 2015 10:25:00 +0000 (13:25 +0300)] 
Do not clear RSN parameters before full configuration

This fixes an issue where hostapd SET command is used to configure RSN
parameters and the wpa parameter is sent after the other parameters.
Previously, the default case here ended up clearing rsn_pairwise and
wpa_pairwise values and once wpa=2 was finally set, the cipher
configuration had already been lost.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoD-Bus: Add InvitationReceived Signal
Maneesh Jain [Thu, 18 Jun 2015 04:16:34 +0000 (09:46 +0530)] 
D-Bus: Add InvitationReceived Signal

This is equivalent to the P2P_EVENT_INVITATION_RECEIVED signal on the
control interface. It can be used to sent the Invitation Received signal
to applications written using D-Bus.

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
8 years agoD-Bus: Add Signal to notify WPS PBC Overlap event
Saurav Babu [Thu, 28 May 2015 03:53:07 +0000 (09:23 +0530)] 
D-Bus: Add Signal to notify WPS PBC Overlap event

Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
8 years agoD-Bus: Add signal to notify WPS timeout event
Saurav Babu [Thu, 28 May 2015 03:53:06 +0000 (09:23 +0530)] 
D-Bus: Add signal to notify WPS timeout event

Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
8 years agowpa_supplicant: Fix channel switch notification with VHT
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:23 +0000 (12:46 +0300)] 
wpa_supplicant: Fix channel switch notification with VHT

Fix a bug in wpas_ap_ch_switch() function, which didn't pass VHT
frequencies correctly to hostapd_event_ch_switch().

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoUpdate wpa_s->current_ssid->frequency on CS event
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:10 +0000 (12:46 +0300)] 
Update wpa_s->current_ssid->frequency on CS event

Update wpa_s->current_ssid->frequency when EVENT_CH_SWITCH is received.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoP2P: Fix the calculation of group common freqs
Ilan Peer [Tue, 8 Sep 2015 09:46:09 +0000 (12:46 +0300)] 
P2P: Fix the calculation of group common freqs

Previously, the calculation allowed for the same frequency to appear
several times in the result.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agoFix get_shared_radio_freqs_data() used-by flags setting
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:08 +0000 (12:46 +0300)] 
Fix get_shared_radio_freqs_data() used-by flags setting

Fix an iteration bug in get_shared_radio_freqs_data when building
freqs_data array. Only the last used-by flag was maintained instead of
making this a bitfield of all found uses.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agomesh: Add support for scanning only the current frequency
Masashi Honma [Tue, 8 Sep 2015 06:10:13 +0000 (15:10 +0900)] 
mesh: Add support for scanning only the current frequency

This patch enables scan_cur_freq=1 on VIF based mesh network.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agoD-BUS: dev_passwd_id should be "q" because it uses DBUS_TYPE_UINT16
Nishant Chaprana [Thu, 17 Sep 2015 12:46:03 +0000 (18:16 +0530)] 
D-BUS: dev_passwd_id should be "q" because it uses DBUS_TYPE_UINT16

This corrects the type of dev_passwd_id in GONegotiationRequest event.
This field is packed as DBUS_TYPE_UINT16 but in
wpas_dbus_interface_signals it was "i" which is DBUS_TYPE_INT32.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
8 years agoFix EAP-EKE peer build rules
Jouni Malinen [Fri, 25 Sep 2015 16:43:44 +0000 (19:43 +0300)] 
Fix EAP-EKE peer build rules

NEED_AES_CBC is needed for EAP-EKE builds.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoLinker changes for building eapol_test on OS X
Alan T. DeKok [Tue, 22 Sep 2015 15:24:12 +0000 (11:24 -0400)] 
Linker changes for building eapol_test on OS X

Signed-off-by: Alan DeKok <aland@freeradius.org>
8 years agoPortability fixes for OS X
Alan T. DeKok [Tue, 22 Sep 2015 14:56:51 +0000 (10:56 -0400)] 
Portability fixes for OS X

Fix os_get_reltime() and os_fdatasync() for OS X.

Signed-off-by: Alan DeKok <aland@freeradius.org>
8 years agoAndroid: Set ctrl_iface client socket group (AID_WIFI) separately
Amarnath Hullur Subramanyam [Wed, 23 Sep 2015 19:39:41 +0000 (12:39 -0700)] 
Android: Set ctrl_iface client socket group (AID_WIFI) separately

Split chown() call in wpa_ctrl_open() and wpa_ctrl_open2() to allow the
group id to be set even if the process does not have privileges to
change the owner. This is needed for modules that need to communicate
with wpa_supplicant since without the group change, wpa_supplicant may
not have privileges to send the response to a control interface command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAndroid: Avoid same per-iface and global ctrl socket
Sunil Dutt [Wed, 23 Sep 2015 15:51:49 +0000 (21:21 +0530)] 
Android: Avoid same per-iface and global ctrl socket

Android platform assigns the same socket id if the socket identifier in
conf->ctrl_interface and global->params.ctrl_interface (parameter for
android_get_control_socket) point to the same Android specific control
socket. This ends up having two eloop socket handlers registered for the
same file descriptor and thus, two attempt to receive and process each
command. This can result in unexpected failure, e.g., the prefix IFNAME=
for any command is valid for global socket handler, but results in
UNKNOWN COMMAND response from the per-interface ctrl socket handler).

Since it might be possible to end up with this type of invalid
configuration in OTA upgrade, compare the socket identifiers and do not
open the ctrl socket on the respective interface if both point to same.
This allows the Wi-Fi framework to use the global control interface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDo not copy STA VHT capabilities if VHT is not enabled for AP
Ashok Raj Nagarajan [Tue, 22 Sep 2015 13:56:00 +0000 (19:26 +0530)] 
Do not copy STA VHT capabilities if VHT is not enabled for AP

Previously, station's VHT information elements were copied and passed
regardless of the AP's VHT configuration. As a result, AP with VHT
disabled in configuration could have ended up transmitting packets in
VHT rates though AP is not advertising VHT support. Fix this by copying
the station's VHT capabilities only when AP supports VHT (both hardware
and configuration).

Signed-off-by: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>
8 years agotests: WPA2-Enterprise interactive identity entry and ENABLE_NETWORK
Jouni Malinen [Tue, 22 Sep 2015 09:03:53 +0000 (12:03 +0300)] 
tests: WPA2-Enterprise interactive identity entry and ENABLE_NETWORK

This verifies that ENABLE_NETWORK does not trigger reconnection if
already connected. The previous commit fixed a case where it was
possible for that to happen.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAvoid reconnection on ENABLE_NETWORK if already connected
Jouni Malinen [Tue, 22 Sep 2015 08:55:54 +0000 (11:55 +0300)] 
Avoid reconnection on ENABLE_NETWORK if already connected

This was already the case for most command sequences, but it was
possible for wpa_s->reassociate to be set to 1 when CTRL-RSP-* commands
were used to set identity, password, or passphrase for EAP
authentication. In such cases, ENABLE_NETWORK issued after the
connection was completed could result in a new connection attempt
(likely reconnection back to the same BSS).

Fix this by checking whether an actual connection is already present
even if wpa_s->reassociate is set when processing the ENABLE_NETWORK
command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoUpdate AP WPA/RSN IE on all associations if driver can select BSS
Sunil Dutt [Thu, 17 Sep 2015 10:30:42 +0000 (10:30 +0000)] 
Update AP WPA/RSN IE on all associations if driver can select BSS

It is possible for driver-based BSS selection to end up reassociating
back to the current AP. If wpa_supplicant preferred another BSS, it
would have updated the internal knowledge of the AP's WPA/RSN IE when
requesting a new connection. In the special case of existing association
and new association being with the same BSS that is different from the
wpa_supplicant preference, association event processing skipped the
WPA/RSN IE update. This could result in the following 4-way handshake
getting rejected due to incorrectly detected mismatch with AP's RSN/WPA
IE between Beacon/Probe Response frame and EAPOL-Key msg 3/4.

Fix this by updating the AP WPA/RSN IE on all association events when
driver-based BSS selection is used regardless of whether the BSSID
changes. This could also cover a theoretical case of the AP changing its
RSN/WPA IE at the very moment we try to reassociate back to the same
BSS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDrop some control interface debug print verbosity for send operations
Jouni Malinen [Thu, 10 Sep 2015 08:19:44 +0000 (11:19 +0300)] 
Drop some control interface debug print verbosity for send operations

These prints were at DEBUG level (-d), but they can be very frequent, so
drop them to MSGDUMP (-dd). This allows the prints to be suppressed in
common debugging cases while still leaving them easily enablable to
debug control interface issues without having to enable excessive
debugging.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoReduce debug verbosity for read-only control interface commands
Jouni Malinen [Thu, 10 Sep 2015 08:17:19 +0000 (11:17 +0300)] 
Reduce debug verbosity for read-only control interface commands

Commands like BSS and GET_NETWORK are used in some cases very frequently
and those can increase the amount of debug information from
wpa_supplicant without significant benefit. These were logged at the
DEBUG level (-d). Move logging of such read-only commands (i.e., no new
wpa_supplicant operation is started based on it) to EXCESSIVE level
(-ddd) which was already used for the PING command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoWPA: Do not print GTK in debug log unless requested
Jouni Malinen [Wed, 9 Sep 2015 14:35:06 +0000 (17:35 +0300)] 
WPA: Do not print GTK in debug log unless requested

The GTK value received in RSN (WPA2) group rekeying did not use the
wpa_hexdump_key() version of debug printing that is conditional on -K
being included on the command line.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoWPS: Reduce struct wps_parse_attr size
Jouni Malinen [Mon, 7 Sep 2015 19:56:40 +0000 (22:56 +0300)] 
WPS: Reduce struct wps_parse_attr size

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>
8 years agoWPS: Reduce wps_ap_priority_compar() stack use
Jouni Malinen [Mon, 7 Sep 2015 19:52:45 +0000 (22:52 +0300)] 
WPS: Reduce wps_ap_priority_compar() stack use

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>
8 years agotests: WPS and DISABLE/ENABLE AP
Jouni Malinen [Mon, 7 Sep 2015 17:53:23 +0000 (20:53 +0300)] 
tests: WPS and DISABLE/ENABLE AP

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>
8 years agoWPS: Fix num_probereq_cb clearing on DISABLE to avoid segfault
Chen, Yi [Wed, 2 Sep 2015 15:55:01 +0000 (21:25 +0530)] 
WPS: Fix num_probereq_cb clearing on DISABLE to avoid segfault

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>
8 years agotests: WPS ER learn OOM
Jouni Malinen [Mon, 7 Sep 2015 14:46:40 +0000 (17:46 +0300)] 
tests: WPS ER learn OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS ER: Clean up WPS session on PutMessage error cases
Jouni Malinen [Mon, 7 Sep 2015 14:45:53 +0000 (17:45 +0300)] 
WPS ER: Clean up WPS session on PutMessage error cases

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>
8 years agotests: WPS ER SetSelectedRegistrar OOM
Jouni Malinen [Mon, 7 Sep 2015 14:24:29 +0000 (17:24 +0300)] 
tests: WPS ER SetSelectedRegistrar OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER OOM in PutWLANResponse generation
Jouni Malinen [Mon, 7 Sep 2015 14:08:52 +0000 (17:08 +0300)] 
tests: WPS ER OOM in PutWLANResponse generation

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER OOM in STA add
Jouni Malinen [Mon, 7 Sep 2015 14:04:57 +0000 (17:04 +0300)] 
tests: WPS ER OOM in STA add

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER and OOM in HTTP response generation
Jouni Malinen [Mon, 7 Sep 2015 13:59:19 +0000 (16:59 +0300)] 
tests: WPS ER and OOM in HTTP response generation

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Use sqlite3.Binary() with the log files
Jouni Malinen [Mon, 7 Sep 2015 13:53:23 +0000 (16:53 +0300)] 
tests: Use sqlite3.Binary() with the log files

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>
8 years agotests: WPS ER subscribe OOM
Jouni Malinen [Mon, 7 Sep 2015 13:38:38 +0000 (16:38 +0300)] 
tests: WPS ER subscribe OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER caching AP settings (OOM)
Jouni Malinen [Mon, 7 Sep 2015 13:31:38 +0000 (16:31 +0300)] 
tests: WPS ER caching AP settings (OOM)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS against external implementation
Jouni Malinen [Sun, 6 Sep 2015 18:47:28 +0000 (21:47 +0300)] 
tests: WPS against external implementation

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>
8 years agotests: WPS ER init failure
Jouni Malinen [Mon, 7 Sep 2015 10:46:58 +0000 (13:46 +0300)] 
tests: WPS ER init failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS AP configured for special ap_setup_locked=2 mode
Jouni Malinen [Mon, 7 Sep 2015 10:42:22 +0000 (13:42 +0300)] 
tests: WPS AP configured for special ap_setup_locked=2 mode

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS AP and UPnP event subscription and many events
Jouni Malinen [Sun, 6 Sep 2015 08:56:10 +0000 (11:56 +0300)] 
tests: WPS AP and UPnP event subscription and many events

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Multiple WPS ERs adding a new enrollee using PIN
Jouni Malinen [Sun, 6 Sep 2015 08:32:02 +0000 (11:32 +0300)] 
tests: Multiple WPS ERs adding a new enrollee using PIN

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: D-Bus GroupFormationFailure signal
Jouni Malinen [Sat, 5 Sep 2015 19:29:00 +0000 (22:29 +0300)] 
tests: D-Bus GroupFormationFailure signal

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoP2P: Add D-Bus signal GroupFormationFailure
Nishant Chaprana [Thu, 20 Aug 2015 10:58:33 +0000 (16:28 +0530)] 
P2P: Add D-Bus signal GroupFormationFailure

This is similar to the control interface event
P2P-GROUP-FORMATION-FAILURE.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
8 years agotests: WPS config method update for WPS and P2P
Jouni Malinen [Sat, 5 Sep 2015 18:58:18 +0000 (21:58 +0300)] 
tests: WPS config method update for WPS and P2P

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Allow config_methods to be cleared with an empty string
Jouni Malinen [Sat, 5 Sep 2015 18:49:38 +0000 (21:49 +0300)] 
WPS: Allow config_methods to be cleared with an empty string

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: IBSS RSN OOM during wpa_init
Jouni Malinen [Sat, 5 Sep 2015 18:35:58 +0000 (21:35 +0300)] 
tests: IBSS RSN OOM during wpa_init

This is a regression test for a segfault that was fixed in the previous
commit.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRSN IBSS: Fix segfault on error path
Jouni Malinen [Sat, 5 Sep 2015 18:35:16 +0000 (21:35 +0300)] 
RSN IBSS: Fix segfault on error path

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>
8 years agotests: Secure mesh network setup failing due to wpa_init() OOM
Jouni Malinen [Sat, 5 Sep 2015 18:30:45 +0000 (21:30 +0300)] 
tests: Secure mesh network setup failing due to wpa_init() OOM

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>
8 years agomesh: Fix memory leak on error path
Masashi Honma [Wed, 26 Aug 2015 08:32:39 +0000 (17:32 +0900)] 
mesh: Fix memory leak on error path

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agomesh: Fix segfault on error path
Masashi Honma [Wed, 26 Aug 2015 08:32:38 +0000 (17:32 +0900)] 
mesh: Fix segfault on error path

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>
8 years agomesh: Add RSN IE to Mesh Peering Open/Confirm frames
Masashi Honma [Mon, 31 Aug 2015 07:58:10 +0000 (16:58 +0900)] 
mesh: Add RSN IE to Mesh Peering Open/Confirm frames

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>
8 years agomesh: Rename IE field to clarify its use
Masashi Honma [Mon, 31 Aug 2015 07:58:09 +0000 (16:58 +0900)] 
mesh: Rename IE field to clarify its use

This is used only for RSNE.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agoTDLS: Use proper IE parsing routine for non-EAPOL-Key cases
Jouni Malinen [Sat, 5 Sep 2015 17:51:11 +0000 (20:51 +0300)] 
TDLS: Use proper IE parsing routine for non-EAPOL-Key cases

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>
8 years agoAdd BSS operating frequency to more debug messages
Jouni Malinen [Sat, 5 Sep 2015 17:40:44 +0000 (20:40 +0300)] 
Add BSS operating frequency to more debug messages

This makes it easier to analyze debug logs when figuring out channel
related issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: AP and STA tracking with passive scan
Jouni Malinen [Sat, 5 Sep 2015 17:29:01 +0000 (20:29 +0300)] 
tests: AP and STA tracking with passive scan

Verify that Public Action frame from a STA is used to add a tracking
entry.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd station tracking based on other management frame subtypes
Jouni Malinen [Sat, 5 Sep 2015 16:38:06 +0000 (19:38 +0300)] 
Add station tracking based on other management frame subtypes

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>
8 years agowpa_gui: Increase control interface message buffer for LIST_NETWORKS
Jouni Malinen [Sat, 5 Sep 2015 16:28:56 +0000 (19:28 +0300)] 
wpa_gui: Increase control interface message buffer for LIST_NETWORKS

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>
8 years agoWPS: Merge identical error paths in ssdp_listener_open()
Jouni Malinen [Sat, 5 Sep 2015 16:28:45 +0000 (19:28 +0300)] 
WPS: Merge identical error paths in ssdp_listener_open()

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Dualband AP rejecting authentication from dualband STA on 2.4 GHz
Jouni Malinen [Sat, 5 Sep 2015 16:01:42 +0000 (19:01 +0300)] 
tests: Dualband AP rejecting authentication from dualband STA on 2.4 GHz

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd option to reject authentication on 2.4 GHz from dualband STA
Jouni Malinen [Sat, 5 Sep 2015 16:00:03 +0000 (19:00 +0300)] 
Add option to reject authentication on 2.4 GHz from dualband STA

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>
8 years agoIndicate CTRL-EVENT-AUTH-REJECT event on authentication rejection
Jouni Malinen [Sat, 5 Sep 2015 15:33:35 +0000 (18:33 +0300)] 
Indicate CTRL-EVENT-AUTH-REJECT event on authentication rejection

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>
8 years agotests: Dualband AP not replying to probes from dualband STA on 2.4 GHz
Jouni Malinen [Sat, 5 Sep 2015 14:54:50 +0000 (17:54 +0300)] 
tests: Dualband AP not replying to probes from dualband STA on 2.4 GHz

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd option to ignore Probe Request frames on 2.4 GHz from dualband STA
Jouni Malinen [Sat, 5 Sep 2015 14:53:15 +0000 (17:53 +0300)] 
Add option to ignore Probe Request frames on 2.4 GHz from dualband STA

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>
8 years agotests: Unconnected station tracking
Jouni Malinen [Sat, 5 Sep 2015 14:13:15 +0000 (17:13 +0300)] 
tests: Unconnected station tracking

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostapd: Add mechanism to track unconnected stations
Jouni Malinen [Sat, 5 Sep 2015 14:11:11 +0000 (17:11 +0300)] 
hostapd: Add mechanism to track unconnected stations

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>
8 years agowpa_priv: Add authentication command and event
Jouni Malinen [Sat, 5 Sep 2015 10:21:17 +0000 (13:21 +0300)] 
wpa_priv: Add authentication command and event

These are needed to work with nl80211 driver interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_priv: Add support for EVENT_SCAN_STARTED
Jouni Malinen [Sat, 5 Sep 2015 09:39:11 +0000 (12:39 +0300)] 
wpa_priv: Add support for EVENT_SCAN_STARTED

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_priv: Print unsupported driver event name in debug log
Jouni Malinen [Sat, 5 Sep 2015 09:35:59 +0000 (12:35 +0300)] 
wpa_priv: Print unsupported driver event name in debug log

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_priv: Clear extended_capa pointers
Jouni Malinen [Sat, 5 Sep 2015 09:32:58 +0000 (12:32 +0300)] 
wpa_priv: Clear extended_capa pointers

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>
8 years agowpa_priv: Add support for global driver interface context
Jouni Malinen [Sat, 5 Sep 2015 09:03:18 +0000 (12:03 +0300)] 
wpa_priv: Add support for global driver interface context

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>
8 years agowpa_priv: allow l2_packet to be opened for ethertype 0x890d
Jouni Malinen [Sat, 5 Sep 2015 08:54:06 +0000 (11:54 +0300)] 
wpa_priv: allow l2_packet to be opened for ethertype 0x890d

This is needed to initialize TDLS functionality.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_priv: Add -c argument to usage text
Jouni Malinen [Sat, 5 Sep 2015 08:44:34 +0000 (11:44 +0300)] 
wpa_priv: Add -c argument to usage text

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_priv: Fix early exit path
Jouni Malinen [Sat, 5 Sep 2015 08:41:49 +0000 (11:41 +0300)] 
wpa_priv: Fix early exit path

eloop_destroy() cannot be called before eloop_init() have been called
successfully.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoDo not advertise DSSS/CCK support in 40 MHz for 5 GHz band
Vasanthakumar Thiagarajan [Fri, 4 Sep 2015 05:22:58 +0000 (10:52 +0530)] 
Do not advertise DSSS/CCK support in 40 MHz for 5 GHz band

DSSS/CCK rate support in 40 MHz has to be set to 0 for 5 GHz band since
this mechanism is designed only for the 2.4 GHz band. Clear
HT_CAP_INFO_DSSS_CCK40MHZ in ht_capab when the configured mode is
neither 11b nor 11g.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
8 years agoMake it clearer that ap_scan=2 mode should not be used with nl80211
Jouni Malinen [Fri, 4 Sep 2015 22:04:29 +0000 (01:04 +0300)] 
Make it clearer that ap_scan=2 mode should not be used with nl80211

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>
8 years agotests: WPS Enrollee protocol testing
Jouni Malinen [Mon, 31 Aug 2015 17:23:57 +0000 (20:23 +0300)] 
tests: WPS Enrollee protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: AP configuration using wps_config and wps_cred_processing=2
Jouni Malinen [Tue, 1 Sep 2015 09:25:31 +0000 (12:25 +0300)] 
tests: AP configuration using wps_config and wps_cred_processing=2

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER timing out STA entry after negotiation
Jouni Malinen [Tue, 1 Sep 2015 09:18:00 +0000 (12:18 +0300)] 
tests: WPS ER timing out STA entry after negotiation

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAllow wpa_cli/hostapd_cli client socket directory to be specified
Manikandan Mohan [Tue, 25 Aug 2015 04:34:03 +0000 (21:34 -0700)] 
Allow wpa_cli/hostapd_cli client socket directory to be specified

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>
8 years agoWPS: Remove trailing CR from subscription callback URLs
Jouni Malinen [Mon, 31 Aug 2015 13:17:31 +0000 (16:17 +0300)] 
WPS: Remove trailing CR from subscription callback URLs

This cleans up the debug log a bit.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Print subscription UUID in debug log in more places
Jouni Malinen [Mon, 31 Aug 2015 13:16:59 +0000 (16:16 +0300)] 
WPS: Print subscription UUID in debug log in more places

This makes it easier to debug subscription issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS AP and advertisement OOM
Jouni Malinen [Mon, 31 Aug 2015 10:05:48 +0000 (13:05 +0300)] 
tests: WPS AP and advertisement OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Clean up next_advertisement() error path
Jouni Malinen [Mon, 31 Aug 2015 09:56:56 +0000 (12:56 +0300)] 
WPS: Clean up next_advertisement() error path

No need to have a common failure handler if it is used from only a
single location and that lcoation does not even need the memory freeing
step.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Merge event_send_start() error paths
Jouni Malinen [Mon, 31 Aug 2015 09:49:58 +0000 (12:49 +0300)] 
WPS: Merge event_send_start() error paths

There is no need to keep these separate.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS UPnP SetSelectedRegistrar protocol testing
Jouni Malinen [Mon, 31 Aug 2015 09:47:38 +0000 (12:47 +0300)] 
tests: WPS UPnP SetSelectedRegistrar protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Merge SetSelectedRegistrar parsing error returns
Jouni Malinen [Mon, 31 Aug 2015 09:29:09 +0000 (12:29 +0300)] 
WPS: Merge SetSelectedRegistrar parsing error returns

There is no need to maintain two error paths for this.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER Selected Registrar timeout
Jouni Malinen [Sun, 30 Aug 2015 22:55:56 +0000 (01:55 +0300)] 
tests: WPS ER Selected Registrar timeout

This extends ap_wps_pbc_timeout to cover another long WPS timeout:
ER-initiated SetSelectedRegistrar timeout on AP. Using the same test
case for this avoids the need for another 120 second test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: More WPS/HTTP test coverage
Jouni Malinen [Fri, 28 Aug 2015 17:33:52 +0000 (20:33 +0300)] 
tests: More WPS/HTTP test coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-WSC peer: Reject connection on unexpected failure
Jouni Malinen [Sun, 30 Aug 2015 15:36:28 +0000 (18:36 +0300)] 
EAP-WSC peer: Reject connection on unexpected failure

Previously, the EAP-WSC peer state machine ended up just ignoring an
error and waiting for a new message from the AP. This is not going to
recover the exchange, so simply force the connection to terminate
immediately.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAllow BSS to return information for AP that uses an invalid WSC IE
Jouni Malinen [Sat, 29 Aug 2015 20:59:44 +0000 (23:59 +0300)] 
Allow BSS to return information for AP that uses an invalid WSC IE

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>
8 years agoWPS: Use a shared error path in http_client_addr()
Jouni Malinen [Sat, 29 Aug 2015 10:41:40 +0000 (13:41 +0300)] 
WPS: Use a shared error path in http_client_addr()

This simplifies error processing by removing duplicated cleanup steps.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Clean up http_client_tx_ready()
Jouni Malinen [Sat, 29 Aug 2015 10:34:39 +0000 (13:34 +0300)] 
WPS: Clean up http_client_tx_ready()

Calculate the send() buffer length only once to make this a bit more
readable.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Remove duplicated isgraph() loop in HTTP header parsing
Jouni Malinen [Fri, 28 Aug 2015 20:58:10 +0000 (23:58 +0300)] 
WPS: Remove duplicated isgraph() loop in HTTP header parsing

The hbp pointer is moved to the next space already earlier in this code
path, so the while loop here did not really do anything.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Merge common error paths in HTTP server
Jouni Malinen [Fri, 28 Aug 2015 17:33:22 +0000 (20:33 +0300)] 
WPS: Merge common error paths in HTTP server

There is no need to maintain three separate "goto fail" cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: cfg80211 connect command to trigger roam
Jouni Malinen [Fri, 28 Aug 2015 16:01:47 +0000 (19:01 +0300)] 
tests: cfg80211 connect command to trigger roam

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoRemove unnecessary enum typedef from wpa_auth_sm_event()
Jouni Malinen [Fri, 28 Aug 2015 13:34:38 +0000 (16:34 +0300)] 
Remove unnecessary enum typedef from wpa_auth_sm_event()

This is more consistent with the expected coding style.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoEAPOL auth: Avoid recursive wpa_sm_step() on WPA_DEAUTH case
Jouni Malinen [Fri, 28 Aug 2015 13:32:14 +0000 (16:32 +0300)] 
EAPOL auth: Avoid recursive wpa_sm_step() on WPA_DEAUTH case

It was possible for wpa_auth_sm_event(WPA_DEAUTH) to be called from
wpa_sm_step() iteration in the case the EAPOL authenticator state
machine ended up requesting the station to be disconnected. This
resulted in unnecessary recursive call to wpa_sm_step(). Avoid this by
using the already running call to process the state change.

It was possible to hit this sequence in the hwsim test case
ap_wpa2_eap_eke_server_oom.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoEAPOL auth: clear keyRun in AUTH_PAE INITIALIZE
Jouni Malinen [Fri, 28 Aug 2015 13:30:06 +0000 (16:30 +0300)] 
EAPOL auth: clear keyRun in AUTH_PAE INITIALIZE

Clearing keyRun here is not specified in IEEE Std 802.1X-2004, but it
looks like this would be logical thing to do here since the EAPOL-Key
exchange is not possible in this state. It is possible to get here on
disconnection event without advancing to the AUTHENTICATING state to
clear keyRun before the IEEE 802.11 RSN authenticator state machine runs
and that may advance from AUTHENTICATION2 to INITPMK if keyRun = TRUE
has been left from the last association. This can be avoided by clearing
keyRun here.

It was possible to hit this corner case in the hwsim test case
ap_wpa2_eap_eke_server_oom in the case getKey operation was forced to
fail memory allocation. The following association resulted in the
station getting disconnected when entering INITPMK without going through
EAP authentication.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>