]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agotests: New hostapd STATUS/STA values
Jouni Malinen [Tue, 31 Oct 2017 15:10:17 +0000 (17:10 +0200)] 
tests: New hostapd STATUS/STA values

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agohostapd: Add max_txpower into STATUS command
bhagavathi perumal s [Fri, 6 Oct 2017 15:03:25 +0000 (20:33 +0530)] 
hostapd: Add max_txpower into STATUS command

Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
7 years agohostapd: Add Beacon interval and DTIM period into STATUS command
bhagavathi perumal s [Fri, 6 Oct 2017 15:03:25 +0000 (20:33 +0530)] 
hostapd: Add Beacon interval and DTIM period into STATUS command

Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
7 years agohostapd: Add HT/VHT capability info into STATUS command
bhagavathi perumal s [Fri, 6 Oct 2017 15:03:25 +0000 (20:33 +0530)] 
hostapd: Add HT/VHT capability info into STATUS command

Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
7 years agohostapd: Add HT/VHT capability info into STA command
bhagavathi perumal s [Fri, 6 Oct 2017 15:03:25 +0000 (20:33 +0530)] 
hostapd: Add HT/VHT capability info into STA command

Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
7 years agohostapd: Add extended capabilities into STA command
bhagavathi perumal s [Fri, 6 Oct 2017 15:03:25 +0000 (20:33 +0530)] 
hostapd: Add extended capabilities into STA command

Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
7 years agohostapd: Add [HT] flag into STA command
bhagavathi perumal s [Fri, 6 Oct 2017 15:03:25 +0000 (20:33 +0530)] 
hostapd: Add [HT] flag into STA command

Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
7 years agohostapd: Add Min/Max Transmit Power Capability into STA command
bhagavathi perumal s [Fri, 6 Oct 2017 15:03:25 +0000 (20:33 +0530)] 
hostapd: Add Min/Max Transmit Power Capability into STA command

This provides access to the Minimum/Maximum Transmit Power Capabilitie
fileds (the nominal minimum/maximum transmit power with which the STA
is capable of transmitting in the current channel; signed integer in
units of decibels relative to 1 mW).

Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
7 years agoOWE: Add AP mode handling of OWE with drivers that implement SME
Ashok Kumar Ponnaiah [Mon, 30 Oct 2017 21:24:42 +0000 (23:24 +0200)] 
OWE: Add AP mode handling of OWE with drivers that implement SME

Handle OWE DH exchange and key setup when processing the association
event from a driver that implements AP SME.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoCheck hostapd current_mode before dereferencing it in additional places
Ashok Kumar Ponnaiah [Mon, 30 Oct 2017 21:17:05 +0000 (23:17 +0200)] 
Check hostapd current_mode before dereferencing it in additional places

While most places using this should be for cases where the hw_features
functionality is required, there seem to be some paths that are getting
exposed in new OWE related operations where that might not be the case.
Add explicit NULL pointer checks to avoid dereferencing the pointer if
it is not set when operating with driver wrappers that do not provide
sufficient information.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: ap_wpa2_eap_tls_versions to test TLSv1.2 with OpenSSL 1.1
Jouni Malinen [Mon, 30 Oct 2017 10:08:19 +0000 (12:08 +0200)] 
tests: ap_wpa2_eap_tls_versions to test TLSv1.2 with OpenSSL 1.1

Change the test condition from "is OpenSSL 1.0.2" to "is not OpenSSL
1.0.1", so that the TLSv1.2 test step gets executed with OpenSSL 1.0.2
and 1.1 (and newer).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: WNM Sleep Mode - RSN with PMF and GTK/IGTK workaround
Jouni Malinen [Sun, 29 Oct 2017 15:19:07 +0000 (17:19 +0200)] 
tests: WNM Sleep Mode - RSN with PMF and GTK/IGTK workaround

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAP-side workaround for WNM-Sleep Mode GTK/IGTK reinstallation issues
Jouni Malinen [Sun, 29 Oct 2017 15:13:54 +0000 (17:13 +0200)] 
AP-side workaround for WNM-Sleep Mode GTK/IGTK reinstallation issues

Normally, WNM-Sleep Mode exit with management frame protection
negotiated would result in the current GTK/IGTK getting added into the
WNM-Sleep Mode Response frame. Some station implementations may have a
vulnerability that results in GTK/IGTK reinstallation based on this
frame being replayed. Add a new hostapd configuration parameter that can
be used to disable that behavior and use EAPOL-Key frames for GTK/IGTK
update instead. This would likely be only used with
wpa_disable_eapol_key_retries=1 that enables a workaround for similar
issues with EAPOL-Key. This is related to station side vulnerabilities
CVE-2017-13087 and CVE-2017-13088. To enable this AP-side workaround,
set wnm_sleep_mode_no_keys=1.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_auth: Deplete group rekey eloop handler for strict rekeying
Johannes Berg [Wed, 25 Oct 2017 08:06:10 +0000 (10:06 +0200)] 
wpa_auth: Deplete group rekey eloop handler for strict rekeying

When strict group rekeying is in effect, every station that leaves will
cause a rekeying to happen 0.5 s after leaving. However, if a lot of
stations join/leave, the previous code could postpone this rekeying
forever, since it always re-registers the handling with a 0.5 s timeout.

Use eloop_deplete_timeout() to address that, only registering the
timeout from scratch if it wasn't pending.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agotests: WPA2-PSK AP and GTK rekey by AP request
Jouni Malinen [Sun, 29 Oct 2017 15:00:50 +0000 (17:00 +0200)] 
tests: WPA2-PSK AP and GTK rekey by AP request

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAllow forcing group rekeying for testing purposes
Johannes Berg [Wed, 25 Oct 2017 08:26:10 +0000 (10:26 +0200)] 
Allow forcing group rekeying for testing purposes

In order to test the WoWLAN GTK rekeying KRACK mitigation, add a
REKEY_GTK hostapd control interface command that can be used at certain
points of the test.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agotests: tshark: deal with "wlan_mgt" -> "wlan" rename
Johannes Berg [Tue, 24 Oct 2017 15:11:31 +0000 (17:11 +0200)] 
tests: tshark: deal with "wlan_mgt" -> "wlan" rename

Recent versions of tshark/wireshark renamed these fields, deal
with that in the tshark wrapper code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agotests: DPP authentication exchange with requested different channel
Jouni Malinen [Sun, 29 Oct 2017 14:09:56 +0000 (16:09 +0200)] 
tests: DPP authentication exchange with requested different channel

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Negotiation channel change request from Initiator
Jouni Malinen [Sun, 29 Oct 2017 14:08:02 +0000 (16:08 +0200)] 
DPP: Negotiation channel change request from Initiator

Allow the Initiator to request a different channel to be used for DPP
Authentication and DPP Configuration exchanges. This commit adds support
for this in wpa_supplicant with the optional neg_freq=<freq in MHz>
parameter in DPP_AUTH_INIT.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: DPP network introduction mismatch cases
Jouni Malinen [Sun, 29 Oct 2017 10:44:01 +0000 (12:44 +0200)] 
tests: DPP network introduction mismatch cases

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Allow testing override values to be cleared
Jouni Malinen [Sun, 29 Oct 2017 10:23:34 +0000 (12:23 +0200)] 
DPP: Allow testing override values to be cleared

This allows wpa_supplicant dpp_config_obj_override,
dpp_discovery_override, and dpp_groups_override parameters to be cleared
by setting them to a zero-length value.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Add DPP Status attribute into Peer Discovery Response
Jouni Malinen [Sun, 29 Oct 2017 09:43:41 +0000 (11:43 +0200)] 
DPP: Add DPP Status attribute into Peer Discovery Response

This was added in DPP tech spec v0.2.7 to allow result of network
introduction to be reported.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: DPP protocol testing incorrect I-nonce, R-capab, R-auth, I-auth
Jouni Malinen [Sat, 28 Oct 2017 09:21:00 +0000 (12:21 +0300)] 
tests: DPP protocol testing incorrect I-nonce, R-capab, R-auth, I-auth

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Process Authentication Confirm failure cases
Jouni Malinen [Sat, 28 Oct 2017 14:40:06 +0000 (17:40 +0300)] 
DPP: Process Authentication Confirm failure cases

Process Authentication Confirm with the two failure cases defined in the
spec: STATUS_NOT_COMPATIBLE and STATUS_AUTH_FAILURE. This verifies the
{R-nonce}k2 part and reports more detailed failure reason if the message
is valid.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Send Authentication Confirm failure reports
Jouni Malinen [Sat, 28 Oct 2017 09:06:22 +0000 (12:06 +0300)] 
DPP: Send Authentication Confirm failure reports

If Authentication Response processing fails due to R-capab
incompatibility or R-auth mismatch, send Authentication Confirm with
error status.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Auth Resp/Conf incorrect attribute values for protocol testing
Jouni Malinen [Sat, 28 Oct 2017 08:23:22 +0000 (11:23 +0300)] 
DPP: Auth Resp/Conf incorrect attribute values for protocol testing

This extends the dpp_test mechanism to allow I-nonce, R-capab, R-auth,
and I-auth values in Authentication Response/Confirm to use incorrect
values.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: DPP fallback to non-mutual authentication on Initiator
Jouni Malinen [Mon, 23 Oct 2017 11:20:16 +0000 (14:20 +0300)] 
tests: DPP fallback to non-mutual authentication on Initiator

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Allow Responder to decide not to use mutual authentication
Jouni Malinen [Mon, 23 Oct 2017 11:14:57 +0000 (14:14 +0300)] 
DPP: Allow Responder to decide not to use mutual authentication

Previously, Initiator decided whether to use mutual authentication on
its own based on having own and peer bootstrapping info. This prevented
Responder from selecting not to use mutual authentication in such a
case. Fix this by allowed Initiator to fall back to non-mutual
authentication based on Responder choice if the bootstrapping mechanism
allows this (PKEX does not; it mandates use of mutual authentication).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: DPP protocol testing - Auth Conf attribute omission
Jouni Malinen [Mon, 23 Oct 2017 10:35:03 +0000 (13:35 +0300)] 
tests: DPP protocol testing - Auth Conf attribute omission

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Report Auth Conf failures in control interface
Jouni Malinen [Mon, 23 Oct 2017 10:46:23 +0000 (13:46 +0300)] 
DPP: Report Auth Conf failures in control interface

This is useful for protocol testing purposes and UI needs to display
more detailed information about DPP exchanges.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Omission of Auth Conf attributes for protocol testing
Jouni Malinen [Mon, 23 Oct 2017 10:34:30 +0000 (13:34 +0300)] 
DPP: Omission of Auth Conf attributes for protocol testing

This extends the dpp_test mechanism to allow each of the required
attributes in Authentication Confirm to be omitted.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: DPP protocol testing
Jouni Malinen [Sun, 22 Oct 2017 10:49:57 +0000 (13:49 +0300)] 
tests: DPP protocol testing

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Report invalid messages and failure conditions in control interface
Jouni Malinen [Sun, 22 Oct 2017 14:24:38 +0000 (17:24 +0300)] 
DPP: Report invalid messages and failure conditions in control interface

This is useful for protocol testing purposes and UI needs to display
more detailed information about DPP exchanges.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Omission of Auth Resp attributes for protocol testing
Jouni Malinen [Sun, 22 Oct 2017 19:17:55 +0000 (22:17 +0300)] 
DPP: Omission of Auth Resp attributes for protocol testing

This extends the dpp_test mechanism to allow each of the required
attributes in Authentication Response to be omitted.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Move Authentication Response building into a separate function
Jouni Malinen [Sun, 22 Oct 2017 16:03:23 +0000 (19:03 +0300)] 
DPP: Move Authentication Response building into a separate function

This cleans up old dpp_auth_build_resp() (now dpp_auth_build_resp_ok())
a bit by separating initialization steps for a DPP authentication
session from the code needed to build the frame. This allows
dpp_auth_build_resp_status() to share the helper function instead of
having to maintain a duplicated message construction implementation. In
addition, this makes it easier to remove some of the attributes for
protocol testing purposes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Omission of Auth Req attributes for protocol testing
Jouni Malinen [Sun, 22 Oct 2017 14:20:24 +0000 (17:20 +0300)] 
DPP: Omission of Auth Req attributes for protocol testing

This extends the dpp_test mechanism to allow each of the required
attributes in Authentication Request to be omitted.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Move Authentication Request building into a separate function
Jouni Malinen [Sun, 22 Oct 2017 14:08:25 +0000 (17:08 +0300)] 
DPP: Move Authentication Request building into a separate function

This cleans up dpp_auth_init() a bit by separating initialization steps
for a DPP authentication session from the code needed to build the
frame. In addition, this makes it easier to remove some of the
attributes for protocol testing purposes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Explicitly check and reject 0x00 and 0x03 I/R-capab role
Jouni Malinen [Sun, 22 Oct 2017 10:49:01 +0000 (13:49 +0300)] 
DPP: Explicitly check and reject 0x00 and 0x03 I/R-capab role

0x00 and 0x03 are not valid I/R-capabilities role values.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Report transmitted messages as control interface events
Jouni Malinen [Sun, 22 Oct 2017 09:35:06 +0000 (12:35 +0300)] 
DPP: Report transmitted messages as control interface events

This is helpful for testing purposes and also for upper layer components
that may want to show more detailed progress through a DPP exchange.
Both the DPP-TX and DPP-TX-STATUS events are provided.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Report received messages as control interface events
Jouni Malinen [Sun, 22 Oct 2017 09:10:47 +0000 (12:10 +0300)] 
DPP: Report received messages as control interface events

This is helpful for testing purposes and also for upper layer components
that may want to show more detailed progress through a DPP exchange.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Remove unnecessary Wrapped Data checks from callers
Jouni Malinen [Sun, 22 Oct 2017 08:46:12 +0000 (11:46 +0300)] 
DPP: Remove unnecessary Wrapped Data checks from callers

Now that dpp_check_attrs() takes care of verifying that no attributes
are after the Wrapped Data attribute, the duplicated checks in hostapd
and wpa_supplicant side of the implementation can be removed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Verify that Wrapped Data attribute is the last one in the message
Jouni Malinen [Sun, 22 Oct 2017 08:37:56 +0000 (11:37 +0300)] 
DPP: Verify that Wrapped Data attribute is the last one in the message

Do not allow any additional attributes to be included after the Wrapped
Data attribute.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Protocol testing framework
Jouni Malinen [Sun, 22 Oct 2017 08:15:21 +0000 (11:15 +0300)] 
DPP: Protocol testing framework

Add a generic mechanism for configuring the DPP implementation to behave
in particular different (mostly incorrect) ways for protocol testing
purposes. The new dpp_test parameter can be set to a non-zero integer to
indicate a specific behavior. This is only available in
CONFIG_TESTING_OPTIONS=y builds.

This commit include cases for an extra attribute being added after the
Wrapped Data attribute and Initiator/Responder capabilities having an
unexpected zero capability.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFix a typo in a debug message
Jouni Malinen [Sun, 22 Oct 2017 13:42:58 +0000 (16:42 +0300)] 
Fix a typo in a debug message

This radio_work_free() message was missing the closing parenthesis.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Make sae_invalid_anti_clogging_token_req more robust
Jouni Malinen [Sun, 22 Oct 2017 13:42:33 +0000 (16:42 +0300)] 
tests: Make sae_invalid_anti_clogging_token_req more robust

Beacon more frequently since Probe Request frames are practically ignored
in this test setup (ext_mgmt_frame_handled=1 on hostapd side) and
wpa_supplicant scans may end up getting ignored if no new results are
available due to the missing Probe Response frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP server: Add event messages for more EAP states
Michael Baird [Thu, 28 Sep 2017 05:53:35 +0000 (18:53 +1300)] 
EAP server: Add event messages for more EAP states

While using an external RADIUS server SUCCESS messages were not being
sent (internal was fine). Also add event messages for other states that
others might find useful, and consistency between the two.

Signed-off-by: Michael Baird <Michael.Baird@ecs.vuw.ac.nz>
7 years agotests: Add a script to aid bisecting Linux kernel with hwsim VM
Johannes Berg [Wed, 11 Oct 2017 11:46:17 +0000 (13:46 +0200)] 
tests: Add a script to aid bisecting Linux kernel with hwsim VM

I find myself writing a version of this script every now and
then, but there's little point in that - just add one to the
tree so we can use it again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoFix a typo in a comment (the variable is ptk, not pkt)
andrekorol [Tue, 17 Oct 2017 11:34:14 +0000 (09:34 -0200)] 
Fix a typo in a comment (the variable is ptk, not pkt)

Signed-off-by: Andre Rossi Korol <anrobits@yahoo.com.br>
7 years agowpa_supplicant: Increase UDP control interface RX buffer
Janusz Dziedzic [Tue, 17 Oct 2017 18:37:29 +0000 (20:37 +0200)] 
wpa_supplicant: Increase UDP control interface RX buffer

Seems like some test cases, e.g., ap_wpa2_psk_ext_retry_msg_3c, require
larger buffer than 256 bytes.

In other case I fail such test cases when run on real HW and using:
CONFIG_CTRL_IFACE=udp-remote

Increase the RX buffer from 256 to 4096 bytes to match the other control
interface cases.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
7 years agotests: WPA2-EAP-FT AP (pull PMK) - wildcard R0KH/R1KH
Jouni Malinen [Sat, 21 Oct 2017 09:00:22 +0000 (12:00 +0300)] 
tests: WPA2-EAP-FT AP (pull PMK) - wildcard R0KH/R1KH

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: hostapd configuration reload modification from file on SIGHUP
Jouni Malinen [Sat, 21 Oct 2017 08:29:45 +0000 (11:29 +0300)] 
tests: hostapd configuration reload modification from file on SIGHUP

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix test build breakage when not compiling with mesh support
Ben Greear [Wed, 18 Oct 2017 22:58:30 +0000 (15:58 -0700)] 
Fix test build breakage when not compiling with mesh support

Build breakage was introduced by commit
16579769ff7bb255e101c6b77fb2c47d3735a883 ('Add testing functionality for
resetting PN/IPN for configured keys') for some CONFIG_TESTING_OPTIONS=y
builds.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agotests: Delayed PTK rekey exchange attack protection
Jouni Malinen [Fri, 20 Oct 2017 16:25:21 +0000 (19:25 +0300)] 
tests: Delayed PTK rekey exchange attack protection

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFix the notes on EAPOL-Key testing procedures
Jouni Malinen [Fri, 20 Oct 2017 15:18:53 +0000 (18:18 +0300)] 
Fix the notes on EAPOL-Key testing procedures

The extra sanity check for replay protection in these procedures ended
up breaking the tests. RESET_PN cannot be used before RESEND_* commands
since that would prevent the DUT from accepting the retransmitted
EAPOL-Key frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoWNM: Ignore BSS Transition Management frames in bss_transition=0 case
Jouni Malinen [Fri, 20 Oct 2017 14:44:07 +0000 (17:44 +0300)] 
WNM: Ignore BSS Transition Management frames in bss_transition=0 case

The hostapd bss_transition parameter was previously used to control
advertisement of BSS Transition Management support, but it was not used
when processing BSS Transition Management Query/Response frames. Add an
explicit check during frame processing as well so that any misbehaving
station is ignored. In addition to bss_transition=1, allow mbo=1 to be
used to mark the functionality enabled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Enable bss_transition in wnm_bss_tm_req_with_mbo_ie
Jouni Malinen [Fri, 20 Oct 2017 17:30:47 +0000 (20:30 +0300)] 
tests: Enable bss_transition in wnm_bss_tm_req_with_mbo_ie

This is needed once BSS TM processing is skipped if the functionality is
not enabled explicitly.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoWNM: Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0 case
Jouni Malinen [Fri, 20 Oct 2017 14:39:42 +0000 (17:39 +0300)] 
WNM: Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0 case

The hostapd wnm_sleep_mode parameter was previously used to control
advertisement of WNM-Sleep Mode support, but it was not used when
processing a request to use WNM-Sleep Mode. Add an explicit check during
request processing as well so that any misbehaving station is ignored.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Skip new ap_ciphers tests cleanly for missing mac80211 debugfs
Jouni Malinen [Thu, 19 Oct 2017 20:32:26 +0000 (23:32 +0300)] 
tests: Skip new ap_ciphers tests cleanly for missing mac80211 debugfs

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd notes on how to do cipher suite and key management testing
Jouni Malinen [Sun, 15 Oct 2017 20:27:12 +0000 (23:27 +0300)] 
Add notes on how to do cipher suite and key management testing

This describes how various wpa_supplicant/hostapd extensions can be used
to test IEEE 802.11 functionality in other devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: CCMP/TKIP/GCMP replay protection
Jouni Malinen [Sat, 14 Oct 2017 10:43:42 +0000 (13:43 +0300)] 
tests: CCMP/TKIP/GCMP replay protection

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Plaintext EAPOL-Key frames when TK is configured
Jouni Malinen [Thu, 19 Oct 2017 09:19:22 +0000 (12:19 +0300)] 
tests: Plaintext EAPOL-Key frames when TK is configured

These test cases do not really verify any specific DUT behavior
automatically, i.e., these are here to generate sniffer captures for
manual analysis.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoExtend RESEND_* test commands to allow forcing plaintext TX
Jouni Malinen [Thu, 19 Oct 2017 09:16:18 +0000 (12:16 +0300)] 
Extend RESEND_* test commands to allow forcing plaintext TX

This allows hostapd testing functionality to be forced to send out a
plaintext EAPOL-Key frame with the RESEND_* command. That can be useful
in seeing how the station behaves if an unencrypted EAPOL frame is
received when TK is already configured.

This is not really perfect since there is no convenient way of sending
out a single unencrypted frame in the current nl80211 design. The
monitor interface could likely still do this, but that's not really
supposed to be used anymore. For now, clear and restore TK during this
operation. The restore part is not really working correctly, though,
since it ends up clearing the TSC value on the AP side and that shows up
as replay protection issues on the station. Anyway, this is sufficient
to generate sniffer captures to analyze station behavior.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Update AES-SIV AD for PKEX frames
Jouni Malinen [Wed, 18 Oct 2017 20:10:34 +0000 (23:10 +0300)] 
DPP: Update AES-SIV AD for PKEX frames

The protocol design was updated to protect the six octets in the header
before the attributes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Update AES-SIV AD for DPP Authentication frames
Jouni Malinen [Wed, 18 Oct 2017 19:51:30 +0000 (22:51 +0300)] 
DPP: Update AES-SIV AD for DPP Authentication frames

The protocol design was updated to protect the six octets in the header
before the attributes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Delayed M1+M3 retransmission and zero TK
Jouni Malinen [Sat, 14 Oct 2017 14:50:25 +0000 (17:50 +0300)] 
tests: Delayed M1+M3 retransmission and zero TK

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Delayed 4-way handshake M1 and M3 retransmission
Jouni Malinen [Sat, 14 Oct 2017 14:25:28 +0000 (17:25 +0300)] 
tests: Delayed 4-way handshake M1 and M3 retransmission

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Delayed group M1 retransmission
Jouni Malinen [Sat, 14 Oct 2017 13:54:51 +0000 (16:54 +0300)] 
tests: Delayed group M1 retransmission

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: More robust owe_transition_mode* tests
Jouni Malinen [Tue, 17 Oct 2017 21:39:43 +0000 (00:39 +0300)] 
tests: More robust owe_transition_mode* tests

Flush old scan results in these test cases to avoid checking incorrect
scan result entry.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Send updated connection parameters to drivers if needed
Vidyullatha Kanchanapally [Thu, 17 Aug 2017 08:26:07 +0000 (13:56 +0530)] 
FILS: Send updated connection parameters to drivers if needed

After an initial connection wpa_supplicant derives ERP information which
can be used in doing eventual authentications in the same realm. This
information can be used by drivers with offloaded FILS support to do
driver/firmware initiated roamings. Add support to send this updated
information to such drivers.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMove assoc param setting into a helper function
Vidyullatha Kanchanapally [Thu, 17 Aug 2017 08:26:07 +0000 (13:56 +0530)] 
Move assoc param setting into a helper function

This is needed to be able to use the same implementation for updating
the connection parameters in the driver during an association.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Allow eap_peer_get_erp_info() to be called without config
Vidyullatha Kanchanapally [Thu, 17 Aug 2017 08:26:07 +0000 (13:56 +0530)] 
FILS: Allow eap_peer_get_erp_info() to be called without config

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Update replay counter from roam info
Vidyullatha Kanchanapally [Thu, 17 Aug 2017 08:28:06 +0000 (13:58 +0530)] 
FILS: Update replay counter from roam info

Update the replay counter after a roam for all cases. This restores the
design back to what it was before commit
01ef320f192daa074c7055a44a03b6b5b811d6bd ('FILS: Update ERP next
sequence number with driver offload').

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: Update FILS roam info from vendor roam event
Vidyullatha Kanchanapally [Mon, 7 Aug 2017 14:32:41 +0000 (20:02 +0530)] 
nl80211: Update FILS roam info from vendor roam event

Add support to update PMK, PMKID, and ERP next sequence number
from FILS roamed info.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: Add support to send updated connection parameters
Vidyullatha Kanchanapally [Thu, 17 Aug 2017 08:06:40 +0000 (13:36 +0530)] 
nl80211: Add support to send updated connection parameters

After an initial connection certain connection parameters may be
updated. It may be necessary to send these parameters to drivers since
these will be used in driver-initiated roaming cases. This commit
defines the driver_ops call for this and implements the needed
functionality for the nl80211 driver interface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd attributes to support roam+auth vendor event for FILS
Vidyullatha Kanchanapally [Wed, 2 Aug 2017 13:18:47 +0000 (18:48 +0530)] 
Add attributes to support roam+auth vendor event for FILS

Add additional attributes to specify the PMK, PMKID, and the ERP next
sequence number to the vendor subcommand
QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH. These are needed in case
of an offloaded FILS roaming.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoClear BSSID information in supplicant state machine on disconnection
Jouni Malinen [Mon, 16 Oct 2017 22:15:24 +0000 (01:15 +0300)] 
Clear BSSID information in supplicant state machine on disconnection

This fixes a corner case where RSN pre-authentication candidate from
scan results was ignored if the station was associated with that BSS
just before running the new scan for the connection.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agonl80211: Use NL80211_BSS_LAST_SEEN_BOOTTIME if available
Jouni Malinen [Mon, 16 Oct 2017 21:04:52 +0000 (00:04 +0300)] 
nl80211: Use NL80211_BSS_LAST_SEEN_BOOTTIME if available

This allows a more accurate scan result age to be fetched than the one
available through NL80211_BSS_SEEN_MS_AGO.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdditional consistentcy checks for PTK component lengths
Jouni Malinen [Mon, 16 Oct 2017 21:01:11 +0000 (00:01 +0300)] 
Additional consistentcy checks for PTK component lengths

Verify that TK, KCK, and KEK lengths are set to consistent values within
struct wpa_ptk before using them in supplicant. This is an additional
layer of protection against unexpected states.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Disabling of EAPOL-Key retries
Jouni Malinen [Mon, 16 Oct 2017 15:37:09 +0000 (18:37 +0300)] 
tests: Disabling of EAPOL-Key retries

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOptional AP side workaround for key reinstallation attacks
Jouni Malinen [Mon, 16 Oct 2017 15:37:43 +0000 (18:37 +0300)] 
Optional AP side workaround for key reinstallation attacks

This adds a new hostapd configuration parameter
wpa_disable_eapol_key_retries=1 that can be used to disable
retransmission of EAPOL-Key frames that are used to install
keys (EAPOL-Key message 3/4 and group message 1/2). This is
similar to setting wpa_group_update_count=1 and
wpa_pairwise_update_count=1, but with no impact to message 1/4
retries and with extended timeout for messages 4/4 and group
message 2/2 to avoid causing issues with stations that may use
aggressive power saving have very long time in replying to the
EAPOL-Key messages.

This option can be used to work around key reinstallation attacks
on the station (supplicant) side in cases those station devices
cannot be updated for some reason. By removing the
retransmissions the attacker cannot cause key reinstallation with
a delayed frame transmission. This is related to the station side
vulnerabilities CVE-2017-13077, CVE-2017-13078, CVE-2017-13079,
CVE-2017-13080, and CVE-2017-13081.

This workaround might cause interoperability issues and reduced
robustness of key negotiation especially in environments with
heavy traffic load due to the number of attempts to perform the
key exchange is reduced significantly. As such, this workaround
is disabled by default (unless overridden in build
configuration). To enable this, set the parameter to 1.

It is also possible to enable this in the build by default by
adding the following to the build configuration:

CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: WPA2-PSK AP and PTK rekey enforced by station and ANonce change
Jouni Malinen [Sat, 14 Oct 2017 15:05:52 +0000 (18:05 +0300)] 
tests: WPA2-PSK AP and PTK rekey enforced by station and ANonce change

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAllow last (Re)Association Request frame to be replayed for testing
Jouni Malinen [Sun, 15 Oct 2017 20:25:55 +0000 (23:25 +0300)] 
Allow last (Re)Association Request frame to be replayed for testing

The new wpa_supplicant RESEND_ASSOC command can be used to request the
last (Re)Association Request frame to be sent to the AP to test FT
protocol behavior.

This functionality is for testing purposes and included only in builds
with CONFIG_TESTING_OPTIONS=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAllow EAPOL-Key Request to be sent through control interface
Jouni Malinen [Sat, 14 Oct 2017 15:04:34 +0000 (18:04 +0300)] 
Allow EAPOL-Key Request to be sent through control interface

The new wpa_supplicant "KEY_REQUEST <error=0/1> <pairwise=0/1>" command
can be used to request an EAPOL-Key Request frame to be sent to the AP.

This functionality is for testing purposes and included only in builds
with CONFIG_TESTING_OPTIONS=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoMake last received ANonce available through control interface
Jouni Malinen [Sat, 14 Oct 2017 14:58:11 +0000 (17:58 +0300)] 
Make last received ANonce available through control interface

This makes it easier to debug 4-way handshake implementation issues
without having to use a sniffer.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAllow arbitrary key configuration for testing
Jouni Malinen [Sat, 14 Oct 2017 14:49:33 +0000 (17:49 +0300)] 
Allow arbitrary key configuration for testing

The new hostapd control interface command SET_KEY can be used to request
an arbitrary key to be configured to the driver.

This functionality is for testing purposes and included only in builds
with CONFIG_TESTING_OPTIONS=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAllow EAPOL-Key messages 1/4 and 3/4 to be retransmitted for testing
Jouni Malinen [Sat, 14 Oct 2017 14:23:59 +0000 (17:23 +0300)] 
Allow EAPOL-Key messages 1/4 and 3/4 to be retransmitted for testing

The new hostapd control interface commands "RESEND_M1 <addr>" and
"RESEND_M3 <addr>" can be used to request a retransmission of the 4-Way
Handshake messages 1/4 and 3/4 witht he same or modified ANonce (in M1).

This functionality is for testing purposes and included only in builds
with CONFIG_TESTING_OPTIONS=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAllow group key handshake message 1/2 to be retransmitted for testing
Jouni Malinen [Sat, 14 Oct 2017 13:53:27 +0000 (16:53 +0300)] 
Allow group key handshake message 1/2 to be retransmitted for testing

The new hostapd control interface command "RESEND_GROUP_M1 <addr>" can
be used to request a retransmission of the Group Key Handshake message
1/2 for the current GTK.

This functionality is for testing purposes and included only in builds
with CONFIG_TESTING_OPTIONS=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd testing functionality for resetting PN/IPN for configured keys
Jouni Malinen [Sat, 14 Oct 2017 10:41:08 +0000 (13:41 +0300)] 
Add testing functionality for resetting PN/IPN for configured keys

This can be used to test replay protection. The "RESET_PN" command in
wpa_supplicant and "RESET_PN <addr>" command in hostapd resets the local
counters to zero for the last configured key. For hostapd, the address
parameter specifies which STA this operation is for or selects GTK
("ff:ff:ff:ff:ff:ff") or IGTK ("ff:ff:ff:ff:ff:ff IGTK").

This functionality is for testing purposes and included only in builds
with CONFIG_TESTING_OPTIONS=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Comment out during-association TK-in-memory checks
Jouni Malinen [Mon, 16 Oct 2017 14:42:20 +0000 (17:42 +0300)] 
tests: Comment out during-association TK-in-memory checks

TK needs to be maintained in memory for additional testing
functionality, so for now, comment out these checks.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowlantest: Do not update RSC on replays
Jouni Malinen [Sat, 14 Oct 2017 09:15:52 +0000 (12:15 +0300)] 
wlantest: Do not update RSC on replays

This changes wlantest behavior to mark CCMP/TKIP replays for more cases
in case a device is resetting its TSC. Previously, the RSC check got
cleared on the first marked replay and the following packets were not
marked as replays if they continued incrementing the PN even if that PN
was below the highest value received with this key at some point in the
past.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoClear PMK length and check for this when deriving PTK
Jouni Malinen [Sun, 8 Oct 2017 10:18:02 +0000 (13:18 +0300)] 
Clear PMK length and check for this when deriving PTK

Instead of setting the default PMK length for the cleared PMK, set the
length to 0 and explicitly check for this when deriving PTK to avoid
unexpected key derivation with an all-zeroes key should it be possible
to somehow trigger PTK derivation to happen before PMK derivation.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd debug prints on PMK configuration in WPA supplicant
Jouni Malinen [Sun, 8 Oct 2017 09:21:21 +0000 (12:21 +0300)] 
Add debug prints on PMK configuration in WPA supplicant

This makes it easier to understand the cases where PMK gets configured
based on information from upper layer call (e.g., a PSK).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoWPA: Extra defense against PTK reinstalls in 4-way handshake
Mathy Vanhoef [Thu, 5 Oct 2017 21:53:01 +0000 (23:53 +0200)] 
WPA: Extra defense against PTK reinstalls in 4-way handshake

Currently, reinstallations of the PTK are prevented by (1) assuring the
same TPTK is only set once as the PTK, and (2) that one particular PTK
is only installed once. This patch makes it more explicit that point (1)
is required to prevent key reinstallations. At the same time, this patch
hardens wpa_supplicant such that future changes do not accidentally
break this property.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
7 years agotests: 4-way handshake msg 3/4 replay with extra msg 1/4
Jouni Malinen [Fri, 29 Sep 2017 15:57:58 +0000 (18:57 +0300)] 
tests: 4-way handshake msg 3/4 replay with extra msg 1/4

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoRemove all PeerKey functionality
Jouni Malinen [Fri, 22 Sep 2017 11:59:13 +0000 (14:59 +0300)] 
Remove all PeerKey functionality

This was originally added to allow the IEEE 802.11 protocol to be
tested, but there are no known fully functional implementations based on
this nor any known deployments of PeerKey functionality. Furthermore,
PeerKey design in the IEEE Std 802.11-2016 standard has already been
marked as obsolete for DLS and it is being considered for complete
removal in REVmd.

This implementation did not really work, so it could not have been used
in practice. For example, key configuration was using incorrect
algorithm values (WPA_CIPHER_* instead of WPA_ALG_*) which resulted in
mapping to an invalid WPA_ALG_* value for the actual driver operation.
As such, the derived key could not have been successfully set for the
link.

Since there are bugs in this implementation and there does not seem to
be any future for the PeerKey design with DLS (TDLS being the future for
DLS), the best approach is to simply delete all this code to simplify
the EAPOL-Key handling design and to get rid of any potential issues if
these code paths were accidentially reachable.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Remove peerkey testing
Jouni Malinen [Fri, 22 Sep 2017 12:04:55 +0000 (15:04 +0300)] 
tests: Remove peerkey testing

This is in preparation of complete removal of the PeerKey functionality.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFILS: Do not allow multiple (Re)Association Response frames
Jouni Malinen [Fri, 22 Sep 2017 08:52:55 +0000 (11:52 +0300)] 
FILS: Do not allow multiple (Re)Association Response frames

The driver is expected to not report a second association event without
the station having explicitly request a new association. As such, this
case should not be reachable. However, since reconfiguring the same
pairwise or group keys to the driver could result in nonce reuse issues,
be extra careful here and do an additional state check to avoid this
even if the local driver ends up somehow accepting an unexpected
(Re)Association Response frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Fix wnm_action_proto_no_pmf to have active WNM_SLEEP operation
Jouni Malinen [Fri, 22 Sep 2017 08:32:30 +0000 (11:32 +0300)] 
tests: Fix wnm_action_proto_no_pmf to have active WNM_SLEEP operation

The previous designed worked since wpa_supplicant did not track pending
request state. With such tracking added, this test case needs to make
sure there is a pending operation when injecting the invalid response.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Delayed EAPOL-Key msg 3/4 replaying attack
Jouni Malinen [Fri, 25 Aug 2017 18:14:02 +0000 (21:14 +0300)] 
tests: Delayed EAPOL-Key msg 3/4 replaying attack

This hits the new wpa_supplicant code path that rejects reconfiguration
of the same GTK.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Replayed FILS association request
Jouni Malinen [Fri, 25 Aug 2017 13:23:56 +0000 (16:23 +0300)] 
tests: Replayed FILS association request

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