]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agotests: wpa_supplicant build for EAP-SIM and PC/SC
Jouni Malinen [Tue, 17 Sep 2019 15:07:03 +0000 (18:07 +0300)] 
tests: wpa_supplicant build for EAP-SIM and PC/SC

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFix wpa_supplicant build with CONFIG_PCSC=y
Jouni Malinen [Tue, 17 Sep 2019 15:00:49 +0000 (18:00 +0300)] 
Fix wpa_supplicant build with CONFIG_PCSC=y

This code block with dependency on PCSC_FUNCS was missed when conf->pin
was moved to conf->cert.pin. Fix this to get rid of compilation issues
with CONFIG_PCSC=y builds.

Fixes: b99c4cadb7f8 ("EAP peer: Move certificate configuration params into shared struct")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP MUD URL
Jouni Malinen [Tue, 17 Sep 2019 14:57:51 +0000 (17:57 +0300)] 
tests: DPP MUD URL

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Allow name and mudurl to be configured for Config Request
Jouni Malinen [Tue, 17 Sep 2019 10:36:22 +0000 (13:36 +0300)] 
DPP: Allow name and mudurl to be configured for Config Request

The new hostapd and wpa_supplicant configuration parameters dpp_name and
dpp_mud_url can now be used to set a specific name and MUD URL for the
Enrollee to use in the Configuration Request. dpp_name replaces the
previously hardcoded "Test" string (which is still the default if an
explicit configuration entry is not included). dpp_mud_url can
optionally be used to add a MUD URL to describe the Enrollee device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Layer 2 Update frame behavior in mac80211
Jouni Malinen [Wed, 11 Sep 2019 12:09:22 +0000 (15:09 +0300)] 
tests: Layer 2 Update frame behavior in mac80211

This verifies mac80211 behavior for Layer 2 Update frame use and other
unexpected frames from a not fully authentication station.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: PMF and Data frame injection
Jouni Malinen [Thu, 29 Aug 2019 08:52:32 +0000 (11:52 +0300)] 
tests: PMF and Data frame injection

Verify driver/mac80211 behavior for unexpected A2 in Data frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Extend ap_pmf_inject_auth coverage for addresses/frames
Jouni Malinen [Thu, 29 Aug 2019 08:52:26 +0000 (11:52 +0300)] 
tests: Extend ap_pmf_inject_auth coverage for addresses/frames

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoMore consistent SA check for unexpected Data frames
Jouni Malinen [Wed, 11 Sep 2019 13:01:57 +0000 (16:01 +0300)] 
More consistent SA check for unexpected Data frames

Use the same rules for dropping driver notifications for Data frames
from unassociated stations as were added for Management frame reception.
This results in more consistent behavior in sending out Deauthentication
frames with Reason Code 6/7.

This case was already checking for unexpected multicast addresses, so
there was no issue for the PMF protections for unexpected disconnection.
Anyway, better avoid unnecessary Deauthentication frames consistently.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Avoid race conditions in couple of Hotspot 2.0 test cases
Jouni Malinen [Mon, 16 Sep 2019 15:05:44 +0000 (18:05 +0300)] 
tests: Avoid race conditions in couple of Hotspot 2.0 test cases

Wait hostapd to complete key setup before asking it to send a frame that
may need PMF. This is needed especially with UML time-travel.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP2 connection status result
Jouni Malinen [Sun, 15 Sep 2019 13:19:45 +0000 (16:19 +0300)] 
tests: DPP2 connection status result

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Connection status result (Enrollee)
Jouni Malinen [Sun, 15 Sep 2019 13:19:45 +0000 (16:19 +0300)] 
DPP2: Connection status result (Enrollee)

Add support for reporting connection status after provisioning if the
Configurator requests this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Connection status result (Configurator)
Jouni Malinen [Sun, 15 Sep 2019 13:19:45 +0000 (16:19 +0300)] 
DPP2: Connection status result (Configurator)

A new argument to the DPP_AUTH_INIT command (conn_status=1) can now be
used to set Configurator to request a station Enrollee to report
connection result after a successfully completed provisioning step. If
the peer supports this, the DPP-CONF-SENT event indicates this with a
new argument (wait_conn_status=1) and the Configurator remains waiting
for the connection result for up to 16 seconds.

Once the Enrollee reports the result, a new DPP-CONN-STATUS-RESULT event
is generated with arguments result, ssid, and channel_list indicating
what the Enrollee reported. result=0 means success while non-zero codes
are for various error cases as specified in the DPP tech spec. If no
report is received from the Enrollee, the event with "timeout" argument
is generated locally.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Connection status result defines
Jouni Malinen [Sun, 15 Sep 2019 13:19:45 +0000 (16:19 +0300)] 
DPP2: Connection status result defines

Add defines for the connection status result mechanism.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Fix DPP wait_auth_success() check for Configurator success
Jouni Malinen [Sun, 15 Sep 2019 14:01:59 +0000 (17:01 +0300)] 
tests: Fix DPP wait_auth_success() check for Configurator success

This looked like a copy-paste error in the event message check and once
that was fixed, couple of test cases needed fixes to expect a success
from the Configurator.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Move dpp_build_conf_result() to be within ifdef block
Jouni Malinen [Sun, 15 Sep 2019 13:40:23 +0000 (16:40 +0300)] 
DPP2: Move dpp_build_conf_result() to be within ifdef block

This is more consistent with the use of CONFIG_DPP2 since the
Configuration Result message is sent only when using version 2 or newer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Fix a memory leak on error path for Config Result
Jouni Malinen [Sun, 15 Sep 2019 13:19:45 +0000 (16:19 +0300)] 
DPP2: Fix a memory leak on error path for Config Result

If only one of the allocations fails, the successful allocation needs to
be freed on the error path.

Fixes: 22f90b32f14e ("DPP2: Configuration Result message generation and processing")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agowpa_supplicant: Don't return an error when successfully parsing WMM rules
Sujay Patwardhan [Mon, 26 Aug 2019 18:35:38 +0000 (11:35 -0700)] 
wpa_supplicant: Don't return an error when successfully parsing WMM rules

The config file parser previously would fall through into an error if
CONFIG_AP is defined and it hit a wmm_ac_* rule with a valid value. Add
a return to prevent incorrectly printing an error message and returning
a non-zero exit code.

Signed-off-by: Sujay Patwardhan <sujay@eero.com>
5 years agoP2P: Use latest BSS entry if multiple P2P Device Addr matches found
Hu Wang [Wed, 11 Sep 2019 03:04:40 +0000 (11:04 +0800)] 
P2P: Use latest BSS entry if multiple P2P Device Addr matches found

If an AP (P2P GO) has changed its operating channel or SSID recently,
the BSS table may have multiple entries for the same BSSID.

Commit 702621e6dd35 ('WPS: Use latest updated BSS entry if multiple
BSSID matches found') fetches latest updated BSS entry based on
BSSID. Do the same when fetching an entry based on the P2P Device
Address.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agowpa_supplicant: Add support for 60 GHz band channels 5 and 6
Alexei Avshalom Lazar [Thu, 8 Aug 2019 11:21:37 +0000 (14:21 +0300)] 
wpa_supplicant: Add support for 60 GHz band channels 5 and 6

The previous support in the 60 GHz band was for channels 1-4.
Add support for channels 5 and 6.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
5 years agoRemove IAPP functionality from hostapd
Jouni Malinen [Wed, 11 Sep 2019 09:34:28 +0000 (12:34 +0300)] 
Remove IAPP functionality from hostapd

IEEE Std 802.11F-2003 was withdrawn in 2006 and as such it has not been
maintained nor is there any expectation of the withdrawn trial-use
recommended practice to be maintained in the future. Furthermore,
implementation of IAPP in hostapd was not complete, i.e., only parts of
the recommended practice were included. The main item of some real use
long time ago was the Layer 2 Update frame to update bridges when a STA
roams within an ESS, but that functionality has, in practice, been moved
to kernel drivers to provide better integration with the networking
stack.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Remove IAPP test case
Jouni Malinen [Wed, 11 Sep 2019 09:30:28 +0000 (12:30 +0300)] 
tests: Remove IAPP test case

This is in preparation for removal of the full IAPP functionality from
hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAP: Silently ignore management frame from unexpected source address
Jouni Malinen [Thu, 29 Aug 2019 08:52:04 +0000 (11:52 +0300)] 
AP: Silently ignore management frame from unexpected source address

Do not process any received Management frames with unexpected/invalid SA
so that we do not add any state for unexpected STA addresses or end up
sending out frames to unexpected destination. This prevents unexpected
sequences where an unprotected frame might end up causing the AP to send
out a response to another device and that other device processing the
unexpected response.

In particular, this prevents some potential denial of service cases
where the unexpected response frame from the AP might result in a
connected station dropping its association.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoHE: Send the AP's OBSS PD settings to the kernel
John Crispin [Tue, 13 Aug 2019 14:16:25 +0000 (16:16 +0200)] 
HE: Send the AP's OBSS PD settings to the kernel

This allows us to send the OBSS PD settings to the kernel, such that the
driver can propagate them to the hardware/firmware.

Signed-off-by: John Crispin <john@phrozen.org>
5 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Tue, 10 Sep 2019 10:42:14 +0000 (13:42 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2019-08-30.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: WPS MAC address change
Mikael Kanstrup [Fri, 16 Aug 2019 06:50:55 +0000 (08:50 +0200)] 
tests: WPS MAC address change

Verify that MAC address of WPS M1 message use correct address
after address change.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
5 years agoWPS: Update MAC address on address changes
Mikael Kanstrup [Fri, 16 Aug 2019 06:50:54 +0000 (08:50 +0200)] 
WPS: Update MAC address on address changes

The WPS component keeps a copy of the network interface MAC address.
When MAC address is changed the WPS copy was not updated so WPS M1
message contained the old address. Some devices check this field
and fail connection attempts.

Update the WPS MAC address on interface MAC address changes.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
5 years agoos_sleep: Use nanosleep for POSIX versions 2008 and higher
Rosen Penev [Sat, 24 Aug 2019 22:01:16 +0000 (15:01 -0700)] 
os_sleep: Use nanosleep for POSIX versions 2008 and higher

uClibc-ng optionally disabled deprecated POSIX functions like usleep,
causing compilation failures. This switches to nanosleep while retaining
support for older libcs that do not support nanosleep.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
5 years agowpa_cli: Do not pick p2p-dev-* interfaces by default
Jouni Malinen [Mon, 9 Sep 2019 13:28:17 +0000 (16:28 +0300)] 
wpa_cli: Do not pick p2p-dev-* interfaces by default

These are the driver-specific interface for the non-netdev P2P Device
interface and not something that useful for most use cases. Skip them to
allow the main netdev (e.g., wlan0 over p2p-dev-wlan0) to be selected.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: wpa_supplicant DPP-only build tests
Jouni Malinen [Sun, 8 Sep 2019 15:07:22 +0000 (18:07 +0300)] 
tests: wpa_supplicant DPP-only build tests

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoSAE: Return result from confirm CN() operation to the caller
Jouni Malinen [Sat, 7 Sep 2019 15:47:48 +0000 (18:47 +0300)] 
SAE: Return result from confirm CN() operation to the caller

These functions could fail in theory, so report the result to the
caller.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFILS: Update connect params after sending connection notification
Ankita Bajaj [Thu, 5 Sep 2019 14:17:55 +0000 (19:47 +0530)] 
FILS: Update connect params after sending connection notification

Update connect params will update auth_alg and fils_hlp_req in
wpa_supplicant structure before calling function
wpas_notify_state_changed(). This could have resulted in triggering
inconsistent state change events and messages in the Android framework.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoCorrect the type/usage of QCA_ATTR_ROAM_CONTROL_SCAN_FREQ_LIST
Srinivas Dasari [Thu, 22 Aug 2019 09:40:16 +0000 (15:10 +0530)] 
Correct the type/usage of QCA_ATTR_ROAM_CONTROL_SCAN_FREQ_LIST

Update the documentation of QCA_ATTR_ROAM_CONTROL_SCAN_FREQ_LIST
to make it a nested attribute to carry frequencies of type u32.
This is to be in sync with the nl80211 attribute
NL80211_ATTR_SCAN_FREQUENCIES.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Fix hostapd build dependencies for DPP-only build
Jouni Malinen [Sun, 8 Sep 2019 14:46:55 +0000 (17:46 +0300)] 
DPP: Fix hostapd build dependencies for DPP-only build

Fix CONFIG_DPP=y build for cases where the needed dependencies were not
pulled in by other optional build parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDPP2: Fix wpa_supplicant build dependencies for CONFIG_AP=y build
Jouni Malinen [Sun, 8 Sep 2019 14:44:07 +0000 (17:44 +0300)] 
DPP2: Fix wpa_supplicant build dependencies for CONFIG_AP=y build

Fix CONFIG_DPP2=y with CONFIG_AP=y build for cases where the needed
dependencies were not pulled in by other optional build parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDPP: Fix wpa_supplicant build dependencies for DPP-only build
Jouni Malinen [Sun, 8 Sep 2019 14:38:53 +0000 (17:38 +0300)] 
DPP: Fix wpa_supplicant build dependencies for DPP-only build

Fix CONFIG_DPP=y build for cases where the needed dependencies were not
pulled in by other optional build parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>