]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agoOWE: Process Diffie-Hellman Parameter element in AP mode
Jouni Malinen [Sat, 11 Mar 2017 23:26:43 +0000 (01:26 +0200)] 
OWE: Process Diffie-Hellman Parameter element in AP mode

This adds AP side processing for OWE Diffie-Hellman Parameter element in
(Re)Association Request frame and adding it in (Re)Association Response
frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOWE: Add driver capability flag for OWE AKM
Jouni Malinen [Sat, 11 Mar 2017 22:38:04 +0000 (00:38 +0200)] 
OWE: Add driver capability flag for OWE AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOWE: Define and parse OWE AKM selector
Jouni Malinen [Sat, 11 Mar 2017 22:32:23 +0000 (00:32 +0200)] 
OWE: Define and parse OWE AKM selector

This adds a new RSN AKM "OWE".

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOWE: Define and parse Diffie-Hellman Parameter element
Jouni Malinen [Sat, 11 Mar 2017 22:23:36 +0000 (00:23 +0200)] 
OWE: Define and parse Diffie-Hellman Parameter element

Add WLAN_EID_EXT_OWE_DH_PARAM definition and extend
ieee802_11_parse_elems() to recognize this element.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Extract-and-Expand HKDF (RFC 5869)
Jouni Malinen [Sat, 11 Mar 2017 20:40:31 +0000 (22:40 +0200)] 
tests: Extract-and-Expand HKDF (RFC 5869)

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoExtend hmac_sha256_kdf() to support HKDF-Expand() as defined in RFC 5869
Jouni Malinen [Sat, 11 Mar 2017 20:38:47 +0000 (22:38 +0200)] 
Extend hmac_sha256_kdf() to support HKDF-Expand() as defined in RFC 5869

The KDF define in RFC 5295 is very similar to HKDF-Expand() defined in
RFC 5869. Allow a NULL label to be used to select the RFC 5869 version
with arbitrary seed (info in RFC 5869) material without forcing the
label and NULL termination to be included. HKDF-Expand() will be needed
for OWE.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOpenSSL: Add wrapper functions for ECDH
Jouni Malinen [Sat, 11 Mar 2017 16:54:33 +0000 (18:54 +0200)] 
OpenSSL: Add wrapper functions for ECDH

These allow ECDH to be used with compressed public key encoding (only
x-coordinate). This is needed for FILS PFS and OWE.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: wpa_supplicant AP mode - HT disabled
Jouni Malinen [Sat, 11 Mar 2017 09:20:17 +0000 (11:20 +0200)] 
tests: wpa_supplicant AP mode - HT disabled

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_supplicant: Allow disabling HT in AP mode without HT overrides
Johannes Berg [Tue, 7 Mar 2017 16:20:59 +0000 (18:20 +0200)] 
wpa_supplicant: Allow disabling HT in AP mode without HT overrides

Since VHT can be toggled explicitly, also expose being able to disable
HT explicitly, without requiring HT overrides. Continue making it
default to enabled though.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agotests: add wpa_supplicant 80 MHz VHT network test
Johannes Berg [Tue, 7 Mar 2017 16:20:58 +0000 (18:20 +0200)] 
tests: add wpa_supplicant 80 MHz VHT network test

Add a test for the configuration knobs exposed in the previous
patch; more precisely, add a test that creates an 80 MHz VHT
network through wpa_supplicant (without P2P).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agowpa_supplicant: Allow explicit wide channel configuration for AP mode
Johannes Berg [Tue, 7 Mar 2017 16:20:57 +0000 (18:20 +0200)] 
wpa_supplicant: Allow explicit wide channel configuration for AP mode

Instead of deducing the wide (HT, VHT) channel configuration only
automatically in P2P mode, allow it to be configured in the network
in non-P2P mode.

Also allow all of these parameters to be configured through the control
interface or the configuration file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agowpa_cli: Execute action file in case of WPS_EVENT_TIMEOUT
Jörg Krause [Thu, 9 Mar 2017 09:59:50 +0000 (10:59 +0100)] 
wpa_cli: Execute action file in case of WPS_EVENT_TIMEOUT

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
7 years agowpa_cli: Execute action file in case of WPS_EVENT_ACTIVE
Jörg Krause [Thu, 9 Mar 2017 09:59:49 +0000 (10:59 +0100)] 
wpa_cli: Execute action file in case of WPS_EVENT_ACTIVE

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
7 years agoWPS: Notify about WPS PBC event in Enrollee mode
Jörg Krause [Thu, 9 Mar 2017 09:59:48 +0000 (10:59 +0100)] 
WPS: Notify about WPS PBC event in Enrollee mode

Previously, the event "WPS-PBC-ACTIVE" was only generated when
wpa_supplicant is operating as WPS Registrar whereas "WPS-SUCCESS" or
"WPS-TIMEOUT" are generated for both, the Registrar and the Enrollee
roles.

Also generate the event when wpa_supplicant is operating as WPS Enrollee
to allow monitoring the begin and the end of a WPS PBC process.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
7 years agowpa_supplicant: events: Don't bounce timeout reason through a buffer
Johannes Berg [Wed, 8 Mar 2017 20:41:17 +0000 (21:41 +0100)] 
wpa_supplicant: events: Don't bounce timeout reason through a buffer

There's no point in making the code use a stack buffer and first copying
the string there, only to copy it again to the output. Make the output
directly use the reason string.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agotests: BSS transition management query with unknown candidates
Avraham Stern [Wed, 8 Mar 2017 12:37:42 +0000 (14:37 +0200)] 
tests: BSS transition management query with unknown candidates

Verify that the AP responds to a BSS transition management query that
includes candidates unknown to the AP.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agowpa_cli: Update wnm_bss_query auto complete message
Avraham Stern [Wed, 8 Mar 2017 12:37:41 +0000 (14:37 +0200)] 
wpa_cli: Update wnm_bss_query auto complete message

It is now possible to add neighbor configuration to wnm_bss_query.
Update the auto complete message to reflect that.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agoWNM: Add option to configure candidates for BTM query candidate list
Avraham Stern [Wed, 8 Mar 2017 12:37:40 +0000 (14:37 +0200)] 
WNM: Add option to configure candidates for BTM query candidate list

Add a mechanism to configure the candidates for BTM query candidate list
manually. This can be used to verify AP behavior for various candidates
preferences.

usage:
wnm_bss_query <reason> [neighbor=<BSSID>,<BSSID information>,
                <operating class>,<channel number>,
<PHY type>[,<hexdump of optional subelements>]]

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agocommon: Add candidate list parsing helper function
Avraham Stern [Wed, 8 Mar 2017 12:37:39 +0000 (14:37 +0200)] 
common: Add candidate list parsing helper function

Add a helper function that parses candidate list from command line
arguments.

This function will be used (in the following commits) to add
a candidate list to BSS transition management query.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agoWNM: Use a dynamically allocated buffer for BTM query and response
Avraham Stern [Wed, 8 Mar 2017 12:37:38 +0000 (14:37 +0200)] 
WNM: Use a dynamically allocated buffer for BTM query and response

BSS transition management query and response use a large static buffer
for the frame because the candidate list may require a lot of space.
However, in most cases the actually used space will be much less than
the buffer (since the candidate list is short or completely missing).

Use a dynamically allocated buffer instead and allocate it according
to the actual space needed.

While at it, remove unneeded filling of the MAC header in the Action
frames, since this gets ignored and wpa_drv_send_action() adds the MAC
header anyway.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agotests: MBO ANQP
Jouni Malinen [Fri, 10 Mar 2017 16:59:12 +0000 (18:59 +0200)] 
tests: MBO ANQP

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMBO: Parse MBO ANQP-element on STA
Jouni Malinen [Fri, 10 Mar 2017 16:57:12 +0000 (18:57 +0200)] 
MBO: Parse MBO ANQP-element on STA

This extends the GAS/ANQP parser in wpa_supplicant to process MBO
ANQP-elements and indicate received Cellular Data Connection Preference
values over the control interface.

When a valid MBO ANQP-element is received, the following control
interface message is sent:

RX-MBO-ANQP <BSSID> cell_conn_pref=<value>

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMBO: Add MBO ANQP-element processing on AP
Jouni Malinen [Fri, 10 Mar 2017 16:33:51 +0000 (18:33 +0200)] 
MBO: Add MBO ANQP-element processing on AP

This extends the GAS server to process MBO ANQP-elements and reply to a
query for the Cellular Data Connection Preference (if configured). The
new configuration parameter mbo_cell_data_conn_pref can be used to set
the value (0, 1, or 255) for the preference to indicate.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Extend ANQP_GET coverage for new functionality
Jouni Malinen [Fri, 10 Mar 2017 15:03:55 +0000 (17:03 +0200)] 
tests: Extend ANQP_GET coverage for new functionality

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoANQP: Extend ANQP_GET command to request without IEEE 802.11 elements
Jouni Malinen [Fri, 10 Mar 2017 15:02:22 +0000 (17:02 +0200)] 
ANQP: Extend ANQP_GET command to request without IEEE 802.11 elements

Previously, ANQP_GET required at least one IEEE 802.11 ANQP-element to
be requested. This is not really necessary, so allow a case where
num_ids == 0 as long as the request includes at least one Hotspot 2.0 or
MBO ANQP-element.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Fix MBO ANQP cellular data preference query
Avraham Stern [Mon, 6 Mar 2017 12:59:55 +0000 (14:59 +0200)] 
tests: Fix MBO ANQP cellular data preference query

The cellular data preference ANQP element subtype is now 2, so
fix the command to query the MBO cellular data preference.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agoMBO: Add option to add MBO query list to ANQP query
Avraham Stern [Thu, 9 Mar 2017 13:19:58 +0000 (15:19 +0200)] 
MBO: Add option to add MBO query list to ANQP query

MBO techspec v0.0_r27 changed the MBO ANQP-element format. The MBO
element in ANQP query should now include an MBO Query List element that
contains a list of MBO elements to query.

Add API to add the MBO Query List to an ANQP query.

Format:
ANQP_GET <addr> <info_id>[,<info_id>]...[,mbo:<subtype>...]

Example for querying neighbor report with MBO cellular data
connection preference:
ANQP_GET <bssid> 272,mbo:2

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agotests: Additional RADIUS accounting failure cases
Jouni Malinen [Fri, 10 Mar 2017 10:23:25 +0000 (12:23 +0200)] 
tests: Additional RADIUS accounting failure cases

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDFS: Handle pre-CAC expired event
Vasanthakumar Thiagarajan [Wed, 8 Mar 2017 05:13:17 +0000 (10:43 +0530)] 
DFS: Handle pre-CAC expired event

As FCC DFS requirement does not explicitly mention about the validity of
the (pre-)CAC when channel is switched, it is safe to assume that the
pre-CAC result will not be valid once the CAC completed channel is
switched or radar detection is not active on the (CAC completed) channel
within a time period which is allowed (10 seconds - channel switch time)
as per FCC DFS requirement.

Use the new driver event to allow the driver to notify expiry of the CAC
result on a channel. Move the DFS state of the channel to 'usable' when
processing pre-CAC expired event.  This means any future operation on
that channel will require a new CAC to be completed. This event is
applicable only when DFS is not offloaded to the kernel driver.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
7 years agonl80211: Handle pre-CAC expired event from the driver
Vasanthakumar Thiagarajan [Wed, 8 Mar 2017 05:13:17 +0000 (10:43 +0530)] 
nl80211: Handle pre-CAC expired event from the driver

Process the new nl80211 event NL80211_RADAR_PRE_CAC_EXPIRED to allow the
driver to notify expiry of the CAC result on a channel.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
7 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Thu, 9 Mar 2017 14:58:31 +0000 (16:58 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2017-03-06.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoDFS: Handle CAC completion event from other radio
Vasanthakumar Thiagarajan [Wed, 8 Mar 2017 05:13:16 +0000 (10:43 +0530)] 
DFS: Handle CAC completion event from other radio

When DFS channel state is shared across multiple radios on the system it
is possible that a CAC completion event is propagated from other radio
to us. When in enabled state, do not proceed with setup completion upon
processing CAC completion event with devices where DFS is not offloaded,
when in state other than enabled make sure the configured DFS channel is
in available state before start the AP.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
7 years agonl80211: Add option to delay start of schedule scan plans
Purushottam Kushwaha [Mon, 6 Mar 2017 07:53:10 +0000 (13:23 +0530)] 
nl80211: Add option to delay start of schedule scan plans

The userspace may want to delay the the first scheduled scan.
This enhances sched_scan to add initial delay (in seconds) before
starting first scan cycle. The driver may optionally choose to
ignore this parameter and start immediately (or at any other time).

This uses NL80211_ATTR_SCHED_SCAN_DELAY to add this via user
global configurable option: sched_scan_start_delay.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoRRM: Fix wpas_rrm_send_msr_report() loop handling
Jouni Malinen [Wed, 8 Mar 2017 14:16:37 +0000 (16:16 +0200)] 
RRM: Fix wpas_rrm_send_msr_report() loop handling

The while (len) loop was updating the next pointer at the end even when
len == 0, i.e., when the new next value won't be used. This could result
in reading one octet beyond the end of the allocated response wpabuf.
While the read value is not really used in practice, this is not correct
behavior, so fix this by skipping the unnecessary next pointer update in
len == 0 case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoRRM: Use dynamically allocated buffer for beacon report
Avraham Stern [Wed, 8 Mar 2017 12:31:49 +0000 (14:31 +0200)] 
RRM: Use dynamically allocated buffer for beacon report

The maximum required size for each Beacon Report element is known in
advance: it is the size of the Beacon Report element fixed fields + the
size of the Reported Frame Body subelement.

Allocate the buffer used for constructing the Beacon Report element
dynamically with the maximum needed size, instead of using a very
large static buffer.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agotests: Fix authsrv_errors_1 and authsrv_errors_3 when running on host
Jouni Malinen [Tue, 7 Mar 2017 16:13:05 +0000 (18:13 +0200)] 
tests: Fix authsrv_errors_1 and authsrv_errors_3 when running on host

Use a non-existing directory in the path to avoid SQLite from being able
to create a new database file. The previous design worked in the VM case
due to the host file system being read-only, but a bit more is needed
for the case when this is running on the host.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoUse os_memdup()
Johannes Berg [Tue, 7 Mar 2017 09:17:23 +0000 (10:17 +0100)] 
Use os_memdup()

This leads to cleaner code overall, and also reduces the size
of the hostapd and wpa_supplicant binaries (in hwsim test build
on x86_64) by about 2.5 and 3.5KiB respectively.

The mechanical conversions all over the code were done with
the following spatch:

    @@
    expression SIZE, SRC;
    expression a;
    @@
    -a = os_malloc(SIZE);
    +a = os_memdup(SRC, SIZE);
    <...
    if (!a) {...}
    ...>
    -os_memcpy(a, SRC, SIZE);

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoIntroduce os_memdup()
Johannes Berg [Tue, 7 Mar 2017 09:17:23 +0000 (10:17 +0100)] 
Introduce os_memdup()

This can be used to clean the code and reduce size by converting
os_malloc() followed by os_memcpy() cases to use a single function call.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agogitignore: Add parallel-vm.log
Johannes Berg [Tue, 7 Mar 2017 06:48:37 +0000 (07:48 +0100)] 
gitignore: Add parallel-vm.log

Ignore parallel-vm.log regardless of where in the tree
it was created.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoap-mgmt-fuzzer: Add .gitignore
Johannes Berg [Tue, 7 Mar 2017 06:47:41 +0000 (07:47 +0100)] 
ap-mgmt-fuzzer: Add .gitignore

Ignore the binary created here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agowpadebug: Add .gitignore
Jouni Malinen [Tue, 7 Mar 2017 10:10:11 +0000 (12:10 +0200)] 
wpadebug: Add .gitignore

Ignore the automatically generated build directories and files.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMBO: Add support for transition reject reason code
Kanchanapally, Vidyullatha [Mon, 6 Mar 2017 11:46:00 +0000 (17:16 +0530)] 
MBO: Add support for transition reject reason code

Add support for rejecting a BSS transition request using MBO reject
reason codes. A candidate is selected or rejected based on whether it is
found acceptable by both wpa_supplicant and the driver. Also accept any
candidate meeting a certain threshold if disassoc imminent is set in BTM
Request frame.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: Driver command for checking BTM accept/reject
Kanchanapally, Vidyullatha [Mon, 6 Mar 2017 11:43:10 +0000 (17:13 +0530)] 
nl80211: Driver command for checking BTM accept/reject

Add driver interface command using the QCA vendor extensions to check
the driverr whether to accept or reject a BSS transition candidate. For
the reject case, report an MBO reject reason code.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Make beacon report tests remote compatible
Avraham Stern [Mon, 6 Mar 2017 11:30:38 +0000 (13:30 +0200)] 
tests: Make beacon report tests remote compatible

Use the new hostapd.add_ap() API (i.e., pass the ap device as a
parameter instead of the interface name) in beacon report tests to
make them remote compatible, and mark them appropriately.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agotests: Make wnm_bss_tm_req a bit more efficient and robust
Jouni Malinen [Mon, 6 Mar 2017 21:53:33 +0000 (23:53 +0200)] 
tests: Make wnm_bss_tm_req a bit more efficient and robust

Use a local variable for the STA address instead of fetching it
separately for each operation. Dump control interface monitor events
between each test message to avoid increasing the socket output queue
unnecessarily.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Clean up wnm_bss_tm_req test not initialize unused AP
Beni Lev [Mon, 6 Mar 2017 11:30:37 +0000 (13:30 +0200)] 
tests: Clean up wnm_bss_tm_req test not initialize unused AP

The second AP is not really needed in this test case that verifies
parsing of various different BSs Transition Management Request frame
payloads.

Signed-off-by: Beni Lev <beni.lev@intel.com>
7 years agowpa_supplicant: Fix non_pref_chan example
Avraham Stern [Mon, 6 Mar 2017 11:30:36 +0000 (13:30 +0200)] 
wpa_supplicant: Fix non_pref_chan example

The parsing code expects non_pref_chan to be non-quoted.
Fix the example in wpa_supplicant.conf not to include
quotes.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agotests: Rename ap_wpa2_psk_file test
Andrei Otcheretianski [Mon, 6 Mar 2017 11:30:35 +0000 (13:30 +0200)] 
tests: Rename ap_wpa2_psk_file test

There are two different tests with the same name in test_ap_psk.py.
Fix that.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 years agotests: hostapd authentication server test cases
Jouni Malinen [Sun, 5 Mar 2017 10:06:28 +0000 (12:06 +0200)] 
tests: hostapd authentication server test cases

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Add TEST_FAIL() to radius_msg_add_attr()
Jouni Malinen [Sun, 5 Mar 2017 14:36:24 +0000 (16:36 +0200)] 
tests: Add TEST_FAIL() to radius_msg_add_attr()

This makes it easier to test error paths for RADIUS message
construction.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoRADIUS server: Fix error paths in new session creation
Jouni Malinen [Sun, 5 Mar 2017 14:16:42 +0000 (16:16 +0200)] 
RADIUS server: Fix error paths in new session creation

radius_server_session_free() does not remove the session from the
session list and these radius_server_get_new_session() error paths ended
up leaving a pointer to freed memory into the session list. This
resulted in the following operations failing due to use of freed memory.

Fix this by using radius_server_session_remove() which removes the entry
from the list in addition to calling radius_server_session_free().

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Automatic channel selection failures
Jouni Malinen [Sat, 4 Mar 2017 14:59:57 +0000 (16:59 +0200)] 
tests: Automatic channel selection failures

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Automatic channel selection for VHT160
Jouni Malinen [Sat, 4 Mar 2017 11:54:31 +0000 (13:54 +0200)] 
tests: Automatic channel selection for VHT160

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoACS: Fix memory leak if interface is disabled during scan
Jouni Malinen [Sat, 4 Mar 2017 11:48:29 +0000 (13:48 +0200)] 
ACS: Fix memory leak if interface is disabled during scan

The survey data was not freed if hostapd interface got disabled during
an ACS scan.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Automatic channel selection for VHT40
Jouni Malinen [Sat, 4 Mar 2017 11:30:43 +0000 (13:30 +0200)] 
tests: Automatic channel selection for VHT40

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Automatic channel selection for HT40- channel
Jouni Malinen [Sat, 4 Mar 2017 11:28:27 +0000 (13:28 +0200)] 
tests: Automatic channel selection for HT40- channel

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoACS: Simplify code paths
Jouni Malinen [Sat, 4 Mar 2017 11:22:46 +0000 (13:22 +0200)] 
ACS: Simplify code paths

This removes some unnecessarily duplicated return paths and simplifies
code paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: ProxyARP error cases
Jouni Malinen [Sat, 4 Mar 2017 09:44:55 +0000 (11:44 +0200)] 
tests: ProxyARP error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Add TEST_FAIL() checks in l2_packet
Jouni Malinen [Sat, 4 Mar 2017 09:43:58 +0000 (11:43 +0200)] 
tests: Add TEST_FAIL() checks in l2_packet

This enables additional test coverage for error paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix DHCP/NDISC snoop deinit followed by failing re-init
Jouni Malinen [Sat, 4 Mar 2017 09:42:15 +0000 (11:42 +0200)] 
Fix DHCP/NDISC snoop deinit followed by failing re-init

It was possible to hit a double-free on the l2_packet socket if
initialization of DHCP/NDISC snoop failed on a hostapd interface that
had previously had those enabled successfully. Fix this by clearing the
l2_packet pointers during deinit.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: P2P autonomous GO and NoA
Jouni Malinen [Sat, 4 Mar 2017 08:57:28 +0000 (10:57 +0200)] 
tests: P2P autonomous GO and NoA

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd QCA vendor command/attr for BRP antenna limit control
Alexei Avshalom Lazar [Tue, 28 Feb 2017 07:36:41 +0000 (09:36 +0200)] 
Add QCA vendor command/attr for BRP antenna limit control

Add QCA_NL80211_VENDOR_SUBCMD_BRP_SET_ANT_LIMIT for setting the number
of antennas that will be active in different modes for each connection.

Signed-off-by: Alexei Avshalom Lazar <qca_ailizaro@qca.qualcomm.com>
7 years agotests: Scan failures for TYPE=ONLY
Jouni Malinen [Wed, 1 Mar 2017 14:42:56 +0000 (16:42 +0200)] 
tests: Scan failures for TYPE=ONLY

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoClear scan_res_handler on no-retry failure
Hu Wang [Wed, 1 Mar 2017 14:39:30 +0000 (16:39 +0200)] 
Clear scan_res_handler on no-retry failure

Previously it was possible for wpa_s->scan_res_handler to remain set to
its old value in case wpa_drv_scan() failed and no retry for the scan
trigger was scheduled (i.e., when last_scan_req == MANUAL_SCAN_REQ).
This could result in getting stuck with the next connection attempt
after a failed "SCAN TYPE=ONLY" operation when wpa_s->scan_res_handler
was set to scan_only_handler().

Fix this by clearing wpa_s->scan_res_handler if wpa_drv_scan() fails and
no retry is scheduled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Wi-Fi Display extensions to P2P with R2 subelems
Jouni Malinen [Wed, 1 Mar 2017 10:16:10 +0000 (12:16 +0200)] 
tests: Wi-Fi Display extensions to P2P with R2 subelems

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoWFD: Add WFD R2 Subelements
Amarnath Hullur Subramanyam [Wed, 1 Mar 2017 05:18:58 +0000 (21:18 -0800)] 
WFD: Add WFD R2 Subelements

Define and add support for WFD R2 Subelements.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoQCA nl80211 vendor attribute for specific sub-20 MHz channel width
Gaole Zhang [Wed, 1 Mar 2017 07:56:32 +0000 (15:56 +0800)] 
QCA nl80211 vendor attribute for specific sub-20 MHz channel width

Define a new attribute QCA_WLAN_VENDOR_ATTR_CONFIG_SUB20_CHAN_WIDTH.
This attribute can set a station device to work in 5 or 10 MHz channel
width while in disconnect state.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: WNM BSS Transition Management and scan needed (Table E-4)
Jouni Malinen [Wed, 1 Mar 2017 09:39:24 +0000 (11:39 +0200)] 
tests: WNM BSS Transition Management and scan needed (Table E-4)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: WNM BSS TM with explicit Table E-4 indication
Jouni Malinen [Wed, 1 Mar 2017 09:25:49 +0000 (11:25 +0200)] 
tests: WNM BSS TM with explicit Table E-4 indication

wnm_bss_tm_global uses an unknown country code to use Table E-4. Extend
that with otherwise identical test case wnm_bss_tm_global4, but with the
country string explicitly indicating use of Table E-4 while using a
known country code.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Country code string and the third octet
Jouni Malinen [Wed, 1 Mar 2017 09:11:31 +0000 (11:11 +0200)] 
tests: Country code string and the third octet

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMake the third octet of Country String configurable
Jouni Malinen [Wed, 1 Mar 2017 08:58:15 +0000 (10:58 +0200)] 
Make the third octet of Country String configurable

The new hostapd.conf parameter country3 can now be used to configure the
third octet of the Country String that was previously hardcoded to ' '
(= 0x20).

For example:

All environments of the current frequency band and country (default)
country3=0x20

Outdoor environment only
country3=0x4f

Indoor environment only
country3=0x49

Noncountry entity (country_code=XX)
country3=0x58

IEEE 802.11 standard Annex E table indication: 0x01 .. 0x1f
Annex E, Table E-4 (Global operating classes)
country3=0x04

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Add mesh path test
Masashi Honma [Tue, 28 Feb 2017 00:50:52 +0000 (09:50 +0900)] 
tests: Add mesh path test

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agotests: Save the log of wmediumd
Masashi Honma [Tue, 28 Feb 2017 00:50:51 +0000 (09:50 +0900)] 
tests: Save the log of wmediumd

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agotests: Work around pyopenssl API change
Jouni Malinen [Tue, 28 Feb 2017 09:48:16 +0000 (11:48 +0200)] 
tests: Work around pyopenssl API change

OpenSSL.SSL.Connection.state_string() was replaced with
get_state_string() in pyopenssl. Add workaround code to be able to use
either of these names.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotrace: Look up start to cope with ASLR
Johannes Berg [Mon, 27 Feb 2017 23:04:14 +0000 (00:04 +0100)] 
trace: Look up start to cope with ASLR

When ASLR is enabled, like it is by default on many distros now,
the trace code doesn't work right.

Fix this by looking up the start of the executable mapping and
subtracing it from all the lookups.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
7 years agotests: Fix EAPOL frame source address in protocol tests
Jouni Malinen [Mon, 27 Feb 2017 22:03:48 +0000 (00:03 +0200)] 
tests: Fix EAPOL frame source address in protocol tests

The send_eapol() calls for delivering frames to wpa_supplicant had a
copy-paste bug from the earlier hostapd cases. These were supposed to
use the BSSID, not the address of the station, as the source address.
The local address worked for most cases since it was practically
ignored, but this could prevent the race condition workaround for
association event from working. Fix this by using the correct source
address (BSSID).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoaf_alg: Crypto wrappers for Linux kernel crypto (AF_ALG)
Jouni Malinen [Sun, 26 Feb 2017 23:10:02 +0000 (01:10 +0200)] 
af_alg: Crypto wrappers for Linux kernel crypto (AF_ALG)

CONFIG_TLS=linux can now be used to select the crypto implementation
that uses the user space socket interface (AF_ALG) for the Linux kernel
crypto implementation. This commit includes some of the cipher, hash,
and HMAC functions. The functions that are not available through AF_ALG
(e.g., the actual TLS implementation) use the internal implementation
(CONFIG_TLS=internal).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agocrypto: Process des_encrypt() error returns in callers
Jouni Malinen [Tue, 28 Feb 2017 09:11:12 +0000 (11:11 +0200)] 
crypto: Process des_encrypt() error returns in callers

This updates all the des_encrypt() callers to handle error cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agocrypto: Add return value to DES and AES encrypt/decrypt
Jouni Malinen [Tue, 28 Feb 2017 08:57:43 +0000 (10:57 +0200)] 
crypto: Add return value to DES and AES encrypt/decrypt

These operations may fail with some crypto wrappers, so allow the
functions to report their results to the caller.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoMBO: Fix minimum length check on non_pref_chan configuration
Ashwini Patil [Fri, 24 Feb 2017 08:01:54 +0000 (13:31 +0530)] 
MBO: Fix minimum length check on non_pref_chan configuration

The reason detail field in non_pref_chan attribute was removed
from MBO draft v0.0_r25. Also oper_class can be 1 character for
few country codes (e.g., country code-UK, channel number-1). So the
shortest channel configuration is 7 characters.

This was missed in the earlier commit
4a83d4b6861f6627b6b256b8c126547a19409a70 ('MBO: Do not add reason_detail
in non_pref_chan attr (STA)') that took care of other changes related to
removal of the reason detail.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agohostapd: Get channel number from frequency based on other modes as well
Peng Xu [Wed, 22 Feb 2017 22:05:35 +0000 (14:05 -0800)] 
hostapd: Get channel number from frequency based on other modes as well

When getting the channel number from a frequency, all supported modes
should be checked rather than just the current mode. This is needed when
hostapd switches to a channel in different band.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Fix fils_hlp.c build with older netinet/udp.h definitions
Jouni Malinen [Sun, 26 Feb 2017 10:18:29 +0000 (12:18 +0200)] 
FILS: Fix fils_hlp.c build with older netinet/udp.h definitions

The __FAVOR_BSD macro was previously used in netinet/udp.h to select
between two different names of the variables in struct udphdr. Define
that to force the versions with the uh_ prefix. In addition, use the
same style consistently within fils_hlp.c.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFix AES-SIV build dependencies
Jouni Malinen [Sun, 26 Feb 2017 10:02:21 +0000 (12:02 +0200)] 
Fix AES-SIV build dependencies

aes-siv.c needs functions from aes-ctr.c and aes-omac1.c, so set
NEED_AES_CTR=y and NEED_AES_OMAC1=y if NEED_AES_SIV is defined. This
fixes some build configuration combinations where either of those
dependencies were not pulled in through other parameters. For example,
some CONFIG_FILS=y cases were impacted.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Fix CONFIG_MESH=y build without CONFIG_IEEE80211W=y
Jouni Malinen [Sun, 26 Feb 2017 09:58:04 +0000 (11:58 +0200)] 
mesh: Fix CONFIG_MESH=y build without CONFIG_IEEE80211W=y

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: AP with open mode and use for SELECT_NETWORK freq parameter
Jouni Malinen [Sat, 25 Feb 2017 16:45:59 +0000 (18:45 +0200)] 
tests: AP with open mode and use for SELECT_NETWORK freq parameter

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix SELECT_NETWORK freq parameter
Jouni Malinen [Sat, 25 Feb 2017 17:15:24 +0000 (19:15 +0200)] 
Fix SELECT_NETWORK freq parameter

This functionality was originally added in commit
204c9ac4eed9f0ad69497f2efcd0d095dfd6e61c ('Extend select_network command
with freq= to reduce scan time') re-using wpa_s->manual_scan_freqs and
MANUAL_SCAN_REQ. That got broken when commit
35d403096eb63c787bd736dd8ba0902c34398fa8 ('Set NORMAL_SCAN_REQ on
SELECT_NETWORK/ENABLE_NETWORK') started overriding wpa_s->scan_req for
SELECT_NETWORK.

Fix this by adding a new scan frequency list specifically for
SELECT_NETWORK so that this does not need to depend on any specific
wpa_s->scan_req value.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoD-Bus: Notify mesh capability if driver supports it
Saurav Babu [Wed, 22 Feb 2017 14:33:41 +0000 (20:03 +0530)] 
D-Bus: Notify mesh capability if driver supports it

Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
7 years agotests: FILS SK using ERP with SIM
Jouni Malinen [Thu, 23 Feb 2017 15:59:13 +0000 (17:59 +0200)] 
tests: FILS SK using ERP with SIM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: FILS SK using ERP and AP going away
Jouni Malinen [Wed, 22 Feb 2017 22:13:48 +0000 (00:13 +0200)] 
tests: FILS SK using ERP and AP going away

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd option to disable broadcast deauth in hostapd on AP start/stop
Jouni Malinen [Wed, 22 Feb 2017 22:03:00 +0000 (00:03 +0200)] 
Add option to disable broadcast deauth in hostapd on AP start/stop

The new broadcast_deauth parameter can be used to disable sending of the
Deauthentication frame whenever AP is started or stopped. The default
behavior remains identical to the past behavior (broadcast_deauth=1).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agohostapd: Fix potential mesh-related change from impacting non-mesh cases
Jouni Malinen [Wed, 22 Feb 2017 22:19:10 +0000 (00:19 +0200)] 
hostapd: Fix potential mesh-related change from impacting non-mesh cases

Commit 01e2231fdc4fbec61fbc382238e3606a1d2826e4 ('hostapd: Skip some
configuration steps for mesh cases') removed some operations based on
hapd->iface->mconf being NULL. This was within #ifdef CONFIG_MESH, so it
should not impact hostapd, but it can impact AP mode with
wpa_supplicant. That does not sound intentional, so make these
conditional on hapd->conf->mesh being enabled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: FILS PMKSA caching with Cache Identifier and external management
Jouni Malinen [Tue, 21 Feb 2017 14:28:37 +0000 (16:28 +0200)] 
tests: FILS PMKSA caching with Cache Identifier and external management

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: External management of PMKSA cache entry with Cache Identifier
Jouni Malinen [Tue, 21 Feb 2017 14:26:58 +0000 (16:26 +0200)] 
FILS: External management of PMKSA cache entry with Cache Identifier

The PMKSA_GET and PMKSA_ADD commands can now use an optional extra
parameter to fetch and add PMKSA cache entries with the FILS Cache
Identifier.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: FILS Cache Identifier for PMKSA caching
Jouni Malinen [Tue, 21 Feb 2017 10:21:45 +0000 (12:21 +0200)] 
tests: FILS Cache Identifier for PMKSA caching

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Use FILS Cache Identifier to extend PMKSA applicability
Jouni Malinen [Tue, 21 Feb 2017 10:22:19 +0000 (12:22 +0200)] 
FILS: Use FILS Cache Identifier to extend PMKSA applicability

This allows PMKSA cache entries for FILS-enabled BSSs to be shared
within an ESS when the BSSs advertise the same FILS Cache Identifier
value.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Extend PMKSA output parser to handle FILS Cache Identifier
Jouni Malinen [Tue, 21 Feb 2017 10:21:15 +0000 (12:21 +0200)] 
tests: Extend PMKSA output parser to handle FILS Cache Identifier

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoSME: Clear portValid on starting authentication to fix FILS
Jouni Malinen [Tue, 21 Feb 2017 10:49:16 +0000 (12:49 +0200)] 
SME: Clear portValid on starting authentication to fix FILS

The ft_completed for FILS authentication case in
wpa_supplicant_event_assoc() depends on something having cleared
portValid so that setting it TRUE ends up authorizing the port. This
clearing part did not happen when using FILS authentication during a
reassociation within an ESS. Fix this by clearing portValid in
sme_send_authentication() just before the keys are cleared (i.e., the
old connection would not be usable anyway).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Fix BSSID in reassociation case
Jouni Malinen [Tue, 21 Feb 2017 10:25:02 +0000 (12:25 +0200)] 
FILS: Fix BSSID in reassociation case

The RSN supplicant implementation needs to be updated to use the new
BSSID whenever doing FILS authentication. Previously, this was only done
when notifying association and that was too late for the case of
reassociation. Fix this by providing the new BSSID when calling
fils_process_auth(). This makes PTK derivation use the correct BSSID.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Find PMKSA cache entries on AP based on FILS Cache Identifier
Jouni Malinen [Tue, 21 Feb 2017 10:18:58 +0000 (12:18 +0200)] 
FILS: Find PMKSA cache entries on AP based on FILS Cache Identifier

This allows PMKSA cache entries to be shared between all the BSSs
operated by the same hostapd process when those BSSs use the same FILS
Cache Identifier value.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agomka: Fix the order of operations in secure channel deletion
Badrish Adiga H R [Sat, 18 Feb 2017 13:14:15 +0000 (05:14 -0800)] 
mka: Fix the order of operations in secure channel deletion

The correct order of deleting a secure channel is to purge all the
secure associations in the channel before actually deleting the secure
channel.

Signed-off-by: Badrish Adiga H R <badrish.adigahr@gmail.com>