]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
6 years agoDPP: Fix an error path memory leak in URI public key parsing
Ankita Bajaj [Mon, 27 Aug 2018 07:31:13 +0000 (13:01 +0530)] 
DPP: Fix an error path memory leak in URI public key parsing

The allocated buffer from base64_decode() needs to be freed on the
sha256_vector() error path.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFree dh_ctx on failure in wps_nfc_gen_dh()
Srikanth Marepalli [Thu, 20 Sep 2018 09:16:54 +0000 (14:46 +0530)] 
Free dh_ctx on failure in wps_nfc_gen_dh()

This is needed to avoid a memory leak on an error path.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Flush PMKSA if an assoc reject without timeout is received
Srinivas Dasari [Wed, 5 Sep 2018 14:56:29 +0000 (20:26 +0530)] 
DPP: Flush PMKSA if an assoc reject without timeout is received

Flush the PMKSA upon receiving assoc reject event without timeout
in the event data, to avoid trying the subsequent connections
with the old PMKID. Do not flush PMKSA if assoc reject is
received with timeout as it is generated internally from the
driver without reaching the AP.

This extends commit d109aa6cacf2c3f643de0c758a30b0daf936a67a ("SAE:
Flush PMKSA if an assoc reject without timeout is received") to handle
also the DPP AKM.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoQCA vendor command support for TWT test configuration
Varun Reddy Yeturu [Fri, 10 Aug 2018 21:47:22 +0000 (14:47 -0700)] 
QCA vendor command support for TWT test configuration

Define new QCA vendor specific test config attributes to configure TWT.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Enable Suite B test cases with OpenSSL 1.1.1
Jouni Malinen [Mon, 17 Sep 2018 14:52:38 +0000 (17:52 +0300)] 
tests: Enable Suite B test cases with OpenSSL 1.1.1

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Fix test functionality for invalid keys with OpenSSL 1.1.0
Jouni Malinen [Mon, 17 Sep 2018 14:23:10 +0000 (17:23 +0300)] 
DPP: Fix test functionality for invalid keys with OpenSSL 1.1.0

It looks like at least OpenSSL 1.1.0i includes the extra checks in
EC_POINT_set_affine_coordinates_GFp() that break the previously used
mechanism for generating invalid keys. Fix this by using the alternative
design that was used with OpenSSL 1.1.1 and BoringSSL.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: Store device MAC address into database
Jouni Malinen [Fri, 14 Sep 2018 23:53:49 +0000 (02:53 +0300)] 
HS 2.0 server: Store device MAC address into database

This is needed for tracking status of certificate enrollment cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: sigma_dut controlled Hotspot 2.0 connection
Jouni Malinen [Thu, 13 Sep 2018 00:43:30 +0000 (03:43 +0300)] 
tests: sigma_dut controlled Hotspot 2.0 connection

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: sigma_dut controlled Venue URL fetch
Jouni Malinen [Wed, 12 Sep 2018 23:40:41 +0000 (02:40 +0300)] 
tests: sigma_dut controlled Venue URL fetch

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Venue URL ANQP-element with PMF
Jouni Malinen [Wed, 12 Sep 2018 22:58:50 +0000 (01:58 +0300)] 
tests: Venue URL ANQP-element with PMF

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoANQP: Parse and report Venue URL information
Jouni Malinen [Wed, 12 Sep 2018 22:56:37 +0000 (01:56 +0300)] 
ANQP: Parse and report Venue URL information

Parse the Venue URL ANQP-element payload and report it with the new
RX-VENUE-URL event messages if the query was done using PMF.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Fix T&C server database check
Jouni Malinen [Wed, 12 Sep 2018 22:04:40 +0000 (01:04 +0300)] 
HS 2.0: Fix T&C server database check

It was possible for the wait loop to exit early due to the $row[0] == 1
check returning false if the database value was not yet set. Fix this by
updated the $waiting default value only if the database actually has a
value for this field.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Allow OSU SSID selection to be enforced for testing purposes
Jouni Malinen [Wed, 12 Sep 2018 01:00:27 +0000 (04:00 +0300)] 
HS 2.0: Allow OSU SSID selection to be enforced for testing purposes

This allows hs20-osu-client to be requested to select a specific OSU
SSID with the new command line argument (-o<OSU_SSID>). This is useful
for testing single SSID transition mode cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Use shared SSID (if available) for OSU by default
Jouni Malinen [Wed, 12 Sep 2018 00:50:16 +0000 (03:50 +0300)] 
HS 2.0: Use shared SSID (if available) for OSU by default

When the AP is detected to have single BSS shared for RSN and OSEN, use
that BSS for OSU by default instead of the one based on the OSU_SSID in
the OSU Providers list.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Hotspot 2.0 OSU provider and single SSID
Jouni Malinen [Wed, 12 Sep 2018 00:49:16 +0000 (03:49 +0300)] 
tests: Hotspot 2.0 OSU provider and single SSID

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Add alternative OSU_SSID into providers info file
Jouni Malinen [Tue, 11 Sep 2018 23:52:50 +0000 (02:52 +0300)] 
HS 2.0: Add alternative OSU_SSID into providers info file

This adds the second SSID (the one used by the shared BSS) for OSU
connection when generating osu-providers.txt. External tools can use
that to configure multiple network profiles for OSU to cover the cases
where transition mode is used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: sigma_dut controlled AP with OSEN
Jouni Malinen [Tue, 11 Sep 2018 23:26:11 +0000 (02:26 +0300)] 
tests: sigma_dut controlled AP with OSEN

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoRADIUS server: Add testing support for authentication result
Jouni Malinen [Tue, 11 Sep 2018 00:58:55 +0000 (03:58 +0300)] 
RADIUS server: Add testing support for authentication result

CONFIG_RADIUS_TEST builds can now update the user SQLite database based
on authentication result from the last attempt. If the database has a
last_msk column, that will be set to the hexdump of the MSK whenever
authentication succeeds and to "FAIL" whenever authentication fails.
This can be used for testing purposes by having an external program
track authentication status per user.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: Replace deprecated PHP function split()
Jouni Malinen [Mon, 10 Sep 2018 20:41:35 +0000 (23:41 +0300)] 
HS 2.0 server: Replace deprecated PHP function split()

Use explode() instead of split() because split() has been removed from
PHP 7.0.0 and there is no need for using full regular expression here.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoXML: Do not add empty Value node for nodes with child nodes in TNDS
Jouni Malinen [Mon, 10 Sep 2018 18:43:43 +0000 (21:43 +0300)] 
XML: Do not add empty Value node for nodes with child nodes in TNDS

This fixes some validation issues against DM_ddf DTD that were caused by
the conversion from the internal tree structure to TNDS. Only the leaf
nodes are supposed to have the Value node.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDefine test config attribute to configure OM control support
Kiran Kumar Lokere [Wed, 29 Aug 2018 21:22:04 +0000 (14:22 -0700)] 
Define test config attribute to configure OM control support

Define a new QCA vendor specific test config attribute to configure the
support for receiving the MPDU with operating mode control subfield.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoOCE: Add OCE capability attribute only when associating to an OCE AP
Beni Lev [Sun, 26 Aug 2018 17:45:04 +0000 (20:45 +0300)] 
OCE: Add OCE capability attribute only when associating to an OCE AP

Signed-off-by: Beni Lev <beni.lev@intel.com>
6 years agoOCE: Send scan parameters when OCE_STA functionality is enabled
Roee Zamir [Sun, 26 Aug 2018 17:45:03 +0000 (20:45 +0300)] 
OCE: Send scan parameters when OCE_STA functionality is enabled

If the device supports OCE features and OCE is enabled, set the relevant
scan parameters and FILS Request Parameters element with Max Channel
Time.

Signed-off-by: Roee Zamir <roee.zamir@intel.com>
6 years agonl80211: Support OCE features (driver capability and scan params)
Roee Zamir [Sun, 26 Aug 2018 17:45:01 +0000 (20:45 +0300)] 
nl80211: Support OCE features (driver capability and scan params)

Check if the device supports specific mandatory features and set the the
relevant WPA_DRIVER_FLAGS_OCE_STA flag. Send the relevant scan
parameters for OCE scans.

Signed-off-by: Roee Zamir <roee.zamir@intel.com>
6 years agodriver: Add OCE scan parameters
Roee Zamir [Sun, 26 Aug 2018 17:45:00 +0000 (20:45 +0300)] 
driver: Add OCE scan parameters

Add a flag to scan parameters that enables OCE scan features. If this
flag is set the device should enable the following features as defined
in the Optimized Connectivity Experience Technical Specification v1.0:
- Overwrite FILS request Max Channel Time with actual value (clause 3.8)
- Send Probe Request frame in high rate (at least 5.5 Mbps) (clause 3.12)
- Probe Request frame Transmission Deferral and Suppression (clause 3.5)
- Accept broadcast Probe Response frame (clause 3.6)

Signed-off-by: Roee Zamir <roee.zamir@intel.com>
6 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Sun, 2 Sep 2018 14:45:27 +0000 (17:45 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2018-08-29.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agorandom: Remove write-only variable random_entropy_file_read
Johannes Berg [Wed, 22 Aug 2018 16:49:06 +0000 (19:49 +0300)] 
random: Remove write-only variable random_entropy_file_read

This variable is never read, so it's not needed. Remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agohostapd: Send an event before throwing a station on re-authentication
Andreas Tobler [Mon, 13 Aug 2018 05:45:37 +0000 (07:45 +0200)] 
hostapd: Send an event before throwing a station on re-authentication

If you modify the WLAN-STA-AUTHORIZED bit in sta->flags, you have to
call the ap_sta_set_authorized() function to make sure the corresponding
event is sent over the control interface. Otherwise we leak entries in
the event history.

Signed-off-by: Andreas Tobler <andreas.tobler@cloudguard.ch>
6 years agoatheros: Fix atheros_send_mgmt() dependency on CONFIG_FILS
Jouni Malinen [Sun, 2 Sep 2018 09:42:28 +0000 (12:42 +0300)] 
atheros: Fix atheros_send_mgmt() dependency on CONFIG_FILS

This fixes a CONFIG_FILS=y build without CONFIG_IEEE80211W=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoOWE: Fix build error in AP code without CONFIG_IEEE80211W=y
Chaitanya T K [Tue, 28 Aug 2018 20:44:33 +0000 (02:14 +0530)] 
OWE: Fix build error in AP code without CONFIG_IEEE80211W=y

When CONFIG_OWE is enabled but none of 11R/11W/FILS are enabled hostapd
(and wpa_supplicant with AP mode support) build failed. Fix this by
adding OWE to the list of conditions for including the local variables.

Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com>
6 years agoParse sae_password option when CONFIG_SAE is enabled
Hai Shalom [Wed, 29 Aug 2018 23:47:55 +0000 (16:47 -0700)] 
Parse sae_password option when CONFIG_SAE is enabled

Call to parse_sae_password was incorrectly depending
on CONFIG_TESTING_OPTIONS and CONFIG_SAE. Should
depend only on the latter.

Fixes: 2377c1caef77 ("SAE: Allow SAE password to be configured separately (AP)")
Signed-off-by: Hai Shalom <haishalom@google.com>
6 years agonl80211: Do not ignore disconnect event in case of !drv->associated
Hu Wang [Wed, 8 Aug 2018 03:21:05 +0000 (11:21 +0800)] 
nl80211: Do not ignore disconnect event in case of !drv->associated

Commit 3f53c006c7d7362cf715ceaeda92c69d91ea7b63 ('nl80211: Ignore
disconnect event in case of locally generated request') made
wpa_supplicant ignore the next received disconnect event for cases where
wpa_supplicant itself requested a disconnection. This can result in
ignoring a disconnection notification in some cases.

Considering a P2P Client receiving disconnect event from the kernel
after a P2P group is started, drv->ignore_next_local_disconnect is
cleared to 0, then wpa_driver_nl80211_disconnect() will be called during
the removal of the group, in which drv->ignore_next_local_disconnect is
set to 1 by mistake.

Do not allow ignore_next_local_{disconnect,deauth} to be set to 1 if the
driver is not in associated state (drv->associated is 0) to avoid this
type of cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: DPP group_id parameter
Jouni Malinen [Thu, 30 Aug 2018 20:34:37 +0000 (23:34 +0300)] 
tests: DPP group_id parameter

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Set group id through DPP_AUTH_INIT or dpp_configurator_params
Purushottam Kushwaha [Fri, 10 Aug 2018 07:03:14 +0000 (12:33 +0530)] 
DPP: Set group id through DPP_AUTH_INIT or dpp_configurator_params

This enhances DPP_AUTH_INIT, DPP_CONFIGURATOR_SIGN, and SET
dpp_configurator_params to allow optional setting of the DPP groupId
string for a Connector. If the value is not set, the previously wildcard
value ("*") is used by default.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoAdd new QCA vendor command and attributes to enhance NAN
Nachiket Kukade [Fri, 3 Aug 2018 10:28:07 +0000 (15:58 +0530)] 
Add new QCA vendor command and attributes to enhance NAN

The payload used for the existing NAN vendor command,
QCA_NL80211_VENDOR_SUBCMD_NAN is a binary blob of data. This
command is not extendable to send additional information. Hence
define a new vendor command QCA_NL80211_VENDOR_SUBCMD_NAN_EXT,
that can carry the binary blob encapsulated within an attribute
and can carry additional attributes to enhance the NAN command
interface. Define additional 3 new attributes for conveying
type of NAN subcmd and channel information.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoCorrect the documentation of NAN vendor command
Nachiket Kukade [Fri, 10 Aug 2018 11:24:09 +0000 (16:54 +0530)] 
Correct the documentation of NAN vendor command

Present implementation of NAN vendor command does not use
attribute encapsulation for sending the command from userspace
to the driver, payload is directly sent as is. Attribute
QCA_WLAN_VENDOR_ATTR_NAN is used only for receiving vendor
events in the userspace from the driver. Update the doc as per
this implementation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agomka: Fix confidentiality offset issue in macsec_qca driver interface
xiaofeis [Wed, 22 Aug 2018 09:00:28 +0000 (17:00 +0800)] 
mka: Fix confidentiality offset issue in macsec_qca driver interface

Confidentiality offset from MKA should be configured to the
driver/hardware when creating SA.

Signed-off-by: xiaofeis <xiaofeis@codeaurora.org>
6 years agomka: Fix sci port mask issue in macsec_qca driver interface
xiaofeis [Wed, 22 Aug 2018 08:29:20 +0000 (16:29 +0800)] 
mka: Fix sci port mask issue in macsec_qca driver interface

Need to use full 8-bit mask here when swapping byte order.

Signed-off-by: xiaofeis <xiaofeis@codeaurora.org>
6 years agoChange the ADDBA buffer size attribute type to U16 from U8
Kiran Kumar Lokere [Wed, 15 Aug 2018 19:01:24 +0000 (12:01 -0700)] 
Change the ADDBA buffer size attribute type to U16 from U8

The max supported ADDBA buffer size value is 256, so change
the buffer size attribute type to U16 to configure the testbed
device to use the 256 buffer size in ADDBA negotiation in 11ax
testing.

This attribute is used only to configure a testbed device and the old
definition of this attribute was not used in any deployed implementation
hence it is still justifiable to change the definition.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoVendor attribute to get max blacklist BSSIDs capability
Srinivas Dasari [Fri, 17 Aug 2018 13:07:04 +0000 (18:37 +0530)] 
Vendor attribute to get max blacklist BSSIDs capability

Add a QCA vendor attribute
QCA_WLAN_VENDOR_ATTR_GSCAN_MAX_BLACKLIST_BSSID to get maximum
blacklist BSSIDs capability from the driver for gscan.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agonl80211: Fix sending of WDS STA event to the correct BSS context
Bhagavathi Perumal S [Wed, 8 Aug 2018 16:33:31 +0000 (22:03 +0530)] 
nl80211: Fix sending of WDS STA event to the correct BSS context

The WDS-STA-INTERFACE-ADDED/WDS-STA-INTERFACE-REMOVED events were always
sent to the first BSS instead of the specific BSS that the STA was
connected to in multi-BSS cases. Fix this by using the BSS specific
context pointer.

Fixes: 1952b626ba57 ("hostapd: Add ctrl iface indications for WDS STA interface")
Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
6 years agotests: FILS SK ERP and ERP flush on server, but not on peer
Jouni Malinen [Thu, 23 Aug 2018 09:11:44 +0000 (12:11 +0300)] 
tests: FILS SK ERP and ERP flush on server, but not on peer

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFILS: Fix FILS connect failures after ERP key invalidation
Ankita Bajaj [Fri, 27 Jul 2018 08:25:27 +0000 (13:55 +0530)] 
FILS: Fix FILS connect failures after ERP key invalidation

If the RADIUS authentication server dropped the cached ERP keys for any
reason, FILS authentication attempts with ERP fails and the previous
wpa_supplicant implementation ended up trying to use the same keys for
all consecutive attempts as well. This did not allow recovery from state
mismatch between the ERP server and peer using full EAP authentication.

Address this by trying to use full (non-FILS) authentication when trying
to connect to an AP using the same ERP realm with FILS-enabled network
profile if the previous authentication attempt had failed. This allows
new ERP keys to be established and FILS authentication to be used again
for the consecutive connections.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agomka: Support GCM-AES-256
xiaofeis [Wed, 1 Aug 2018 08:27:22 +0000 (01:27 -0700)] 
mka: Support GCM-AES-256

GCM-AES-256 cipher suite is defined in IEEE Std 802.1AEbn-2011.

If authenticator configured as GCM-AES-256, the distributed SAK will be
256 bits indicated by the GCM-AES-256 ID in the MKA packet.

This patch will make AES Key Unwrap to 32 bytes of SAK when identify the
ID.

Signed-off-by: xiaofeis <xiaofeis@codeaurora.org>
6 years agotests: HT40 disabling
Jouni Malinen [Tue, 21 Aug 2018 16:07:53 +0000 (19:07 +0300)] 
tests: HT40 disabling

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agohostapd: SET ht_capab support for disabling 40 MHz bandwidth
Sathishkumar Muruganandam [Wed, 25 Jul 2018 12:46:20 +0000 (18:16 +0530)] 
hostapd: SET ht_capab support for disabling 40 MHz bandwidth

'hostapd_cli SET ht_capab' only checked for [HT40+] or [HT40-] or both
to be present. Based on the offset + or -, secondary_channel is updated
but HT20/VHT20 mode can be brought up only from config file and can't be
done using the SET command when the current HT mode is HT40+ or HT40-.

When managing AP+STA mode from userspace doing hostapd_cli: "disable ->
set channel, ht_capab -> enable" sequence, channel switch from
HT40/VHT40 to HT20/VHT20 was not possible with this SET ht_capab
limitation.

Cover this additional case by resetting secondary_channel to 0 for
HT20/VHT20 when ht_capab has neither [HT40+] nor [HT40-] present.

Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
6 years agotests: AP with WEP and external ifconfig down
Jouni Malinen [Tue, 21 Aug 2018 15:50:55 +0000 (18:50 +0300)] 
tests: AP with WEP and external ifconfig down

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoRe-configure WEP keys on hostapd interface re-enable
Hu Wang [Wed, 18 Jul 2018 08:41:40 +0000 (16:41 +0800)] 
Re-configure WEP keys on hostapd interface re-enable

This allows WEP mode AP to be re-enabled automatically after external
ifconfig down + up on netdev used by hostapd.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFix QoS Mapping ext capab bit setting
Jouke Witteveen [Mon, 25 Jun 2018 20:28:50 +0000 (22:28 +0200)] 
Fix QoS Mapping ext capab bit setting

Fix the typo in using WPA_DRIVER_FLAGS_QOS_MAPPING to set the QoS Map
bit in Extended Capabilities. The previous implementation ended up
adding this bit even if the driver did not actually indicate support for
the capability.

Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
6 years agoOpenSSL: Fix compile with OpenSSL 1.1.0 and deprecated APIs
Rosen Penev [Sat, 28 Jul 2018 02:31:09 +0000 (19:31 -0700)] 
OpenSSL: Fix compile with OpenSSL 1.1.0 and deprecated APIs

SSL_session_reused() is the same as the deprecated SSL_cache_hit(). The
engine load stuff is now handled by OPENSSL_init().

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years agoClarify the TODO comment regarding PMKID KDE in EAPOL-Key msg 1/4
Jouni Malinen [Fri, 10 Aug 2018 10:51:04 +0000 (13:51 +0300)] 
Clarify the TODO comment regarding PMKID KDE in EAPOL-Key msg 1/4

Make it clear that the consideration should be only for the IBSS case
and in infrastructure BSS case, PMKID KDE should not be added due to
risks involved with exposing this to stations that do not know the
passphrase.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: WPA2-PSK/TKIP and MIC=0 in msg 3/4
Jouni Malinen [Mon, 6 Aug 2018 16:22:40 +0000 (19:22 +0300)] 
tests: WPA2-PSK/TKIP and MIC=0 in msg 3/4

Verify that unauthenticated EAPOL-Key message does not get decrypted.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoWPA: Ignore unauthenticated encrypted EAPOL-Key data
Mathy Vanhoef [Sat, 14 Jul 2018 23:25:53 +0000 (01:25 +0200)] 
WPA: Ignore unauthenticated encrypted EAPOL-Key data

Ignore unauthenticated encrypted EAPOL-Key data in supplicant
processing. When using WPA2, these are frames that have the Encrypted
flag set, but not the MIC flag.

When using WPA2, EAPOL-Key frames that had the Encrypted flag set but
not the MIC flag, had their data field decrypted without first verifying
the MIC. In case the data field was encrypted using RC4 (i.e., when
negotiating TKIP as the pairwise cipher), this meant that
unauthenticated but decrypted data would then be processed. An adversary
could abuse this as a decryption oracle to recover sensitive information
in the data field of EAPOL-Key messages (e.g., the group key).
(CVE-2018-14526)

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agotests: Check both FT and non-FT connections in ap_hs20_ft
Jouni Malinen [Thu, 2 Aug 2018 21:40:51 +0000 (00:40 +0300)] 
tests: Check both FT and non-FT connections in ap_hs20_ft

Verify that the automatically generated network profile is able to
connect to a non-FT network automatically after having used FT for the
first connection.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Fix hs20-osu-client handling of HomeSP/HomeOIList/<X+>/HomeOI
Jouni Malinen [Thu, 2 Aug 2018 13:15:14 +0000 (16:15 +0300)] 
HS 2.0: Fix hs20-osu-client handling of HomeSP/HomeOIList/<X+>/HomeOI

This node was mapped to a SET_CRED roaming_consortium command with
quotation marks even though this is a hexdump of the OI. Remove the
quotation marks to allow this to be set correctly in the wpa_supplicant
credential.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Extend eap_proto_aka_prime to cover additional AT_KDF cases
Jouni Malinen [Thu, 2 Aug 2018 12:36:24 +0000 (15:36 +0300)] 
tests: Extend eap_proto_aka_prime to cover additional AT_KDF cases

Verify that EAP-AKA' client rejects Challenge with an appended AT_KDF
and a modified AT_KDF value during KDF negotiation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: sigma_dut with various AP KeyMgnt values
Jouni Malinen [Wed, 1 Aug 2018 15:45:53 +0000 (18:45 +0300)] 
tests: sigma_dut with various AP KeyMgnt values

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoProvide more details of WPA3 modes in wpa_supplicant.conf
Jouni Malinen [Wed, 1 Aug 2018 14:54:13 +0000 (17:54 +0300)] 
Provide more details of WPA3 modes in wpa_supplicant.conf

Clarify that proto=RSN is used for WPA3 and add the WPA3-Personal name
for SAE and include OWE as a possible key_mgmt value.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoProvide more details of WPA3 modes in hostapd.conf
Jouni Malinen [Wed, 1 Aug 2018 14:51:42 +0000 (17:51 +0300)] 
Provide more details of WPA3 modes in hostapd.conf

Clarify that wpa=2 (i.e., RSN) is used for WPA3 and list previously
undocumented wpa_key_mgmt values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDefine test config vendor attribute to override MU EDCA
Kiran Kumar Lokere [Tue, 31 Jul 2018 01:24:45 +0000 (18:24 -0700)] 
Define test config vendor attribute to override MU EDCA

Add a new test config QCA vendor attribute to override the MU EDCA
parameters to default values in the driver for test configuration. This
is used for configuring the testbed device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: OSEN with two group ciphers allowed on client side
Jouni Malinen [Mon, 30 Jul 2018 21:33:08 +0000 (00:33 +0300)] 
tests: OSEN with two group ciphers allowed on client side

This verifies the new default behavior for OSEN in Single SSID capable
devices.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Allow CCMP as group cipher for OSEN single SSID case
Jouni Malinen [Mon, 30 Jul 2018 21:31:16 +0000 (00:31 +0300)] 
HS 2.0: Allow CCMP as group cipher for OSEN single SSID case

When OSEN is used in the BSS that is shared both for production data and
OSU uses, the group cipher might be either GTK_NOT_USED (like in Rel 2
OSEN) or CCMP. Modify hs20-osu-client to allow both these group ciphers
to be used when requesting OSEN connection.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Verify T&C Server URL generation result
Jouni Malinen [Mon, 30 Jul 2018 21:21:59 +0000 (00:21 +0300)] 
tests: Verify T&C Server URL generation result

Check that the @1@ macro gets replaced correctly both when in the middle
and when in the end of the URL template.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Fix Terms and Conditions Server URL macro replacement
Jouni Malinen [Mon, 30 Jul 2018 21:07:36 +0000 (00:07 +0300)] 
HS 2.0: Fix Terms and Conditions Server URL macro replacement

The last character of the STA MAC address got replaced with 0x00 due to
truncation if the @1@ macro was used at the end of the URL. Fix this
case by allocating larger buffer for the URL.

Fixes: d4e39c51f8bb ("HS 2.0: Move Terms and Conditions Server URL generation from AP to AS")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDefine test config QCA vendor attribute for HE MAC padding duration
Kiran Kumar Lokere [Thu, 5 Jul 2018 22:28:11 +0000 (15:28 -0700)] 
Define test config QCA vendor attribute for HE MAC padding duration

Add a new wifi test config QCA vendor attribute to configure HE
trigger frame MAC padding duration value in the driver.
This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agonl80211: Indicate interface up only for the main netdev
Hu Wang [Tue, 26 Jun 2018 02:56:29 +0000 (10:56 +0800)] 
nl80211: Indicate interface up only for the main netdev

ifname is checked for interface down event in commit
106fa1e97e29e7514ae324020802c280f993ee48 ("nl80211: Indicate
interface-down event only for the main netdev"). Do the same for
interface up event to avoid unexpected notifications when the master
interface (e.g., a bridge interface) is set up while then WLAN interface
remains down.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agonl80211: Allocate nl_sock for NETLINK_ROUTE when already_in_bridge
Sathishkumar Muruganandam [Wed, 4 Jul 2018 09:31:02 +0000 (15:01 +0530)] 
nl80211: Allocate nl_sock for NETLINK_ROUTE when already_in_bridge

When we start hostapd having Hotspot 2.0 configuration with interface
already added to bridge interface, addition and deletion of new neighbor
to bridge ip neighbor table fails.

This is since 'bss->added_if_into_bridge' is not set which only allows
'drv->rtnl_sk' (nl_sock for NETLINK_ROUTE) allocation needed for bridge
ip neighbor table.

Add a new bit 'already_in_bridge' and set it when interface is already
added to bridge by some external component. Check this bit in addition
to 'bss->added_if_into_bridge' for 'drv->rtnl_sk' allocation done in
i802_init().

Now 'drv->rtnl_sk' is closed in wpa_driver_nl80211_deinit() regardless of
'bss->added_if_into_bridge' since when we have 'bss->already_in_bridge'
case too, this need to be removed.

brctl show

bridge name     bridge id               STP enabled     interfaces
br0             8000.8efdf006b050       no              ap

hostapd_cli raw STATUS-DRIVER

Selected interface 'ap'
ifindex=15
ifname=ap
brname=br0
addr=8e:fd:f0:06:b0:50
freq=5180
beacon_set=1
already_in_bridge=1
..

Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
6 years agonl80211: Skip vendor specific DFS offload if upstream mechanism is used
Peng Xu [Fri, 15 Jun 2018 21:39:32 +0000 (14:39 -0700)] 
nl80211: Skip vendor specific DFS offload if upstream mechanism is used

Since the generic DFS offload support flag is added as
NL80211_EXT_FEATURE_DFS_OFFLOAD, only use the vendor command to check
DFS capablity if the flag is not already set.

Signed-off-by: Peng Xu <pxu@codeaurora.org>
6 years agoDefine test config QCA vendor attribute for HE MU EDCA params
Kiran Kumar Lokere [Thu, 28 Jun 2018 23:50:19 +0000 (16:50 -0700)] 
Define test config QCA vendor attribute for HE MU EDCA params

Add a new wifi test config QCA vendor attributes to configure
HE MU EDCA parameters value in the driver.
This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDefine test config QCA vendor attribute for Tx beamformee NSTS
Kiran Kumar Lokere [Sat, 23 Jun 2018 00:31:45 +0000 (17:31 -0700)] 
Define test config QCA vendor attribute for Tx beamformee NSTS

Add a new wifi test config QCA vendor attribute to configure Tx
beamformee number of space-time streams value in the driver.
This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: CoA-Request from Terms and Conditions server
Jouni Malinen [Fri, 22 Jun 2018 17:22:40 +0000 (20:22 +0300)] 
HS 2.0: CoA-Request from Terms and Conditions server

This extends the terms.php implementation of Hotspot 2.0 Terms and
Conditions server to allow it to interact with hostapd(AS) to clear the
filtering rules from the AP. After requesting hostapd to send out the
CoA-Request, terms.php waits for up to 10 seconds to see whether the
current_sessions table gets an update to indicate that filtering has
been successfully disabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: ap_hs20_terms_and_conditions_sql to test DAC_REQUEST
Jouni Malinen [Fri, 22 Jun 2018 16:34:37 +0000 (19:34 +0300)] 
tests: ap_hs20_terms_and_conditions_sql to test DAC_REQUEST

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoRADIUS: Add DAC implementation in hostapd(AS)
Jouni Malinen [Fri, 22 Jun 2018 16:32:46 +0000 (19:32 +0300)] 
RADIUS: Add DAC implementation in hostapd(AS)

The new DAC_REQUEST control interface command can now be used to request
hostapd to send out Disconnect-Request and CoA-Request packets for an
existing session.

DAC_REQUEST <disconnect|coa> <MAC Address> [t_c_clear]

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoRADIUS: Allow 0.0.0.0 to be used as wildard radius_das_client
Jouni Malinen [Fri, 22 Jun 2018 08:47:19 +0000 (11:47 +0300)] 
RADIUS: Allow 0.0.0.0 to be used as wildard radius_das_client

This allows hostapd DAS to be configured to allow any DAC (with the
matching shared secret) to send Disconnect-Request and CoA-Request
packets.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Check current_sessions in ap_hs20_terms_and_conditions_sql
Jouni Malinen [Thu, 21 Jun 2018 21:13:15 +0000 (00:13 +0300)] 
tests: Check current_sessions in ap_hs20_terms_and_conditions_sql

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoRADIUS server: Add current_sessions SQLite table
Jouni Malinen [Thu, 21 Jun 2018 21:12:07 +0000 (00:12 +0300)] 
RADIUS server: Add current_sessions SQLite table

This can be used to track active sessions, e.g., for the purpose of
issuing RADIUS DAS commands (Disconnect-Request or CoA-Request).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Move hs20_t_c_server_url parameter from AP to AS
Jouni Malinen [Thu, 21 Jun 2018 17:52:54 +0000 (20:52 +0300)] 
tests: Move hs20_t_c_server_url parameter from AP to AS

This is needed with the modified hostapd implementation to fix the
ap_hs20_terms_and_conditions* test cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Move Terms and Conditions Server URL generation from AP to AS
Jouni Malinen [Thu, 21 Jun 2018 17:50:54 +0000 (20:50 +0300)] 
HS 2.0: Move Terms and Conditions Server URL generation from AP to AS

This makes it more convenient to generate the URL in a way that
interoperates between different vendors. The AP is simply copying the
already constructed URL as-is from Access-Accept to WNM-Notification.
This means that the HO AAA can generate the URL in a manner that works
for the associated T&C Server without having to coordinate with each AP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: hs20-osu-client testing for PPS MO parsing
Jouni Malinen [Thu, 21 Jun 2018 16:18:54 +0000 (19:18 +0300)] 
tests: hs20-osu-client testing for PPS MO parsing

This adds a mechanism to allow hs20-osu-client set_pps command to be
tested with PPS MO files.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Process Credential/UsernamePassword/EAPMethod nodes in PPS MO
Jouni Malinen [Thu, 21 Jun 2018 16:16:26 +0000 (19:16 +0300)] 
HS 2.0: Process Credential/UsernamePassword/EAPMethod nodes in PPS MO

This allows hs20-osu-client to configure wpa_supplicant credential with
a specific EAP method so that roaming consortium OI -based matching can
be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Fix mbo_supp_oper_classes with new regdb
Jouni Malinen [Wed, 20 Jun 2018 12:23:50 +0000 (15:23 +0300)] 
tests: Fix mbo_supp_oper_classes with new regdb

Change country code KZ to SY for the 2.4 GHz only case since 5 GHz rules
were added for KZ.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Add more details on sae_bignum_failure logs
Jouni Malinen [Wed, 20 Jun 2018 10:07:38 +0000 (13:07 +0300)] 
tests: Add more details on sae_bignum_failure logs

It is easier to understand the hostapd debug log here if each step is
noted there before starting the wpa_supplicant operation. In addition,
it looks safer to process all pending event messages between each step
to avoid running out of any buffer limits.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoSAE: Allow authentication restart on AP
Jouni Malinen [Wed, 20 Jun 2018 10:04:31 +0000 (13:04 +0300)] 
SAE: Allow authentication restart on AP

In the infrastructure BSS case, the AP needs to clear pending SAE state
if a new Commit message is received when already in Committed state.
This allows the non-AP STA to negotiate a new group if it ends up trying
to go through SAE authentication again before the AP side has removed
the previous STA entry.

This fixes an issue where a kernel update changed something in SAE
timing or authentication sequence and started failing the
sae_bignum_failure hwsim test case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: sigma_dut controlled AP with EAP+OSEN
Jouni Malinen [Mon, 18 Jun 2018 21:39:42 +0000 (00:39 +0300)] 
tests: sigma_dut controlled AP with EAP+OSEN

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Allow Hotspot 2.0 version number to be overridden for build
Jouni Malinen [Mon, 18 Jun 2018 16:42:38 +0000 (19:42 +0300)] 
HS 2.0: Allow Hotspot 2.0 version number to be overridden for build

This can be used for testing and development purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: P2P and avoid frequencies driver event on 5 GHz
Jouni Malinen [Fri, 15 Jun 2018 18:56:21 +0000 (21:56 +0300)] 
tests: P2P and avoid frequencies driver event on 5 GHz

This test case verifies that wpa_supplicant is able to perform CSA to a
VHT80 channel when having to move the GO due to an avoid-frequencies
driver event.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoP2P: Use more compact debug print of common group frequencies
Jouni Malinen [Fri, 15 Jun 2018 18:55:26 +0000 (21:55 +0300)] 
P2P: Use more compact debug print of common group frequencies

Print the list of frequencies on a single line instead of one line per
frequency.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoP2P: Improve common group channel selection if GO needs to be moved
Jouni Malinen [Fri, 15 Jun 2018 18:47:29 +0000 (21:47 +0300)] 
P2P: Improve common group channel selection if GO needs to be moved

Prefer channels that support VHT80 (and secondarily, HT40 on the same
band) over other common group channels. If no such channel is found,
prefer any channel that uses the same band so that CSA can be used. This
improves the case where a P2P GO needs to move to another channel and
there is no other reason (e.g., preferred channel from the driver or an
already used channel from a virtual interface sharing the same radio) to
pick a specific channel.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoP2P/AP: More detailed debug prints on HT/VHT parameter selection
Jouni Malinen [Fri, 15 Jun 2018 18:40:43 +0000 (21:40 +0300)] 
P2P/AP: More detailed debug prints on HT/VHT parameter selection

This makes it easier to debug why wpa_supplicant selects particular
HT/VHT parameters for AP/P2P GO mode.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agonl80211: Add more command/event names to debug prints
Jouni Malinen [Fri, 15 Jun 2018 18:40:08 +0000 (21:40 +0300)] 
nl80211: Add more command/event names to debug prints

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Associated STA indicating 40 MHz intolerant and hostapd deinit
Jouni Malinen [Tue, 12 Jun 2018 18:47:43 +0000 (21:47 +0300)] 
tests: Associated STA indicating 40 MHz intolerant and hostapd deinit

This is a regression test for a forgotten ap_ht2040_timeout() eloop
timer callback on AP interface removal.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoAP: Fix HT 20/40 co-ex transition timer cancellation on iface removal
Martin Willi [Thu, 26 Apr 2018 12:27:05 +0000 (14:27 +0200)] 
AP: Fix HT 20/40 co-ex transition timer cancellation on iface removal

When removing an interface, hostapd_bss_deinit() frees all associated
STAs. If any of the stations is 40MHz intolerant, the cleanup invokes
ht40_intolerant_remove(), that in turn registers a 20->40MHz transition
timer for the last station (ap_ht2040_timeout() function). That timer is
never canceled; once it executes, the interface is gone, most likely
resulting in a segfault when referencing it.

While hostapd_interface_deinit() cancels the transition timer, it does
so before cleaning up STAs. Move the cancellation after STA cleanup to
cancel any timer that was registered during that operation.

Signed-off-by: Martin Willi <martin@strongswan.org>
6 years agonl80211: Handle NL80211_CMD_WIPHY_REG_CHANGE event
Peng Xu [Wed, 14 Mar 2018 22:10:19 +0000 (15:10 -0700)] 
nl80211: Handle NL80211_CMD_WIPHY_REG_CHANGE event

Handle NL80211_CMD_WIPHY_REG_CHANGE the same way as the
NL80211_CMD_REG_CHANGE event. The wiphy-specific event is generated by
the cfg80211 reg_process_self_managed_hints() function, e.g., when going
through regulatory_set_wiphy_regd_sync_rtnl(). Previously, such events
were ignored completely in hostapd/wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Derive PMKR0Name/PMKR1Name using SHA-384 with AKM 00-0F-AC:13
Jouni Malinen [Wed, 6 Jun 2018 18:57:58 +0000 (21:57 +0300)] 
FT: Derive PMKR0Name/PMKR1Name using SHA-384 with AKM 00-0F-AC:13

The AKM 00-0F-AC:13 is supposed to use cryptographic algorithms
consistently, but the current IEEE 802.11 standard is not doing so for
the key names: PMKID (uses SHA-1), PMKR0Name/PMKR1Name (uses SHA-256).
The PMKID case was already implemented with SHA-384 and this commit
replaces use of SHA-256 with SHA-384 for PMKR0Name/PMKR1Name derivation
to be consistent in SHA-384. While this is not compliant with the
current IEEE 802.11 standard, this is clearly needed to meet CNSA Suite
requirements. Matching change is being proposed in REVmd to get the IEEE
802.11 standard to meet the use case requirements.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: SAE reauthentication
Jouni Malinen [Tue, 5 Jun 2018 22:27:00 +0000 (01:27 +0300)] 
tests: SAE reauthentication

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoSAE: Do not drop STA entry on reauthentication in infrastructure BSS
Jouni Malinen [Tue, 5 Jun 2018 22:22:01 +0000 (01:22 +0300)] 
SAE: Do not drop STA entry on reauthentication in infrastructure BSS

A new SAE Commit message should not be allowed to drop an existing STA
entry since the sender of that Commit message cannot be authenticated
before receiving the Confirm message. This is important in particular
when PMF is used since this would provide a potential new path for
forcing a connection to be dropped.

Fix this by allowing a new SAE Authentication instance to be started
when the old instance is in Accepted state and the new Commit message
does not use the same peer-scalar value (checked in
sae_parse_commit_scalar()). When PMF is used, the AP will use SA Query
procedure when receiving the (Re)Association Request frame. In theory,
that step could be skipped in case of SAE Authentication since the
non-AP STA is demonstrating knowledge of the password. Anyway, there is
no allowance for that exception in the IEEE 802.11 standard, so at least
for now, leave this using SA Query procedure just like any other PMF
case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: FT with different BIP algorithms
Jouni Malinen [Tue, 5 Jun 2018 18:39:08 +0000 (21:39 +0300)] 
tests: FT with different BIP algorithms

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Support BIP-CMAC-256, BIP-GMAC-128, BIP-GMAC-256 in STA case
Jouni Malinen [Tue, 5 Jun 2018 18:38:01 +0000 (21:38 +0300)] 
FT: Support BIP-CMAC-256, BIP-GMAC-128, BIP-GMAC-256 in STA case

wpa_supplicant was hardcoded to use BIP-CMAC-128 in FT protocol if PMF
was enabled. Extend that to allow the other BIP algorithms to be used as
well.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Support 256-bit IGTK in AP case
Jouni Malinen [Tue, 5 Jun 2018 18:36:56 +0000 (21:36 +0300)] 
FT: Support 256-bit IGTK in AP case

hostapd was hardcoded to use 128-bit IGTK in FT protocol (IGTK
subelement in FTE). Extend that to allow 256-bit IGTK (i.e.,
BIP-CMAC-256 and BIP-GMAC-256) to be used as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: FILS+FT with SHA384
Jouni Malinen [Tue, 5 Jun 2018 17:15:53 +0000 (20:15 +0300)] 
tests: FILS+FT with SHA384

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