]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agotests: WPA2-Enterprise connection using EAP-PSK after MAC address change
Jouni Malinen [Fri, 30 Mar 2018 09:11:55 +0000 (12:11 +0300)] 
tests: WPA2-Enterprise connection using EAP-PSK after MAC address change

This is a regression test for a sequence where wpa_supplicant interface
MAC address is changed externally and the ifdown-ifup sequence is
processed only after the interface has already been set UP.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_supplicant: Fix auth failure when the MAC is updated externally
Beniamino Galvani [Thu, 15 Feb 2018 10:50:01 +0000 (11:50 +0100)] 
wpa_supplicant: Fix auth failure when the MAC is updated externally

When connecting to a WPA-EAP network and the MAC address is changed
just before the association (for example by NetworkManager, which sets
a random MAC during scans), the authentication sometimes fails in the
following way ('####' logs added by me):

wpa_supplicant logs:
 wlan0: WPA: RX message 1 of 4-Way Handshake from 02:00:00:00:01:00 (ver=1)
 RSN: msg 1/4 key data - hexdump(len=22): dd 14 00 0f ac 04 d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 WPA: PMKID in EAPOL-Key - hexdump(len=22): dd 14 00 0f ac 04 d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 RSN: PMKID from Authenticator - hexdump(len=16): d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 wlan0: RSN: no matching PMKID found
 EAPOL: Successfully fetched key (len=32)
 WPA: PMK from EAPOL state machines - hexdump(len=32): [REMOVED]
 #### WPA: rsn_pmkid():
 #### WPA: aa              - hexdump(len=6): 02 00 00 00 01 00
 #### WPA: spa             - hexdump(len=6): 66 20 cf ab 8c dc
 #### WPA: PMK             - hexdump(len=32): b5 24 76 4f 6f 50 8c f6 a1 2e 24 b8 07 4e 9a 13 1b 94 c4 a8 1f 7e 22 d6 ed fc 7d 43 c7 77 b6 f7
 #### WPA: computed PMKID  - hexdump(len=16): ea 73 67 b1 8e 5f 18 43 58 24 e8 1c 47 23 87 71
 RSN: Replace PMKSA entry for the current AP and any PMKSA cache entry that was based on the old PMK
 nl80211: Delete PMKID for 02:00:00:00:01:00
 wlan0: RSN: PMKSA cache entry free_cb: 02:00:00:00:01:00 reason=1
 RSN: Added PMKSA cache entry for 02:00:00:00:01:00 network_ctx=0x5630bf85a270
 nl80211: Add PMKID for 02:00:00:00:01:00
 wlan0: RSN: PMKID mismatch - authentication server may have derived different MSK?!

hostapd logs:
 WPA: PMK from EAPOL state machine (MSK len=64 PMK len=32)
 WPA: 02:00:00:00:00:00 WPA_PTK entering state PTKSTART
 wlan1: STA 02:00:00:00:00:00 WPA: sending 1/4 msg of 4-Way Handshake
 #### WPA: rsn_pmkid():
 #### WPA: aa              - hexdump(len=6): 02 00 00 00 01 00
 #### WPA: spa             - hexdump(len=6): 02 00 00 00 00 00
 #### WPA: PMK             - hexdump(len=32): b5 24 76 4f 6f 50 8c f6 a1 2e 24 b8 07 4e 9a 13 1b 94 c4 a8 1f 7e 22 d6 ed fc 7d 43 c7 77 b6 f7
 #### WPA: computed PMKID  - hexdump(len=16): d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 WPA: Send EAPOL(version=1 secure=0 mic=0 ack=1 install=0 pairwise=1 kde_len=22 keyidx=0 encr=0)

That's because wpa_supplicant computed the PMKID using the wrong (old)
MAC address used during the scan. wpa_supplicant updates own_addr when
the interface goes up, as the MAC can only change while the interface
is down. However, drivers don't report all interface state changes:
for example the nl80211 driver may ignore a down-up cycle if the down
message is processed later, when the interface is already up. In such
cases, wpa_supplicant (and in particular, the EAP state machine) would
continue to use the old MAC.

Add a new driver event that notifies of MAC address changes while the
interface is active.

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
7 years agoAdd definitions for RADIUS attributes standardised in RFC 7055
Alejandro Pérez Méndez [Tue, 27 Mar 2018 21:50:48 +0000 (23:50 +0200)] 
Add definitions for RADIUS attributes standardised in RFC 7055

hostap code is used by the Moonshot software (an implementation of the
GSS EAP mechanism - RFC 7055), and those definitions are required but
missing.

Signed-off-by: Alejandro Perez <alex.perez-mendez@jisc.ac.uk>
7 years agonl80211: Add DFS offload support using upstream nl80211 definitions
Dmitry Lebed [Sat, 24 Mar 2018 07:54:27 +0000 (10:54 +0300)] 
nl80211: Add DFS offload support using upstream nl80211 definitions

Add generic DFS offload support using the nl80211 feature that was
recently added to the mac80211-next tree. This uses the already
available DFS offload infrastructure that was previously used with
vendor specific definitions and just sets necessary flags (DFS_OFFLOAD
ext_feature) and forawrds CAC_STARTED event for processing.

Signed-off-by: Dmitry Lebed <lebed.dmitry@gmail.com>
7 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 30 Mar 2018 07:54:57 +0000 (10:54 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2018-03-26.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd SAR V2 power selection capability (QCA vendor attributes)
Kabilan Kannan [Thu, 22 Mar 2018 00:17:45 +0000 (17:17 -0700)] 
Add SAR V2 power selection capability (QCA vendor attributes)

Add changes to select SAR V2 power limits using the existing QCA vendor
command.

Signed-off-by: Kabilan Kannan <kabilank@codeaurora.org>
7 years agotests: sigma_dut DPP protocol testing - Stop at TX on Initiator/Enrollee
Jouni Malinen [Fri, 30 Mar 2018 07:44:38 +0000 (10:44 +0300)] 
tests: sigma_dut DPP protocol testing - Stop at TX on Initiator/Enrollee

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: GAS/ANQP and Venue URL (hostapd venue_url)
Jouni Malinen [Mon, 26 Mar 2018 13:11:54 +0000 (16:11 +0300)] 
tests: GAS/ANQP and Venue URL (hostapd venue_url)

Test the hostapd venue_url configuration parameter. In addition, fix the
previous defined gas_anqp_venue_url test case to use correct encoding of
the Venue URL ANQP-element payload (URLs were missing and Venue Number
was off-by-one).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd hostapd.conf venue_url to set Venue URL ANQP-element
Jouni Malinen [Mon, 26 Mar 2018 13:10:47 +0000 (16:10 +0300)] 
Add hostapd.conf venue_url to set Venue URL ANQP-element

The new venue_url parameter can now be used to set the Venue URL ANQP
information instead of having to construct the data and use
anqp_elem=277:<hexdump> to set the raw value.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOWE: Fix CONFIG_OWE=y build without CONFIG_IEEE80211R=y
Jouni Malinen [Mon, 26 Mar 2018 09:34:36 +0000 (12:34 +0300)] 
OWE: Fix CONFIG_OWE=y build without CONFIG_IEEE80211R=y

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFILS: Fix CONFIG_FILS=y build without CONFIG_IEEE80211R=y
Jouni Malinen [Mon, 26 Mar 2018 09:33:52 +0000 (12:33 +0300)] 
FILS: Fix CONFIG_FILS=y build without CONFIG_IEEE80211R=y

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: FILS SK using ERP and FT initial mobility domain association
Jouni Malinen [Sat, 24 Mar 2018 09:28:10 +0000 (11:28 +0200)] 
tests: FILS SK using ERP and FT initial mobility domain association

Verify use of KCK2/KEK2 and new FTE MIC calculation with FT-FILS-SHA256.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd NOTE control interface command for hostapd
Jouni Malinen [Mon, 26 Mar 2018 08:55:42 +0000 (11:55 +0300)] 
Add NOTE control interface command for hostapd

This does the same as the matching command in wpa_supplicant, i.e., add
a note in the debug log.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFILS: Add more complete support for FT-FILS use cases
Jouni Malinen [Sat, 24 Mar 2018 09:24:18 +0000 (11:24 +0200)] 
FILS: Add more complete support for FT-FILS use cases

This extends the original IEEE Std 802.11ai-2016 functionality with the
changes added in REVmd to describe how additional keys are derived to
protect the FT protocol using keys derived through FILS authentication.

This allows key_mgmt=FT-FILS-SHA256 to be used with FT protocol since
the FTE MIC can now be calculated following the changes in REVmd. The
FT-FILS-SHA384 case is still unsupported (it needs support for variable
length MIC field in FTE).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFT: Derive PMK-R1 locally if requested PMKR0Name is found
Jouni Malinen [Sat, 24 Mar 2018 16:45:42 +0000 (18:45 +0200)] 
FT: Derive PMK-R1 locally if requested PMKR0Name is found

Derive PMK-R1 locally if the derived PMKR1Name is not found from the
local cache, but the request is for a key that was originally generated
locally (R0KH-ID matches) and the PMKR0Name is found in the local cache.
This was apparently not hit in the previously used FT sequences, but
this is useful to have available if a PMK-R1 entry is dropped from the
local cache before PMK-R0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFT: Do not send PMK-R1 pull request to own R0KH address
Jouni Malinen [Sat, 24 Mar 2018 09:47:37 +0000 (11:47 +0200)] 
FT: Do not send PMK-R1 pull request to own R0KH address

If the requested key is not available locally, there is no point in
trying to send a pull request back to self for the key.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Fix PTK derivation to use KDF-SHA256
Jouni Malinen [Fri, 23 Mar 2018 15:57:14 +0000 (17:57 +0200)] 
SAE: Fix PTK derivation to use KDF-SHA256

The previous implementation ended up defaulting to using PRF-SHA1 for
deriving PTK from PMK when SAE was used. This is not correct since the
SAE AKM is defined to be using SHA-256 -based KDF instead. Fix that.

Note: This change is not backwards compatible. Both the AP and station
side implementations will need to be updated at the same time to
maintain functionality.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Fix PMKID in EAPOL-Key msg 1/4
Jouni Malinen [Fri, 23 Mar 2018 15:45:44 +0000 (17:45 +0200)] 
SAE: Fix PMKID in EAPOL-Key msg 1/4

Previously, the association that used SAE authentication ended up
recalculating the PMKID for EAPOL-Key msg 1/4 using incorrect
PMK-to-PMKID derivation instead of using the previously derived PMKID
from SAE. The correct PMKID was used only when going through PMKSA
caching exchange with a previously derived PMKSA from SAE.

Fix this by storing the SAE PMKID into the state machine entry for the
initial SAE authentication case when there is no explicit PMKSA entry
attached to the station.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Fix FT-SAE key derivation for a case where PMKID in msg 1/4 matches
Jouni Malinen [Fri, 23 Mar 2018 16:42:21 +0000 (18:42 +0200)] 
SAE: Fix FT-SAE key derivation for a case where PMKID in msg 1/4 matches

Previously, matching PMKSA cache entry ended up clearing XXKey. However,
that XXKey is needed in the specific case where FT-SAE goes through the
initial mobility domain association with SAE authentication. FT-SAE
worked previously since the hostapd side generation of the particular
PMKID value in msg 1/4 was broken, but once that PMKID is fixed,
wpa_supplicant will need this fix to allow FT-SAE to be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFix a resource leak on hostapd maclist parsing error path
Jouni Malinen [Wed, 21 Mar 2018 20:34:09 +0000 (22:34 +0200)] 
Fix a resource leak on hostapd maclist parsing error path

The open file needs to be closed in error case. The conversion to using
a new helper function (hostapd_add_acl_maclist) somehow managed to
remove the neede fclose(f) call. Bring it back to fix this.

Fixes: 3988046de538 ("hostapd: Dynamic MAC ACL management over control interface")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Overlapping BSS scan report handling no overlap
Jouni Malinen [Wed, 21 Mar 2018 15:02:15 +0000 (17:02 +0200)] 
tests: Overlapping BSS scan report handling no overlap

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDo not disable 40 MHz based on co-ex report with matching primary channel
Jouni Malinen [Wed, 21 Mar 2018 14:58:05 +0000 (16:58 +0200)] 
Do not disable 40 MHz based on co-ex report with matching primary channel

When processing 20/40 BSS Coexistence Management frames that do not
explicitly require 40 MHz to be disabled, check whether the reported
channels in 20/40 BSS Intolerant Channel Report element match the
current primary channel. If so, allow 40 MHz operation to continue. This
makes the during-operation updates for 20/40 Operation Permitted more
consistent with the scans during initial BSS startup.

The received 20/40 BSS Intolerant Channel Report channels are to be used
in the OT set in the during-operation determination and the P == OT_i
exception was ignored in the previous implementation which could result
in the AP first starting with 40 MHz and then dropping to 20 MHz on
first received 20/40 BSS Coexistence Management frame even though there
was no change in the neighboring BSSs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSupport multiple 20/40 BSS Intolerant Channel Report elements
Jouni Malinen [Wed, 21 Mar 2018 14:43:54 +0000 (16:43 +0200)] 
Support multiple 20/40 BSS Intolerant Channel Report elements

This extends 20/40 BSS Coexistence Management frame processing to
iterate over all the included 20/40 BSS Intolerant Channel Report
elements instead of using only the first one.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoIgnore intra-BSS 20/40 BSS Coexistence Management from not-associated STA
Jouni Malinen [Wed, 21 Mar 2018 14:35:15 +0000 (16:35 +0200)] 
Ignore intra-BSS 20/40 BSS Coexistence Management from not-associated STA

The 20 MHz BSS Width Request field is set to 1 only for intra-BSS
reports. As such, ignore the frame if such a claim is made by a
transmitter that is not currently associated with the AP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd more debug prints for 20/40 BSS Coexistence Management frame Rx
Jouni Malinen [Wed, 21 Mar 2018 14:32:35 +0000 (16:32 +0200)] 
Add more debug prints for 20/40 BSS Coexistence Management frame Rx

This makes it easier to understand what kind of information a STA is
reporting about 20/40 MHz coexistence requirements.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agohostapd: Ignore LOW_ACK event for co-operative steering clients
Rajkumar Manoharan [Tue, 13 Mar 2018 03:20:28 +0000 (08:50 +0530)] 
hostapd: Ignore LOW_ACK event for co-operative steering clients

Ignore hostapd_event_sta_low_ack for a station which has agreed to
steering by checking the agreed_to_steer flag. This flag will be set
whenever a station accepts the BSS transition request from the AP.
Without this ignoring of the LOW_ACK event, the steering in-progress
might be affected due to disassociation. In this way AP will allow some
time (two seconds) for the station to move away and reset the flag after
the timeout.

Co-Developed-by: Tamizh Chelvam <tamizhr@codeaurora.org>
Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
7 years agoMake STA opmode change event available to upper layers
Tamizh chelvam [Fri, 9 Mar 2018 12:49:09 +0000 (18:19 +0530)] 
Make STA opmode change event available to upper layers

Add an event callback for EVENT_STATION_OPMODE_CHANGED to allow
user/application to get the notification whenever there is a change in a
station's HT/VHT op mode.

The new events:
STA-OPMODE-MAX-BW-CHANGED <addr> <20(no-HT)|20|40|80|80+80|160>
STA-OPMODE-SMPS-MODE-CHANGED <addr> <automatic|off|dynamic|static>
STA-OPMODE-N_SS-CHANGED <addr> <N_SS>

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
7 years agonl80211: Add support for STA opmode change events
Tamizh chelvam [Fri, 9 Mar 2018 12:49:08 +0000 (18:19 +0530)] 
nl80211: Add support for STA opmode change events

The nl80211 driver can report STA_OPMODE notification event as soon as
it receives an HT/VHT Action frame about modification of station's SMPS
mode/bandwidth/RX NSS. Add support to parse such events.

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
7 years agohostapd: Add last_ack_rssi into ctrl iface cmd STA
Bhagavathi Perumal S [Tue, 6 Mar 2018 09:00:11 +0000 (14:30 +0530)] 
hostapd: Add last_ack_rssi into ctrl iface cmd STA

This allows external application to get last ACK signal strength of the
last transmitted frame if the driver makes this information
(NL80211_STA_INFO_ACK_SIGNAL) available.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
7 years agoAdd hostapd_cli poll_sta command
Bhagavathi Perumal S [Tue, 6 Mar 2018 09:00:11 +0000 (14:30 +0530)] 
Add hostapd_cli poll_sta command

This uses the already existing POLL_STA control interface to poll an
associated station to check connectivity.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
7 years agoOWE: Clean up pointer check in a testing code path
Ashok Ponnaiah [Mon, 5 Mar 2018 05:29:18 +0000 (10:59 +0530)] 
OWE: Clean up pointer check in a testing code path

Check wpa_auth_write_assoc_resp_owe() return value to keep static
analyzers happier. The code path where this could happen is not really
reachable due to the separate hapd->conf->own_ie_override check and
wpa_auth_write_assoc_resp_owe() returning NULL only in an error case in
the override path. Furthermore, clean up the pointer return value to use
a proper pointer (NULL vs. 0).

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Mon, 19 Mar 2018 17:08:15 +0000 (19:08 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2018-02-13.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: DPP Configurator reconfiguration
Jouni Malinen [Fri, 16 Mar 2018 18:43:54 +0000 (20:43 +0200)] 
tests: DPP Configurator reconfiguration

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: Support retrieving of configurator's private key
Purushottam Kushwaha [Fri, 16 Mar 2018 10:04:21 +0000 (15:34 +0530)] 
DPP: Support retrieving of configurator's private key

To retain configurator information across hostapd/wpa_supplicant
restart, private key need to be maintained to generate a valid pair of
authentication keys (connector, netaccess_key, csign) for new enrollees
in the network.

Add a DPP_CONFIGURATOR_GET_KEY control interface API through which the
private key of an existing configurator can be fetched.

Command format:
DPP_CONFIGURATOR_GET_KEY <configurator_id>

The output from this command can then be used with
"DPP_CONFIGURATOR_ADD key=<hexdump>" to create the same key again.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Fix EAPOL-Key integrity and key-wrap algorithm selection
Jouni Malinen [Fri, 16 Mar 2018 11:04:15 +0000 (13:04 +0200)] 
SAE: Fix EAPOL-Key integrity and key-wrap algorithm selection

The SAE AKM 00-0F-AC:8 is supposed to use EAPOL-Key Key Descriptor
Version 0 (AKM-defined) with AES-128-CMAC and NIST AES Key Wrap.
However, the previous implementation ended up using Key Descriptor
Version 2 (HMAC-SHA-1-128 and NIST AES Key Wrap). Fix this by using the
appropriate Key Descriptor Version and integrity algorithm. Use helper
functions to keep the selection clearer and more consistent between
wpa_supplicant and hostapd uses.

Note: This change is not backwards compatible. Both the AP and station
side implementations will need to be updated at the same time to
maintain functionality.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: DPP protocol testing - stop when transmitting Auth Conf
Jouni Malinen [Mon, 12 Mar 2018 23:04:03 +0000 (01:04 +0200)] 
tests: DPP protocol testing - stop when transmitting Auth Conf

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: Extend dpp_test 89 functionality to transmit side
Srinivas Dasari [Wed, 7 Mar 2018 11:56:26 +0000 (17:26 +0530)] 
DPP: Extend dpp_test 89 functionality to transmit side

This extends dpp_test functionality to allow DPP exchanges to be stopped
after authentication is completed on the Initiator, i.e., after sending
out the Authentication Confirm message. Previously, dpp_test=89 was used
only on the Responder side to stop after receiving the Authentication
Confirm message. The main use case for this extended functionality is to
be able to stop the protocol exchange on a device that acts as
authentication Initiator and Enrollee.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoUse correct WPA_ALG_* values to compare for enum wpa_alg
Purushottam Kushwaha [Mon, 12 Mar 2018 14:44:48 +0000 (20:14 +0530)] 
Use correct WPA_ALG_* values to compare for enum wpa_alg

enum wpa_alg was being compared with WPA_CIPHER_* values. That does not
work here and strict compilers will report this as an error. Fix the
comparision to use proper WPA_ALG_* values. This fixes testing
capability for resetting IPN for BIP.

Fixes: 16579769ff7b ("Add testing functionality for resetting PN/IPN for configured keys")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agomka: Mark ieee802_1x_kay_create_mka() ckn and cak arguments const
Jouni Malinen [Sun, 11 Mar 2018 15:04:34 +0000 (17:04 +0200)] 
mka: Mark ieee802_1x_kay_create_mka() ckn and cak arguments const

These structures are not modified or freed (i.e., only data from them is
copied), so mark the arguments const to document this a bit more clearly
now that there was a memory leak in one of the callers to this function.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_supplicant: Fix memory leaks in ieee802_1x_create_preshared_mka()
Davide Caratti [Thu, 8 Mar 2018 16:15:02 +0000 (17:15 +0100)] 
wpa_supplicant: Fix memory leaks in ieee802_1x_create_preshared_mka()

In case MKA is initialized successfully, local copies of CAK and CKN
were allocated, but never freed. Ensure that such memory is released
also when ieee802_1x_kay_create_mka() returns a valid pointer.

Fixes: ad51731abf06 ("wpa_supplicant: Allow pre-shared (CAK,CKN) pair for MKA")
Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
7 years agomka: Do not print contents of SAK to debug log
Mike Siedzik [Tue, 20 Feb 2018 19:28:40 +0000 (14:28 -0500)] 
mka: Do not print contents of SAK to debug log

Log newly generated SAKs as well as unwrapped SAKs with wpa_hexdump_key()
rather than wpa_hexdump(). By default, the wpa_hexdump_key() function
will not display sensitive key data.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
7 years agomka: Detect duplicate MAC addresses during key server election
Mike Siedzik [Tue, 20 Feb 2018 19:28:37 +0000 (14:28 -0500)] 
mka: Detect duplicate MAC addresses during key server election

In the unlikely event the local KaY and the elected peer have the same
actor priority as well as the same MAC address, log a warning message
and do not elect a key server. Resolution is for network administrator
to reconfigure MAC address.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
7 years agomka: Loss of live peers to result in connect PENDING not AUTHENTICATED
Mike Siedzik [Tue, 20 Feb 2018 19:28:34 +0000 (14:28 -0500)] 
mka: Loss of live peers to result in connect PENDING not AUTHENTICATED

When the number of live peers becomes 0 the KaY was setting
kay->authenticated true and telling the CP to connect AUTHENTICATED.
Per IEEE Std 802.1X-2010 Clause 12.2, MKA.authenticated means "the Key
Server has proved mutual authentication but has determined that
Controlled Port communication should proceed without the use of MACsec",
which means port traffic will be passed in the clear.

When the number of live peers becomes 0 the KaY must instead set
kay->authenticated false and tell the CP to connect PENDING. Per Clause
12.3 connect PENDING will "prevent connectivity by clearing the
controlledPortEnabled parameter."

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
7 years agomka: Ignore MACsec SAK Use Old Key parameter if we don't have our old key
Mike Siedzik [Tue, 20 Feb 2018 19:28:32 +0000 (14:28 -0500)] 
mka: Ignore MACsec SAK Use Old Key parameter if we don't have our old key

Upon receipt of the "MACsec MKPDU SAK Use parameter set" the KaY verifies
that both the latest key and the old key are valid. If the local system
reboots or is reinitialized, the KaY won't have a copy of its old key.
Therefore if the KaY does not have a copy of its old key it should not
reject MKPDUs that contain old key data in the MACsec SAK Use parameter.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
7 years agomka: When matching CKNs ensure that lengths are identical
Mike Siedzik [Tue, 20 Feb 2018 19:28:31 +0000 (14:28 -0500)] 
mka: When matching CKNs ensure that lengths are identical

KaY looks up participants using CAK Name (CKN). Per IEEE Std 802.1X-2010
Clause 9.3.1 CAK identification, the CKN is an integral number of
octets, between 1 and 32 (inclusive). This fix will ensure that the KaY
does not inadvertently match CKNs such as 'myCakNamedFoo' and
'myCakNamedFooBar'.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
7 years agotests: Add support for wolfSSL cryptographic library
Sean Parkinson [Thu, 18 Jan 2018 02:26:39 +0000 (12:26 +1000)] 
tests: Add support for wolfSSL cryptographic library

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agotests: Check PKCS#12 support in additional test cases
Sean Parkinson [Thu, 18 Jan 2018 02:26:39 +0000 (12:26 +1000)] 
tests: Check PKCS#12 support in additional test cases

These test cases use PKCS#12, so skip them if the build does not include
support for it.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agotests: Verify MSCHAPV2 support in eap_peap_session_resumption
Sean Parkinson [Thu, 18 Jan 2018 02:26:39 +0000 (12:26 +1000)] 
tests: Verify MSCHAPV2 support in eap_peap_session_resumption

This test case uses EAP-MSCHAPv2 within the PEAP tunnel, so verify that
the build includes support for that before running the test.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agoAdd support for wolfSSL cryptographic library
Sean Parkinson [Thu, 18 Jan 2018 02:26:39 +0000 (12:26 +1000)] 
Add support for wolfSSL cryptographic library

Allow hostapd/wpa_supplicant to be compiled with the wolfSSL
cryptography and TLS library.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agoExtend ACL check for Probe Request frames
Tamizh chelvam [Wed, 14 Feb 2018 13:43:56 +0000 (19:13 +0530)] 
Extend ACL check for Probe Request frames

Extend ACL check to deny Probe Request frames for the client which does
not pass ACL check. Skip this check for the case where RADIUS ACL is
used to avoid excessive load on the RADIUS authentication server due to
Probe Request frames. This patch add wpa_msg event for auth and assoc
rejection due to acl reject.

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
7 years agoAdd new WiFi test config attributes to configure BA params
Kiran Kumar Lokere [Tue, 27 Feb 2018 03:23:04 +0000 (19:23 -0800)] 
Add new WiFi test config attributes to configure BA params

Define a new WiFi test configuration attributes in QCA vendor
command to configure BA session parameters and to add or
delete a BA session and to configure no ack policy.
This is used for configuring the testbed device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd new WiFi test config attribute to allow WEP/TKIP in HE
Kiran Kumar Lokere [Tue, 27 Feb 2018 02:54:37 +0000 (18:54 -0800)] 
Add new WiFi test config attribute to allow WEP/TKIP in HE

Define a new WiFi test configuration attribute in QCA vendor
command to allow or not to allow WEP/TKIP in HT/VHT/HE mode.
This is used for configuring the testbed device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFILS: Check kde more consistently to avoid static analyzer warnings
Jeffin Mammen [Fri, 2 Mar 2018 19:10:38 +0000 (21:10 +0200)] 
FILS: Check kde more consistently to avoid static analyzer warnings

For FILS, __wpa_send_eapol() is called only with the kde != NULL, but a
static analyzer might not understand that. Add an explicit check kde !=
NULL similarly to the other cases going through the kde parameter to
silence such bogus warnings.

Signed-off-by: Jeffin Mammen <jmammen@codeaurora.org>
7 years agoSAE: Debug print group support in the crypto library
Jouni Malinen [Fri, 2 Mar 2018 10:29:30 +0000 (12:29 +0200)] 
SAE: Debug print group support in the crypto library

This makes it easier to understand why "SAE: Failed to select group"
debug entry shows up in cases the selected crypto library does not
support a specific group.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Fix potential infinite loop in mismatching PMK case on AP
Jouni Malinen [Fri, 2 Mar 2018 10:13:16 +0000 (12:13 +0200)] 
SAE: Fix potential infinite loop in mismatching PMK case on AP

Commit e61fea6b467bec0702096c795b06195584d32a6c ('SAE: Fix PMKSA caching
behavior in AP mode') modified the PSK fetching loop to not override PMK
in case of SAE with PMKSA caching. However, that commit missed the error
path cases where there is need to break from the loop with exact
negative of the check in the beginning of the loop. This could result in
hitting an infinite loop in hostapd if a station derived a different PMK
value from otherwise successfully completed SAE authentication or if a
STA used a different PMK with a PMKSA caching attempt after a previously
completed successful authentication.

Fix this by adding the matching break condition on SAE AKM within the
loops.

Fixes: e61fea6b467b ("SAE: Fix PMKSA caching behavior in AP mode")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoReject eap_server_erp hostapd.conf parameter without CONFIG_ERP=y
Jouni Malinen [Wed, 28 Feb 2018 11:09:07 +0000 (13:09 +0200)] 
Reject eap_server_erp hostapd.conf parameter without CONFIG_ERP=y

This provides an explicit error report if runtime configuration is not
valid and ERP server functionality cannot be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Improve QR Code scanning with zxing
Jouni Malinen [Fri, 23 Feb 2018 14:29:05 +0000 (16:29 +0200)] 
wpadebug: Improve QR Code scanning with zxing

Set SCAN_MODE to accept only QR Codes and close the scanner more
reliably after a successfully scanned QR Code.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Add activity to select method for QR Code scanning
Anurag Das [Fri, 23 Feb 2018 10:14:02 +0000 (15:44 +0530)] 
wpadebug: Add activity to select method for QR Code scanning

Add QrCodeReadActivity that makes a decision to select between InputUri
and QrCodeScannerActivity depending on the availability of the camera in
the device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Close InputUri activity automatically on DPP URI completion
Jouni Malinen [Thu, 22 Feb 2018 12:40:47 +0000 (14:40 +0200)] 
wpadebug: Close InputUri activity automatically on DPP URI completion

Check the entered text and stop automatically at the end of full DPP
URI.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Add main screen buttons for QR Code operations
Jouni Malinen [Thu, 22 Feb 2018 12:20:10 +0000 (14:20 +0200)] 
wpadebug: Add main screen buttons for QR Code operations

These can be used for manual testing of the DPP QR Code functionality.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: A dialog activity to input the URI from QR Code Scanner
Anurag Das [Wed, 21 Feb 2018 12:35:33 +0000 (18:05 +0530)] 
wpadebug: A dialog activity to input the URI from QR Code Scanner

This should help to read the URI from the QR Code Scanner's (USB HID
devices instead of USB video device) that decodes the QR Code.
This dialog box provisions the mechanism to enter the decoded
URI code from such hardware devices.

This dialog can be used with:
am start -n w1.fi.wpadebug/w1.fi.wpadebug.InputUri

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Update default project target to android-22
Jouni Malinen [Thu, 22 Feb 2018 10:22:12 +0000 (12:22 +0200)] 
wpadebug: Update default project target to android-22

This matches the current zxing target level and as such, is more likely
to be installed on devices that build wpadebug.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Suite B tests with BoringSSL
Jouni Malinen [Fri, 16 Feb 2018 15:15:57 +0000 (17:15 +0200)] 
tests: Suite B tests with BoringSSL

Enable appropriate Suite B test cases with BoringSSL. Currently, this
means enabling only the 192-bit level ECDSA and ECDHE-RSA since
BoringSSL has removed support for DHE and there is no need to support
128-bit level ECDSA anymore.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoBoringSSL: Set appropriate sigalgs for Suite B RSA 3K cases
Jouni Malinen [Mon, 19 Feb 2018 14:37:36 +0000 (16:37 +0200)] 
BoringSSL: Set appropriate sigalgs for Suite B RSA 3K cases

This commit takes care of the sigalg configuration using the relatively
recent SSL_CTX_set_verify_algorithm_prefs() addition from April 2017 to
address the functionality that was already there with OpenSSL using
SSL_set1_sigalgs_list().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoBoringSSL: Map OpenSSL SUITEB192 cipher into appropriate sigalgs
Jouni Malinen [Mon, 19 Feb 2018 14:25:54 +0000 (16:25 +0200)] 
BoringSSL: Map OpenSSL SUITEB192 cipher into appropriate sigalgs

BoringSSL removed the special OpenSSL cipher suite value "SUITEB192", so
need to map that to the explicit ciphersuite
(ECDHE-ECDSA-AES256-GCM-SHA384), curve (P-384), and sigalg
(SSL_SIGN_ECDSA_SECP384R1_SHA384) to allow 192-bit level Suite B with
ECDSA to be used.

This commit takes care of the sigalg configuration using the relatively
recent SSL_CTX_set_verify_algorithm_prefs() addition from April 2017.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoBoringSSL: Map OpenSSL SUITEB192 cipher into appropriate parameters
Jouni Malinen [Fri, 16 Feb 2018 15:14:16 +0000 (17:14 +0200)] 
BoringSSL: Map OpenSSL SUITEB192 cipher into appropriate parameters

BoringSSL removed the special OpenSSL cipher suite value "SUITEB192", so
need to map that to the explicit ciphersuite
(ECDHE-ECDSA-AES256-GCM-SHA384), curve (P-384), and sigalg
(SSL_SIGN_ECDSA_SECP384R1_SHA384) to allow 192-bit level Suite B with
ECDSA to be used.

This commit takes care of the ciphersuite and curve configuration.
sigalg change is in a separate commit since it requires a newer
BoringSSL API function that may not be available in all builds.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOpenSSL: Replace SSL_set1_curves_list() with SSL_set1_curves()
Jouni Malinen [Mon, 19 Feb 2018 14:00:19 +0000 (16:00 +0200)] 
OpenSSL: Replace SSL_set1_curves_list() with SSL_set1_curves()

In practice, this does the same thing (i.e., allows only the P-384 curve
to be used), but using an older API function that happens to be
available in some BoringSSL builds while the newer one is not.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Processing of truncated RSNE fields
Jouni Malinen [Fri, 16 Feb 2018 11:55:38 +0000 (13:55 +0200)] 
tests: Processing of truncated RSNE fields

Verify that truncated RSN Capabilities field and PMKIDCount field get
ignored.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Fix Permission denied on Fedora
Masashi Honma [Sat, 30 Dec 2017 20:35:28 +0000 (05:35 +0900)] 
tests: Fix Permission denied on Fedora

On Fedora 26, start.sh fails with these error messages.

Failed to connect to wpa_supplicant global interface: /tmp/wpas-wlan0  error: Permission denied
Failed to connect to wpa_supplicant global interface: /tmp/wpas-wlan0  error: Permission denied
...

This is because Fedora 26 uses "wheel" group as administrative group.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agoAllow HT40 on 5 GHz channels 165 and 169
Ben Greear [Wed, 3 Jan 2018 18:53:53 +0000 (10:53 -0800)] 
Allow HT40 on 5 GHz channels 165 and 169

India supports 5 GHz channels 169 and 173 now. Enable HT40 across
channels 165 and 169. Leave channel 173 to remain HT20 only.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agonl80211: Use the new NL80211_MFP_OPTIONAL option
Emmanuel Grumbach [Thu, 1 Feb 2018 14:21:57 +0000 (16:21 +0200)] 
nl80211: Use the new NL80211_MFP_OPTIONAL option

Now we can configure the network block so that it allows MFP setting for
the NL80211_CMD_CONNECT command. If the kernel finds an AP that requires
MFP, it'll be able to connect to it.

Note that since NL80211_MFP_OPTIONAL isn't supported for
NL80211_CMD_ASSOCIATE, we need to take the MFP configuration outside
nl80211_connect_common(). In addition, check that
NL80211_EXT_FEATURE_MFP_OPTIONAL is supported, to be backward compatible
with older kernels.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
7 years agowpa_supplicant: Handle port authorized event
Avraham Stern [Sun, 28 Jan 2018 12:45:37 +0000 (14:45 +0200)] 
wpa_supplicant: Handle port authorized event

When the driver indicates that the connection is authorized (i.e., the
4-way handshake was completed by the driver), cancel the EAP
authentication timeout and set the EAP state machine to success state.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agonl80211: Handle port authorized event
Avraham Stern [Sun, 28 Jan 2018 12:45:36 +0000 (14:45 +0200)] 
nl80211: Handle port authorized event

Indicate that the connection is authorized when receiving a port
authorized event from the driver.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agodriver: Add port authorized event
Avraham Stern [Sun, 28 Jan 2018 12:45:35 +0000 (14:45 +0200)] 
driver: Add port authorized event

Add an event that indicates that the 4 way handshake was completed by
the driver.

This event is useful for networks that require 802.1X authentication.
The driver can use this event that a new connection is already
authorized (e.g. when the driver used PMKSA caching) and 802.1X
authentication is not required.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agonl80211: Add API to set the PMK to the driver
Avraham Stern [Sun, 28 Jan 2018 12:45:34 +0000 (14:45 +0200)] 
nl80211: Add API to set the PMK to the driver

Add support for setting the PMK to the driver. This is used for
drivers that support 4-way handshake offload.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agonl80211: Check 4-way handshake offload support
Eliad Peller [Sun, 28 Jan 2018 12:45:33 +0000 (14:45 +0200)] 
nl80211: Check 4-way handshake offload support

Set the WPA_DRIVER_FLAGS_4WAY_HANDSHAKE flag if the driver indicates
both 4-way handshake PSK and 802.1X support. Currently wpa_supplicant
doesn't distinguish between 4-way handshake for 802.1X and PSK, but
nl80211 API has different capabilities for each one.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 years agonl80211: Support passing PSK on connect
Eliad Peller [Sun, 28 Jan 2018 12:45:32 +0000 (14:45 +0200)] 
nl80211: Support passing PSK on connect

If the driver advertises WPA_DRIVER_FLAGS_4WAY_HANDSHAKE support, pass
the PSK on connect.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
7 years agotests: Add option --dbus for logging D-Bus messages
Vasyl Vavrychuk [Mon, 12 Feb 2018 19:26:10 +0000 (21:26 +0200)] 
tests: Add option --dbus for logging D-Bus messages

Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
7 years agotests: Document building of hostapd_cli for hwsim builds
Vasyl Vavrychuk [Mon, 12 Feb 2018 19:24:10 +0000 (21:24 +0200)] 
tests: Document building of hostapd_cli for hwsim builds

This is used in the tests, too, and was already covered by the build.sh
script, but not this README file.

Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
7 years agowpa_passphrase: Include $(LIBS) for linking
Arkadiusz Drabczyk [Tue, 13 Feb 2018 22:49:08 +0000 (23:49 +0100)] 
wpa_passphrase: Include $(LIBS) for linking

wpa_passphrase requires libcrypto from OpenSSL (or another selected
library). User can set an alternative path to OpenSSL libraries by
defining LIBS at the top of .config but if $(LIBS) is not actually used
wrong libcrypto is used or compilation fails if there is no libcrypto in
the default locations cc is looking for it. It's especially bad for
cross-compilers that fail with 'cannot find -lcrypto' message.

Signed-off-by: Arkadiusz Drabczyk <arkadiusz@drabczyk.org>
7 years agoDPP: Do not include common/dpp.h without CONFIG_DPP=y
Jouni Malinen [Sat, 17 Feb 2018 16:07:43 +0000 (18:07 +0200)] 
DPP: Do not include common/dpp.h without CONFIG_DPP=y

This header file pulls in an OpenSSL header file and as such, should not
be included without CONFIG_DPP=y to avoid bringing in an unnecessary
build dependency on OpenSSL header files.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoDefine host_to_le64() for Windows builds
Jouni Malinen [Sat, 17 Feb 2018 16:04:54 +0000 (18:04 +0200)] 
Define host_to_le64() for Windows builds

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix a typo in disassoc_low_ack documentation
Jouni Malinen [Sat, 17 Feb 2018 15:59:27 +0000 (17:59 +0200)] 
Fix a typo in disassoc_low_ack documentation

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: wpa_supplicant AP mode - open network with client isolation
Jouni Malinen [Sat, 17 Feb 2018 15:57:45 +0000 (17:57 +0200)] 
tests: wpa_supplicant AP mode - open network with client isolation

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd ap_isolate configuration option for wpa_supplicant AP mode
Danilo Ravotto [Thu, 1 Feb 2018 11:09:38 +0000 (12:09 +0100)] 
Add ap_isolate configuration option for wpa_supplicant AP mode

Allow client isolation to be configured with ap_isolate inside
wpa_supplicant configuration file.

Signed-off-by: Danilo Ravotto <danilo.ravotto@zirak.it>
7 years agotests: Fix dbus_set_global_properties failure if run twice
Jouni Malinen [Sat, 17 Feb 2018 15:41:57 +0000 (17:41 +0200)] 
tests: Fix dbus_set_global_properties failure if run twice

Clear the model_name parameter back to the default (empty string) at the
beginning and the end of dbus_set_global_properties to avoid failures if
the test case is run multiple times.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Make dbus_p2p_discovery more robust
Jouni Malinen [Sat, 17 Feb 2018 15:21:05 +0000 (17:21 +0200)] 
tests: Make dbus_p2p_discovery more robust

Ignore any unexpected deviceLost event before the peer devices has been
discovered. This works around issues where the previous test case
terminates before the D-Bus events have been fully delivered. This could
happen, e.g., when running dbus_p2p_discovery twice in a row.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoExtend APF interface for read/write and enable/disable ops
Vamsi Krishna [Fri, 12 Jan 2018 07:12:58 +0000 (12:42 +0530)] 
Extend APF interface for read/write and enable/disable ops

Enhance QCA vendor specific APF interface to support write/read program
and/or data and to enable/disable APF feature.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOpenSSL: Fix EAP-FAST with OpenSSL 1.1.1-pre1
Jouni Malinen [Wed, 14 Feb 2018 10:40:33 +0000 (12:40 +0200)] 
OpenSSL: Fix EAP-FAST with OpenSSL 1.1.1-pre1

TLS v1.3 needs to be explicitly disabled to allow cipher suite selection
for EAP-FAST to work with OpenSSL builds that include TLS v1.3 support.
Without this, OpenSSL refuses to generate ClientHello due to the cipher
suite list including only ciphers allowed with older versions than TLS
v1.3.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: sigma_dut controlled STA as DPP PKEX responder and error case
Jouni Malinen [Mon, 12 Feb 2018 22:24:50 +0000 (00:24 +0200)] 
tests: sigma_dut controlled STA as DPP PKEX responder and error case

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOWE: Add testing RSNE for OWE assoc response with driver SME/MLME
Ashok Ponnaiah [Mon, 12 Feb 2018 11:57:12 +0000 (17:27 +0530)] 
OWE: Add testing RSNE for OWE assoc response with driver SME/MLME

Allow RSNE to be overwritten for testing purposes also in the
driver-based SME/MLME case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: Use wildcard BSSID in GAS query frames
Jouni Malinen [Sat, 10 Feb 2018 10:42:00 +0000 (12:42 +0200)] 
DPP: Use wildcard BSSID in GAS query frames

Force use of the wildcard BSSID address in GAS query frames with DPP
regardless of how the gas_address3 configuration parameter is set. DPP
specification mandates this and the use of GAS here is really outside
the context of a BSS, so using the wildcard BSSID makes sense even for
the corner case of Configurator running on a known AP (where IEEE 802.11
standard would allow the BSSID of the AP to be used).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agonl80211: Do not try to add too large NL80211_ATTR_PMK for set/del PMKSA
Jouni Malinen [Sat, 10 Feb 2018 10:16:53 +0000 (12:16 +0200)] 
nl80211: Do not try to add too large NL80211_ATTR_PMK for set/del PMKSA

The current cfg80211 limit for the maximum NL80211_ATTR_PMK length is
48, so anything larger than that will result in the operation completely
failing. Since the PMKSA entries can be used without the PMK for most
purposes (the main use case for PMK currently is offloaded FILS
authentication), try to go ahead by configuring only the PMKID for the
case where 64-octet PMK is needed (which is currently limited to only
DPP with NIST P-521 and brainpoolP512r1 curves). This can fix DPP
connections with drivers that expect to get the PMKID through this
interface while still leaving the actual 4-way handshake for user space.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agonl80211: Print NL80211_CMD_{SET,DEL}_PMKSA failures in debug log
Jouni Malinen [Sat, 10 Feb 2018 10:10:07 +0000 (12:10 +0200)] 
nl80211: Print NL80211_CMD_{SET,DEL}_PMKSA failures in debug log

This makes it easier to notice if the driver operation to manage PMKSA
cache information fails unexpectedly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Add support for QR Code scanning and display via zxing
Purushottam Kushwaha [Tue, 30 Jan 2018 15:05:46 +0000 (20:35 +0530)] 
wpadebug: Add support for QR Code scanning and display via zxing

Enhance wpadebug application to support scanning and displaying of QR
codes. This depends on a third-party source: zxing
(https://github.com/zxing/zxing).

Shell command to launch scanner/viewer via wpadebug is:
>adb root
>adb shell

Scanner:
>am start -n w1.fi.wpadebug/w1.fi.wpadebug.QrCodeScannerActivity
Viewer:
>am start -n w1.fi.wpadebug/w1.fi.wpadebug.QrCodeDisplayActivity

QR code string input/output file would be generated in
'/sdcard/wpadebug_qrdata.txt' in the device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: MAC ACL accept/deny management
Jouni Malinen [Wed, 7 Feb 2018 17:45:32 +0000 (19:45 +0200)] 
tests: MAC ACL accept/deny management

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agohostapd: Dynamic MAC ACL management over control interface
Tamizh chelvam [Thu, 11 Jan 2018 09:59:03 +0000 (15:29 +0530)] 
hostapd: Dynamic MAC ACL management over control interface

Previously, MAC ACL could be modified only through file operations
(modify accept/deny_mac_file and reload it to hostapd). Extend this to
allow MAC ACL to be modified and displayed through new control interface
commands:

ACCEPT_ACL <subcmd> [argument]
DENY_ACL <subcmd> [argument]

subcmd: ADD_MAC <addr>[ VLAN_ID=<id>]|DEL_MAC <addr>|SHOW|CLEAR

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
7 years agoDPP: Fix GAS query removal race condition on DPP_STOP_LISTEN
Jouni Malinen [Wed, 7 Feb 2018 16:03:58 +0000 (18:03 +0200)] 
DPP: Fix GAS query removal race condition on DPP_STOP_LISTEN

If a DPP_STOP_LISTEN call happens to be received when there is a pending
gas-query radio work that has not yet been started, it was possible for
gas_query_stop() to go through gas_query_done() processing with
gas->work == NULL and that ended up with the pending GAS query getting
freed without removing the pending radio work that hold a reference to
the now freed memory. Fix this by removing the pending non-started radio
work for the GAS query in this specific corner case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Make dpp_qr_code_curve_select more robust
Jouni Malinen [Wed, 7 Feb 2018 15:09:20 +0000 (17:09 +0200)] 
tests: Make dpp_qr_code_curve_select more robust

Wait for the configuration exchange to complete before issuing the
DPP_STOP_LISTEN command to avoid confusing sequence of operation between
the ongoing and immediately following DPP exchanges.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: DPP and PKEX on 5 GHz
Jouni Malinen [Wed, 7 Feb 2018 14:58:52 +0000 (16:58 +0200)] 
tests: DPP and PKEX on 5 GHz

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>