]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
6 years agotests: Work around tshark bug in wpas_mesh_max_peering
Jouni Malinen [Wed, 17 Oct 2018 09:33:11 +0000 (12:33 +0300)] 
tests: Work around tshark bug in wpas_mesh_max_peering

It looks like tshark parser was broken at some point for
wlan.mesh.config.cap which is now (tshark 2.6.3) pointing to incorrect
field (same as wlan.mesh.config.ps_protocol). This used to work with
tshark 2.2.6.

For now, assume the capability field ends up being the last octet of the
frame.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Update tshark wlan_mgmt compatibility code for new version
Jouni Malinen [Tue, 16 Oct 2018 15:21:07 +0000 (18:21 +0300)] 
tests: Update tshark wlan_mgmt compatibility code for new version

It looks like at least tshark 2.6.3 uses a different error message for
unknown display filter fields:
tshark: Neither "wlan_mgt.fixed.category_code" nor "4" are field or protocol names.
and a different status exit code (2 instead of 1).

Add a new handler for this combination to allow automatic wlan_mgt to
wlan conversion to happen.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoAP: Warn about VLAN interface name truncations
Andrei Otcheretianski [Wed, 22 Aug 2018 17:47:32 +0000 (20:47 +0300)] 
AP: Warn about VLAN interface name truncations

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
6 years agonl80211: Warn about interface name truncations
Andrei Otcheretianski [Wed, 22 Aug 2018 17:47:31 +0000 (20:47 +0300)] 
nl80211: Warn about interface name truncations

This is something useful to know and also eliminates format truncation
warnings.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
6 years agotests: Make ap_reconnect_auth_timeout test more robust
Andrei Otcheretianski [Wed, 22 Aug 2018 17:31:45 +0000 (20:31 +0300)] 
tests: Make ap_reconnect_auth_timeout test more robust

This test starts two identical APs and assumes a connection to the first
one, though it is not necessary true. Fix that by starting the second AP
only after the connection is established.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
6 years agotests: ap_vht_csa_vht40 to check for unexpected disconnection
Jouni Malinen [Tue, 16 Oct 2018 09:44:48 +0000 (12:44 +0300)] 
tests: ap_vht_csa_vht40 to check for unexpected disconnection

This test case had an error that hit an unexpected disconnection. Add an
explicit check to verify that this does not happen anymore.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Fix ap_vht_csa_vht40 test
Andrei Otcheretianski [Wed, 22 Aug 2018 17:11:17 +0000 (20:11 +0300)] 
tests: Fix ap_vht_csa_vht40 test

The channel configuration in CHAN_SWITCH command was incorrect. This
resulted in switching to HT40+ channel, while announcing HT40- in the
secondary channel IE. This caused a disconnection after the channel
switch. Fix that.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
6 years agoRSN: Use COMPACT_MACSTR to match MAC2STR
Johannes Berg [Wed, 22 Aug 2018 16:49:03 +0000 (19:49 +0300)] 
RSN: Use COMPACT_MACSTR to match MAC2STR

We shouldn't open-code the %02x... when we have COMPACT_MACSTR.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agotests: WMM advertisement parameter change
Jouni Malinen [Tue, 16 Oct 2018 09:30:57 +0000 (12:30 +0300)] 
tests: WMM advertisement parameter change

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoWMM: Update WMM parameter advertisement on the fly
Beni Lev [Wed, 22 Aug 2018 16:49:02 +0000 (19:49 +0300)] 
WMM: Update WMM parameter advertisement on the fly

Update the Beacon frame template once WMM parameters have been changed
and the AP is already up.

Signed-off-by: Beni Lev <beni.lev@intel.com>
6 years agotests: EAP-pwd local error case in eap_pwd_perform_confirm_exchange()
Jouni Malinen [Tue, 16 Oct 2018 09:13:31 +0000 (12:13 +0300)] 
tests: EAP-pwd local error case in eap_pwd_perform_confirm_exchange()

This is a regression test case for a memory leak on these error paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-pwd peer: Fix memory leak in eap_pwd_perform_confirm_exchange()
Nishant Chaprana [Tue, 21 Aug 2018 11:37:51 +0000 (17:07 +0530)] 
EAP-pwd peer: Fix memory leak in eap_pwd_perform_confirm_exchange()

hash variable is allocated memory using eap_pwd_h_init(), but there are
couple of error case code paths which skips deallocation of hash. The
memory of hash is deallocated using eap_pwd_h_final(). Fix this by
calling eap_pwd_h_final() at the end of the function if execution got
there through one of those error cases.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
6 years agotests: VHT with 80 MHz channel width reconfigured to 2.4 GHz HT
Jouni Malinen [Mon, 15 Oct 2018 21:51:21 +0000 (00:51 +0300)] 
tests: VHT with 80 MHz channel width reconfigured to 2.4 GHz HT

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFix 5 GHz to 2.4 GHz channel switch with hostapd through DISABLE/ENABLE
Sathishkumar Muruganandam [Mon, 15 Oct 2018 15:07:49 +0000 (20:37 +0530)] 
Fix 5 GHz to 2.4 GHz channel switch with hostapd through DISABLE/ENABLE

When moving a 5 GHz VHT AP to 2.4 GHz band with VHT disabled through the
hostapd control interface DISABLE/reconfig/ENABLE commands, enabling of
the AP on 2.4 GHz failed due to the previously configured VHT capability
being compared with hardware VHT capability on 2.4 GHz band:

hw vht capab: 0x0, conf vht capab: 0x33800132
Configured VHT capability [VHT_CAP_MAX_MPDU_LENGTH_MASK] exceeds max value supported by the driver (2 > 0)
ap: interface state DISABLED->DISABLED

Since VHT (ieee80211ac) config is already disabled for the 2.4 GHz band,
add fix this by validating vht_capab only when VHT is enabled.

Fixes: c781eb842852 ("hostapd: Verify VHT capabilities are supported by driver")
Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
6 years agotests: OWE group negotiation with PMF
Jouni Malinen [Mon, 15 Oct 2018 21:20:57 +0000 (00:20 +0300)] 
tests: OWE group negotiation with PMF

Verify that PMF does not end up reporting unexpected status code 30
(temporary rejection; SA Query).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoPMF: Do not start SA Query procedure if there is no association
Ashok Kumar [Fri, 12 Oct 2018 04:06:05 +0000 (09:36 +0530)] 
PMF: Do not start SA Query procedure if there is no association

Previous implementation ended up triggering PMF check for previous
association and SA Query procedure incorrectly in cases where there is a
STA entry in hostapd, but that STA is not in associated state. This
resulted in undesired temporary rejection of the association with status
code 30.

This ended up breaking OWE group negotiation when PMF is in use since
the check for the OWE group would have happened only after this earlier
PMF check and rejection (i.e., the station got status code 30 instead of
the expected 77).

For example, when the AP is configured with OWE group 21 and a station
tries groups 19, 20, and 21 (in this sequence), the first two
Association Request frames should be rejected with status code 77.
However, only the first one got that status code while the second one
got status code 30 due to that issue with PMF existing association
check.

Furthermore, hostapd was continuing with SA Query procedure with
unencrypted Action frames in this type of case even though there was no
existing association (and obviously, not an encryption key either).

Fix this by checking that the STA entry is in associated state before
initiating SA Query procedure based on the PMF rules.

Signed-off-by: Ashok Kumar <aponnaia@codeaurora.org>
6 years agotests: Maximum number of cred roaming_consortiums
Jouni Malinen [Sun, 14 Oct 2018 17:48:32 +0000 (20:48 +0300)] 
tests: Maximum number of cred roaming_consortiums

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agowpa_supplicant: Fix buffer overflow in roaming_consortiums
Andrei Otcheretianski [Sun, 16 Sep 2018 18:19:16 +0000 (21:19 +0300)] 
wpa_supplicant: Fix buffer overflow in roaming_consortiums

When configuring more than 36 roaming consortiums with SET_CRED, the
stack is smashed. Fix that by correctly verifying the
num_roaming_consortiums.

Fixes: 909a948b ("HS 2.0: Add a new cred block parameter roaming_consortiums")
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
6 years agonl80211: Implement netlink extended ACK support
Johannes Berg [Thu, 11 Oct 2018 13:55:49 +0000 (15:55 +0200)] 
nl80211: Implement netlink extended ACK support

Implement netlink extended ACK support to print out the error
message (if any).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agotests: SAE and MFP enabled without sae_require_mfp
Jouni Malinen [Sun, 14 Oct 2018 17:14:30 +0000 (20:14 +0300)] 
tests: SAE and MFP enabled without sae_require_mfp

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoSAE: Do not ignore option sae_require_mfp
Hauke Mehrtens [Wed, 10 Oct 2018 21:43:07 +0000 (23:43 +0200)] 
SAE: Do not ignore option sae_require_mfp

Without this patch sae_require_mfp is always activate, when ieee80211w
is set to optional all stations negotiating SAEs are being rejected when
they do not support PMF. With this patch hostapd only rejects these
stations in case sae_require_mfp is set to some value and not null.

Fixes ba3d435fe43 ("SAE: Add option to require MFP for SAE associations")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years agoDrop logging priority for handle_auth_cb no-STA-match messages
Jouni Malinen [Sun, 14 Oct 2018 17:03:55 +0000 (20:03 +0300)] 
Drop logging priority for handle_auth_cb no-STA-match messages

This message was printed and MSG_INFO level which would be more
reasonable for error cases where hostapd has accepted authentication.
However, this is not really an error case for the cases where
authentication was rejected (e.g., due to MAC ACL). Drop this to use
MSG_DEBUG level.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoReduce undesired logging of ACL rejection events from AP mode
Jouni Malinen [Sun, 14 Oct 2018 16:57:22 +0000 (19:57 +0300)] 
Reduce undesired logging of ACL rejection events from AP mode

When Probe Request frame handling was extended to use MAC ACL through
ieee802_11_allowed_address(), the MSG_INFO level log print ("Station
<addr> not allowed to authenticate") from that function ended up getting
printed even for Probe Request frames. That was not by design and it can
result in excessive logging and MSG_INFO level if MAC ACL is used.

Fix this by printing this log entry only for authentication and
association frames. In addition, drop the priority of that log entry to
MSG_DEBUG since this is not really an unexpected behavior in most MAC
ACL use cases.

Fixes: 92eb00aec2a0 ("Extend ACL check for Probe Request frames")
Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: OWE transition mode and need for multiple scans
Jouni Malinen [Fri, 12 Oct 2018 16:20:33 +0000 (19:20 +0300)] 
tests: OWE transition mode and need for multiple scans

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoOWE: Improve discovery of OWE transition mode AP
Ilan Peer [Wed, 22 Aug 2018 16:49:04 +0000 (19:49 +0300)] 
OWE: Improve discovery of OWE transition mode AP

An OWE AP device that supports transition mode does not transmit the
SSID of the OWE AP in its Beacon frames and in addition the OWE AP does
not reply to broadcast Probe Request frames. Thus, the scan results
matching relies only on Beacon frames from the OWE open AP which can be
missed in case the AP's frequency is actively scanned.

To improve the discovery of transition mode APs, include their SSID in
the scan command to perform an active scan for the SSIDs learned from
the open mode BSSs.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
6 years agoOWE: Use shorter scan interval during transition mode search
Jouni Malinen [Fri, 12 Oct 2018 16:33:51 +0000 (19:33 +0300)] 
OWE: Use shorter scan interval during transition mode search

Start scans more quickly if an open BSS advertising OWE transition mode
is found, but the matching OWE BSS has not yet been seen.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoOWE: Attempt more scans for OWE transition SSID if expected BSS not seen
Sunil Dutt [Thu, 6 Sep 2018 17:27:29 +0000 (22:57 +0530)] 
OWE: Attempt more scans for OWE transition SSID if expected BSS not seen

This commit introduces a threshold for OWE transition BSS selection,
which signifies the maximum number of selection attempts (scans) done
for finding OWE BSS.

This aims to do more scan attempts for OWE BSS and eventually select the
open BSS if the selection/scan attempts for OWE BSS exceed the
configured threshold.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Use execve() with custom env PATH to launch browser using 'am'
Purushottam Kushwaha [Fri, 12 Oct 2018 10:07:34 +0000 (15:37 +0530)] 
HS 2.0: Use execve() with custom env PATH to launch browser using 'am'

With new restriction in Android, if PATH env variable doesn't have
correct path of 'am' binary, execv() fails to launch wpadebug browser
(am starts, but something seems to fail within its internal processing).

This commit is a workaround to use execve() with custom environment PATH
which includes "/system/bin;/vendor/bin" to handle the cases where
hs20-osu-client fails to launch wpadebug browser through /system/bin/am.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoQCA vendor subcommand and attributes to configure capture of CFR data
Visweswara Tanuku [Thu, 4 Oct 2018 06:45:12 +0000 (12:15 +0530)] 
QCA vendor subcommand and attributes to configure capture of CFR data

Add a subcommand for Channel Frequency Response (CFG) Capture
Configuration and define attributes for configuring CFR capture
parameters per peer and enabling/disabling CFR capture.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: SSID with 32 octets with nul at the end
Jouni Malinen [Wed, 10 Oct 2018 21:10:54 +0000 (00:10 +0300)] 
tests: SSID with 32 octets with nul at the end

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: Subscription remediation with user selected new password
Jouni Malinen [Mon, 8 Oct 2018 15:07:00 +0000 (18:07 +0300)] 
HS 2.0 server: Subscription remediation with user selected new password

Add support for user remediation to request a new password from the user
for username/password credentials that have been configured not use use
machine managed password.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: Show whether credential is machine managed
Jouni Malinen [Mon, 8 Oct 2018 12:31:55 +0000 (15:31 +0300)] 
HS 2.0 server: Show whether credential is machine managed

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: Make user list more readable
Jouni Malinen [Mon, 8 Oct 2018 12:18:27 +0000 (15:18 +0300)] 
HS 2.0 server: Make user list more readable

Order the rows based on identity and use a bit smaller font for some of
the fields to make the table fit on the screen more easily.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: Clarify signup page options
Jouni Malinen [Mon, 8 Oct 2018 12:08:58 +0000 (15:08 +0300)] 
HS 2.0 server: Clarify signup page options

Make it clearer that there are three different types of credentials that
can be provisioned.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: Do not perform subrem if not requested to
Jouni Malinen [Mon, 8 Oct 2018 10:15:59 +0000 (13:15 +0300)] 
HS 2.0 server: Do not perform subrem if not requested to

Instead of defaulting to machine remediation, reject a request to do
subscription remediation if that has not been configured to be required.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoRADIUS: Support last_msk with EAP-TLS
Jouni Malinen [Sun, 7 Oct 2018 13:50:08 +0000 (16:50 +0300)] 
RADIUS: Support last_msk with EAP-TLS

This extends the last_msk testing functionality in the RADIUS server to
work with EAP-TLS based on "cert-<serial_num>" form user names in the
database.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoEAP server: Add eap_get_serial_num()
Jouni Malinen [Sun, 7 Oct 2018 13:49:26 +0000 (16:49 +0300)] 
EAP server: Add eap_get_serial_num()

This can be used to fetch the serial number of the peer certificate
during TLS-based EAP session.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoTLS: Add tls_connection_peer_serial_num()
Jouni Malinen [Sun, 7 Oct 2018 13:47:25 +0000 (16:47 +0300)] 
TLS: Add tls_connection_peer_serial_num()

This can be used to fetch the serial number of the peer certificate in
the EAP server. For now, this is implemented only with OpenSSL.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoAS: Add an event_cb() callback handler
Jouni Malinen [Sun, 7 Oct 2018 13:01:30 +0000 (16:01 +0300)] 
AS: Add an event_cb() callback handler

This provides debug log information on TLS events on the server side.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoOpenSSL: Make serial number of peer certificate available in event_cb
Jouni Malinen [Sun, 7 Oct 2018 13:00:28 +0000 (16:00 +0300)] 
OpenSSL: Make serial number of peer certificate available in event_cb

Add serial number to the event_cb() information for the peer certificate
chain.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: Add last_msk into users table setup
Jouni Malinen [Sun, 7 Oct 2018 09:47:21 +0000 (12:47 +0300)] 
HS 2.0 server: Add last_msk into users table setup

This field is used for debugging purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Reject OSU connection for Single SSID case without OSU_NAI
Jouni Malinen [Fri, 5 Oct 2018 18:02:29 +0000 (21:02 +0300)] 
HS 2.0: Reject OSU connection for Single SSID case without OSU_NAI

The Single SSID case can only use OSEN, so reject the case where OSU_NAI
is not set and open OSU connection would be used since that connection
cannot succeed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: OSU Providers NAI List ANQP-element
Jouni Malinen [Fri, 5 Oct 2018 17:54:40 +0000 (20:54 +0300)] 
tests: OSU Providers NAI List ANQP-element

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Use alternative OSU_NAI information in hs20-osu-client
Jouni Malinen [Fri, 5 Oct 2018 17:53:31 +0000 (20:53 +0300)] 
HS 2.0: Use alternative OSU_NAI information in hs20-osu-client

Extend hs20-osu-client to support the new osu_nai2 value for OSU
connection with the shared BSS (Single SSID) case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Request and process OSU Providers NAI List ANQP-element
Jouni Malinen [Fri, 5 Oct 2018 17:51:51 +0000 (20:51 +0300)] 
HS 2.0: Request and process OSU Providers NAI List ANQP-element

Extend wpa_supplicant to use a separate OSU_NAI information from OSU
Providers NAI List ANQP-element instead of the OSU_NAI information from
OSU Providers list ANQP-element when connecting to the shared BSS
(Single SSID) for OSU.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: OSU Provider NAI List advertisement
Jouni Malinen [Fri, 5 Oct 2018 17:49:42 +0000 (20:49 +0300)] 
HS 2.0: OSU Provider NAI List advertisement

Extend hostapd to allow the new OSU Provider NAI List ANQP-element to be
advertised in addition to the previously used OSU Providers list
ANQP-element. The new osu_nai2 configurator parameter option is used to
specify the OSU_NAI value for the shared BSS (Single SSID) case while
osu_nai remains to be used for the separate OSU BSS.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Update server and user certificates (2018)
Jouni Malinen [Wed, 3 Oct 2018 22:16:55 +0000 (01:16 +0300)] 
tests: Update server and user certificates (2018)

The previous versions expired, so need to re-sign these to fix number of
the EAP test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Test connectivity within each step of FILS+FT
Jouni Malinen [Wed, 3 Oct 2018 10:17:15 +0000 (13:17 +0300)] 
tests: Test connectivity within each step of FILS+FT

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoAdd QCA vendor event to report roam scan events
vamsi krishna [Mon, 17 Sep 2018 12:52:44 +0000 (18:22 +0530)] 
Add QCA vendor event to report roam scan events

Driver/firmware does roam scan when it finds the need to roam to a
different BSS. Add a QCA vendor event to indicate such roam scan events
from driver/firmware to user space.

Please note that some drivers may not send these events in few cases,
e.g., if the host processor is sleeping when this event is generated in
firmware to avoid undesired wakeups.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoOWE: Do not try to enable PMF for non-RSN associations
Purushottam Kushwaha [Tue, 18 Sep 2018 11:04:09 +0000 (16:34 +0530)] 
OWE: Do not try to enable PMF for non-RSN associations

Explicitly set the PMF configuration to 0 (NO_MGMT_FRAME_PROTECTION) for
non-RSN associations. This specifically helps with OWE transition mode
when the network block is configured with PMF set to required, but the
BSS selected is in open mode. There is no point to try to enable PMF for
such an association.

This fixes issues with drivers that use the NL80211_ATTR_USE_MFP
attribute to set expectations for PMF use. The combination of non-RSN
connection with claimed requirement for PMF (NL80211_MFP_REQUIRED) could
cause such drivers to reject the connection in OWE transition mode.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Suite B and PMKSA caching multiple times
Jouni Malinen [Thu, 27 Sep 2018 08:43:58 +0000 (11:43 +0300)] 
tests: Suite B and PMKSA caching multiple times

This verifies that wpa_supplicant and hostapd behave consistently with
PMKSA caching when Suite B AKMs end up deriving a new PMKID from each
4-way handshake.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoRSN: Do not replace existing Suite B PMKSA on 4-way handshake
Jouni Malinen [Thu, 27 Sep 2018 08:37:19 +0000 (11:37 +0300)] 
RSN: Do not replace existing Suite B PMKSA on 4-way handshake

PMKID derivation with the Suite B AKMs is a special case compared to
other AKMs since that derivation uses KCK instead of PMK as an input.
This means that the PMKSA cache entry can be added only after KCK has
been derived during 4-way handshake. This also means that PMKID would
change every time 4-way handshake is repeated even when maintaining the
same PMK (i.e., during PTK rekeying and new associations even if they
use PMKSA caching).

wpa_supplicant was previously replacing the PMKSA cache entry whenever a
new PMKID was derived. This did not match hostapd expectations on the AP
side since hostapd did not update the PMKSA cache entry after it was
created. Consequently, PMKSA caching could be used only once (assuming
no PTK rekeying happened before that). Fix this by making wpa_supplicant
behave consistently with hostapd, i.e., by adding the Suite B PMKSA
cache entries with the PMKID from the very first 4-way handshake
following PMK derivation and then not updating the PMKID.

IEEE Std 802.11-2016 is somewhat vague in this area and it seems to
allow both cases to be used (initial PMKID or any consecutive PMKID
derived from the same PMK). While both cases could be supported that
would result in significantly more complex implementation and need to
store multiple PMKID values. It looks better to clarify the standard to
explicitly note that only the first PMKID derived after PMK derivation
is used (i.e., match the existing hostapd implementation).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Remove hs20-osu-client debug file Cert/est-resp.raw
Jouni Malinen [Wed, 26 Sep 2018 09:59:41 +0000 (12:59 +0300)] 
HS 2.0: Remove hs20-osu-client debug file Cert/est-resp.raw

This was used during initial EST development time testing, but the same
information is available in the debug log and since this separate file
is deleted automatically, just remove its generation completely to
simplify implementation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: DPP_CONFIGURATOR_ADD error path
Jouni Malinen [Fri, 21 Sep 2018 18:39:34 +0000 (21:39 +0300)] 
tests: DPP_CONFIGURATOR_ADD error path

This is a regression test case for a memory leak on DPP_CONFIGURATOR_ADD
error path in dpp_keygen_configurator() when an unsupported curve is
specified.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoeap_proxy: Fix memory leaks when using eap_peer_erp_init()
Srikanth Marepalli [Thu, 20 Sep 2018 07:56:07 +0000 (13:26 +0530)] 
eap_proxy: Fix memory leaks when using eap_peer_erp_init()

The external session_id and emsk from eap_proxy_get_eap_session_id() and
eap_proxy_get_emsk() need to be freed consistently in all code paths
within eap_peer_erp_init() and outside it in the case ERP is not
initialized.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Fix a memory leak on Configurator keygen error path
Ankita Bajaj [Mon, 27 Aug 2018 07:31:13 +0000 (13:01 +0530)] 
DPP: Fix a memory leak on Configurator keygen error path

The allocated configuration structure needs to be freed if the specified
curve is not supported.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Fix a memory leak in L derivation
Ankita Bajaj [Mon, 27 Aug 2018 07:31:13 +0000 (13:01 +0530)] 
DPP: Fix a memory leak in L derivation

The temporary EC_POINT 'sum' needs to be freed at the end of the
function with the other OpenSSL allocations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
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>