]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agoRemove CONFIG_IEEE80211W build parameter
Jouni Malinen [Sun, 8 Sep 2019 14:17:31 +0000 (17:17 +0300)] 
Remove CONFIG_IEEE80211W build parameter

Hardcode this to be defined and remove the separate build options for
PMF since this functionality is needed with large number of newer
protocol extensions and is also something that should be enabled in all
WPA2/WPA3 networks.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDFS offload: Fix hostapd state and CAC info in STATUS output
Hu Wang [Wed, 14 Aug 2019 09:31:19 +0000 (17:31 +0800)] 
DFS offload: Fix hostapd state and CAC info in STATUS output

With DFS offloaded to the driver, hostapd state and CAC info was not
updated in DFS-CAC-START event, so STATUS output showed wrong info. Fix
this by updating the CAC related state when processing the driver event.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoEAP-TEAP peer: Clear Phase 2 EAP method on new Identity exchange
Jouni Malinen [Sun, 1 Sep 2019 14:15:06 +0000 (17:15 +0300)] 
EAP-TEAP peer: Clear Phase 2 EAP method on new Identity exchange

This is needed to allow clean transition from one inner EAP
authentication method to another one if EAP method negotiation is needed
within Phase 2.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: EAP-TEAP with inner EAP-MSCHAPv2 user and EAP-TLS machine credentials
Jouni Malinen [Sun, 1 Sep 2019 14:08:45 +0000 (17:08 +0300)] 
tests: EAP-TEAP with inner EAP-MSCHAPv2 user and EAP-TLS machine credentials

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP peer: Add support for machine credentials using certificates
Jouni Malinen [Sun, 1 Sep 2019 13:44:51 +0000 (16:44 +0300)] 
EAP-TEAP peer: Add support for machine credentials using certificates

This allows EAP-TLS to be used within an EAP-TEAP tunnel when there is
an explicit request for machine credentials. The network profile
parameters are otherwise same as the Phase 1 parameters, but each one
uses a "machine_" prefix for the parameter name.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDo not try to include net/ethernet.h in MinGW/Windows builds
Jouni Malinen [Sun, 1 Sep 2019 13:16:43 +0000 (16:16 +0300)] 
Do not try to include net/ethernet.h in MinGW/Windows builds

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix Windows error code definition workaround
Jouni Malinen [Sun, 1 Sep 2019 13:14:08 +0000 (16:14 +0300)] 
Fix Windows error code definition workaround

ENOTCONN, EOPNOTSUPP, and ECANCELED are defined in a newer version of
MinGW, so make this workaround conditional on what is defined in the
header files.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP peer config: Move ocsp param to phase1/phase2
Jouni Malinen [Sun, 1 Sep 2019 13:07:58 +0000 (16:07 +0300)] 
EAP peer config: Move ocsp param to phase1/phase2

OCSP configuration is applicable to each instance of TLS-based
authentication and as such, the configuration might need to be different
for Phase 1 and Phase 2. Move ocsp into struct eap_peer_cert_config and
add a separate ocsp2 network profile parameter to set this for Phase 2.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Too many EAP roundtrips (server)
Jouni Malinen [Sun, 1 Sep 2019 12:59:34 +0000 (15:59 +0300)] 
tests: Too many EAP roundtrips (server)

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP server: Configurable maximum number of authentication message rounds
Jouni Malinen [Sun, 1 Sep 2019 12:58:10 +0000 (15:58 +0300)] 
EAP server: Configurable maximum number of authentication message rounds

Allow the previously hardcoded maximum numbers of EAP message rounds to
be configured in hostapd EAP server. This can be used, e.g., to increase
the default limits if very large X.509 certificates are used for EAP
authentication.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP peer: Move certificate configuration params into shared struct
Jouni Malinen [Sun, 1 Sep 2019 12:37:22 +0000 (15:37 +0300)] 
EAP peer: Move certificate configuration params into shared struct

These parameters for certificate authentication are identical for the
Phase 1 (EAP-TLS alone) and Phase 2 (EAP-TLS inside a TLS tunnel).
Furthermore, yet another copy would be needed to support separate
machine credential in Phase 2. Clean this up by moving the shared
parameters into a separate data struct that can then be used for each
need without having to define separate struct members for each use.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agomesh: Do not enable HE on 5 GHz without VHT
Sven Eckelmann [Tue, 13 Aug 2019 13:50:52 +0000 (15:50 +0200)] 
mesh: Do not enable HE on 5 GHz without VHT

The commit ad9a1bfe788e ("nl80211: Share VHT channel configuration for
HE") always enforced that VHT is enabled when HE was enabled. This broke
the mesh functionality on 2.4 GHz with HE because ibss_mesh_setup_freq()
isn't setting up the VHT parameters for 2.4 GHz.

This problem was resolved for 2.4 GHz by commit df4f959988b6 ("nl80211:
Don't force VHT channel definition with HE"), but it is still possible
to disable VHT during the mesh/IBSS freq setup on 5 GHz - which would
result in the same problem as seen on 2.4 GHz.

The code enabling HE for IBSS/mesh must now make sure that it doesn't
enable HE when VHT could be enforced by the nl80211 driver code but
disabled by the user.

Fixes: 3459c54ac78b ("mesh: Add support for HE mode")
Signed-off-by: Sven Eckelmann <seckelmann@datto.com>
4 years agoHE: Fix HE Capabilities element size
John Crispin [Tue, 13 Aug 2019 13:10:46 +0000 (15:10 +0200)] 
HE: Fix HE Capabilities element size

Set the max value of optional bytes inside the data structure. This
requires us to calculate the actually used size when copying the
HE capabilities and generating the IE.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Sven Eckelmann <seckelmann@datto.com>
4 years agoAdd nl80211 vendor ACS trigger reasons related to interference
Krishna Rao [Wed, 14 Aug 2019 14:51:19 +0000 (20:21 +0530)] 
Add nl80211 vendor ACS trigger reasons related to interference

Add the following ACS trigger reasons to enum
qca_wlan_vendor_acs_select_reason:
1) QCA_WLAN_VENDOR_ACS_SELECT_REASON_GENERIC_INTERFERENCE
       Generic, uncategorized interference found
2) QCA_WLAN_VENDOR_ACS_SELECT_REASON_80211_INTERFERENCE
       Excessive 802.11 interference found
3) QCA_WLAN_VENDOR_ACS_SELECT_REASON_CW_INTERFERENCE
       Continuous Wave (CW) interference found
4) QCA_WLAN_VENDOR_ACS_SELECT_REASON_MWO_INTERFERENCE
       Microwave Oven (MWO) interference found
5) QCA_WLAN_VENDOR_ACS_SELECT_REASON_FHSS_INTERFERENCE
       Frequency-Hopping Spread Spectrum (FHSS) interference found
6) QCA_WLAN_VENDOR_ACS_SELECT_REASON_NON_80211_FHSS_INTERFERENCE
       Non-802.11 Frequency-Hopping Spread Spectrum (FHSS) interference
       found
7) QCA_WLAN_VENDOR_ACS_SELECT_REASON_WB_INTERFERENCE
       Wideband (WB) interference found
8) QCA_WLAN_VENDOR_ACS_SELECT_REASON_NON_80211_WB_INTERFERENCE
       Non-802.11 Wideband (WB) interference found
9) QCA_WLAN_VENDOR_ACS_SELECT_REASON_JAMMER_INTERFERENCE
       Jammer interference found

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoHS 2.0: Do not add two copies of OSEN element into Beacon/Probe Resp
Jouni Malinen [Fri, 30 Aug 2019 12:41:58 +0000 (15:41 +0300)] 
HS 2.0: Do not add two copies of OSEN element into Beacon/Probe Resp

OSEN element was getting added both through the Authenticator IEs
(before some non-vendor elements) and separately at the end of the
frames with other vendor elements. Fix this by removing the separate
addition of the OSEN element and by moving the Authenticator IE addition
for OSEN to match the design used with WPA so that the vendor element
gets added in the proper place in the sequence of IEs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Hotspot 2.0 open OSU association
Jouni Malinen [Fri, 30 Aug 2019 12:25:07 +0000 (15:25 +0300)] 
tests: Hotspot 2.0 open OSU association

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoHS 2.0 AP: Do not mandate PMF for HS 2.0 Indication in open OSU network
Jouni Malinen [Fri, 30 Aug 2019 12:22:42 +0000 (15:22 +0300)] 
HS 2.0 AP: Do not mandate PMF for HS 2.0 Indication in open OSU network

Even though the station is not supposed to include Hotspot 2.0
Indication element in the Association Request frame when connecting to
the open OSU BSS, some station devices seem to do so. With the strict
PMF-required-with-Hotspot-2.0-R2 interpretation, such connection
attempts were rejected. Relax this to only perform the PMF check if the
local AP configuration has PMF enabled, i.e., for the production BSS.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Make nfc_wps more robust by avoiding race conditions
Jouni Malinen [Sat, 24 Aug 2019 19:52:52 +0000 (22:52 +0300)] 
tests: Make nfc_wps more robust by avoiding race conditions

The hostapd side operations and data connectivity test were executed
without explicitly waiting for hostapd to report connection as having
been completed. This could result in trying to transmit data before
EAPOL-Key msg 4/4 was processed especially when using UML time-travel.
Make this more robust by waiting for hostapd to be ready before the data
test.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix ap_ft_reassoc_replay for case where wlantest has the PSK
Jouni Malinen [Sat, 24 Aug 2019 16:20:40 +0000 (19:20 +0300)] 
tests: Fix ap_ft_reassoc_replay for case where wlantest has the PSK

This test case was failing if wlantest was able to decrypt the CCMP
protected frames. Fix the tshark filter string to include only the
actually encrypted frames for PN comparison.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoIEEE 802.1X authenticator: Coding style cleanup
Jouni Malinen [Sat, 24 Aug 2019 14:31:39 +0000 (17:31 +0300)] 
IEEE 802.1X authenticator: Coding style cleanup

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoClean up IEEE 802.1X authentication debug messages for EAP code
Jouni Malinen [Sat, 24 Aug 2019 14:12:45 +0000 (17:12 +0300)] 
Clean up IEEE 802.1X authentication debug messages for EAP code

Merge the separate debug print with the text name of the EAP code into
the same debug line with the numerical value to clean up debug log.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: EAP-TEAP with user and machine credentials
Jouni Malinen [Sat, 24 Aug 2019 13:48:23 +0000 (16:48 +0300)] 
tests: EAP-TEAP with user and machine credentials

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP peer: Fix protected indication of inner EAP method failure
Jouni Malinen [Sat, 24 Aug 2019 13:55:26 +0000 (16:55 +0300)] 
EAP-TEAP peer: Fix protected indication of inner EAP method failure

Need to leave EAP-TEAP methodState == MAY_CONT when marking decision =
FAIL based on inner EAP method failure since this message will be
followed by protected failure indication.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP server: Add support for requiring user and machine credentials
Jouni Malinen [Sat, 24 Aug 2019 13:48:34 +0000 (16:48 +0300)] 
EAP-TEAP server: Add support for requiring user and machine credentials

The new eap_teap_id=5 hostapd configuration parameter value can be used
to configure EAP-TEAP server to request and require user and machine
credentials within the tunnel. This can be done either with Basic
Password Authentication or with inner EAP authentication methods.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Remove unnecessary "config exists" debug prints from build.sh
Jouni Malinen [Sat, 24 Aug 2019 09:18:40 +0000 (12:18 +0300)] 
tests: Remove unnecessary "config exists" debug prints from build.sh

This is the common case and these prints do not really help and just
make the output from build.sh less clear.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Import helper functions directly from utils.py
Jouni Malinen [Fri, 23 Aug 2019 21:14:41 +0000 (00:14 +0300)] 
tests: Import helper functions directly from utils.py

These were moved from test_sae.py to utils.py, so import them from the
correct location instead of through test_sae.py that imports them from
utils.py.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Derive PMK-R1 and PTK for FT protocol cases
Jouni Malinen [Thu, 22 Aug 2019 19:14:47 +0000 (22:14 +0300)] 
wlantest: Derive PMK-R1 and PTK for FT protocol cases

Track PMK-R0/PMK-R0-Name from the initial mobility domain association
and derive PMK-R1/PTK when the station uses FT protocol. This allows
frames from additional roaming cases to be decrypted.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Configure wlantest for FT+PMF test cases
Jouni Malinen [Thu, 22 Aug 2019 19:13:02 +0000 (22:13 +0300)] 
tests: Configure wlantest for FT+PMF test cases

It is useful to get the encrypted frames decrypted in the sniffer
capture for these test cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: EAP-TEAP with machine username/password credential
Jouni Malinen [Tue, 20 Aug 2019 10:15:19 +0000 (13:15 +0300)] 
tests: EAP-TEAP with machine username/password credential

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP peer: Add support for machine authentication
Jouni Malinen [Tue, 20 Aug 2019 10:13:25 +0000 (13:13 +0300)] 
EAP-TEAP peer: Add support for machine authentication

This allows a separate machine credential to be used for authentication
if the server requests Identity-Type = 2 (machine).

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP peer: Add a concept of a separate machine credential
Jouni Malinen [Tue, 20 Aug 2019 10:10:34 +0000 (13:10 +0300)] 
EAP peer: Add a concept of a separate machine credential

This is an initial step in adding support for configuring separate user
and machine credentials. The new wpa_supplicant network profile
parameters machine_identity and machine_password are similar to the
existing identity and password, but explicitly assigned for the purpose
of machine authentication.

This commit alone does not change actual EAP peer method behavior as
separate commits are needed to determine when there is an explicit
request for machine authentication. Furthermore, this is only addressing
the username/password credential type, i.e., additional changes
following this design approach will be needed for certificate
credentials.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Update authsrv_oom to match implementation changes
Jouni Malinen [Mon, 19 Aug 2019 23:59:06 +0000 (02:59 +0300)] 
tests: Update authsrv_oom to match implementation changes

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRADIUS server: Abort startup on allocation failures
Jouni Malinen [Mon, 19 Aug 2019 23:57:58 +0000 (02:57 +0300)] 
RADIUS server: Abort startup on allocation failures

Be more consistent on checking all parameter allocation and copying
steps within radius_server_init() and abort startup if anything fails
instead of trying to continue with other parts of the configuration.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRADIUS server: Use struct eap_config to avoid duplicated definitions
Jouni Malinen [Mon, 19 Aug 2019 23:32:05 +0000 (02:32 +0300)] 
RADIUS server: Use struct eap_config to avoid duplicated definitions

Use struct eap_config as-is within RADIUS server to avoid having to
duplicate all the configuration variables at each interface. This
continues cleanup on struct eap_config duplication in hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP server: Fix eap_teap_pac_no_inner configuration
Jouni Malinen [Mon, 19 Aug 2019 23:12:31 +0000 (02:12 +0300)] 
EAP-TEAP server: Fix eap_teap_pac_no_inner configuration

This was not passed correctly to the EAP server code when using hostapd
internal EAP server.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP server: Fix Crypto-Binding check in PAC no-inner-auth case
Jouni Malinen [Mon, 19 Aug 2019 23:11:31 +0000 (02:11 +0300)] 
EAP-TEAP server: Fix Crypto-Binding check in PAC no-inner-auth case

The Crypto-Binding TLV is included without Intermediate-Result TLV in
this sequence since the server is skipping all inner authentication
methods and is only sending out Result TLV with the Crypto-Binding TLV.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: EAP-TEAP Identity-Type
Jouni Malinen [Mon, 19 Aug 2019 22:37:18 +0000 (01:37 +0300)] 
tests: EAP-TEAP Identity-Type

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP server: Allow a specific Identity-Type to be requested/required
Jouni Malinen [Mon, 19 Aug 2019 22:37:31 +0000 (01:37 +0300)] 
EAP-TEAP server: Allow a specific Identity-Type to be requested/required

The new hostapd configuration parameter eap_teap_id can be used to
configure the expected behavior for used identity type.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP peer: Support Identity-Type TLV
Jouni Malinen [Mon, 19 Aug 2019 22:35:36 +0000 (01:35 +0300)] 
EAP-TEAP peer: Support Identity-Type TLV

Parse the received Identity-Type TLV and report the used Identity-Type
in response if the request included this TLV. For now, only the
Identity-Type 1 (User) is supported.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP: Add parsing and generation routines for Identity-Type TLV
Jouni Malinen [Mon, 19 Aug 2019 22:34:12 +0000 (01:34 +0300)] 
EAP-TEAP: Add parsing and generation routines for Identity-Type TLV

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: sigma_dut controlled SAE association and FT-over-DS
Jouni Malinen [Mon, 19 Aug 2019 21:15:20 +0000 (00:15 +0300)] 
tests: sigma_dut controlled SAE association and FT-over-DS

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut controlled AP FT-PSK (over-DS)
Jouni Malinen [Mon, 19 Aug 2019 20:54:29 +0000 (23:54 +0300)] 
tests: sigma_dut controlled AP FT-PSK (over-DS)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Make mbo_cell_capa_update_pmf more robust
Jouni Malinen [Mon, 19 Aug 2019 14:22:41 +0000 (17:22 +0300)] 
tests: Make mbo_cell_capa_update_pmf more robust

Wait for hostapd to report completion of connection so that the WNM
Notification Request frame does not get sent before the AP has processed
EAPOL-Key msg 4/4 and configured the TK. This could result in a race
condition especially when testing using UML with time-travel.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut and initial UOSC with TOD-STRICT/TOFU
Jouni Malinen [Mon, 19 Aug 2019 13:57:55 +0000 (16:57 +0300)] 
tests: sigma_dut and initial UOSC with TOD-STRICT/TOFU

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoOpenSSL: Write peer certificate chain details in debug log
Jouni Malinen [Mon, 19 Aug 2019 13:34:22 +0000 (16:34 +0300)] 
OpenSSL: Write peer certificate chain details in debug log

This makes it more convenient to debug TLS certificate validation
issues.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: ap_wpa2_eap_too_many_roundtrips to use shorter fragment
Jouni Malinen [Sun, 18 Aug 2019 14:46:34 +0000 (17:46 +0300)] 
tests: ap_wpa2_eap_too_many_roundtrips to use shorter fragment

This is needed with the increased maximum EAP round limit since the
server side sends out longer messages in this exchange and that prevent
the short message limit from being reached.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP: Increase the maximum number of message exchanges
Jouni Malinen [Sun, 18 Aug 2019 14:18:17 +0000 (17:18 +0300)] 
EAP: Increase the maximum number of message exchanges

Allow 100 rounds of EAP messages if there is data being transmitted.
Keep the old 50 round limit for cases where only short EAP messages are
sent (i.e., the likely case of getting stuck in ACK loop).

This allows larger EAP data (e.g., large certificates) to be exchanged
without breaking the workaround for ACK loop interop issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Update authsrv_oom match changed implementation
Jouni Malinen [Sun, 18 Aug 2019 14:39:58 +0000 (17:39 +0300)] 
tests: Update authsrv_oom match changed implementation

Need to take into account the additional memory allocation within
radius_server_init().

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP server: Use struct eap_config to avoid duplicated definitions
Jouni Malinen [Sun, 18 Aug 2019 12:23:12 +0000 (15:23 +0300)] 
EAP server: Use struct eap_config to avoid duplicated definitions

Use struct eap_config as-is within struct eap_sm and EAPOL authenticator
to avoid having to duplicate all the configuration variables at each
interface. Split the couple of session specific variables into a
separate struct to allow a single const struct eap_config to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Vendor EAP method in Phase 2
Jouni Malinen [Sat, 17 Aug 2019 13:12:23 +0000 (16:12 +0300)] 
tests: Vendor EAP method in Phase 2

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP peer: Support vendor EAP method in Phase 2
Jouni Malinen [Sat, 17 Aug 2019 13:12:09 +0000 (16:12 +0300)] 
EAP-TEAP peer: Support vendor EAP method in Phase 2

The implementation was previously hardcoded to use only the non-expanded
IETF EAP methods in Phase 2. Extend that to allow vendor EAP methods
with expanded header to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-PEAP server: Support vendor EAP types in Phase 2
Jouni Malinen [Sat, 17 Aug 2019 13:11:20 +0000 (16:11 +0300)] 
EAP-PEAP server: Support vendor EAP types in Phase 2

This was already allowed with EAP-PEAP, but EAP-TEAP was hardcoded to
use only the non-expanded EAP types. Extend that to allow vendor EAP
types to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-FAST peer: Support vendor EAP method in Phase 2
Jouni Malinen [Sat, 17 Aug 2019 12:58:26 +0000 (15:58 +0300)] 
EAP-FAST peer: Support vendor EAP method in Phase 2

The implementation was previously hardcoded to use only the non-expanded
IETF EAP methods in Phase 2. Extend that to allow vendor EAP methods
with expanded header to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-FAST server: Support vendor EAP types in Phase 2
Jouni Malinen [Sat, 17 Aug 2019 12:57:52 +0000 (15:57 +0300)] 
EAP-FAST server: Support vendor EAP types in Phase 2

This was already allowed with EAP-PEAP, but EAP-FAST was hardcoded to
use only the non-expanded EAP types. Extend that to allow vendor EAP
types to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-PEAP peer: Support vendor EAP method in Phase 2
Jouni Malinen [Sat, 17 Aug 2019 12:40:59 +0000 (15:40 +0300)] 
EAP-PEAP peer: Support vendor EAP method in Phase 2

The implementation was previously hardcoded to allow only the Microsoft
SoH expanded EAP method in Phase 2 in addition to non-expanded EAP
methods. Extend that to allow any vendor EAP method with an expanded
header to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP peer: Allow VENDOR-TEST method in Phase 2
Jouni Malinen [Sat, 17 Aug 2019 09:12:57 +0000 (12:12 +0300)] 
EAP peer: Allow VENDOR-TEST method in Phase 2

This allows EAP methods to be tested for support of expanded EAP headers
in Phase 2.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TTLS peer: Support vendor EAP method in Phase 2
Jouni Malinen [Sat, 17 Aug 2019 09:11:50 +0000 (12:11 +0300)] 
EAP-TTLS peer: Support vendor EAP method in Phase 2

The implementation was previously hardcoded to use only the non-expanded
IETF EAP methods in Phase 2. Extend that to allow vendor EAP methods
with expanded header to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TTLS server: Support vendor EAP types in Phase 2
Jouni Malinen [Sat, 17 Aug 2019 09:09:27 +0000 (12:09 +0300)] 
EAP-TTLS server: Support vendor EAP types in Phase 2

This was already allowed with EAP-PEAP, but EAP-TTLS was hardcoded to
use only the non-expanded EAP types. Extend that to allow vendor EAP
types to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoReplace EapType typedef with enum eap_type
Jouni Malinen [Sat, 17 Aug 2019 08:36:20 +0000 (11:36 +0300)] 
Replace EapType typedef with enum eap_type

This cleans up coding style of the EAP implementation by avoiding
typedef of an enum hiding the type of the variables.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: EAP-TEAP and separate message for Result TLV
Jouni Malinen [Fri, 16 Aug 2019 20:54:37 +0000 (23:54 +0300)] 
tests: EAP-TEAP and separate message for Result TLV

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP server: Testing mechanism for Result TLV in a separate message
Jouni Malinen [Fri, 16 Aug 2019 20:54:51 +0000 (23:54 +0300)] 
EAP-TEAP server: Testing mechanism for Result TLV in a separate message

The new eap_teap_separate_result=1 hostapd configuration parameter can
be used to test TEAP exchange where the Intermediate-Result TLV and
Crypto-Binding TLV are send in one message exchange while the Result TLV
exchange in done after that in a separate message exchange.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP peer: Allow Result TLV without Crypto-Binding TLV
Jouni Malinen [Fri, 16 Aug 2019 20:39:33 +0000 (23:39 +0300)] 
EAP-TEAP peer: Allow Result TLV without Crypto-Binding TLV

If the Crypto-Binding TLV for the last EAP method has been validated
successfully in a previous message exchange with Intermediate-Result TLV
and no new EAP method has been started, Result TLV can be accepted
without an additional Crypto-Binding TLV. This allows the server to go
through additional message exchanges after inner EAP method, if needed.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP: Add parsing of Error TLV
Jouni Malinen [Fri, 16 Aug 2019 20:25:31 +0000 (23:25 +0300)] 
EAP-TEAP: Add parsing of Error TLV

This TLV needs to be processed properly instead of NAK'ed as
unsupported.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP server: Require Intermediate-Result TLV even with Result TLV
Jouni Malinen [Fri, 16 Aug 2019 20:12:54 +0000 (23:12 +0300)] 
EAP-TEAP server: Require Intermediate-Result TLV even with Result TLV

It is not sufficient for the peer to include only the Result TLV if the
server included both the Intermediate-Result TLV and Result TLV.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP peer: Add Intermediate-Result TLV with Crypto-Binding TLV
Jouni Malinen [Fri, 16 Aug 2019 20:11:28 +0000 (23:11 +0300)] 
EAP-TEAP peer: Add Intermediate-Result TLV with Crypto-Binding TLV

Previously, only the Result TLV was added when writing Crypto-Binding
TLV response. This is not sufficient, since RFC 7170 require
Intermediate-Result TLV response to be included from the peer if the
server included Intermediate-Result TLV.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-TEAP: Fix TLS-PRF for TLS ciphersuites that use SHA384
Jouni Malinen [Fri, 16 Aug 2019 18:16:44 +0000 (21:16 +0300)] 
EAP-TEAP: Fix TLS-PRF for TLS ciphersuites that use SHA384

These need to be using the HMAC-based TLS-PRF with SHA384 instead of
SHA256 as the hash algorithm.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAdd TLS-PRF using HMAC with P_SHA384 for TEAP
Jouni Malinen [Fri, 16 Aug 2019 18:15:32 +0000 (21:15 +0300)] 
Add TLS-PRF using HMAC with P_SHA384 for TEAP

This version of TLS PRF is needed when using TEAP with TLS ciphersuites
that are defined to use SHA384 instead of SHA256.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: sigma_dut with TOD-TOFU
Jouni Malinen [Fri, 16 Aug 2019 13:39:08 +0000 (16:39 +0300)] 
tests: sigma_dut with TOD-TOFU

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: TOD-TOFU policy reporting
Jouni Malinen [Fri, 16 Aug 2019 13:25:14 +0000 (16:25 +0300)] 
tests: TOD-TOFU policy reporting

Also rename the previously added test case to use the TOD-STRICT name
for the earlier policy OID.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Update RSA 3k certificates before the previous ones expire
Jouni Malinen [Fri, 16 Aug 2019 13:21:38 +0000 (16:21 +0300)] 
tests: Update RSA 3k certificates before the previous ones expire

In addition, update the generation script to allow convenient update of
the server and user certificates without having to generate new keys.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Add a server certificate with TOD-TOFU policy
Jouni Malinen [Fri, 16 Aug 2019 12:59:43 +0000 (15:59 +0300)] 
tests: Add a server certificate with TOD-TOFU policy

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoExtend server certificate TOD policy reporting to include TOD-TOFU
Jouni Malinen [Fri, 16 Aug 2019 12:51:40 +0000 (15:51 +0300)] 
Extend server certificate TOD policy reporting to include TOD-TOFU

The previously used single TOD policy was split into two policies:
TOD-STRICT and TOD-TOFU. Report these separately in the
CTRL-EVENT-EAP-PEER-CERT events (tod=1 for TOD-STRICT and tod=2 for
TOD-TOFU).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Conditionally set PMKID while notifying the external auth status
Sunil Dutt [Fri, 16 Aug 2019 05:18:45 +0000 (10:48 +0530)] 
SAE: Conditionally set PMKID while notifying the external auth status

This is needed for the drivers implementing SME to include the PMKID in
the Association Request frame directly following SAE authentication.

This commit extends the commit d2b208384391 ("SAE: Allow PMKID to be
added into Association Request frame following SAE") for drivers with
internal SME that use the external authentication mechanism.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Use BSSID stored in ext_auth_bssid for set_pmk
Sunil Dutt [Fri, 16 Aug 2019 05:08:10 +0000 (10:38 +0530)] 
SAE: Use BSSID stored in ext_auth_bssid for set_pmk

pending_bssid is cleared in the connected state and thus is not valid if
SAE authentication is done to a new BSSID when in the connected state.
Hence use the BSSID from ext_auth_bssid while configuring the PMK for
the external authentication case. This is required for roaming to a new
BSSID with driver-based-SME while the SAE processing happens with
wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoOWE: Update connect params with new DH attributes to the driver
Sunil Dutt [Thu, 25 Jul 2019 06:40:57 +0000 (12:10 +0530)] 
OWE: Update connect params with new DH attributes to the driver

A new DH public key is sent through this interface to the driver after
every successful connection/roam to a BSS. This helps to do OWE roaming
to a new BSS with drivers that implement SME/MLME operations during
roaming.

This updated DH IEs are added in the subsequent (Re)Association Request
frame sent by the station when roaming. The DH IE from the roamed AP is
given to wpa_supplicant in the roam result event. wpa_supplicant shall
further process these DH IEs to generate the PMK for the 4-way
handshake.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Request update connection params only for drivers with SME
Sunil Dutt [Fri, 16 Aug 2019 04:53:24 +0000 (10:23 +0530)] 
nl80211: Request update connection params only for drivers with SME

Update Connection Params is intended for drivers that implement
internal SME and expect these updated connection params from
wpa_supplicant. Do not send this request for the drivers using
SME from wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Additional FT with PMF required testing coverage
Jouni Malinen [Fri, 16 Aug 2019 10:53:04 +0000 (13:53 +0300)] 
tests: Additional FT with PMF required testing coverage

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFT: Reject over-the-DS response with MFPC=0 if PMF is required
Jouni Malinen [Fri, 16 Aug 2019 10:50:54 +0000 (13:50 +0300)] 
FT: Reject over-the-DS response with MFPC=0 if PMF is required

If FT over-the-DS case is enforced through the "FT_DS <BSSID>" control
interface command, the PMF capability check during BSS selection is not
used and that could have allowed PMF to be disabled in the over-the-DS
case even if the local network profile mandated use of PMF. Check
against this explicitly to avoid unexpected cases if the APs within the
same mobility domain are not configured consistently.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoRSN: Do not allow connection to proceed without MFPC=1 if PMF required
Jouni Malinen [Fri, 16 Aug 2019 10:48:16 +0000 (13:48 +0300)] 
RSN: Do not allow connection to proceed without MFPC=1 if PMF required

PMF capability check is done as part of BSS selection routines, but
those are not used when going through the enforced roaming operation
("ROAM <BSSID>" control interface command). While that mechanism is
mainly for testing purposes, extend it to do the same check for PMF to
prevent cases where forced roaming could end up disabling PMF against
the local profile requirement.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFT: Fix MFPR flag in RSNE during FT protocol
Jouni Malinen [Fri, 16 Aug 2019 10:23:06 +0000 (13:23 +0300)] 
FT: Fix MFPR flag in RSNE during FT protocol

Commit e820cf952f29 ("MFP: Add MFPR flag into station RSN IE if 802.11w
is mandatory") added indication of MFPR flag in non-FT cases, but forgot
to do so for the FT protocol cases where a different function is used to
build the RSNE. Do the same change now for that FT specific case to get
consistent behavior on indicating PMF configuration state with MFPR.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoOCE: Mandate PMF for WPA2 association with OCE AP
Ankita Bajaj [Tue, 30 Jul 2019 09:05:32 +0000 (14:35 +0530)] 
OCE: Mandate PMF for WPA2 association with OCE AP

An OCE AP with WPA2 enabled shall require PMF negotiation when
associating with an OCE STA. An OCE STA-CFON may negotiate PMF with a
STA when it is operating as an AP. Don't select an OCE AP for connection
if PMF is not enabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoHS 2.0: Match credentials based on required_roaming_consortium
Purushottam Kushwaha [Fri, 26 Jul 2019 05:55:19 +0000 (11:25 +0530)] 
HS 2.0: Match credentials based on required_roaming_consortium

When required_roaming_consortium is set in a credential, station
should match this against Roaming Consortium(s) for a BSS similar
to how it is matching for roaming_consortiums during Interworking
credentials availability check for roaming_consortium.

In the context of Hotspot 2.0 PPS MO, this means addressing matching
part in the same manner for HomeSP/HomeOIList/<X+>/HomeOI regardless of
how HomeSP/HomeOIList/<X+>/HomeOIRequired is set (i.e., the required
part is used as an independent check for the AP advertising the needed
information while the "credential can be used here and this is a home
network" part is shared).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: SAE and PMKSA caching (PMKID in AssocReq after SAE)
Jouni Malinen [Wed, 14 Aug 2019 14:51:31 +0000 (17:51 +0300)] 
tests: SAE and PMKSA caching (PMKID in AssocReq after SAE)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Allow PMKID to be added into Association Request frame following SAE
Jouni Malinen [Wed, 14 Aug 2019 14:49:23 +0000 (17:49 +0300)] 
SAE: Allow PMKID to be added into Association Request frame following SAE

IEEE Std 802.11-2016 does not require this behavior from a SAE STA, but
it is not disallowed either, so it is useful to have an option to
identify the derived PMKSA in the immediately following Association
Request frames. This is disabled by default (i.e., no change to previous
behavior) and can be enabled with a global wpa_supplicant configuration
parameter sae_pmkid_in_assoc=1.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoMake wpa_insert_pmkid() more generic
Jouni Malinen [Wed, 14 Aug 2019 14:47:58 +0000 (17:47 +0300)] 
Make wpa_insert_pmkid() more generic

This is not used only with FT, so make the comments less confusing and
include the function in all builds to make it available for
non-FT/non-FILS builds.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Fix wlan.mesh.config.cap workaround for test_wpas_mesh_max_peering
Sven Eckelmann [Fri, 12 Jul 2019 10:48:53 +0000 (12:48 +0200)] 
tests: Fix wlan.mesh.config.cap workaround for test_wpas_mesh_max_peering

The wlan.mesh.config doesn't have to be the last element of beacon. Things
like VHT or HE oper/cap are usually follow the mesh configuration element.

The workaround must first get the position of a correct reference value in
wlan.mesh.config (ps_protocol) and then calculate the correct
wlan.mesh.config.cap offset based on that.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Fixes: 2cbaf0de223b ("tests: Work around tshark bug in wpas_mesh_max_peering")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
4 years agoHE: MCS size is always a minimum of 4 bytes
John Crispin [Mon, 1 Jul 2019 13:27:09 +0000 (15:27 +0200)] 
HE: MCS size is always a minimum of 4 bytes

The MCS set always has a minimal size of 4 bytes. Without this change
HE20 failed to work.

Signed-off-by: John Crispin <john@phrozen.org>
4 years agonl80211: Don't force VHT channel definition with HE
Sven Eckelmann [Mon, 1 Jul 2019 13:34:08 +0000 (15:34 +0200)] 
nl80211: Don't force VHT channel definition with HE

HE (802.11ax) is also supported on 2.4 GHz. And the 2.4 GHz band isn't
supposed to use VHT operations. Some codepaths in wpa_supplicant will
therefore not initialize the freq->bandwidth or the freq->center_freq1/2
members. As a result, the nl80211_put_freq_params() will directly return
an error (-1) or the kernel will return an error due to the invalid
channel definition.

Instead, the channel definitions should be created based on the actual
HT/VHT/none information on 2.4 GHz.

Fixes: ad9a1bfe788e ("nl80211: Share VHT channel configuration for HE")
Signed-off-by: Sven Eckelmann <seckelmann@datto.com>
4 years agoCheck for LEAP before doing FT
Matthew Wang [Thu, 8 Aug 2019 20:02:12 +0000 (13:02 -0700)] 
Check for LEAP before doing FT

According to https://www.cisco.com/c/en/us/td/docs/wireless/controller/technotes/80211r-ft/b-80211r-dg.html
Cisco does not support EAP-LEAP with Fast Transition. Here,
we check for LEAP before selecting FT 802.1X key management
suite.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
4 years agotests: DPP network introduction with expired netaccesskey
Jouni Malinen [Sun, 11 Aug 2019 13:45:43 +0000 (16:45 +0300)] 
tests: DPP network introduction with expired netaccesskey

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: SAE dot11RSNASAESync
Jouni Malinen [Sun, 11 Aug 2019 13:34:41 +0000 (16:34 +0300)] 
tests: SAE dot11RSNASAESync

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix a typo in hostapd config documentation
Jouni Malinen [Sun, 11 Aug 2019 13:32:27 +0000 (16:32 +0300)] 
Fix a typo in hostapd config documentation

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: OCE AP
Jouni Malinen [Sun, 11 Aug 2019 13:31:34 +0000 (16:31 +0300)] 
tests: OCE AP

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS registrar configuring an AP using preconfigured AP password token
Jouni Malinen [Sun, 11 Aug 2019 13:25:48 +0000 (16:25 +0300)] 
tests: WPS registrar configuring an AP using preconfigured AP password token

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: HE AP parameters
Jouni Malinen [Sun, 11 Aug 2019 13:14:44 +0000 (16:14 +0300)] 
tests: HE AP parameters

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: OCV on 2.4 GHz with PMF getting enabled automatically
Jouni Malinen [Sun, 11 Aug 2019 13:06:49 +0000 (16:06 +0300)] 
tests: OCV on 2.4 GHz with PMF getting enabled automatically

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: acs_exclude_dfs=1
Jouni Malinen [Sun, 11 Aug 2019 13:02:43 +0000 (16:02 +0300)] 
tests: acs_exclude_dfs=1

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: FT RKH parameters
Jouni Malinen [Sun, 11 Aug 2019 10:25:33 +0000 (13:25 +0300)] 
tests: FT RKH parameters

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: FT PMK-R0/R1 expiration
Jouni Malinen [Sun, 11 Aug 2019 10:19:44 +0000 (13:19 +0300)] 
tests: FT PMK-R0/R1 expiration

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Server checking CRL with check_crl_strict=0
Jouni Malinen [Sun, 11 Aug 2019 08:04:13 +0000 (11:04 +0300)] 
tests: Server checking CRL with check_crl_strict=0

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