]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
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>
7 years agoFILS: Accept another (Re)Association Request frame during an association
Jouni Malinen [Fri, 25 Aug 2017 13:24:18 +0000 (16:24 +0300)] 
FILS: Accept another (Re)Association Request frame during an association

The previous implementation ended up starting a new EAPOL-Key 4-way
handshake if the STA were to attempt to perform another association.
This resulted in immediate disconnection since the PTK was not ready for
configuring FILS TK at the point when EAPOL-Key msg 1/4 is sent out.
This is better than alloing the association to continue with the same TK
reconfigured, but not really ideal.

Address this potential sequence by not starting a new 4-way handshake on
the additional association attempt. Instead, allow the association to
complete, but do so without reconfiguring the TK to avoid potential
issues with PN reuse with the same TK.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Allow wpa_supplicant to maintain GTK in memory during association
Jouni Malinen [Sat, 5 Aug 2017 14:07:36 +0000 (17:07 +0300)] 
tests: Allow wpa_supplicant to maintain GTK in memory during association

This is needed to allow GTK configuration triggers to verify whether the
key has changed.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: WPA2-PSK-FT AP and replayed Reassociation Request frame
Jouni Malinen [Fri, 4 Aug 2017 10:16:11 +0000 (13:16 +0300)] 
tests: WPA2-PSK-FT AP and replayed Reassociation Request frame

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd MGMT_TX_STATUS_PROCESS command for testing purposes
Jouni Malinen [Fri, 4 Aug 2017 10:14:57 +0000 (13:14 +0300)] 
Add MGMT_TX_STATUS_PROCESS command for testing purposes

This allows ext_mgmt_frame_handling=1 cases with hostapd to process TX
status events based on external processing. This is useful for increased
test coverage of management frame processing.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFT: Do not allow multiple Reassociation Response frames
Jouni Malinen [Fri, 22 Sep 2017 09:06:37 +0000 (12:06 +0300)] 
FT: Do not allow multiple Reassociation 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
Reassociation Response frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoWNM: Ignore WNM-Sleep Mode Response without pending request
Jouni Malinen [Fri, 22 Sep 2017 08:25:02 +0000 (11:25 +0300)] 
WNM: Ignore WNM-Sleep Mode Response without pending request

Commit 03ed0a52393710be6bdae657d1b36efa146520e5 ('WNM: Ignore WNM-Sleep
Mode Response if WNM-Sleep Mode has not been used') started ignoring the
response when no WNM-Sleep Mode Request had been used during the
association. This can be made tighter by clearing the used flag when
successfully processing a response. This adds an additional layer of
protection against unexpected retransmissions of the response frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoTDLS: Reject TPK-TK reconfiguration
Jouni Malinen [Fri, 22 Sep 2017 08:03:15 +0000 (11:03 +0300)] 
TDLS: Reject TPK-TK reconfiguration

Do not try to reconfigure the same TPK-TK to the driver after it has
been successfully configured. This is an explicit check to avoid issues
related to resetting the TX/RX packet number. There was already a check
for this for TPK M2 (retries of that message are ignored completely), so
that behavior does not get modified.

For TPK M3, the TPK-TK could have been reconfigured, but that was
followed by immediate teardown of the link due to an issue in updating
the STA entry. Furthermore, for TDLS with any real security (i.e.,
ignoring open/WEP), the TPK message exchange is protected on the AP path
and simple replay attacks are not feasible.

As an additional corner case, make sure the local nonce gets updated if
the peer uses a very unlikely "random nonce" of all zeros.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix PTK rekeying to generate a new ANonce
Jouni Malinen [Sun, 1 Oct 2017 09:32:57 +0000 (12:32 +0300)] 
Fix PTK rekeying to generate a new ANonce

The Authenticator state machine path for PTK rekeying ended up bypassing
the AUTHENTICATION2 state where a new ANonce is generated when going
directly to the PTKSTART state since there is no need to try to
determine the PMK again in such a case. This is far from ideal since the
new PTK would depend on a new nonce only from the supplicant.

Fix this by generating a new ANonce when moving to the PTKSTART state
for the purpose of starting new 4-way handshake to rekey PTK.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoPrevent installation of an all-zero TK
Mathy Vanhoef [Fri, 29 Sep 2017 02:22:51 +0000 (04:22 +0200)] 
Prevent installation of an all-zero TK

Properly track whether a PTK has already been installed to the driver
and the TK part cleared from memory. This prevents an attacker from
trying to trick the client into installing an all-zero TK.

This fixes the earlier fix in commit
ad00d64e7d8827b3cebd665a0ceb08adabf15e1e ('Fix TK configuration to the
driver in EAPOL-Key 3/4 retry case') which did not take into account
possibility of an extra message 1/4 showing up between retries of
message 3/4.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
7 years agoExtend protection of GTK/IGTK reinstallation of WNM-Sleep Mode cases
Jouni Malinen [Sun, 1 Oct 2017 09:12:24 +0000 (12:12 +0300)] 
Extend protection of GTK/IGTK reinstallation of WNM-Sleep Mode cases

This extends the protection to track last configured GTK/IGTK value
separately from EAPOL-Key frames and WNM-Sleep Mode frames to cover a
corner case where these two different mechanisms may get used when the
GTK/IGTK has changed and tracking a single value is not sufficient to
detect a possible key reconfiguration.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoPrevent reinstallation of an already in-use group key
Mathy Vanhoef [Wed, 12 Jul 2017 14:03:24 +0000 (16:03 +0200)] 
Prevent reinstallation of an already in-use group key

Track the current GTK and IGTK that is in use and when receiving a
(possibly retransmitted) Group Message 1 or WNM-Sleep Mode Response, do
not install the given key if it is already in use. This prevents an
attacker from trying to trick the client into resetting or lowering the
sequence counter associated to the group key.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
7 years agohostapd: Avoid key reinstallation in FT handshake
Mathy Vanhoef [Fri, 14 Jul 2017 13:15:35 +0000 (15:15 +0200)] 
hostapd: Avoid key reinstallation in FT handshake

Do not reinstall TK to the driver during Reassociation Response frame
processing if the first attempt of setting the TK succeeded. This avoids
issues related to clearing the TX/RX PN that could result in reusing
same PN values for transmitted frames (e.g., due to CCM nonce reuse and
also hitting replay protection on the receiver) and accepting replayed
frames on RX side.

This issue was introduced by the commit
0e84c25434e6a1f283c7b4e62e483729085b78d2 ('FT: Fix PTK configuration in
authenticator') which allowed wpa_ft_install_ptk() to be called multiple
times with the same PTK. While the second configuration attempt is
needed with some drivers, it must be done only if the first attempt
failed.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
7 years agotests: sigma_dut ap_get_mac_address
Jouni Malinen [Wed, 11 Oct 2017 21:02:10 +0000 (00:02 +0300)] 
tests: sigma_dut ap_get_mac_address

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Remove forgotten developer debug prints
Jouni Malinen [Wed, 11 Oct 2017 20:43:59 +0000 (23:43 +0300)] 
OWE: Remove forgotten developer debug prints

These were used during initial implementation testing and were not
supposed to get committed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: sigma_dut SAE and long password
Jouni Malinen [Wed, 11 Oct 2017 20:23:53 +0000 (23:23 +0300)] 
tests: sigma_dut SAE and long password

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: SAE with sae_password
Jouni Malinen [Wed, 11 Oct 2017 20:10:03 +0000 (23:10 +0300)] 
tests: SAE with sae_password

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoSAE: Allow SAE password to be configured separately (STA)
Jouni Malinen [Wed, 11 Oct 2017 20:09:16 +0000 (23:09 +0300)] 
SAE: Allow SAE password to be configured separately (STA)

The new sae_password network profile parameter can now be used to set
the SAE password instead of the previously used psk parameter. This
allows shorter than 8 characters and longer than 63 characters long
passwords to be used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoSAE: Allow SAE password to be configured separately (AP)
Jouni Malinen [Wed, 11 Oct 2017 20:07:08 +0000 (23:07 +0300)] 
SAE: Allow SAE password to be configured separately (AP)

The new sae_password hostapd configuration parameter can now be used to
set the SAE password instead of the previously used wpa_passphrase
parameter. This allows shorter than 8 characters and longer than 63
characters long passwords to be used. In addition, this makes it
possible to configure a BSS with both WPA-PSK and SAE enabled to use
different passphrase/password based on which AKM is selected.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoP2P: Do not mark DFS channel as invalid if DFS is offloaded to driver
Sunil Dutt [Wed, 27 Sep 2017 10:43:11 +0000 (16:13 +0530)] 
P2P: Do not mark DFS channel as invalid if DFS is offloaded to driver

While considering the movement of P2P GO from its current operating
channel, do not mark a DFS channel as invalid if DFS is offloaded
to the driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Fix static analyzer warnings in key generation and JWK construction
Jouni Malinen [Wed, 11 Oct 2017 15:19:03 +0000 (18:19 +0300)] 
DPP: Fix static analyzer warnings in key generation and JWK construction

Memory allocation failures could have resulted in error paths that
dereference a NULL pointer or double-freeing memory. Fix this by
explicitly clearing the freed pointer and checking allocation results.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoP2P: Prefer 5/60 GHz band over 2.4 GHz during GO configuration
Sunil Dutt [Sun, 8 Oct 2017 05:33:21 +0000 (11:03 +0530)] 
P2P: Prefer 5/60 GHz band over 2.4 GHz during GO configuration

Previously, wpas_p2p_select_go_freq_no_pref() ended up selecting a 2.4
GHz band channel first before even considering 5 or 60 GHz channels.
This was likely done more or less by accident rather than by design when
the 5 GHz and 60 GHz band extensions were added. It seems reasonable to
enhance this by reordering the code to start with 5 and 60 GHz operating
classes and move to 2.4 GHz band only if no channel was available in 5
or 60 GHz bands for P2P GO use.

This does have some potential interop issues with 2.4 GHz only peer
devices when starting up an autonomous GO (i.e., without there being
prior knowledge of channels that the peers support). Upper layers are
expected to enforce 2.4 GHz selection if that is needed for some use
cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Add the forgotten files for owe_transition_mode_multi_bss
Jouni Malinen [Wed, 11 Oct 2017 09:16:19 +0000 (12:16 +0300)] 
tests: Add the forgotten files for owe_transition_mode_multi_bss

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: sigma_dut controlled AP with OWE and transition mode
Jouni Malinen [Tue, 10 Oct 2017 17:59:09 +0000 (20:59 +0300)] 
tests: sigma_dut controlled AP with OWE and transition mode

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: sigma_dut controlled AP with OWE and ECGroupID
Jouni Malinen [Tue, 10 Oct 2017 16:20:24 +0000 (19:20 +0300)] 
tests: sigma_dut controlled AP with OWE and ECGroupID

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Opportunistic Wireless Encryption and limited group set
Jouni Malinen [Tue, 10 Oct 2017 16:02:09 +0000 (19:02 +0300)] 
tests: Opportunistic Wireless Encryption and limited group set

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Allow set of enabled DH groups to be limited on AP
Jouni Malinen [Tue, 10 Oct 2017 16:00:57 +0000 (19:00 +0300)] 
OWE: Allow set of enabled DH groups to be limited on AP

The new hostapd configuration parameter owe_groups can be used to
specify a subset of the allowed DH groups as a space separated list of
group identifiers.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: sigma_dut OWE with invalid DH Param element
Jouni Malinen [Tue, 10 Oct 2017 15:35:19 +0000 (18:35 +0300)] 
tests: sigma_dut OWE with invalid DH Param element

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Opportunistic Wireless Encryption and unsupported group
Jouni Malinen [Tue, 10 Oct 2017 15:27:58 +0000 (18:27 +0300)] 
tests: Opportunistic Wireless Encryption and unsupported group

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Allow DH Parameters element to be overridden for testing purposes
Jouni Malinen [Tue, 10 Oct 2017 15:26:29 +0000 (18:26 +0300)] 
OWE: Allow DH Parameters element to be overridden for testing purposes

This allows CONFIG_TESTING_OPTIONS=y builds of wpa_supplicant to
override the OWE DH Parameters element in (Re)Association Request frames
with arbitrary data specified with the "VENDOR_ELEM_ADD 13 <IE>"
command. This is only for testing purposes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Remove op_cl and ch_list from DPP
Jouni Malinen [Mon, 9 Oct 2017 22:34:49 +0000 (01:34 +0300)] 
tests: Remove op_cl and ch_list from DPP

These were removed from the protocol.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Add the crypto suite field to the frames
Jouni Malinen [Mon, 9 Oct 2017 22:30:08 +0000 (01:30 +0300)] 
DPP: Add the crypto suite field to the frames

This additional field was added to DPP Public Action frames in DPP tech
spec v0.2.3 to support cryptographic agility in the future.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Remove DPP C-sign-key expiry testing
Jouni Malinen [Mon, 9 Oct 2017 22:19:22 +0000 (01:19 +0300)] 
tests: Remove DPP C-sign-key expiry testing

This was removed from the protocol.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Remove C-sign-key expiry
Jouni Malinen [Mon, 9 Oct 2017 22:17:33 +0000 (01:17 +0300)] 
DPP: Remove C-sign-key expiry

This was removed in DPP tech spec v0.2.3.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Explicitly delete the PKEX secret element K upon generation of z
Jouni Malinen [Mon, 9 Oct 2017 21:56:21 +0000 (00:56 +0300)] 
DPP: Explicitly delete the PKEX secret element K upon generation of z

This was added as an explicit requirement in DPP tech spec 0.2.3.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Rename PKEX secret element from Z to K
Jouni Malinen [Mon, 9 Oct 2017 21:52:35 +0000 (00:52 +0300)] 
DPP: Rename PKEX secret element from Z to K

This matches the change in the DPP tech spec to make this less likely to
be confused with the shared secret z.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Verify that PKEX Qi is not the point-at-infinity
Jouni Malinen [Mon, 9 Oct 2017 21:42:34 +0000 (00:42 +0300)] 
DPP: Verify that PKEX Qi is not the point-at-infinity

This was added as an explicit requirement in DPP tech spec v0.2.3.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: sigma_dut with OWE
Jouni Malinen [Mon, 9 Oct 2017 13:54:03 +0000 (16:54 +0300)] 
tests: sigma_dut with OWE

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Opportunistic Wireless Encryption transition mode (multi BSS)
Jouni Malinen [Mon, 9 Oct 2017 10:37:56 +0000 (13:37 +0300)] 
tests: Opportunistic Wireless Encryption transition mode (multi BSS)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Transition mode information based on BSS ifname
Jouni Malinen [Mon, 9 Oct 2017 10:38:15 +0000 (13:38 +0300)] 
OWE: Transition mode information based on BSS ifname

The owe_transition_bssid and owe_transition_ssid parameters can now be
replace with owe_transition_ifname to clone the BSSID/SSID information
automatically in case the same hostapd process manages both the OWE and
open BSS for transition mode.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: OWE using cfg80211 connect command
Jouni Malinen [Mon, 9 Oct 2017 09:39:14 +0000 (12:39 +0300)] 
tests: OWE using cfg80211 connect command

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Support station SME-in-driver case
Jouni Malinen [Mon, 9 Oct 2017 09:35:14 +0000 (12:35 +0300)] 
OWE: Support station SME-in-driver case

Previously, only the SME-in-wpa_supplicant case was supported. This
extends that to cover the drivers that implement SME internally (e.g.,
through the cfg80211 Connect command).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Opportunistic Wireless Encryption and PMKSA caching
Jouni Malinen [Mon, 9 Oct 2017 09:09:22 +0000 (12:09 +0300)] 
tests: Opportunistic Wireless Encryption and PMKSA caching

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: PMKSA caching in station mode
Jouni Malinen [Mon, 9 Oct 2017 09:08:57 +0000 (12:08 +0300)] 
OWE: PMKSA caching in station mode

This extends OWE support in wpa_supplicant to allow PMKSA caching to be
used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: PMKSA caching in AP mode
Jouni Malinen [Mon, 9 Oct 2017 09:08:12 +0000 (12:08 +0300)] 
OWE: PMKSA caching in AP mode

This extends OWE support in hostapd to allow PMKSA caching to be used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Fix EAPOL-Key Key MIC calculation
Jouni Malinen [Sun, 8 Oct 2017 13:40:51 +0000 (16:40 +0300)] 
DPP: Fix EAPOL-Key Key MIC calculation

The Key MIC field value got truncated for all cases and incorrect HMAC
hash algorithm was used for the SHA512 cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: OWE DH groups
Jouni Malinen [Sun, 8 Oct 2017 13:38:44 +0000 (16:38 +0300)] 
tests: OWE DH groups

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Support DH groups 20 (NIST P-384) and 21 (NIST P-521) in station
Jouni Malinen [Sun, 8 Oct 2017 13:39:08 +0000 (16:39 +0300)] 
OWE: Support DH groups 20 (NIST P-384) and 21 (NIST P-521) in station

This extends OWE support in wpa_supplicant to allow DH groups 20 and 21
to be used in addition to the mandatory group 19 (NIST P-256). The group
is configured using the new network profile parameter owe_group.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Support DH groups 20 (NIST P-384) and 21 (NIST P-521) in AP mode
Jouni Malinen [Sun, 8 Oct 2017 13:37:32 +0000 (16:37 +0300)] 
OWE: Support DH groups 20 (NIST P-384) and 21 (NIST P-521) in AP mode

This extends OWE support in hostapd to allow DH groups 20 and 21 to be
used in addition to the mandatory group 19 (NIST P-256).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Extend shared helper functions to support other DH curves
Jouni Malinen [Sun, 8 Oct 2017 13:35:29 +0000 (16:35 +0300)] 
OWE: Extend shared helper functions to support other DH curves

This extends the helper functions for determining OWE key lengths and
Key MIC values to support other DH curves beyond the mandatory group 19.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Include RSNE in (Re)Association Response frame
Jouni Malinen [Sun, 8 Oct 2017 10:49:45 +0000 (13:49 +0300)] 
OWE: Include RSNE in (Re)Association Response frame

This is not normally done in RSN, but RFC 8110 seems to imply that AP
has to include OWE AKM in the RSNE within these frames. So, add the RSNE
to (Re)Association Response frames when OWE is being negotiated.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: OWE Transition Mode
Jouni Malinen [Sun, 8 Oct 2017 09:29:02 +0000 (12:29 +0300)] 
tests: OWE Transition Mode

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Transition mode support on station side
Jouni Malinen [Sun, 8 Oct 2017 09:32:02 +0000 (12:32 +0300)] 
OWE: Transition mode support on station side

Add support for using the OWE Transition Mode element to determine the
hidden SSID for an OWE BSS that is used in transition mode.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Set PMK length properly on supplicant side
Jouni Malinen [Sun, 8 Oct 2017 09:29:33 +0000 (12:29 +0300)] 
OWE: Set PMK length properly on supplicant side

sm->pmk_len was not set when deriving the PMK as part of OWE key
generation. This depending on wpa_sm_set_pmk_from_pmksa() call resetting
the value to the default. While this worked for many cases, this is not
correct and can have issues with network profile selection based on
association information. For example, the OWE transition mode cases
would hit an issue here.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOWE: Add AP support for transition mode
Jouni Malinen [Sun, 8 Oct 2017 09:23:00 +0000 (12:23 +0300)] 
OWE: Add AP support for transition mode

The new owe_transition_bssid and owe_transition_ssid parameters can be
used to configure hostapd to advertise the OWE Transition Mode element.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agowlantest: Add support for decrypting 4-address Data frames
Jouni Malinen [Fri, 6 Oct 2017 09:15:30 +0000 (12:15 +0300)] 
wlantest: Add support for decrypting 4-address Data frames

This covers the case where 4-address Data frames are exchanged between
an AP and an associated station.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agohostapd: Update HE capabilities and HE operation definition
Peng Xu [Fri, 29 Sep 2017 23:32:44 +0000 (16:32 -0700)] 
hostapd: Update HE capabilities and HE operation definition

Replace vendor-specific elements for HE capabilities and HE operation
elements with the P802.11ax defined element values. This version is
based on P802.11ax/D1.4.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: P2P GO with Interworking element
Jouni Malinen [Thu, 5 Oct 2017 11:54:15 +0000 (14:54 +0300)] 
tests: P2P GO with Interworking element

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoP2P: Allow GO to advertise Interworking element
Sunil Dutt [Mon, 31 Jul 2017 12:35:05 +0000 (18:05 +0530)] 
P2P: Allow GO to advertise Interworking element

This adds new wpa_supplicant configuration parameters (go_interworking,
go_access_network_type, go_internet, go_venue_group, go_venue_type) to
add a possibility of configuring the P2P GO to advertise Interworking
element.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd TX/RX rate info and signal strength into STA output
bhagavathi perumal s [Tue, 26 Sep 2017 06:25:52 +0000 (11:55 +0530)] 
Add TX/RX rate info and signal strength into STA output

These allow external programs to fetch the TX and RX rate information
and signal strength for a specific STA through the hostapd control
interface command "STA <addr>". The values of these attributes are
filled in the response of nl80211 command NL80211_CMD_GET_STATION.

Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
7 years agoWPS: Do not increment wildcard_uuid when pin is locked
Lior David [Thu, 28 Sep 2017 18:55:09 +0000 (21:55 +0300)] 
WPS: Do not increment wildcard_uuid when pin is locked

Commit 84751b98c151f70c322b6b7f70d967400e147852 ('WPS: Allow wildcard
UUID PIN to be used twice') relaxed the constraints on how many time a
wildcard PIN can be used to allow two attempts. However, it did this in
a way that could result in concurrent attempts resulting in the wildcard
PIN being invalidated even without the second attempt actually going as
far as trying to use the PIN and a WPS protocol run.

wildcard_uuid is a flag/counter set for wildcard PINs and it is
incremented whenever the PIN is retrieved by wps_registrar_get_pin().
Eventually it causes the wildcard PIN to be released, effectively
limiting the number of registration attempts with a wildcard PIN.

With the previous implementation, when the PIN is in use and locked
(PIN_LOCKED), it is not returned from wps_registrar_get_pin() but
wildcard_uuid is still incremented which can cause the PIN to be
released earlier and stations will have fewer registration attempts with
it. Fix this scenario by only incrementing wildcard_uuid if the PIN is
actually going to be returned and used.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
7 years agotests: sigma_dut Suite B station with RSA certificate
Jouni Malinen [Tue, 3 Oct 2017 15:16:51 +0000 (18:16 +0300)] 
tests: sigma_dut Suite B station with RSA certificate

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOCE: Update default scan IEs when OCE is enabled/disabled
vamsi krishna [Thu, 31 Aug 2017 08:45:18 +0000 (14:15 +0530)] 
OCE: Update default scan IEs when OCE is enabled/disabled

Update the default scan IEs when OCE is enabled/disabled to the
driver/firmware, so that the correct IEs will be sent out by the
driver/firmware in Probe Request frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Update server and user certificates (2017)
Jouni Malinen [Sun, 1 Oct 2017 15:45:07 +0000 (18:45 +0300)] 
tests: Update server and user certificates (2017)

The previous versions expired, so need to re-sign these to fix number of
the EAP test cases. In addition, add a shell script (update.sh) and the
needed CA files to automate this full update process.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoVendor flags for 11ax channel property flags for use with external ACS
Krishna Rao [Sat, 23 Sep 2017 13:03:23 +0000 (18:33 +0530)] 
Vendor flags for 11ax channel property flags for use with external ACS

Add 802.11ax channel property flags for use with external ACS (QCA
vendor command). Use the remaining available bits in
qca_wlan_vendor_channel_prop_flags for the first few 11ax flags. Then
add qca_wlan_vendor_channel_prop_flags_2 as a continuation of
qca_wlan_vendor_channel_prop_flags and add the remaining 11ax flags
there. Note that qca_wlan_vendor_channel_prop_flags_ext is not used
since it is currently not intended for holding such information. Rather
it is meant for holding additional control information related to
features such as DFS, CSA, etc.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: sigma_dut PMF group management cipher selection on STA
Jouni Malinen [Tue, 26 Sep 2017 14:54:56 +0000 (17:54 +0300)] 
tests: sigma_dut PMF group management cipher selection on STA

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: PMF group mgmt cipher constraints
Jouni Malinen [Tue, 26 Sep 2017 14:36:01 +0000 (17:36 +0300)] 
tests: PMF group mgmt cipher constraints

Verify new wpa_supplicant group_mgmt parameter functionality.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd group_mgmt network parameter for PMF cipher selection
Jouni Malinen [Tue, 26 Sep 2017 14:36:33 +0000 (17:36 +0300)] 
Add group_mgmt network parameter for PMF cipher selection

The new wpa_supplicant network parameter group_mgmt can be used to
specify which group management ciphers (AES-128-CMAC, BIP-GMAC-128,
BIP-GMAC-256, BIP-CMAC-256) are allowed for the network. If not
specified, the current behavior is maintained (i.e., follow what the AP
advertises). The parameter can list multiple space separate ciphers.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoPAE: Validate input before pointer
Michael Braun [Thu, 17 Aug 2017 23:14:28 +0000 (01:14 +0200)] 
PAE: Validate input before pointer

ieee802_1x_kay_decode_mkpdu() calls ieee802_1x_mka_i_in_peerlist()
before body_len has been checked on all segments.

ieee802_1x_kay_decode_mkpdu() and ieee802_1x_mka_i_in_peerlist() might
continue and thus underflow left_len even if it finds left_len to small
(or before checking).

Additionally, ieee802_1x_mka_dump_peer_body() might perform out of bound
reads in this case.

Fix this by checking left_len and aborting if too small early.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>