]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
8 years agotests: Make scan_trigger_failure more informative
Jouni Malinen [Sun, 11 Dec 2016 16:41:04 +0000 (18:41 +0200)] 
tests: Make scan_trigger_failure more informative

If wpa_state is left to SCANNING by a previously executed test case,
scan_trigger_failure will fail. Instead of waiting for that failure,
check for wpa_state at the beginning of the test case and report a more
helpful error message if the test case would fail due to a previously
executed test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoInterworking: Clear SCANNING state if no network selected
Jouni Malinen [Sun, 11 Dec 2016 16:39:12 +0000 (18:39 +0200)] 
Interworking: Clear SCANNING state if no network selected

Commit 192ad3d7307473f14c049c1ea724e292a3f8ae24 ('Interworking: Clear
SCANNING state if no match found') did this for the case where no
network matched credentials, but left the SCANNING state in place if
there were a match, but automatic connection was not enabled. Extend
this to cover the case where INTERWORKING_SELECT is not followed by a
connection attempt so that wpa_state is not left indefinitely to
SCANNING.

This fixes a hwsim test case failure in the following sequence:
ap_anqp_sharing scan_trigger_failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoSME: Fix IBSS setup after shared key/FT/FILS association
Jouni Malinen [Sun, 11 Dec 2016 16:23:13 +0000 (18:23 +0200)] 
SME: Fix IBSS setup after shared key/FT/FILS association

wpa_s->sme.auth_alg could have been left to a previously value other
than WPA_AUTH_ALG_OPEN if IBSS network is used after an association that
used shared key, FT, or FILS authentication algorithm. This could result
in the IBSS setup failing due to incorrect authentication processing
steps.

Fix this by setting wpa_s->sme.auth_alg = WPA_AUTH_ALG_OPEN whenever
starting an IBSS (or mesh, for that matter) network.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoP2P: Fix a theoretical out of bounds read in wpas_p2p_select_go_freq()
Amit Purwar [Fri, 9 Dec 2016 13:29:16 +0000 (18:59 +0530)] 
P2P: Fix a theoretical out of bounds read in wpas_p2p_select_go_freq()

Commit 8e84921efe652233703588852bc43c36ccb241df ('P2P: Support driver
preferred freq list for Autonomous GO case') introduced this loop to go
through preferred channel list from the driver. The loop does bounds
checking of the index only after having read a value from the array.
That could in theory read one entry beyond the end of the stack buffer.

Fix this by moving the index variable check to be done before using it
to fetch a value from the array.

This code is used only if wpa_supplicant is build with
CONFIG_DRIVER_NL80211_QCA=y and if the driver supports the vendor
extension (get_pref_freq_list() driver op). In addition, the driver
would need to return more than P2P_MAX_PREF_CHANNELS (= 100) preferred
channels for this to actually be able to read beyond the buffer. No
driver is known to return that many preferred channels, so this does not
seem to be reachable in practice.

Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agoP2P: Fix a theoretical out of bounds read in wpas_p2p_setup_freqs()
Amit Purwar [Fri, 9 Dec 2016 13:25:59 +0000 (18:55 +0530)] 
P2P: Fix a theoretical out of bounds read in wpas_p2p_setup_freqs()

Commit 370017d968e071522357ea88c0c6aaed02853222 ('P2P: Use preferred
frequency list from the local driver') introduced this loop to go
through preferred channel list from the driver. The loop does bounds
checking of the index only after having read a value from the array.
That could in theory read one entry beyond the end of the stack buffer.

Fix this by moving the index variable check to be done before using it
to fetch a value from the array.

This code is used only if wpa_supplicant is build with
CONFIG_DRIVER_NL80211_QCA=y and if the driver supports the vendor
extension (get_pref_freq_list() driver op). In addition, the driver
would need to return more than P2P_MAX_PREF_CHANNELS (= 100) preferred
channels for this to actually be able to read beyond the buffer. No
driver is known to return that many preferred channels, so this does not
seem to be reachable in practice.

Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agotests: Add kernel BSS leak tests
Johannes Berg [Thu, 8 Dec 2016 16:29:43 +0000 (17:29 +0100)] 
tests: Add kernel BSS leak tests

Add two tests that check if the kernel BSS leak (when we get a deauth or
otherwise abandon an association attempt) is present in the kernel. This
is for a long-standing cfg80211/mac80211 issue that got fixed with the
kernel commit 'cfg80211/mac80211: fix BSS leaks when abandoning assoc
attempts'.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agotests: P2P device discovery and peer changing device name
Jouni Malinen [Sat, 10 Dec 2016 20:35:49 +0000 (22:35 +0200)] 
tests: P2P device discovery and peer changing device name

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoP2P: Send P2P-DEVICE-FOUND event on peer changing device name
Mayank Haarit [Wed, 7 Dec 2016 16:46:04 +0000 (22:16 +0530)] 
P2P: Send P2P-DEVICE-FOUND event on peer changing device name

This is to handle the case when peer changes device name and same needs
to be updated to upper layers by P2P-DEVICE-FOUND event. It is similar
to the case when a peer changes wfd_subelems and P2P-DEVICE-FOUND event
goes to upper layers.

Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
8 years agotests: Peer disabling Wi-Fi Display advertisement
Jouni Malinen [Sat, 10 Dec 2016 17:30:12 +0000 (19:30 +0200)] 
tests: Peer disabling Wi-Fi Display advertisement

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWFD: Clear wfd_subelems when P2P peer stops sending them
Mayank Haarit [Wed, 7 Dec 2016 15:17:16 +0000 (20:47 +0530)] 
WFD: Clear wfd_subelems when P2P peer stops sending them

When a peer device stops sending wfd_subelems, wpa_supplicant should
remove dev->info.wfd_subelems from peer's properties. Previously,
wpa_supplicant left the previously learned dev->info.wfd_subelems in
place whenever the new message did not include wfd_subelems.

In addition to fixing the clearing of the old wfd_subelems, this
resolves another issue. As "wfd_changed" variable becomes true even when
peer stops sending wfd_subelems and dev->info.wfd_subelems has an old
value, a new P2P-DEVICE-FOUND event notification was sent again and
again to upper layers whenever a new discovery response was received
from the peer that previously advertised WFD subelements.

Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agotests: Ongoing scan and FLUSH
Jouni Malinen [Sat, 10 Dec 2016 17:03:07 +0000 (19:03 +0200)] 
tests: Ongoing scan and FLUSH

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoIgnore scan results from ongoing scan when FLUSH command is issued
Jouni Malinen [Sat, 10 Dec 2016 17:00:47 +0000 (19:00 +0200)] 
Ignore scan results from ongoing scan when FLUSH command is issued

This makes wpa_supplicant behavior more consistent with FLUSH command to
clear all state. Previously, it was possible for an ongoing scan to be
aborted when the FLUSH command is issued and the scan results from that
aborted scan would still be processed and that would update the BSS
table which was supposed to cleared by the FLUSH command.

This could result in hwsim test case failures due to unexpected BSS
table entries being present after the FLUSH command.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Scan and only_new=1 multiple times
Jouni Malinen [Sat, 10 Dec 2016 15:04:08 +0000 (17:04 +0200)] 
tests: Scan and only_new=1 multiple times

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoMake update_idx available in BSS control interface command
Jouni Malinen [Sat, 10 Dec 2016 15:03:24 +0000 (17:03 +0200)] 
Make update_idx available in BSS control interface command

This can be used to perform more accurate tests on BSS entry updates.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Make p2ps_wildcard_p2ps more robust
Jouni Malinen [Fri, 9 Dec 2016 22:33:33 +0000 (00:33 +0200)] 
tests: Make p2ps_wildcard_p2ps more robust

The final check in this test case was issuing a new P2P_FIND command
immediately after the P2P_SERVICE_DEL command on the peer. It looked
like it was possible for the scan timing to go in a sequence that made
the new P2P_FIND operation eventually accept a cfg80211 BSS entry from
the very end of the previous P2P_FIND. This resulted in unexpected
P2P-DEVICE-FOUND event even though there was no new Probe Response frame
from the peer at that point in time.

Make this less likely to show unrelated failures by waiting a bit before
starting a new P2P_FIND operation after having changes peer
configuration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Clear PEER_WAITING_RESPONSE on GO Negotiation success
Jouni Malinen [Fri, 9 Dec 2016 22:16:33 +0000 (00:16 +0200)] 
P2P: Clear PEER_WAITING_RESPONSE on GO Negotiation success

Previously, this flag was cleared only in case of failed GO Negotiation.
That could leave the flag set for a peer and if a new group formation
was performed with the same peer before the entry expired, there was
increased risk of getting stuck in a state where neither peer replied to
a GO Negotiation Request frame if a GO Negotiation Response frame with
Status 1 was dropped.

The error sequence could happen in the go_neg_with_bss_connected test
case when timing was suitable to make the second GO negotiation drop a
pending TX Action frame if the GO Negotiation Response with Status 1 was
scheduled for transmission during a P2P scan and P2P_CONNECT was issued
before that scan got aborted.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDefine a QCA vendor command to configure SAR Power limits
Jeff Johnson [Tue, 6 Dec 2016 00:13:36 +0000 (16:13 -0800)] 
Define a QCA vendor command to configure SAR Power limits

There is a regulatory requirement for Specific Absorption Rate (SAR)
whereby the device transmit power is reduced when it is determined that
the device is in close proximity to the body. Implement a vendor command
interface to allow a userspace entity to dynamically control the SAR
power limits.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoUse eloop timeout for post-EAP-Failure wait before disconnection
Jouni Malinen [Tue, 6 Dec 2016 16:12:11 +0000 (18:12 +0200)] 
Use eloop timeout for post-EAP-Failure wait before disconnection

Previously, os_sleep() was used to block the hostapd (or wpa_supplicant
AP/P2P GO mode) processing between sending out EAP-Failure and
disconnecting the STA. This is not ideal for couple of reasons: it
blocks all other parallel operations in the process and it leaves a
window during which the station might deauthenticate and the AP would
have no option for reacting to that before forcing out its own
Deauthentication frame which could go out after the STA has already
started new connection attempt.

Improve this design by scheduling an eloop timeout of 10 ms instead of
the os_sleep() call and perform the delayed operations from the eloop
callback function. This eloop timeout is cancelled if the STA
disconnects or initiates a new connection attempt before the 10 ms time
is reached. This gets rid of the confusing extra Deauthentication frame
in cases where the STA reacts to EAP-Failure by an immediate
deauthentication.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WEP to WPA2-PSK configuration change in hostapd
Jouni Malinen [Mon, 5 Dec 2016 19:30:17 +0000 (21:30 +0200)] 
tests: WEP to WPA2-PSK configuration change in hostapd

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAllow hostapd wep_key# parameters to be cleared
Jouni Malinen [Mon, 5 Dec 2016 19:28:50 +0000 (21:28 +0200)] 
Allow hostapd wep_key# parameters to be cleared

Setting wep_key# to an empty string will now clear a previously
configured key. This is needed to be able to change WEP configured AP to
using WPA/WPA2 through the hostapd control interface SET commands.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: P2P group formation with VHT 80 MHz
Jouni Malinen [Mon, 5 Dec 2016 19:14:55 +0000 (21:14 +0200)] 
tests: P2P group formation with VHT 80 MHz

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Check data connectivity after supplicant triggered EAP reauth
Jouni Malinen [Mon, 5 Dec 2016 19:01:43 +0000 (21:01 +0200)] 
tests: Check data connectivity after supplicant triggered EAP reauth

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agowpa_passphrase: Reject invalid passphrase
Jouni Malinen [Mon, 5 Dec 2016 13:36:56 +0000 (15:36 +0200)] 
wpa_passphrase: Reject invalid passphrase

Reject a passphrase with control characters instead of trying to write
out an example network configuration block with such control characters
included.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: AP with open mode and external association
Jouni Malinen [Mon, 5 Dec 2016 09:48:07 +0000 (11:48 +0200)] 
tests: AP with open mode and external association

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Update drv->ssid on connect/associate event based on BSS data
Ningyuan Wang [Mon, 24 Oct 2016 17:59:52 +0000 (10:59 -0700)] 
nl80211: Update drv->ssid on connect/associate event based on BSS data

On a connect nl80211 event, wpa_supplicant uses
wpa_driver_nl80211_get_ssid() to fetch the current associated SSID to
compare to existing configurations. However,
wpa_driver_nl80211_get_ssid() uses drv->ssid, which is a cached value.
It is set when we explicitly initial a connect request using
wpa_supplicant. If the association was initiated outside of
wpa_supplicant, we need another way to populate drv->ssid. This commit
sets drv->ssid based on cfg80211 BSS information on connect/associate
nl80211 events.

Signed-off-by: Ningyuan Wang <nywang@google.com>
8 years agonl80211: Fix scan_state update in no pending scan state
Jouni Malinen [Mon, 5 Dec 2016 09:43:16 +0000 (11:43 +0200)] 
nl80211: Fix scan_state update in no pending scan state

Commit adcd7c4b0bd02bead77f884f52782a813f5243bb ('nl80211: Support
vendor scan together with normal scan') made the drv->scan_state updates
for NL80211_CMD_NEW_SCAN_RESULTS and NL80211_CMD_SCAN_ABORTED
conditional on drv->last_scan_cmd being NL80211_CMD_TRIGGER_SCAN. This
missed the part about the possibility of last_scan_cmd == 0 and an
externally started cfg80211 scan is ending. This could leave
drv->scan_state into SCAN_STARTED state even after the scan was
completed. Consequently, hwsim test cases could get stuck in reset()
handler waiting for scan to terminate.

Fix this by updating drv->scan_state also in drv->last_scan_cmd == 0
case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Verify multicast_to_unicast operation
Michael Braun [Mon, 31 Oct 2016 13:58:09 +0000 (14:58 +0100)] 
tests: Verify multicast_to_unicast operation

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
8 years agoAdd multicast to unicast support
Michael Braun [Mon, 31 Oct 2016 13:58:08 +0000 (14:58 +0100)] 
Add multicast to unicast support

This adds support for nl80211 NL80211_CMD_SET_MULTICAST_TO_UNICAST
command.

By setting the new hostapd configuration option multicast_to_unicast=1,
hostapd configures this AP to perform multicast to unicast conversion.

When enabled, all multicast packets with ethertype ARP, IPv4, or IPv6
(possibly within an 802.1Q header) will be sent out to each station once
with the destination (multicast) MAC address replaced by the station's
MAC address. Note that this may break certain expectations of the
receiver, e.g., the ability to drop unicast IP packets encapsulated in
multicast L2 frames, or the ability to not send destination unreachable
messages in such cases.

This also does not implement Directed Multicast Service (DMS).

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
8 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Sun, 4 Dec 2016 18:50:07 +0000 (20:50 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2016-12-02.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRemove inactivity timeout for wired interfaces
Sam Tannous [Mon, 17 Oct 2016 22:02:16 +0000 (18:02 -0400)] 
Remove inactivity timeout for wired interfaces

We should unconditionally remove inactivity timers for wired network
cases. This commit checks for this after a new station association:

   hapd->iface->drv_flags & WPA_DRIVER_FLAGS_WIRED

and then cancels the timeout and does not register a new one.

It prints out a debug message like this:

1476740180.276286: IEEE 802.1X: 00:02:00:00:00:07 CTRL_DIR entering
state FORCE_BOTH
1476740180.276295: hostapd_new_assoc_sta: canceled wired ap_handle_timer
timeout for 00:02:00:00:00:07

This was tested on a debian jessie amd64 system with a configured 120
second inactivity timer and the session did not timeout.

Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
8 years agoDefer scans while PNO is in progress instead of skipping them
Arik Nemtsov [Thu, 24 Apr 2014 05:45:35 +0000 (08:45 +0300)] 
Defer scans while PNO is in progress instead of skipping them

Skipping the scan altogether will hurt auto-reconnect. Also move the PNO
check down since the scan might be canceled for other reasons before we
defer it.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
8 years agonl80211: Optimize memory use in nl80211_get_assoc_freq()
Jouni Malinen [Sat, 3 Dec 2016 20:37:41 +0000 (22:37 +0200)] 
nl80211: Optimize memory use in nl80211_get_assoc_freq()

Do not use the generic bss_info_handler() design to fetch all scan
results into temporary memory buffer. Instead, use a separate BSS info
handler that fetches the requested information without fully parsing the
BSS entries and without allocating any memory for collecting all the
results.

This is also simplifying bss_info_handler() and nl80211_parse_bss_info()
design by getting rid of the special case that was used only for
nl80211_get_assoc_freq() and not normal scan result fetching.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Reduce nl80211_dump_scan() memory need
Jouni Malinen [Sat, 3 Dec 2016 20:14:04 +0000 (22:14 +0200)] 
nl80211: Reduce nl80211_dump_scan() memory need

Instead of fetching all scan results to a temporary buffer, debug print
scan result dump directly from the message handler function one BSS at a
time.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Split bss_info_handler() into a separate parser function
Jouni Malinen [Sat, 3 Dec 2016 17:36:24 +0000 (19:36 +0200)] 
nl80211: Split bss_info_handler() into a separate parser function

This allows a single scan result to be parsed at a time. This is a step
towards optimizing scan result fetching without having to allocate
memory for all entries at the same time.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Move duplicate scan result removal to bss.c
Jouni Malinen [Sat, 3 Dec 2016 17:26:47 +0000 (19:26 +0200)] 
nl80211: Move duplicate scan result removal to bss.c

The way the removal of duplicated (one per frequency) BSS entries in the
cfg80211 scan results were removed in driver_nl80211_scan.c
bss_info_handler() depended on having the full scan results available to
allow iteration through the other entries. This is problematic for the
goal of being able to optimize memory allocations for scan result
fetching in a manner that would not build the full result buffer in
memory.

Move this duplicate removal into bss.c since it has sufficient
information available for doing the same determination of which one of
two BSS entries is more current.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Add more debug details to duplicate scan entry removal
Jouni Malinen [Sat, 3 Dec 2016 16:59:32 +0000 (18:59 +0200)] 
nl80211: Add more debug details to duplicate scan entry removal

This makes it easier to understand which cfg80211 entry got removed as
obsolete duplicate.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Scanning and AP changing channels
Jouni Malinen [Sat, 3 Dec 2016 16:53:36 +0000 (18:53 +0200)] 
tests: Scanning and AP changing channels

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoprivsep: Support frequency list for scan requests
Jouni Malinen [Sat, 3 Dec 2016 16:27:16 +0000 (18:27 +0200)] 
privsep: Support frequency list for scan requests

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoprivsep: Support multiple scan SSIDs
Jouni Malinen [Sat, 3 Dec 2016 16:17:28 +0000 (18:17 +0200)] 
privsep: Support multiple scan SSIDs

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoprivsep: Coding style cleanup for struct definitions
Jouni Malinen [Sat, 3 Dec 2016 16:05:33 +0000 (18:05 +0200)] 
privsep: Coding style cleanup for struct definitions

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoprivsep: Fix scan result fetching with Beacon frame IEs
Jouni Malinen [Sat, 3 Dec 2016 16:02:49 +0000 (18:02 +0200)] 
privsep: Fix scan result fetching with Beacon frame IEs

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>
8 years agowpa_priv: Document reduced functionality
Jouni Malinen [Sat, 3 Dec 2016 15:49:37 +0000 (17:49 +0200)] 
wpa_priv: Document reduced functionality

wpa_priv has never really been fully up-to-date with the wpa_supplicant
driver interface extensions. This does not seem like something that
would change in the future either, so document this reduced
functionality as a potential drawback.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_priv: Handler driver global_deinit() on termination path
Jouni Malinen [Sat, 3 Dec 2016 15:38:01 +0000 (17:38 +0200)] 
wpa_priv: Handler driver global_deinit() on termination path

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>
8 years agowpa_priv: Explicitly clear padding in message structures
Jouni Malinen [Sat, 3 Dec 2016 15:32:07 +0000 (17:32 +0200)] 
wpa_priv: Explicitly clear padding in message structures

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>
8 years agowpa_priv: Use fromlen instead sizeof(struct sockaddr_un)
Jouni Malinen [Sat, 3 Dec 2016 15:28:18 +0000 (17:28 +0200)] 
wpa_priv: Use fromlen instead sizeof(struct sockaddr_un)

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>
8 years agowpa_priv: Add support for multiple l2_packet connections
Jouni Malinen [Sat, 3 Dec 2016 09:37:41 +0000 (11:37 +0200)] 
wpa_priv: Add support for multiple l2_packet connections

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>
8 years agotests: P2P provision discovery while GO/CLI
Jouni Malinen [Sat, 3 Dec 2016 08:58:39 +0000 (10:58 +0200)] 
tests: P2P provision discovery while GO/CLI

These test cases verify that there is no duplicate processing of P2P
Action frames while operating in a P2P group.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Split nl80211_check_bss_status() into a separate function
Jouni Malinen [Fri, 2 Dec 2016 18:54:49 +0000 (20:54 +0200)] 
nl80211: Split nl80211_check_bss_status() into a separate function

This allows a single scan result to be checked at a time. This is a step
towards optimizing scan result fetching without having to allocate
memory for all entries at the same time.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Separate channel noise fetch from scan result processing
Jouni Malinen [Fri, 2 Dec 2016 18:48:43 +0000 (20:48 +0200)] 
nl80211: Separate channel noise fetch from scan result processing

This untangles the NL80211_CMD_GET_SURVEY handler loop from
NL80211_CMD_GET_SCAN processing so that the per-channel noise
information can be fetched with a common function to a local data
structure that can then be easily used to update individual scan results
(a single BSS) instead of having to go through a full set of scan
results. This is a step towards optimizing scan result fetching without
having to allocate memory for all entries at the same time.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: WDS 4addr behavior on reassociation and with open and WEP
Jouni Malinen [Fri, 2 Dec 2016 10:53:07 +0000 (12:53 +0200)] 
tests: WDS 4addr behavior on reassociation and with open and WEP

This extends the ap_wds_sta test case to cover post-reassociation case
(both with and without Authentication frame exchange) and add similar
test cases to cover open and WEP cases in addition to this existing
WPA2-PSK test case.

These cover functionality testing for the previous fix in
reassociation-without-new-authentication case. In addition, these find a
new mac80211 issue for the WEP + 4addr combination.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix 4addr reassociation-without-deauthentication on AP
Jouni Malinen [Fri, 2 Dec 2016 10:51:16 +0000 (12:51 +0200)] 
Fix 4addr reassociation-without-deauthentication on AP

Data connection was lost if a station reassociated without the STA entry
being cleaned up on the AP side. Fix this by moving reconfiguration of
the STA WDS parameters in association response callback to happen only
after the STA flags have been updated to associated stated.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agowired: Mark some common helper functions static
Jouni Malinen [Wed, 30 Nov 2016 16:02:51 +0000 (18:02 +0200)] 
wired: Mark some common helper functions static

These are used only within driver_wired_common.c now at the end of the
refactoring changes, so there is no need to make these helper functions
available outside driver_wired_common.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agomka: Remove references to macsec_qca from wpa_supplicant.conf
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:56 +0000 (20:08 +0100)] 
mka: Remove references to macsec_qca from wpa_supplicant.conf

Make the documentation generic, as this is no longer the only macsec
driver.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agomacsec_linux: Add a driver for macsec on Linux kernels
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:55 +0000 (20:08 +0100)] 
macsec_linux: Add a driver for macsec on Linux kernels

This uses libnl3 to communicate with the macsec module available on
Linux. A recent enough version of libnl is needed for the macsec.h file
(which is not yet available in a formal libnl release at the time of
this commit).

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move driver_wired_get_ssid() to a common file
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:54 +0000 (20:08 +0100)] 
drivers: Move driver_wired_get_ssid() to a common file

This continues refactoring of the common parts of wired drivers code
into a shared file, so that they can be reused by other drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move driver_wired_get_bssid() to a common file
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:53 +0000 (20:08 +0100)] 
drivers: Move driver_wired_get_bssid() to a common file

This continues refactoring of the common parts of wired drivers code
into a shared file, so that they can be reused by other drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move driver_wired_get_capa() to a common file
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:52 +0000 (20:08 +0100)] 
drivers: Move driver_wired_get_capa() to a common file

This continues refactoring of the common parts of wired drivers code
into a shared file, so that they can be reused by other drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move driver_wired_deinit_common() to a common file
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:51 +0000 (20:08 +0100)] 
drivers: Move driver_wired_deinit_common() to a common file

This continues refactoring of the common parts of wired drivers code
into a shared file, so that they can be reused by other drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move driver_wired_init_common() to a common file
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:50 +0000 (20:08 +0100)] 
drivers: Move driver_wired_init_common() to a common file

This continues refactoring of the common parts of wired drivers code
into a shared file, so that they can be reused by other drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move driver_wired_get_ifstatus() to a common file
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:49 +0000 (20:08 +0100)] 
drivers: Move driver_wired_get_ifstatus() to a common file

This continues refactoring of the common parts of wired drivers code
into a shared file, so that they can be reused by other drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move driver_wired_set_ifflags() to a common file
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:48 +0000 (20:08 +0100)] 
drivers: Move driver_wired_set_ifflags() to a common file

This continues refactoring of the common parts of wired drivers code
into a shared file, so that they can be reused by other drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move driver_wired_get_ifflags() to a common file
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:47 +0000 (20:08 +0100)] 
drivers: Move driver_wired_get_ifflags() to a common file

This continues refactoring of the common parts of wired drivers code
into a shared file, so that they can be reused by other drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move driver_wired_multi() to a common file
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:46 +0000 (20:08 +0100)] 
drivers: Move driver_wired_multi() to a common file

This continues refactoring of the common parts of wired drivers code
into a shared file, so that they can be reused by other drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move wired_multicast_membership() to a common file
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:45 +0000 (20:08 +0100)] 
drivers: Move wired_multicast_membership() to a common file

This continues refactoring of the common parts of wired drivers code
into a shared file, so that they can be reused by other drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agodrivers: Move common definitions for wired drivers out
Sabrina Dubroca [Sun, 27 Nov 2016 19:08:44 +0000 (20:08 +0100)] 
drivers: Move common definitions for wired drivers out

Refactor the common parts of wired drivers code into a shared file, so
that they can be reused by other drivers. The macsec_qca driver already
contains a lot of code duplication from the wired driver, and the
macsec_linux driver would do the same. A structure to hold data common
to all wired drivers is added and used in all these drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agoAdd support to abort vendor scan
Sunil Dutt [Wed, 30 Nov 2016 04:39:38 +0000 (10:09 +0530)] 
Add support to abort vendor scan

This commit enhances the existing implementation of abort scan to also
abort concurrent active vendor scans. This is achieved by passing the
the scan_cookie to the driver interface with the intention to abort
the specific scan request. This scan_cookie is returned from the driver
interface when the scan request is scheduled.

This scan_cookie is 0 if the scan is triggered through the upstream
cfg80211 interface. Thus, the scan_cookie is used to determine whether
to abort the cfg80211 or vendor scan request.

Also, the previous implementation of relying on scan_work/p2p_scan_work
for the active work to trigger the abort scan is enhanced to check for
the started state of either of these work operations. This should also
help to abort the concurrent active scan/p2p-scan operations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Enhance abort scan to also abort the vendor scan
Sunil Dutt [Wed, 30 Nov 2016 04:34:38 +0000 (10:04 +0530)] 
nl80211: Enhance abort scan to also abort the vendor scan

This commit enhances the abort scan implementation to also abort the
vendor scan, if one was used to trigger the scan.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDefine a QCA vendor command to abort vendor scan
Sunil Dutt [Tue, 22 Nov 2016 15:20:08 +0000 (20:50 +0530)] 
Define a QCA vendor command to abort vendor scan

The new QCA_NL80211_VENDOR_SUBCMD_ABORT_SCAN command can be used to
abort an ongoing scan that was started with
QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: PMF and Authentication frame injection
Jouni Malinen [Tue, 29 Nov 2016 14:07:25 +0000 (16:07 +0200)] 
tests: PMF and Authentication frame injection

Verify that AP does not break PMF-enabled connection due to injected
Authentication frame. This is a regression test for
NL80211_FEATURE_FULL_AP_CLIENT_STATE changes resulting in dropping the
key in such a case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd MGMT_RX_PROCESS test command for hostapd
Jouni Malinen [Tue, 29 Nov 2016 13:57:22 +0000 (15:57 +0200)] 
Add MGMT_RX_PROCESS test command for hostapd

This makes it easier to write hwsim test cases to verify management
frame processing sequences with dropped or modified frames. When
ext_mgmt_frame_handling is used, this new command can be used to request
hostapd to process a received a management frame, e.g., based on
information reported in the MGMT-RX events.

This is more or less identical to the earlier wpa_supplicant commit
4de70e2330c54c32f42a5fc93517d65c0a2c3be9 ('Add MGMT_RX_PROCESS test
command for wpa_supplicant'), but for hostapd.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAP: Do not drop STA entry if PMF is used with full AP client state
Jouni Malinen [Tue, 29 Nov 2016 14:15:31 +0000 (16:15 +0200)] 
AP: Do not drop STA entry if PMF is used with full AP client state

This fixes a regression from commit
bb598c3bdd0616f0c15e1a42e99591d8f3ff3323 ('AP: Add support for full
station state'). That commit added code to remove and re-add the kernel
STA entry when processing Authentication frames with a driver that
advertises support for full AP client state. That resulted in bypassing
PMF protections for unprotected Authentication frames with such drivers
since the TK was lost in this operation.

It is simplest to skip the STA entry clearing in this type of case
completely to leave the TK in place and to process the new
authentication exchange otherwise normally. This matches the behavior
used with the drivers that do not implement full AP client state.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: WPA2-PSK-FT AP with WPA2-PSK enabled and unexpected MDE
Jouni Malinen [Sat, 26 Nov 2016 09:30:26 +0000 (11:30 +0200)] 
tests: WPA2-PSK-FT AP with WPA2-PSK enabled and unexpected MDE

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFT: Explicitly check for MDE not present in non-FT association
Will Glynn [Sat, 26 Nov 2016 02:39:12 +0000 (02:39 +0000)] 
FT: Explicitly check for MDE not present in non-FT association

IEEE Std 802.11-2012, 12.4.2 states that if an MDE is present in an
(Re)Association Request frame but the RSNE uses a non-FT AKM suite, the
AP shall reject the association using status code 43 ("Invalid AKMP").

wpa_validate_wpa_ie() now explicitly checks for this condition to meet
this requirement instead of simply ignoring the MDE based on non-FT AKM.

Signed-off-by: Will Glynn <will@willglynn.com>
8 years agotests: Beacon frame TX rate configuration
Jouni Malinen [Fri, 25 Nov 2016 22:36:50 +0000 (00:36 +0200)] 
tests: Beacon frame TX rate configuration

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Configure Beacon frame TX rate if driver advertises support
Purushottam Kushwaha [Thu, 24 Nov 2016 15:09:47 +0000 (20:39 +0530)] 
nl80211: Configure Beacon frame TX rate if driver advertises support

If the driver advertises support for setting Beacon frame data rate,
allow the user to configure this rate as part of starting the AP. Only
one Beacon frame TX rate is allowed.

Drivers advertising such support should set corresponding flag via the
NL80211_ATTR_EXT_FEATURES attribute.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd support for user configurable Beacon frame data rate for AP mode
Purushottam Kushwaha [Tue, 22 Nov 2016 09:10:35 +0000 (14:40 +0530)] 
Add support for user configurable Beacon frame data rate for AP mode

Allow configuration of Beacon frame TX rate from hostapd.conf with
"beacon_rate=xx" option. The following format is used to set
legacy/HT/VHT beacon rates:

Legacy (CCK/OFDM rates):
beacon_rate=<legacy rate in 100 kbps>
HT:
beacon_rate=ht:<HT MCS>
VHT:
beacon_rate=vht:<VHT MCS>

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Random MAC address in scans while connected
Jouni Malinen [Fri, 25 Nov 2016 20:48:26 +0000 (22:48 +0200)] 
tests: Random MAC address in scans while connected

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoUse random MAC address for scanning only in non-connected state
Srinivas Dasari [Mon, 21 Nov 2016 12:10:36 +0000 (17:40 +0530)] 
Use random MAC address for scanning only in non-connected state

cfg80211 rejects the scans issued with random MAC address if the STA is
in connected state. This resulted in failures when using MAC_RAND_SCAN
while connected (CTRL-EVENT-SCAN-FAILED ret=-95). Enable random MAC
address functionality only if the STA is not in connected state to avoid
this. The real MAC address of the STA is already revealed in the
association, so this is an acceptable fallback mechanism for now.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: D-Bus P2P and IP address parameters
Jouni Malinen [Mon, 21 Nov 2016 11:57:21 +0000 (13:57 +0200)] 
tests: D-Bus P2P and IP address parameters

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoD-Bus: Send P2P IP address assignment info with GroupStarted event
Nishant Chaprana [Wed, 2 Nov 2016 10:20:28 +0000 (15:50 +0530)] 
D-Bus: Send P2P IP address assignment info with GroupStarted event

This commit adds IP address information into GroupStarted event on the
P2P client side like it is sent over the control interface.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
8 years agoD-Bus: Add getter and setter for P2P IP address config parameters
Nishant Chaprana [Thu, 3 Nov 2016 10:52:43 +0000 (16:22 +0530)] 
D-Bus: Add getter and setter for P2P IP address config parameters

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>
8 years agoFT: Complete CONFIG_IEEE80211R_AP renaming for hostapd
Jouni Malinen [Sat, 19 Nov 2016 21:54:50 +0000 (23:54 +0200)] 
FT: Complete CONFIG_IEEE80211R_AP renaming for hostapd

Commit 4ec1fd8e42bad9390f14a58225b6e5f6fb691950 ('FT: Differentiate
between FT for station and for AP in build') renamed all
CONFIG_IEEE80211R instances within src/ap/* to CONFIG_IEEE80211R_AP, but
it did not change hostapd/* files to match. While this does not cause
much harm for normal use cases, this broke some test builds where
wpa_supplicant build is used to build in hostapd/*.c files for analysis.
Fix this by completing CONFIG_IEEE80211R_AP renaming.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_supplicant: Allow configuring the MACsec port for MKA
Sabrina Dubroca [Wed, 2 Nov 2016 15:38:39 +0000 (16:38 +0100)] 
wpa_supplicant: Allow configuring the MACsec port for MKA

Previously, wpa_supplicant only supported hardcoded port == 1 in the
SCI, but users may want to choose a different port.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agomka: Add enable_encrypt op and call it from CP state machine
Sabrina Dubroca [Wed, 2 Nov 2016 15:38:38 +0000 (16:38 +0100)] 
mka: Add enable_encrypt op and call it from CP state machine

This allows MKA to turn encryption on/off down to the driver.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agowpa_supplicant: Add macsec_integ_only setting for MKA
Sabrina Dubroca [Wed, 2 Nov 2016 15:38:37 +0000 (16:38 +0100)] 
wpa_supplicant: Add macsec_integ_only setting for MKA

So that the user can turn encryption on (MACsec provides
confidentiality+integrity) or off (MACsec provides integrity only). This
commit adds the configuration parameter while the actual behavior change
to disable encryption in the driver is handled in the following commit.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agomka: Disable peer detection timeout for PSK mode
Sabrina Dubroca [Wed, 2 Nov 2016 15:38:36 +0000 (16:38 +0100)] 
mka: Disable peer detection timeout for PSK mode

The first peer may take a long time to come up. In PSK mode we are
basically in a p2p system, and we cannot know when a peer will join the
key exchange. Wait indefinitely, and let the administrator decide if
they want to abort.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agowpa_supplicant: Allow pre-shared (CAK,CKN) pair for MKA
Sabrina Dubroca [Wed, 2 Nov 2016 15:38:35 +0000 (16:38 +0100)] 
wpa_supplicant: Allow pre-shared (CAK,CKN) pair for MKA

This enables configuring key_mgmt=NONE + mka_ckn + mka_cak.
This allows wpa_supplicant to work in a peer-to-peer mode, where peers
are authenticated by the pre-shared (CAK,CKN) pair. In this mode, peers
can act as key server to distribute keys for the MACsec instances.

This is what some MACsec switches support, and even without HW
support, it's a convenient way to setup a network.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agoFix hostapd usage entry style for -T
Jouni Malinen [Sat, 19 Nov 2016 20:20:14 +0000 (22:20 +0200)] 
Fix hostapd usage entry style for -T

Remove the extra equals sign from the line since hostapd usage text does
not have it for other entries either (while wpa_supplicant does and this
was likely copy-pasted from there).

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd doxygen ref to eap_method structure
Sergei Sinyak [Thu, 10 Nov 2016 15:34:34 +0000 (18:34 +0300)] 
Add doxygen ref to eap_method structure

doc/eap.doxygen was mentioning eap_method structure, but there was no
reference as in doc/eap_server.doxygen on a similar paragraph

Signed-off-by: Sergei Sinyak <serega.belarus@gmail.com>
8 years agoAndroid: Remove BoringSSL guard
Kenny Root [Thu, 10 Nov 2016 21:05:01 +0000 (21:05 +0000)] 
Android: Remove BoringSSL guard

BoringSSL is the only supported version of SSL, so remove this guard so
we can continue to compile when the flavor.mk is removed.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
8 years agonl80211: Fix get_inact_sec() returning -1 on failure
Joel Cunningham [Thu, 10 Nov 2016 19:24:41 +0000 (13:24 -0600)] 
nl80211: Fix get_inact_sec() returning -1 on failure

This commit fixes the nl80211 driver call get_inact_sec() to return -1
when STA inactivity time retrieval fails in i802_read_sta_data().

This was intended to be handled by initalizing the inactive_msec member
to -1 but i802_read_sta_data() assumes the data parameter is
uninitialized and memsets the entire structure, neutralizing the attempt
to distinguish between no value (-1) and a time value of 0.

This is fixed by now requiring i802_read_sta_data() callers to
initialize the data structure first (allowing get_inact_sec() to use
-1). This is a safe change because it does not change any driver API
behavior and only affects one other static function in driver_nl80211.c

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
8 years agomka: Fix getting capabilities from the driver
Sabrina Dubroca [Tue, 15 Nov 2016 17:06:23 +0000 (18:06 +0100)] 
mka: Fix getting capabilities from the driver

In commit a25e4efc9e428d968e83398bd8c9c94698ba5851 ('mka: Add driver op
to get macsec capabilities') I added some code to check the driver's
capabilities. This commit has two problems:
 - wrong enum type set in kay->macsec_confidentiality
 - ignores that drivers could report MACSEC_CAP_NOT_IMPLEMENTED, in
   which case the MKA would claim that MACsec is supported.

Fix this by interpreting MACSEC_CAP_NOT_IMPLEMENTED in the same way as a
DO_NOT_SECURE policy, and set the correct value in
kay->macsec_confidentiality.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
8 years agotests: GAS/ANQP and Capability List ANQP-element
Jouni Malinen [Thu, 17 Nov 2016 14:00:10 +0000 (16:00 +0200)] 
tests: GAS/ANQP and Capability List ANQP-element

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoReserve QCA vendor specific nl80211 command 144
Peng Xu [Wed, 9 Nov 2016 22:51:20 +0000 (14:51 -0800)] 
Reserve QCA vendor specific nl80211 command 144

This is reserved for QCA use.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: GAS/ANQP and Venue URL
Jouni Malinen [Wed, 16 Nov 2016 18:32:42 +0000 (20:32 +0200)] 
tests: GAS/ANQP and Venue URL

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoGAS: Add Capability List ANQP-element support for Info ID 270, 280..299
Jouni Malinen [Wed, 16 Nov 2016 18:13:53 +0000 (20:13 +0200)] 
GAS: Add Capability List ANQP-element support for Info ID 270, 280..299

This extends the anqp_elem configuration parameter support for new Info
IDs (270 (TDLS Capability) was previously missed from the list of
defined values, 280 has already been assigned in REVmc/D8.0; 281..299
are yet to be assigned). No additional source code changes are needed to
allow hostapd to advertise support for these if the ANQP-element value
is set with the anqp_elem parameter.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Allow multiple management frames to be used with ap-mgmt-fuzzer
Jouni Malinen [Wed, 16 Nov 2016 16:17:08 +0000 (18:17 +0200)] 
tests: Allow multiple management frames to be used with ap-mgmt-fuzzer

The optional "-m <multi.dat>" command line option can now be used to
specify a data file that can include multiple management frames with
each one prefixed with a 16-bit big endian length field. This allows a
single fuzzer run to be used to go through multi-frame exchanges. The
multi.dat file shows an example of this with Probe Request frame,
Authentication frame, Association Request frame, and an Action frame.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix libap.a build
Jouni Malinen [Wed, 16 Nov 2016 11:26:23 +0000 (13:26 +0200)] 
Fix libap.a build

Add the new defines and files to allow src/ap/libap.a to be build with
all the needed functions.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDebug print scan results matching the currently selected network
Jouni Malinen [Sun, 13 Nov 2016 16:22:38 +0000 (18:22 +0200)] 
Debug print scan results matching the currently selected network

This provides more details on BSS selection process in the debug log.
Previously, the BSSs that were not either the current or the selected
one were not necessarily printed at all. Now all BSSs that match the
currently selected network are listed with their frequency and signal
strength details.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoUse estimated throughput to avoid signal based roaming decision
Jouni Malinen [Sun, 13 Nov 2016 15:46:00 +0000 (17:46 +0200)] 
Use estimated throughput to avoid signal based roaming decision

Previously, the estimated throughput was used to enable roaming to a
better AP. However, this information was not used when considering a
roam to an AP that has better signal strength, but smaller estimated
throughput. This could result in allowing roaming from 5 GHz band to 2.4
GHz band in cases where 2.4 GHz band has significantly higher signal
strength, but still a lower throughput estimate.

Make this less likely to happen by increasing/reducing the minimum
required signal strength difference based on the estimated throughputs
of the current and selected AP. In addition, add more details about the
selection process to the debug log to make it easier to determine whaty
happened and why.

Signed-off-by: Jouni Malinen <j@w1.fi>