]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
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>
6 years agoFT: Handle AssocResp generation failures as fatal errors
Jouni Malinen [Tue, 5 Jun 2018 18:09:43 +0000 (21:09 +0300)] 
FT: Handle AssocResp generation failures as fatal errors

Instead of sending out a partially completed frame, abort the
association process if something unexpected happens and remove the STA
entry.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Split ap_ft_ap_oom7 into separate test cases
Jouni Malinen [Tue, 5 Jun 2018 18:48:27 +0000 (21:48 +0300)] 
tests: Split ap_ft_ap_oom7 into separate test cases

The implementation changes in hostapd FT error path handling in the
follow commit would result in ap_ft_ap_oom7 test case failing. This is
triggered partially by PMF protections and SA Query attempts, so it
looks like it is easier to split each failure case into a separate test
case.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFILS: Fix KEK2 use in FT-FILS use cases
Jouni Malinen [Tue, 5 Jun 2018 17:13:34 +0000 (20:13 +0300)] 
FILS: Fix KEK2 use in FT-FILS use cases

When support for KCK2 and KEK2 was added, both keys were derived for
FT-FILS cases, but only KCK2 was actually used. Add similar changes to
use KEK2 to protect GTK/IGTK in FTE with using FT-FILS AKMs.

This fixes AES key wrapping to use the correct key. The change is not
backwards compatible.

Fixes: 2f37387812a5 ("FILS: Add more complete support for FT-FILS use cases")
Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Fix potential NULL pointer dereference in MDE addition
Jouni Malinen [Tue, 5 Jun 2018 11:40:18 +0000 (14:40 +0300)] 
FT: Fix potential NULL pointer dereference in MDE addition

The bss variable in this function might be NULL, so make the FT MDE
addition case conditional on a BSS entry being available.

Fixes: 3dc3afe298f0 ("FT: Add MDE to assoc request IEs in connect params")
Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Fix RRB error path handling
Jouni Malinen [Tue, 5 Jun 2018 11:18:41 +0000 (14:18 +0300)] 
FT: Fix RRB error path handling

When building an RRB message, a failure in wpa_ft_rrb_lin() calls could
have resulted in trying to free an uninitialized pointer. Fix this by
initializing *packet to NULL before going through the initial steps.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Debug print of IE parsing element details
Jouni Malinen [Tue, 5 Jun 2018 10:21:27 +0000 (13:21 +0300)] 
FT: Debug print of IE parsing element details

This makes it easier to debug issues in processing FT frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: FT-EAP-SHA384
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
tests: FT-EAP-SHA384

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Add key management value FT-EAP-SHA384 for wpa_supplicant
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: Add key management value FT-EAP-SHA384 for wpa_supplicant

This allows wpa_supplicant to be configuted to use the SHA384-based FT
AKM.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Add key management value FT-EAP-SHA384 for hostapd
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: Add key management value FT-EAP-SHA384 for hostapd

This allows hostapd to be configuted to use the SHA384-based FT AKM.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Add support for variable length PMK-R1 receiving in RRB
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: Add support for variable length PMK-R1 receiving in RRB

SHA384-based FT AKM uses longer keys, so the RRB receive processing for
push and pull response messages needs to be able to accept variable
length PMK-R1.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: FTE generation for SHA384-based AKM on AP
Jouni Malinen [Mon, 4 Jun 2018 22:31:43 +0000 (01:31 +0300)] 
FT: FTE generation for SHA384-based AKM on AP

The MIC field is now a variable length field, so make FTE generation in
hostapd aware of the two different field lengths.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: FTE generation for SHA384-based AKM on STA
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: FTE generation for SHA384-based AKM on STA

The MIC field is now a variable length field, so make FTE generation in
wpa_supplicant aware of the two different field lengths.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: FTE parsing for SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: FTE parsing for SHA384-based AKM

The MIC field is now a variable length field, so make the FTE parser
aware of the two different field lengths.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Connection settings for SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: Connection settings for SHA384-based AKM

Extend wpa_supplicant to allow SHA384-based FT AKM to be selected for a
connection.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: PMK-R0 derivation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: PMK-R0 derivation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: PMKID derivation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: PMKID derivation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: PTK derivation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: PTK derivation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: PMK-R1 derivation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: PMK-R1 derivation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: FTE MIC calculation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: FTE MIC calculation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: EAPOL-Key MIC calculation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: EAPOL-Key MIC calculation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: XXKey derivation for SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: XXKey derivation for SHA384-based AKM

XXKey is the first 384 bits of MSK when using the SHA384-based FT AKM.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Support variable length keys
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: Support variable length keys

This is a step in adding support for SHA384-based FT AKM.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: SHA384-based AKM in RSNE processing
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: SHA384-based AKM in RSNE processing

This defines key lengths for SHA384-based FT AKM and handles writing and
parsing for RSNE AKMs with the new value.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-TLS: Derive Session-Id using TLS-Exporter when TLS v1.3 is used
Jouni Malinen [Fri, 1 Jun 2018 14:58:56 +0000 (17:58 +0300)] 
EAP-TLS: Derive Session-Id using TLS-Exporter when TLS v1.3 is used

This updates Session-Id derivation with TLS v1.3 per
draft-ietf-emu-eap-tls13-00.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: ERP enabled on RADIUS server and peer using EAP-TLS v1.3
Jouni Malinen [Fri, 1 Jun 2018 14:53:10 +0000 (17:53 +0300)] 
tests: ERP enabled on RADIUS server and peer using EAP-TLS v1.3

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-TLS server: Fix EMSK derivation with TLS v1.3
Jouni Malinen [Fri, 1 Jun 2018 14:52:18 +0000 (17:52 +0300)] 
EAP-TLS server: Fix EMSK derivation with TLS v1.3

The new label string for TLS-Exporter was taken into use for MSK
derivation, but it was missed from EMSK deriation in the server side
implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-TLS: Update key derivation label per draft-ietf-emu-eap-tls13-00
Jouni Malinen [Fri, 1 Jun 2018 14:41:59 +0000 (17:41 +0300)] 
EAP-TLS: Update key derivation label per draft-ietf-emu-eap-tls13-00

The label strings used for deriving Key_Material with TLS v1.3 were
changed, so update the implementation to match the new values.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agowpa_supplicant: Fix parsing of max_oper_chwidth
Sven Eckelmann [Mon, 7 May 2018 13:24:29 +0000 (15:24 +0200)] 
wpa_supplicant: Fix parsing of max_oper_chwidth

The max_oper_chwidth is parsed in wpa_config_set as INT_RANGE (see
ssid_fields). The actual parsing for INT_RANGE is done by
wpa_config_parse_int which can only store the result as full integer.

max_oper_chwidth is stored as u8 (a single byte) in wpa_ssid. This means
that on little endian systems, the least significant byte of the parsed
value are really stored in the max_oper_chwidth. But on big endian
system, the only most significant byte is stored as max_oper_chwidth.
This means that 0 is always stored because the provided range doesn't
allow any other value for systems with multi-byte-wide integers.

This also means that for common systems with 4-byte-wide integers, the
remaining 3 bytes were written after the actual member of the struct.
This should not have influenced the behavior of succeeding members
because these bytes would have been part of the padding between the
members on most systems.

Increasing its size to a full int fixes the write operations outside of
the member and allows to use the max_oper_chwidth setting on big endian
systems.

Fixes: 0f29bc68d18e ("IBSS/mesh: Add support for VHT80P80 configuration")
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
6 years agotests: Update mesh_oom to match implementation change
Jouni Malinen [Thu, 31 May 2018 13:13:58 +0000 (16:13 +0300)] 
tests: Update mesh_oom to match implementation change

The initial direct allocation within wpa_supplicant_mesh_init() was
removed.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agomesh: Fix crash with CONFIG_TAXONOMY enabled
Felix Fietkau [Thu, 3 May 2018 10:36:15 +0000 (12:36 +0200)] 
mesh: Fix crash with CONFIG_TAXONOMY enabled

wpa_s->ifmsh needs to be allocated using hostapd_alloc_iface() instead
of a direct call to os_zalloc(), otherwise the linked list for station
taxonomy items remains uninitialized, leading to a crash on the first
attempt to traverse that list

Signed-off-by: Felix Fietkau <nbd@nbd.name>