]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
6 years agotests: WPA2-PSK-FT AP with PSK from a file
Jouni Malinen [Sun, 4 Feb 2018 10:40:03 +0000 (12:40 +0200)] 
tests: WPA2-PSK-FT AP with PSK from a file

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agohostapd: Fix wpa_psk_file support for FT-PSK
Michal Kazior [Thu, 1 Feb 2018 11:03:28 +0000 (12:03 +0100)] 
hostapd: Fix wpa_psk_file support for FT-PSK

For FT-PSK sm->xxkey was populated with only the first password on the
linked list (i.e., last matching password in the wpa_psk_file) in
INITPSK. This caused only that password to be recognized and accepted.
All other passwords were not verified properly and subsequently
prevented clients from connecting.

Hostapd would report:

 Jan 30 12:55:44 hostapd: ap0: STA xx:xx:xx:xx:xx:xx WPA: sending 1/4 msg of 4-Way Handshake
 Jan 30 12:55:44 hostapd: ap0: STA xx:xx:xx:xx:xx:xx WPA: received EAPOL-Key frame (2/4 Pairwise)
 Jan 30 12:55:44 hostapd: ap0: STA xx:xx:xx:xx:xx:xx WPA: invalid MIC in msg 2/4 of 4-Way Handshake
 Jan 30 12:55:45 hostapd: ap0: STA xx:xx:xx:xx:xx:xx WPA: EAPOL-Key timeout

Signed-off-by: Michal Kazior <michal@plumewifi.com>
6 years agowpa_supplicant: Fix parsing errors on additional config file
Jouni Malinen [Sun, 4 Feb 2018 10:20:13 +0000 (12:20 +0200)] 
wpa_supplicant: Fix parsing errors on additional config file

If the -I<config> argument is used and the referenced configuration file
cannot be parsed, wpa_config_read() ended up freeing the main
configuration data structure and that resulted in use of freed memory in
such an error case. Fix this by not freeing the main config data and
handling the error case in the caller.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agowpa_supplicant: Free config only if it was allocated in same call
Dmitry Shmidt [Thu, 1 Feb 2018 00:34:54 +0000 (00:34 +0000)] 
wpa_supplicant: Free config only if it was allocated in same call

If option -I:config points to a non-existing file, the the previously
allocated config must not be freed. Avoid use of freed memory in such an
error case by skipping the incorrect freeing operation.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
6 years agotests: Enable device PS before sending PS-Poll
Adiel Aloni [Tue, 30 Jan 2018 11:10:10 +0000 (13:10 +0200)] 
tests: Enable device PS before sending PS-Poll

Linux kernel commit c9491367b759 ("mac80211: always update the PM state
of a peer on MGMT / DATA frames") enforces the AP to check only
mgmt/data frames PM bit, and to update station's power save accordingly.
When sending only a PS-Poll (control frame) the AP will ignore the PM
bit. As the result, the partial virtual bitmap will not be updated, and
the test ap_open_disconnect_in_ps will fail on tshark check. Since the
test needs only the TIM to be updated, setting PS enabled will send NDP
that will signal that the station is sleeping. Sending PS-Poll to enable
power save is not correct, according to the following standard
statement: "A PS-Poll frame exchange does not necessarily result in an
Ack frame from the AP, so a non-AP STA cannot change power management
mode using a PS-Poll frame."

Signed-off-by: Adiel Aloni <adiel.aloni@intel.com>
6 years agoOWE: Fix association IEs for transition mode open AP connection
Jouni Malinen [Sun, 4 Feb 2018 09:55:01 +0000 (11:55 +0200)] 
OWE: Fix association IEs for transition mode open AP connection

The special case of returning from wpa_supplicant_set_suites() when OWE
transition mode profile is used for an open association did not clear
the wpa_ie buffer length properly. This resulted in trying to use
corrupted IEs in the association request and failed association
(cfg80211 rejects the request or if the request were to go out, the AP
would likely reject it).

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agowpa_cli: Enable add/remove/get vendor elements without P2P
Simon Dinkin [Thu, 1 Feb 2018 15:12:02 +0000 (17:12 +0200)] 
wpa_cli: Enable add/remove/get vendor elements without P2P

This functionality can be used regardless of P2P and should not be under
the ifdef of CONFIG_P2P.

Signed-off-by: Simon Dinkin <simon.dinkin@tandemg.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
6 years agocommon: Fix the description of wpa_ctrl_request() function
Simon Dinkin [Thu, 1 Feb 2018 15:12:03 +0000 (17:12 +0200)] 
common: Fix the description of wpa_ctrl_request() function

The blocking timeout of this function was changed from 2 seconds to 10
seconds in this commit 1480633f ("Use longer timeout in
wpa_ctrl_request()"), but the description was never changed accordingly.

Signed-off-by: Simon Dinkin <simon.dinkin@tandemg.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
6 years agoFix compiler issue with CONFIG_TESTING_OPTIONS
David Messer [Wed, 31 Jan 2018 16:01:00 +0000 (11:01 -0500)] 
Fix compiler issue with CONFIG_TESTING_OPTIONS

Use the preprocessor conditional "ifdef" instead of "if" before
CONFIG_TESTING_OPTIONS to prevent an issue on build systems that treat
undefined preprocessor identifiers as an error.

Signed-off-by: David Messer <david.messer@garmin.com>
6 years agoD-Bus: Report error on starting P2P find
Vasyl Vavrychuk [Thu, 1 Feb 2018 12:07:30 +0000 (14:07 +0200)] 
D-Bus: Report error on starting P2P find

Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
6 years agowpa_cli: Fix cred_fields[] declaration
Jouni Malinen [Sat, 3 Feb 2018 10:08:09 +0000 (12:08 +0200)] 
wpa_cli: Fix cred_fields[] declaration

This was supposed to be an array of const-pointers to const-char; not
something duplicating const for char and resulting in compiler warnings
with more recent gcc versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoSAE: Support external authentication offload for driver-SME cases
Sunil Dutt [Thu, 1 Feb 2018 11:31:28 +0000 (17:01 +0530)] 
SAE: Support external authentication offload for driver-SME cases

Extend the SME functionality to support the external authentication.
External authentication may be used by the drivers that do not define
separate commands for authentication and association
(~WPA_DRIVER_FLAGS_SME) but rely on wpa_supplicant's SME for the
authentication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: SAE with connect command
Jouni Malinen [Fri, 2 Feb 2018 17:08:34 +0000 (19:08 +0200)] 
tests: SAE with connect command

This does not really work with mac80211_hwsim due to missing offload
support, but at least some minimal extra code coverage can be achieved.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agonl80211: Create a netlink socket handle for the Connect interface
Sunil Dutt [Thu, 1 Feb 2018 11:22:57 +0000 (16:52 +0530)] 
nl80211: Create a netlink socket handle for the Connect interface

This netlink socket handle owns the connect request and is further used
by the host driver/kernel to request for the external authentication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agonl80211: Introduce the interface for external authentication
Sunil Dutt [Thu, 1 Feb 2018 07:15:41 +0000 (12:45 +0530)] 
nl80211: Introduce the interface for external authentication

This command/event interface can be used by host drivers that do not
define separate commands for authentication and association but rely on
wpa_supplicant for the authentication (SAE) processing.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoAdd new QCA vendor commands for thermal shutdown
Guisen Yang [Thu, 1 Feb 2018 09:05:19 +0000 (17:05 +0800)] 
Add new QCA vendor commands for thermal shutdown

Add new QCA vendor commands and attributes to get thermal information
and send thermal shutdown related commands. Indicates the driver to
enter the power saving mode or resume from the power saving mode based
on the given temperature and thresholds.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 2 Feb 2018 16:34:14 +0000 (18:34 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2018-01-31.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoOWE: Use PMKSA caching if available with driver AP MLME
Ashok Ponnaiah [Tue, 30 Jan 2018 11:24:39 +0000 (16:54 +0530)] 
OWE: Use PMKSA caching if available with driver AP MLME

If a matching PMKSA cache entry is present for an OWE client, use it and
do not go through DH while processing Association Rquest frame.
Association Response frame will identify the PMKID in such a case and DH
parameters won't be present.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
6 years agoOWE: Handle unsupported finite cyclic group with driver MLME
Ashok Ponnaiah [Tue, 30 Jan 2018 11:21:12 +0000 (16:51 +0530)] 
OWE: Handle unsupported finite cyclic group with driver MLME

Handle OWE unsupported finite cyclic group in (Re)Association Request
frame when not using the hostapd SME/MLME.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
6 years agoatheros: Send correct SSID length to the driver
Ashok Ponnaiah [Tue, 30 Jan 2018 10:13:57 +0000 (15:43 +0530)] 
atheros: Send correct SSID length to the driver

Send the exact SSID length to the driver by removing the legacy +1
padding.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
6 years agonl80211: Add DPP and OWE AKM selectors to CONNECT/ASSOC request
Srinivas Dasari [Tue, 30 Jan 2018 07:12:46 +0000 (12:42 +0530)] 
nl80211: Add DPP and OWE AKM selectors to CONNECT/ASSOC request

This is needed to support drivers that use NL80211_ATTR_AKM_SUITES.

Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
6 years agotests: Update DPP PKEX test vector parameters to match new tech spec
Jouni Malinen [Tue, 30 Jan 2018 16:28:24 +0000 (18:28 +0200)] 
tests: Update DPP PKEX test vector parameters to match new tech spec

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Make dpp_pkex_test_vector parameters clearer
Jouni Malinen [Tue, 30 Jan 2018 16:21:37 +0000 (18:21 +0200)] 
tests: Make dpp_pkex_test_vector parameters clearer

This makes it a bit clearer to see which parameters need to be modified
if the test vector needs to be recreated based on new values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoExtend QCA vendor NDP params to support schedule update indication
Subhani Shaik [Thu, 25 Jan 2018 22:31:21 +0000 (14:31 -0800)] 
Extend QCA vendor NDP params to support schedule update indication

Add additional NDP attributes and NDP subcommand value which is
provided as part of schedule update indication from driver/firmware
to HAL.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoUpdate QCA vendor commands to match ASOP
Subhani Shaik [Fri, 19 Jan 2018 01:49:37 +0000 (17:49 -0800)] 
Update QCA vendor commands to match ASOP

This updates QCA vendor command and attribute definitions to match AOSP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoOWE: Transition mode with non-AP-MLME
Ashok Ponnaiah [Tue, 16 Jan 2018 09:03:14 +0000 (14:33 +0530)] 
OWE: Transition mode with non-AP-MLME

Add OWE Transition IE in build_ap_extra() ies to support drivers that do
not use hostapd MLME.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
6 years agohostapd: Send broadcast Public Action frame with wildcard BSSID address
Ashok Ponnaiah [Mon, 29 Jan 2018 16:11:03 +0000 (18:11 +0200)] 
hostapd: Send broadcast Public Action frame with wildcard BSSID address

Send Public Action frames with wildcard BSSID when destination was
broadcast address. This is required for DPP PKEX where the recipients
may drop the frames received with different BSSID than the wildcard
address or the current BSSID.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
6 years agotests: DPP using externally generated bootstrapping keys
Jouni Malinen [Mon, 29 Jan 2018 11:23:19 +0000 (13:23 +0200)] 
tests: DPP using externally generated bootstrapping keys

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Update PKEX role-specific points
Jouni Malinen [Fri, 26 Jan 2018 15:54:49 +0000 (17:54 +0200)] 
DPP: Update PKEX role-specific points

The y coordinates for some of these PKEX role-specific points were
changed in the PKEX specification, so update the implementation to
match.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoAdd QCA vendor command and attributes for MSDU queue depth threshold
Venkateswara Swamy Bandaru [Mon, 8 Jan 2018 08:23:59 +0000 (13:53 +0530)] 
Add QCA vendor command and attributes for MSDU queue depth threshold

This allow MSDU queue depth threshold in target to be set per peer per
TID. This command contains MAC address, TID, update mask, and threshold
values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFILS: Fix extended capability bit setting for FILS in AP mode
Jouni Malinen [Sun, 21 Jan 2018 22:07:44 +0000 (00:07 +0200)] 
FILS: Fix extended capability bit setting for FILS in AP mode

FILS capability bit setting could have ended up setting boths biths 72
(correct) and 64 (incorrect; part of Max Number of MSDUs In A-MSDU). Fix
this by adding the missing break to the switch statement.

Fixed: f55acd909e37 ("FILS: Set FILS Capability bit in management frames from AP")
Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-SIM/AKA: Separate identity for MK derivation
Jouni Malinen [Fri, 8 Dec 2017 15:05:40 +0000 (17:05 +0200)] 
EAP-SIM/AKA: Separate identity for MK derivation

This allows a separate configuration parameter (imsi_identity) to be
used in EAP-SIM/AKA/AKA' profiles to override the identity used in MK
derivation for the case where the identity is expected to be from the
last AT_IDENTITY attribute (or EAP-Response/Identity if AT_IDENTITY was
not used). This may be needed to avoid sending out an unprotected
permanent identity information over-the-air and if the EAP-SIM/AKA
server ends up using a value based on the real IMSI during the internal
key derivation operation (that does not expose the data to others).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
6 years agoDPP: Get rid of compiler warnings on signed/unsigned comparison
Jouni Malinen [Sun, 21 Jan 2018 09:24:33 +0000 (11:24 +0200)] 
DPP: Get rid of compiler warnings on signed/unsigned comparison

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoDPP: Track M.x/N.x/L.x availability for ke derivation
Jouni Malinen [Sat, 13 Jan 2018 02:12:46 +0000 (04:12 +0200)] 
DPP: Track M.x/N.x/L.x availability for ke derivation

This prevents an issue where duplicated Authentication Response frame
could have resulted in deriving a new ke value after M.x had already
been cleared. This would result in the following configuration exchange
failing. This could happen since many driver do not filter out
retransmitted Public Action frames and link layer. Furthermore, this
could have been used as a denial-of-service attack agains the DPP
exchange.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: OWE with PMF required and with open network selection
Jouni Malinen [Sat, 13 Jan 2018 01:57:40 +0000 (03:57 +0200)] 
tests: OWE with PMF required and with open network selection

Verify that PMF can be marked required OWE networks and verify that a
station in transition mode can connect to an open network.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoOWE: Allow station in transition mode to connect to an open BSS
Jouni Malinen [Sat, 13 Jan 2018 01:56:26 +0000 (03:56 +0200)] 
OWE: Allow station in transition mode to connect to an open BSS

If the OWE network profile matches an open network which does not
advertise OWE BSS, allow open connection. The new owe_only=1 network
profile parameter can be used to disable this transition mode and
enforce connection only with OWE networks.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoExtend NUD Stats to collect the data packet statistics
Sunil Dutt [Thu, 21 Dec 2017 12:08:01 +0000 (17:38 +0530)] 
Extend NUD Stats to collect the data packet statistics

This commit extends the existing QCA vendor specific NUD_STATS_GET/SET
interface to also collect the statistics of the data packets. The
intention here is to get more comprehensive information to detect the
network unreachability.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Add the EC root CA private keys to repository
Jouni Malinen [Fri, 12 Jan 2018 20:42:23 +0000 (22:42 +0200)] 
tests: Add the EC root CA private keys to repository

These were forgotten from the initial commit adding the EC PKI.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Suite B 192-bit RSA validation with 2048-bit client cert
Jouni Malinen [Fri, 12 Jan 2018 20:40:55 +0000 (22:40 +0200)] 
tests: Suite B 192-bit RSA validation with 2048-bit client cert

Verify that unexpected 2048-bit RSA client certificate gets rejected by
the RADIUS server if the server is configured to use Suite B at 192-bit
level.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoCopy WLAN-Reason-Code value from Access-Reject to Deauthentication
Jouni Malinen [Fri, 12 Jan 2018 18:55:33 +0000 (20:55 +0200)] 
Copy WLAN-Reason-Code value from Access-Reject to Deauthentication

This makes hostapd use the WLAN-Reason-Code value from Access-Reject
when disconnecting a station due to IEEE 802.1X authentication failure.
If the RADIUS server does not include this attribute, the default value
23 (IEEE 802.1X authentication failed) is used. That value was the
previously hardcoded reason code.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoRADIUS: Add WLAN-Reason-Code attribute to Access-Reject
Jouni Malinen [Fri, 12 Jan 2018 18:45:12 +0000 (20:45 +0200)] 
RADIUS: Add WLAN-Reason-Code attribute to Access-Reject

Make the RADIUS server in hostapd add WLAN-Reason-Code attribute to all
Access-Reject messages generated based on EAP-Failure from the EAP
server. For now, the reason code value is set to 23 (IEEE 802.1X
authentication failed). This can be extending in future commits to cover
addition failure reasons.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Suite B 192-bit validation with p256 client cert
Jouni Malinen [Fri, 12 Jan 2018 18:30:07 +0000 (20:30 +0200)] 
tests: Suite B 192-bit validation with p256 client cert

Verify that unexpected p256 client certificate gets rejected if the
server is configured to use Suite B at 192-bit level.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Set appropriate permission(s) for cert file/folders on Android
Purushottam Kushwaha [Wed, 27 Dec 2017 10:57:59 +0000 (16:27 +0530)] 
HS 2.0: Set appropriate permission(s) for cert file/folders on Android

This commit adds additional permission to 'SP' and 'Cert' folders
which is needed to copy certificates from Cert to SP. Additionally,
this associates AID_WIFI group id with these folders.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Update ap_wpa2_eap_assoc_rsn to match implementation change
Jouni Malinen [Fri, 12 Jan 2018 00:08:39 +0000 (02:08 +0200)] 
tests: Update ap_wpa2_eap_assoc_rsn to match implementation change

This covers the new status code for group management cipher mismatch.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoReplace RSNE group key management mismatch status/reason codes
Jouni Malinen [Thu, 11 Jan 2018 23:12:00 +0000 (01:12 +0200)] 
Replace RSNE group key management mismatch status/reason codes

Use "cipher out of policy" value instead of invalid group cipher (which
is for the group data frame cipher) and management frame policy
violation (which is used for MFPC/MFPR mismatch).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoAdd QCA vendor command to get the WLAN MAC information
Sunil Dutt [Thu, 21 Dec 2017 09:30:29 +0000 (15:00 +0530)] 
Add QCA vendor command to get the WLAN MAC information

This commit introduces a QCA vendor command that provides the current
information of WLAN hardware MAC and its associated WLAN netdev
interfaces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: sigma_dut Suite B tests to not explicitly set PMF
Jouni Malinen [Thu, 11 Jan 2018 18:21:48 +0000 (20:21 +0200)] 
tests: sigma_dut Suite B tests to not explicitly set PMF

PMF is supposed to be enabled automatically in sigma_dut, so remove
the explicit argument to do so from the commands.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: WPA2-PSK AP and association request RSN IE with PMKID
Jouni Malinen [Thu, 11 Jan 2018 00:24:52 +0000 (02:24 +0200)] 
tests: WPA2-PSK AP and association request RSN IE with PMKID

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Report reception of Config Request to upper layers
Jouni Malinen [Wed, 10 Jan 2018 20:14:22 +0000 (22:14 +0200)] 
DPP: Report reception of Config Request to upper layers

This is mainly for protocol testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Use longer timeout in sigma_dut_dpp_proto_initiator
Jouni Malinen [Wed, 10 Jan 2018 20:13:48 +0000 (22:13 +0200)] 
tests: Use longer timeout in sigma_dut_dpp_proto_initiator

This is needed to be ready for a sigma_dut change to wait for an extra
frame RX event.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: sigma_dut sta_scan_bss
Jouni Malinen [Wed, 10 Jan 2018 15:50:43 +0000 (17:50 +0200)] 
tests: sigma_dut sta_scan_bss

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: sigma_dut with alternative OWE transition mode configuration
Jouni Malinen [Wed, 10 Jan 2018 15:09:50 +0000 (17:09 +0200)] 
tests: sigma_dut with alternative OWE transition mode configuration

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: sigma_dut and new DPP config index values
Jouni Malinen [Tue, 9 Jan 2018 19:22:25 +0000 (21:22 +0200)] 
tests: sigma_dut and new DPP config index values

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: DPP QR Code and hostapd as initiator (offchannel)
Jouni Malinen [Mon, 8 Jan 2018 03:21:49 +0000 (05:21 +0200)] 
tests: DPP QR Code and hostapd as initiator (offchannel)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Authentication exchange retries and channel iteration in hostapd
Jouni Malinen [Mon, 8 Jan 2018 03:19:05 +0000 (05:19 +0200)] 
DPP: Authentication exchange retries and channel iteration in hostapd

This extends hostapd with previoiusly implemented wpa_supplicant
functionality to retry DPP Authentication Request/Response and to
iterate over possible negotiation channels.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoReport offchannel RX frame frequency to hostapd
Jouni Malinen [Mon, 8 Jan 2018 01:37:48 +0000 (03:37 +0200)] 
Report offchannel RX frame frequency to hostapd

Not all code paths for management frame RX reporting delivered the
correct frequency for offchannel RX cases. This is needed mainly for
Public Action frame processing in some special cases where AP is
operating, but an exchange is done on a non-operational channel. For
example, DPP Initiator role may need to do this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Enable and require PMF in SAE and OWE test cases with sigma_dut
Jouni Malinen [Thu, 4 Jan 2018 15:06:40 +0000 (17:06 +0200)] 
tests: Enable and require PMF in SAE and OWE test cases with sigma_dut

All SAE and OWE associations are expected to require PMF to be
negotiated, so enable or require PMF in AP and STA configurations
accordingly to match the new sigma_dut behavior.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoGnuTLS: Add option to build with libnettle instead of libgcrypt
Jouni Malinen [Fri, 29 Dec 2017 15:11:21 +0000 (17:11 +0200)] 
GnuTLS: Add option to build with libnettle instead of libgcrypt

GnuTLS-based builds can now be done using either libnettle or libgcrypt
for crypto functionality:

CONFIG_TLS=gnutls
CONFIG_CRYPTO=nettle

CONFIG_TLS=gnutls
CONFIG_CRYPTO=gnutls

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: GnuTLS configuration of intermediate CA certificate
Jouni Malinen [Fri, 29 Dec 2017 10:01:22 +0000 (12:01 +0200)] 
tests: GnuTLS configuration of intermediate CA certificate

GnuTLS seems to require the intermediate CA certificate to be included
both in the ca_cert and client_cert file for the cases of server and
client certificates using different intermediate CA certificates. Use
the user_and_ica.pem file with GnuTLS builds and reorder the
certificates in that file to make this work with GnuTLS.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Enable Suite B test cases with GnuTLS
Jouni Malinen [Thu, 28 Dec 2017 16:48:23 +0000 (18:48 +0200)] 
tests: Enable Suite B test cases with GnuTLS

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Speed up suite_b_192_rsa_insufficient_dh in failure case
Jouni Malinen [Thu, 28 Dec 2017 18:26:57 +0000 (20:26 +0200)] 
tests: Speed up suite_b_192_rsa_insufficient_dh in failure case

Check for unexpected connection to avoid timeout on TLS alert event if
the implementation does not check DH key size at all.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoGnuTLS: Suite B validation
Jouni Malinen [Thu, 28 Dec 2017 16:46:28 +0000 (18:46 +0200)] 
GnuTLS: Suite B validation

This allows OpenSSL-style configuration of Suite B parameters to be used
in the wpa_supplicant network profile. 128-bit and 192-bit level
requirements for ECDHE-ECDSA cases are supported. RSA >=3K case is
enforced using GnuTLS %PROFILE_HIGH special priority string keyword.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoGnuTLS: Add support for disabling TLS versions
Jouni Malinen [Thu, 28 Dec 2017 16:03:29 +0000 (18:03 +0200)] 
GnuTLS: Add support for disabling TLS versions

This extends GnuTLS support for tls_disable_v1_{0,1,2}=1 flags in the
phase1 network profile parameter in wpa_supplicant.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoGnuTLS: Implement tls_get_cipher()
Jouni Malinen [Thu, 28 Dec 2017 15:41:20 +0000 (17:41 +0200)] 
GnuTLS: Implement tls_get_cipher()

Provide OpenSSL-style name for the negotiated cipher suite.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoGnuTLS: Make debug prints clearer for cert/key parsing
Jouni Malinen [Thu, 28 Dec 2017 11:18:15 +0000 (13:18 +0200)] 
GnuTLS: Make debug prints clearer for cert/key parsing

Indicate more clearly when the parsing succeeds to avoid ending the
debug prints with various internal GnuTLS internal error messages even
when the parsing actually succeeded in the end.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Skip eap_tls_pkcs8_pkcs5_v15 with GnuTLS
Jouni Malinen [Thu, 28 Dec 2017 11:02:04 +0000 (13:02 +0200)] 
tests: Skip eap_tls_pkcs8_pkcs5_v15 with GnuTLS

It looks like this private key format is not supported in GnuTLS (tested
with version 3.4.10).

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Fix wpas_config_file with non-mesh and non-SAE builds
Jouni Malinen [Thu, 28 Dec 2017 10:57:47 +0000 (12:57 +0200)] 
tests: Fix wpas_config_file with non-mesh and non-SAE builds

Check wpa_supplicant capabilities before testing mesh and SAE
parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Fix gas_anqp_overrides with non-FILS builds
Jouni Malinen [Thu, 28 Dec 2017 10:45:59 +0000 (12:45 +0200)] 
tests: Fix gas_anqp_overrides with non-FILS builds

Need to ignore missing RX-ANQP event for the FILS Realm Info if
wpa_supplicant build does not include FILS support.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoGnuTLS: Add TEST_FAIL() to crypto routines for testing purposes
Jouni Malinen [Thu, 28 Dec 2017 10:33:02 +0000 (12:33 +0200)] 
GnuTLS: Add TEST_FAIL() to crypto routines for testing purposes

This allows number of hwsim test cases for local error conditions to be
executed with GnuTLS-based builds.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoGnuTLS: Implement tls_get_version()
Jouni Malinen [Wed, 27 Dec 2017 22:29:18 +0000 (00:29 +0200)] 
GnuTLS: Implement tls_get_version()

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Skip sigma_dut tests for SAE/DPP based on build capabilities
Jouni Malinen [Wed, 27 Dec 2017 22:16:53 +0000 (00:16 +0200)] 
tests: Skip sigma_dut tests for SAE/DPP based on build capabilities

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoGnuTLS: Implement HMAC functions using libgcrypt
Jouni Malinen [Wed, 27 Dec 2017 21:35:26 +0000 (23:35 +0200)] 
GnuTLS: Implement HMAC functions using libgcrypt

Replace the internal HMAC MD5, SHA-1, and SHA256 implementations with
the ones from libgcrypt and also add the SHA384 and SHA512 versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoGnuTLS: Implement sha{256,384,512}_vector() using libgcrypt
Jouni Malinen [Wed, 27 Dec 2017 21:19:32 +0000 (23:19 +0200)] 
GnuTLS: Implement sha{256,384,512}_vector() using libgcrypt

Replace the internal SHA256 implementation with the one from libgcrypt
and also add the SHA384 and SHA512 versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoGnuTLS: Use a helper function for hash functions
Jouni Malinen [Wed, 27 Dec 2017 21:13:51 +0000 (23:13 +0200)] 
GnuTLS: Use a helper function for hash functions

Use a shared helper function instead of implementing practically same
sequence separately for each hash function.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Opportunistic Wireless Encryption and group negotiation
Jouni Malinen [Wed, 27 Dec 2017 19:07:05 +0000 (21:07 +0200)] 
tests: Opportunistic Wireless Encryption and group negotiation

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoOWE: Try all supported DH groups automatically on STA
Jouni Malinen [Wed, 27 Dec 2017 19:06:02 +0000 (21:06 +0200)] 
OWE: Try all supported DH groups automatically on STA

If a specific DH group for OWE is not set with the owe_group parameter,
try all supported DH groups (currently 19, 20, 21) one by one if the AP
keeps rejecting groups with the status code 77.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Mixed mode BSS and MFP-enabled AP rejecting TKIP
Jouni Malinen [Wed, 27 Dec 2017 16:39:20 +0000 (18:39 +0200)] 
tests: Mixed mode BSS and MFP-enabled AP rejecting TKIP

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFix MFP-enabled test for disallowed TKIP
Jouni Malinen [Wed, 27 Dec 2017 16:38:12 +0000 (18:38 +0200)] 
Fix MFP-enabled test for disallowed TKIP

The test against use of TKIP was done only in MFP-required
(ieee80211w=2) configuration. Fix this to check the pairwise cipher for
MFP-enabled (ieee80211w=1) case as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Mixed SAE and non-SAE network and MFP required with SAE
Jouni Malinen [Wed, 27 Dec 2017 16:28:07 +0000 (18:28 +0200)] 
tests: Mixed SAE and non-SAE network and MFP required with SAE

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoSAE: Add option to require MFP for SAE associations
Jouni Malinen [Wed, 27 Dec 2017 16:26:31 +0000 (18:26 +0200)] 
SAE: Add option to require MFP for SAE associations

The new hostapd.conf parameter sae_require_pmf=<0/1> can now be used to
enforce negotiation of MFP for all associations that negotiate use of
SAE. This is used in cases where SAE-capable devices are known to be
MFP-capable and the BSS is configured with optional MFP (ieee80211w=1)
for legacy support. The non-SAE stations can connect without MFP while
SAE stations are required to negotiate MFP if sae_require_mfp=1.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Set PMK length in eapol-fuzzer
Jouni Malinen [Wed, 27 Dec 2017 10:27:33 +0000 (12:27 +0200)] 
tests: Set PMK length in eapol-fuzzer

Commit b488a12948751f57871f09baa345e59b23959a41 ('Clear PMK length and
check for this when deriving PTK') started rejecting PTK derivation
based on PMK length. This reduced coverage from the eapol-fuzzer, so set
the default length when initializing the state machine in the fuzzer to
reach the previously used code paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: SAE protocol testing - Confirm replay
Jouni Malinen [Wed, 27 Dec 2017 10:13:20 +0000 (12:13 +0200)] 
tests: SAE protocol testing - Confirm replay

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoSAE: Set special Sc value when moving to Accepted state
Jouni Malinen [Wed, 27 Dec 2017 10:17:44 +0000 (12:17 +0200)] 
SAE: Set special Sc value when moving to Accepted state

Set Sc to 2^16-1 when moving to Accepted state per IEEE Std 802.11-2016,
12.4.8.6.5 (Protocol instance behavior - Confirmed state). This allows
the peer in Accepted state to silently ignore unnecessary
retransmissions of the Confirm message.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoSAE: Add Rc variable and peer send-confirm validation
Jouni Malinen [Wed, 27 Dec 2017 10:14:41 +0000 (12:14 +0200)] 
SAE: Add Rc variable and peer send-confirm validation

This implements the behavior described in IEEE Std 802.11-2016,
12.4.8.6.6 (Protocol instance behavior - Accepted state) to silently
discard received Confirm message in the Accepted state if the new
message does not use an incremented send-confirm value or if the special
2^16-1 value is used. This avoids unnecessary processing of
retransmitted Confirm messages.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoSAE: Print state changes in debug log
Jouni Malinen [Tue, 26 Dec 2017 22:07:42 +0000 (00:07 +0200)] 
SAE: Print state changes in debug log

This makes it easier to follow state changes in SAE protocol instances.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoSAE: Make dot11RSNASAESync configurable
Jouni Malinen [Tue, 26 Dec 2017 10:46:22 +0000 (12:46 +0200)] 
SAE: Make dot11RSNASAESync configurable

The new hostapd.conf parameter sae_sync (default: 5) can now be used to
configure the dot11RSNASAESync value to specify the maximum number of
synchronization errors that are allowed to happen prior to
disassociation of the offending SAE peer.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Make dpp_pkex_test_fail and dpp_pkex_alloc_fail more robust
Jouni Malinen [Mon, 25 Dec 2017 16:36:17 +0000 (18:36 +0200)] 
tests: Make dpp_pkex_test_fail and dpp_pkex_alloc_fail more robust

Wait for test/allocation failure for longer than the wait_fail_trigger()
default two seconds to allow DPP (in particular, PKEX) retransmission to
occur. This removes some issues where the previous wait was more or less
exactly the same duration as the retransmission interval and the first
Listen operation not always starting quickly enough to receive the first
frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Fix "ocsp: Digest must be before -cert or -serial"
leishaoting [Tue, 19 Dec 2017 06:40:44 +0000 (14:40 +0800)] 
tests: Fix "ocsp: Digest must be before -cert or -serial"

When executing ./start.sh with OpenSSL 1.1.0f, an OCSP operation fails.

Put "-sha256" ahead of "-serial" to fix this.

~# openssl version
OpenSSL 1.1.0f  25 May 2017
~# openssl ocsp -reqout /lkp/benchmarks/hwsim/tests/hwsim/logs/current/ocsp-req.der -issuer /lkp/benchmarks/hwsim/tests/hwsim/auth_serv/ca.pem -serial 0xD8D3E3A6CBE3CD12 -no_nonce -sha256
ocsp: Digest must be before -cert or -serial
ocsp: Use -help for summary.
~# openssl ocsp -reqout /lkp/benchmarks/hwsim/tests/hwsim/logs/current/ocsp-req.der -issuer /lkp/benchmarks/hwsim/tests/hwsim/auth_serv/ca.pem -sha256 -serial 0xD8D3E3A6CBE3CD12 -no_nonce

Signed-off-by: leishaoting <leist.fnst@cn.fujitsu.com>
6 years agoPAE: Remove OpenSSL header dependency
Jouni Malinen [Sun, 24 Dec 2017 15:41:48 +0000 (17:41 +0200)] 
PAE: Remove OpenSSL header dependency

Instead of requiring OpenSSL headers to be available just for the
SSL3_RANDOM_SIZE definition, replace that macro with a fixed length (32)
to simplify dependencies.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-pwd: Use abstract crypto API
Sean Parkinson [Mon, 16 Oct 2017 05:45:09 +0000 (15:45 +1000)] 
EAP-pwd: Use abstract crypto API

This makes it easier to use EAP-pwd with other crypto libraries than
OpenSSL.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
6 years agoEAP-EKE: Use abstract crypto API
Sean Parkinson [Mon, 16 Oct 2017 05:45:09 +0000 (15:45 +1000)] 
EAP-EKE: Use abstract crypto API

This makes it easier to use EAP-pwd with other crypto libraries.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
6 years agoEnhance crypto abstract API for DH
Sean Parkinson [Mon, 16 Oct 2017 05:45:09 +0000 (15:45 +1000)] 
Enhance crypto abstract API for DH

The patch offers alternate implementations of some functions using the
abstract cryptographic API.

This work was done in preparation for the changes to allow hostap to be
compiled with the wolfSSL cryptography and TLS library.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
6 years agocrypto: Implement new crypto API functions for DH
Jouni Malinen [Sun, 24 Dec 2017 15:25:39 +0000 (17:25 +0200)] 
crypto: Implement new crypto API functions for DH

This implements crypto_dh_init() and crypto_dh_derive_secret() using
os_get_random() and crypto_mod_exp() for all crypto_*.c wrappers that
include crypto_mod_exp() implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoOpenSSL: Implement new crypto API functions
Jouni Malinen [Sat, 23 Dec 2017 15:51:14 +0000 (17:51 +0200)] 
OpenSSL: Implement new crypto API functions

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEnhance crypto abstract API
Sean Parkinson [Mon, 16 Oct 2017 05:45:09 +0000 (15:45 +1000)] 
Enhance crypto abstract API

Add more crypto_*() wrappers to enable use of other crypto libraries
than OpenSSL.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
6 years agoFix copy-paste errors in function comments
Sean Parkinson [Mon, 16 Oct 2017 05:45:09 +0000 (15:45 +1000)] 
Fix copy-paste errors in function comments

Use correct function names for the documentation.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
6 years agoDH: Remove trailing whitespace
Jouni Malinen [Sun, 24 Dec 2017 15:02:53 +0000 (17:02 +0200)] 
DH: Remove trailing whitespace

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-pwd: Remove trailing empty line
Jouni Malinen [Sat, 23 Dec 2017 15:26:38 +0000 (17:26 +0200)] 
EAP-pwd: Remove trailing empty line

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoAdd new QCA vendor attribute for getting preferred channel
Peng Xu [Tue, 12 Dec 2017 17:00:01 +0000 (09:00 -0800)] 
Add new QCA vendor attribute for getting preferred channel

A new vendor attribute QCA_WLAN_VENDOR_ATTR_GET_WEIGHED_PCL is added for
getting preferred channels with weight value and a flag to indicate how
the channels should be used in P2P negotiation process.

Signed-off-by: Peng Xu <pxu@qti.qualcomm.com>
6 years agoFix couple of QCA_NL80211_VENDOR_SUBCMD_GET_SAR_LIMITS comments
Jouni Malinen [Fri, 22 Dec 2017 16:57:47 +0000 (18:57 +0200)] 
Fix couple of QCA_NL80211_VENDOR_SUBCMD_GET_SAR_LIMITS comments

Copy-paste errors in the command name (set vs. the new get).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>