]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agoSAE-PK: Make no-KEK debug prints distinct
Jouni Malinen [Fri, 31 Jul 2020 16:59:52 +0000 (19:59 +0300)] 
SAE-PK: Make no-KEK debug prints distinct

Debug logs did not make it clear whether the failure happens when
checking a received SAE confirm or when writing own SAE confirm. Those
cases have different checks on when to go through SAE-PK processing, so
it is useful to make this part clear in the debug log.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Skip sigma_dut_dpp_qr_resp_11 if dpp-ca.py does not exist
Jouni Malinen [Fri, 31 Jul 2020 07:09:33 +0000 (10:09 +0300)] 
tests: Skip sigma_dut_dpp_qr_resp_11 if dpp-ca.py does not exist

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Report negotiated connection handover result
Jouni Malinen [Thu, 30 Jul 2020 22:23:39 +0000 (01:23 +0300)] 
dpp-nfc: Report negotiated connection handover result

Print out a summary of the result in yellow text.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Stop only_one run after failed handover attempt
Jouni Malinen [Thu, 30 Jul 2020 22:09:31 +0000 (01:09 +0300)] 
dpp-nfc: Stop only_one run after failed handover attempt

Do not require connection handover to succeed before stopping the loop
in the only_one case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Do not indicate no initial HS as failure if alt HR will be sent
Jouni Malinen [Thu, 30 Jul 2020 21:48:46 +0000 (00:48 +0300)] 
dpp-nfc: Do not indicate no initial HS as failure if alt HR will be sent

Do not use red color for the "No response receive" message in case
another HR will be sent after this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Improved version of HandoverServer::serve()
Jouni Malinen [Thu, 30 Jul 2020 21:38:42 +0000 (00:38 +0300)] 
dpp-nfc: Improved version of HandoverServer::serve()

Fix processing of the case where no handover select is sent out and add
automatic (delayed) termination of the link on completing the handover
successfully.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Stop process after successful handover client completion
Jouni Malinen [Thu, 30 Jul 2020 21:16:12 +0000 (00:16 +0300)] 
dpp-nfc: Stop process after successful handover client completion

terminate_now was not being set in the only_one case with connection
handover. Set it for that case as well as the tag cases to automatically
close down the link once it is not needed anymore.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Optimize HandoverClient message receiving for alternative HR case
Jouni Malinen [Thu, 30 Jul 2020 20:51:30 +0000 (23:51 +0300)] 
dpp-nfc: Optimize HandoverClient message receiving for alternative HR case

Use a shorter polling interval in recv_octets() to be able to send out
the alternative HR more quickly when using a single thread and handover
client. In addition, fix recv_records() to handle normal exception cases
like not receiving anything.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Use a single handover client thread
Jouni Malinen [Thu, 30 Jul 2020 20:29:18 +0000 (23:29 +0300)] 
dpp-nfc: Use a single handover client thread

Avoid extra complexity from use a separate thread to send out the
alternative proposal.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Add a class for maintaining connection handover state
Jouni Malinen [Thu, 30 Jul 2020 17:58:08 +0000 (20:58 +0300)] 
dpp-nfc: Add a class for maintaining connection handover state

This cleans up the shared state between the handover server and client.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Reuse the same handover client for alternative URI
Jouni Malinen [Thu, 30 Jul 2020 14:09:56 +0000 (17:09 +0300)] 
dpp-nfc: Reuse the same handover client for alternative URI

Postpone closing of the handover client to allow the same client to be
used for sending both handover request messages if an alternative URI
needs to be tried.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Add peer URI into the HS in testing mode
Jouni Malinen [Thu, 30 Jul 2020 17:35:10 +0000 (20:35 +0300)] 
dpp-nfc: Add peer URI into the HS in testing mode

This makes it easier to confirm that the correct pair of the HR and the
HS were used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Enable more verbose nfcpy debugging
Jouni Malinen [Thu, 30 Jul 2020 13:49:40 +0000 (16:49 +0300)] 
dpp-nfc: Enable more verbose nfcpy debugging

Set logging level to various upper layer nfcpy modules to enable more
detailed debugging of the actual NFC operations when requested (-d on
the command line).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: AES-CTR encrypt test vectors
Jouni Malinen [Thu, 30 Jul 2020 10:52:14 +0000 (13:52 +0300)] 
tests: AES-CTR encrypt test vectors

Verify AES-CTR encryption implementation against the test vectors in
NIST SP 800-38a. This implementations was already tested against AES SIV
and EAX mode test vectors, but this adds more explicit testing against
published CTR mode test vectors.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Skip P2P management interfaces
Jouni Malinen [Thu, 30 Jul 2020 09:51:56 +0000 (12:51 +0300)] 
dpp-nfc: Skip P2P management interfaces

Do not try to perform DPP operations on the P2P management interface
when no specific interface has been identified.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut DPP Configurator reporting MUD URL
Jouni Malinen [Tue, 28 Jul 2020 13:44:41 +0000 (16:44 +0300)] 
tests: sigma_dut DPP Configurator reporting MUD URL

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Ignore (no) response to initial handover request
Jouni Malinen [Fri, 24 Jul 2020 09:46:20 +0000 (12:46 +0300)] 
dpp-nfc: Ignore (no) response to initial handover request

If an alternative proposal (second handover request) is sent, the
response (or lack of it) to the initial handover request should be
ignored.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Do not allow more than one alternative channel proposal
Jouni Malinen [Thu, 23 Jul 2020 21:51:49 +0000 (00:51 +0300)] 
dpp-nfc: Do not allow more than one alternative channel proposal

This avoids potential loops of endless alternative URI exchanges over
NFC negotiated connection handover. Only allow one such alternative
proposal and declarare the handover as a failure if another alternative
were needed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Add test mode for negotiated connection handover
Jouni Malinen [Thu, 23 Jul 2020 21:30:38 +0000 (00:30 +0300)] 
dpp-nfc: Add test mode for negotiated connection handover

Allow all actual DPP processing steps in wpa_supplicant to be skipped by
specifying hardcoded URI values. Also allow a hardcoded crn to be
specified to force specific handover requestor/selector roles.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoUpdate documentation for vendor attributes to ignore BSSIDs during roaming
Jouni Malinen [Fri, 24 Jul 2020 09:23:56 +0000 (12:23 +0300)] 
Update documentation for vendor attributes to ignore BSSIDs during roaming

Replace some of the "blacklist" term to reduce undesired connotations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRename driver op for temporarily disallowed BSSIDs
Jouni Malinen [Fri, 24 Jul 2020 09:13:19 +0000 (12:13 +0300)] 
Rename driver op for temporarily disallowed BSSIDs

Use the "tmp_disallow" name more consistently so that both the core
wpa_supplicant functionality (struct wpa_bss_tmp_disallowed) and the
wpa_driver_ops callback have more similar names.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFT: Rename temporary blocking of nonresponsive R0KH
Jouni Malinen [Fri, 24 Jul 2020 09:02:11 +0000 (12:02 +0300)] 
FT: Rename temporary blocking of nonresponsive R0KH

Avoid use of the "blacklist" term here to reduce undesired connotations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP Configurator enrolling followed by use of the new Configurator
Jouni Malinen [Thu, 23 Jul 2020 14:34:15 +0000 (17:34 +0300)] 
tests: DPP Configurator enrolling followed by use of the new Configurator

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Fix auth termination after receiving Configurator backup
Jouni Malinen [Thu, 23 Jul 2020 14:57:28 +0000 (17:57 +0300)] 
DPP2: Fix auth termination after receiving Configurator backup

remove_on_tx_status needs to be set in this case even if
dpp_config_processing=2 is used since there will be no connection
attempt when receiving a Configurator backup instead of station config
object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Return failure status if operation fails
Jouni Malinen [Thu, 23 Jul 2020 09:26:46 +0000 (12:26 +0300)] 
dpp-nfc: Return failure status if operation fails

For now, this is done only for the case where the NFC Device is not
usable and if writing a single tag fails.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Add color and details for interactive operations
Jouni Malinen [Thu, 23 Jul 2020 09:10:26 +0000 (12:10 +0300)] 
dpp-nfc: Add color and details for interactive operations

Make the debug output easier to read when performing interactive NFC
operations on a device that has a terminal showing the log.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Fix regression in NFC Tag writing
Jouni Malinen [Thu, 23 Jul 2020 08:32:21 +0000 (11:32 +0300)] 
dpp-nfc: Fix regression in NFC Tag writing

The change to checking DPP_LISTEN return value ended up overwriting the
actual URI information from wpas_get_nfc_uri().

Fixes: 288c0ffaaa27 ("dpp-nfc: Do not hardcode netrole for NFC Tag writing cases")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Detect a non-NDEF tag when trying to write
Jouni Malinen [Thu, 23 Jul 2020 08:27:27 +0000 (11:27 +0300)] 
dpp-nfc: Detect a non-NDEF tag when trying to write

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Do not hardcode netrole for NFC Tag writing cases
Jouni Malinen [Wed, 22 Jul 2020 22:30:30 +0000 (01:30 +0300)] 
dpp-nfc: Do not hardcode netrole for NFC Tag writing cases

Allow netrole to be specified for NFC Tag writing cases. Previously,
this was hardcoded to use netrole=configurator when starting the listen
operation. Now the netrole parameter is not included by default, but any
netrole value can be specified with the new --netrole command line
argument.

In addition, fix the listening frequency for the case where a channel is
picked.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attribute to configure QoS/AC upgrade for UDP frames
Sunil Dutt [Fri, 26 Jun 2020 12:17:13 +0000 (17:47 +0530)] 
Vendor attribute to configure QoS/AC upgrade for UDP frames

Introduce a new attribute QCA_WLAN_VENDOR_ATTR_CONFIG_UDP_QOS_UPGRADE
to configure access category override for UDP frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd a vendor command to fetch the currently enabled band(s)
Sunil Dutt [Fri, 26 Jun 2020 12:15:52 +0000 (17:45 +0530)] 
Add a vendor command to fetch the currently enabled band(s)

Introduces a vendor command to get the currently enabled band(s)
through QCA_NL80211_VENDOR_SUBCMD_GETBAND.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor command to configure TWT
Sunil Dutt [Thu, 25 Jun 2020 10:49:27 +0000 (16:19 +0530)] 
Vendor command to configure TWT

This commit defines a new vendor interface
QCA_NL80211_VENDOR_SUBCMD_CONFIG_TWT to configure TWT.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEnhance the qca_set_band enum values to be used as a bitmap
Sunil Dutt [Thu, 18 Jun 2020 08:17:14 +0000 (13:47 +0530)] 
Enhance the qca_set_band enum values to be used as a bitmap

Also introduce a new attribute QCA_WLAN_VENDOR_ATTR_SETBAND_MASK to
carry this new bitmask enum. This attribute shall consider the bitmask
combinations to define the respective band combinations and substitutes
QCA_WLAN_VENDOR_ATTR_SETBAND_VALUE. The old attribute use remains same
as before.

In addition, document the previously undocumented, but defined,
QCA_NL80211_VENDOR_SUBCMD_SETBAND.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Fix sending proper VLAN ID attr value when using VLAN offload
Seevalamuthu Mariappan [Thu, 11 Jun 2020 11:37:35 +0000 (17:07 +0530)] 
nl80211: Fix sending proper VLAN ID attr value when using VLAN offload

The NL80211_ATTR_VLAN_ID attribute expects non-zero values, but vlan_id
with value 0 has been set in VLAN offload case. Due to this, station
connection failure is observed if the driver advertises VLAN_OFFLOAD
support:

nl80211: NL80211_ATTR_STA_VLAN (addr=8c:fd:f0:22:19:15 ifname=wlan0
         vlan_id=0) failed: -34 (Result not representable)
wlan0: STA 8c:fd:f0:22:19:15 IEEE 802.11: could not bind the STA
         entry to vlan_id=0

Fix this by setting only non-zero values.

Fixes: 0f903f37dca1 ("nl80211: VLAN offload support")
Signed-off-by: Seevalamuthu Mariappan <seevalam@codeaurora.org>
5 years agoFix enabling 40/80 MHz bandwidth support in the 6 GHz band
Pradeep Kumar Chitrapu [Tue, 16 Jun 2020 07:57:58 +0000 (00:57 -0700)] 
Fix enabling 40/80 MHz bandwidth support in the 6 GHz band

40/80 MHz bandwidth setting was being rejected due to incorrect sanity
check on the channel index. Fix that for the bandwidths larger than 20
MHz.

Fixes: d7c2c5c98c4f ("AP: Add initial support for 6 GHz band")
Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
5 years agomesh: Fix peer link counting when removing a mesh peer
Yu Wang [Tue, 7 Jul 2020 18:18:47 +0000 (02:18 +0800)] 
mesh: Fix peer link counting when removing a mesh peer

When removing a mesh peer with control interface commands (ACCEPT_ACL
DEL_MAC/DENY_ACL ADD_MAC/MESH_PEER_REMOVE) the plink count was not
decreased from its last connection. This resulted in peer link count
leakage and wpa_supplicant rejecting the connections after reaching
max_peer_links (default: 99).

Fix this by decreasing the plink count when removing a mesh peer which
is in PLINK_ESTAB state.

Signed-off-by: Yu Wang <yyuwang@codeaurora.org>
5 years agotests: sigma_dut client privacy
Jouni Malinen [Fri, 26 Jun 2020 19:50:13 +0000 (22:50 +0300)] 
tests: sigma_dut client privacy

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut DPP reconfiguration
Jouni Malinen [Fri, 26 Jun 2020 18:06:12 +0000 (21:06 +0300)] 
tests: sigma_dut DPP reconfiguration

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Make sure dpp_auth gets cleared with external config processing
Jouni Malinen [Fri, 26 Jun 2020 17:50:23 +0000 (20:50 +0300)] 
DPP2: Make sure dpp_auth gets cleared with external config processing

wpa_s->dpp_auth did not get cleaner if dpp_config_processing=1 is used.
Clear this after having received TX status for Configuration Result to
avoid leaving behind the completed provisioning instance.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Do not allow reconfiguration to be started with pending auth
Jouni Malinen [Fri, 26 Jun 2020 17:40:40 +0000 (20:40 +0300)] 
DPP2: Do not allow reconfiguration to be started with pending auth

The pending authentication exchange will make us ignore Reconfig
Authentication Request, so do not allow reconfiguration to be started in
that state.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Debug print reason for rejecting reconfiguration
Jouni Malinen [Fri, 26 Jun 2020 17:37:30 +0000 (20:37 +0300)] 
DPP2: Debug print reason for rejecting reconfiguration

This makes it easier to understand why Reconfig Authentication Request
gets ignored.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut SAE-PK AP with additional SAE_PK_KeyPair values
Jouni Malinen [Wed, 24 Jun 2020 22:20:06 +0000 (01:20 +0300)] 
tests: sigma_dut SAE-PK AP with additional SAE_PK_KeyPair values

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE-PK password minimum length
Jouni Malinen [Wed, 24 Jun 2020 22:19:51 +0000 (01:19 +0300)] 
tests: SAE-PK password minimum length

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Fix password validation check for Sec
Jouni Malinen [Wed, 24 Jun 2020 22:18:30 +0000 (01:18 +0300)] 
SAE-PK: Fix password validation check for Sec

The 0..3 value decoded from the password was not incremented to the
actual 2..5 range for Sec. This resulted in not properly detecting the
minimum password length.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Fix SAE-PK password module tests
Jouni Malinen [Wed, 24 Jun 2020 22:38:50 +0000 (01:38 +0300)] 
tests: Fix SAE-PK password module tests

Couple of the test values were not actually valid, so remove them.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Fix connection handover renegotiation
Jouni Malinen [Wed, 24 Jun 2020 19:37:52 +0000 (22:37 +0300)] 
dpp-nfc: Fix connection handover renegotiation

The use of the alternative channel list did not work properly for the
case were both ends were trying to initiate the negotiated connection
handover. Fix this by always starting a new connection handover client
thread for sending the alternative proposal and ignoring peer messages
(likely something from the first attempt) during this modified attempt.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFILS: Use FILS auth alg when connecting using PMKSA caching
Vinita S. Maloo [Tue, 19 May 2020 12:13:22 +0000 (17:43 +0530)] 
FILS: Use FILS auth alg when connecting using PMKSA caching

When a PMKSA cache entry is available and used for connection with FILS
key management suite, use FILS authentication algorithm for connection
even if ERP keys are not available. This scenario may happen when
applications using wpa_supplicant cache persistently only PMKSA but not
ERP keys and reconfigures wpa_supplicant with PMKSA cache after
restarting wpa_supplicant.

The previous implementation correctly handles SME-in-wpa_supplicant
cases. However, SME-in-driver cases, complete FILS authentication
without PMKSA caching is performed.

Fix SME-in-driver behavior by setting authentication algorithm to
WPA_AUTH_ALG_FILS when connecting to a FILS AP using PMKSA caching.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Do not send FILS ERP sequence number without rRK
Vinita S. Maloo [Tue, 19 May 2020 12:13:22 +0000 (17:43 +0530)] 
nl80211: Do not send FILS ERP sequence number without rRK

FILS ERP cannot be used without rRK, so include these attributes only
together.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years ago6 GHz: Change 6 GHz channels per IEEE P802.11ax/D6.1
Wu Gao [Mon, 8 Jun 2020 06:27:12 +0000 (14:27 +0800)] 
6 GHz: Change 6 GHz channels per IEEE P802.11ax/D6.1

The channel numbering/center frequencies was changed in IEEE
P802.11ax/D6.1. The center frequencies of the channels were shifted by
10 MHz. Also, a new operating class 136 was defined with a single
channel 2. Add required support to change the channelization as per IEEE
P802.11ax/D6.1.

Signed-off-by: Wu Gao<wugao@codeaurora.org>
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
5 years agodpp-nfc: Support channel list negotiation
Jouni Malinen [Tue, 23 Jun 2020 10:24:38 +0000 (13:24 +0300)] 
dpp-nfc: Support channel list negotiation

If the peer's channel list in negotiated handover does not have any
common channels and the local end is configured with an alternative
channel list, try to initiate another negotiation handover with the
alternative channels.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Update debug print for tag-read-only operation
Jouni Malinen [Mon, 22 Jun 2020 21:57:18 +0000 (00:57 +0300)] 
dpp-nfc: Update debug print for tag-read-only operation

Be clearer about only a tag read being allowed when dpp-nfc is
configured to not allow connection handover.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut sta_scan WaitCompletion,1
Jouni Malinen [Mon, 22 Jun 2020 20:38:36 +0000 (23:38 +0300)] 
tests: sigma_dut sta_scan WaitCompletion,1

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut DPP Configurator for dot1x
Jouni Malinen [Mon, 22 Jun 2020 18:45:57 +0000 (21:45 +0300)] 
tests: sigma_dut DPP Configurator for dot1x

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Fix DPP_CA_SET processing with authentication not having peer BI
Jouni Malinen [Mon, 22 Jun 2020 18:45:10 +0000 (21:45 +0300)] 
DPP2: Fix DPP_CA_SET processing with authentication not having peer BI

Need to check for auth->peer_bi being set before using it here.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Clear bootstrap entries only after clearing authentication state
Jouni Malinen [Mon, 22 Jun 2020 17:00:31 +0000 (20:00 +0300)] 
DPP: Clear bootstrap entries only after clearing authentication state

This fixes an issue where the pending authentication might have held a
reference to auth->tmp_peer_bi and dpp_auth_deinit() would try to free
that bootstrapping entry. This needs to happen before the call to
dpp_global_clear() to avoid double-removal of the bootstrapping entry
from the list.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: nl80211 control port in AP mode disabled/enabled
Jouni Malinen [Sun, 21 Jun 2020 14:32:00 +0000 (17:32 +0300)] 
tests: nl80211 control port in AP mode disabled/enabled

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Use control port TX (status) in AP mode if possible
Markus Theil [Wed, 10 Jun 2020 08:32:58 +0000 (10:32 +0200)] 
nl80211: Use control port TX (status) in AP mode if possible

Check if nl80211 control port TX status is available in the kernel and
enable control port TX if so. With this feature, nl80211 control path is
able to provide the same feature set as nl80211 (management) + AF_PACKET
socket (control) before.

For debugging and testing, this can explicitly be disabled with
the driver parameter control_port_ap=0.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Work around misdelivered control port TX status
Jouni Malinen [Sun, 21 Jun 2020 14:32:00 +0000 (17:32 +0300)] 
nl80211: Work around misdelivered control port TX status

The kernel commit "mac80211: support control port TX status reporting"
seems to be delivering the TX status events for EAPOL frames over
control port using NL80211_CMD_FRAME_TX_STATUS due to incorrect check on
whether the frame is a Management or Data frame. Use the pending cookie
value from EAPOL TX operation to detect this incorrect behavior and
redirect the event internally to allow it to be used to get full TX
control port functionality available for AP mode.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Use ext ack handler for TX control port
Markus Theil [Wed, 10 Jun 2020 08:32:59 +0000 (10:32 +0200)] 
nl80211: Use ext ack handler for TX control port

Allow custom ack handler to be registered and use the ext ack handler
for TX control port to fetch the cookie information. If these cookies
are not supported by the current kernel, a value of 0 is returned.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Handle control port TX status events over nl80211
Markus Theil [Wed, 10 Jun 2020 08:32:57 +0000 (10:32 +0200)] 
nl80211: Handle control port TX status events over nl80211

In order to retransmit faster in AP mode, hostapd can handle TX status
notifications. When using nl80211, this is currently only possible with
socket control messages. Add support for receiving such events directly
over nl80211 and detecting, if this feature is supported.

This finally allows for a clean separation between management/control
path (over nl80211) and in-kernel data path.

A follow up commit enables the feature in AP mode.

Control port TX status contains the original frame content for matching
with the current hostapd code. Furthermore, a cookie is included, which
allows for matching against outstanding cookies in the future. This
commit only prints the cookie value for debugging purposes on TX status
receive.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Add custom ack handler arguments to send_and_recv()
Markus Theil [Wed, 10 Jun 2020 08:32:56 +0000 (10:32 +0200)] 
nl80211: Add custom ack handler arguments to send_and_recv()

This is a preliminary patch for using extack cookies for TX control port
handling. Custom ack handler arguments for send_and_recv() and friends
is introduced therefore. This commit does not actually use the provided
values, i.e., that will be added in a separate commit.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Clean up SO_WIFI_STATUS error reporting
Jouni Malinen [Sun, 21 Jun 2020 13:44:51 +0000 (16:44 +0300)] 
nl80211: Clean up SO_WIFI_STATUS error reporting

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: EAP-TEAP with client certificate in Phase 1
Jouni Malinen [Sat, 20 Jun 2020 15:08:12 +0000 (18:08 +0300)] 
tests: EAP-TEAP with client certificate in Phase 1

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoEAP-TEAP (server): Allow Phase 2 skip based on client certificate
Jouni Malinen [Sat, 20 Jun 2020 15:07:04 +0000 (18:07 +0300)] 
EAP-TEAP (server): Allow Phase 2 skip based on client certificate

eap_teap_auth=2 can now be used to configure hostapd to skip Phase 2 if
the peer can be authenticated based on client certificate during Phase
1.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoEAP-TEAP (client): Allow Phase 2 to be skipped if certificate is used
Jouni Malinen [Sat, 20 Jun 2020 15:05:46 +0000 (18:05 +0300)] 
EAP-TEAP (client): Allow Phase 2 to be skipped if certificate is used

The EAP-TEAP server may skip Phase 2 if the client authentication could
be completed during Phase 1 based on client certificate. Handle this
similarly to the case of PAC use.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoOpenSSL: Provide access to peer subject and own certificate use
Jouni Malinen [Sat, 20 Jun 2020 15:04:51 +0000 (18:04 +0300)] 
OpenSSL: Provide access to peer subject and own certificate use

These are needed for EAP-TEAP server and client side implementation to
allow Phase 2 to be skipped based on client certificate use during Phase
1.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoConvert int to bool for throughput estimate tables
Jouni Malinen [Fri, 19 Jun 2020 14:28:25 +0000 (17:28 +0300)] 
Convert int to bool for throughput estimate tables

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAdd WPA_EVENT_{DO,SKIP}_ROAM events
Matthew Wang [Tue, 2 Jun 2020 00:10:18 +0000 (17:10 -0700)] 
Add WPA_EVENT_{DO,SKIP}_ROAM events

Add events for within-ESS reassociation. This allows us to monitor roam
events, both skipped and allowed, in tests.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
5 years agoRefactor wpa_supplicant_need_to_roam()
Matthew Wang [Tue, 2 Jun 2020 00:10:15 +0000 (17:10 -0700)] 
Refactor wpa_supplicant_need_to_roam()

Pull all the within-ESS roam code out of wpa_supplicant_need_to_roam()
and into its own function, wpa_supplicant_need_to_roam_within_ess().
This way, we avoid interleaving several #ifndef's in the original
function and wrap the new function in one big #ifndef. This also
modularizes the within-ESS roam code and makes it easier to test.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
5 years agoUse lookup-table instead of macro for TX rate estimates
Matthew Wang [Tue, 2 Jun 2020 00:10:13 +0000 (17:10 -0700)] 
Use lookup-table instead of macro for TX rate estimates

Change INTERPOLATE_RATE() macro to a lookup-table instead for the sake
of readability.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
5 years agoDPP2: Remove forgetten development time debug prints
Jouni Malinen [Thu, 18 Jun 2020 21:37:40 +0000 (00:37 +0300)] 
DPP2: Remove forgetten development time debug prints

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Copy subject from CSR to certificate
Jouni Malinen [Thu, 18 Jun 2020 21:36:44 +0000 (00:36 +0300)] 
tests: Copy subject from CSR to certificate

Instead of overriding the subject field with something arbitrary, use
the value that is included in the CSR now that there is something there.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP over TCP for enterprise provisioning
Jouni Malinen [Thu, 18 Jun 2020 21:12:56 +0000 (00:12 +0300)] 
tests: DPP over TCP for enterprise provisioning

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Fix dot1x config object parsing without trustedEapServerName
Jouni Malinen [Thu, 18 Jun 2020 21:10:51 +0000 (00:10 +0300)] 
DPP2: Fix dot1x config object parsing without trustedEapServerName

Need to check that the JSON node was found before using its value.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add an automatic peer_bi entry for CSR matching if needed
Jouni Malinen [Thu, 18 Jun 2020 21:08:33 +0000 (00:08 +0300)] 
DPP2: Add an automatic peer_bi entry for CSR matching if needed

This allows the DPP_CA_SET command to be targeting a specific DPP-CST
event in cases where the Configurator did not receive the bootstrapping
information for the peer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add Enrollee name into CSR as the commonName
Jouni Malinen [Thu, 18 Jun 2020 18:06:10 +0000 (21:06 +0300)] 
DPP2: Add Enrollee name into CSR as the commonName

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: GAS comeback response processing for Enrollee over TCP
Jouni Malinen [Thu, 18 Jun 2020 10:39:53 +0000 (13:39 +0300)] 
DPP2: GAS comeback response processing for Enrollee over TCP

This is almost identical to processing of the GAS initial response.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: GAS comeback request processing for Configurator over TCP
Jouni Malinen [Thu, 18 Jun 2020 10:38:37 +0000 (13:38 +0300)] 
DPP2: GAS comeback request processing for Configurator over TCP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: GAS Comeback Request for the TCP case
Jouni Malinen [Thu, 18 Jun 2020 10:14:25 +0000 (13:14 +0300)] 
DPP2: GAS Comeback Request for the TCP case

Make the Enrollee handle GAS comeback delay when performing DPP over
TCP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Comeback delay response for certificate in over TCP case
Jouni Malinen [Thu, 18 Jun 2020 10:03:29 +0000 (13:03 +0300)] 
DPP2: Comeback delay response for certificate in over TCP case

Send out the GAS Initial Response with comeback delay when Configurator
is operating over TCP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: CSR wait in Configurator when using TCP
Jouni Malinen [Thu, 18 Jun 2020 09:56:51 +0000 (12:56 +0300)] 
DPP2: CSR wait in Configurator when using TCP

Make Configurator wait for CSR (i.e., another Config Request) when using
DPP over TCP similarly to the over Public Action frame case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: CSR generation in TCP Client/Enrollee
Jouni Malinen [Thu, 18 Jun 2020 09:10:23 +0000 (12:10 +0300)] 
DPP2: CSR generation in TCP Client/Enrollee

This was previously covered for the DPP over Public Action frames, but
the DPP over TCP case was missed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Do not try to proceed with GAS client if CSR building fails
Jouni Malinen [Thu, 18 Jun 2020 09:09:00 +0000 (12:09 +0300)] 
DPP2: Do not try to proceed with GAS client if CSR building fails

This error path was supposed to stop instead of continuing to
wpas_dpp_start_gas_client().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDefine a new QCA vendor attribute for Optimized Power Management
Alan Chen [Tue, 16 Jun 2020 22:33:18 +0000 (15:33 -0700)] 
Define a new QCA vendor attribute for Optimized Power Management

Define a new attribute configuring Optimized Power Management.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP and enterprise provisioning and CSR getting rejected
Jouni Malinen [Wed, 17 Jun 2020 18:42:35 +0000 (21:42 +0300)] 
tests: DPP and enterprise provisioning and CSR getting rejected

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Allow CSR processing by CA/RA to reject configuration
Jouni Malinen [Wed, 17 Jun 2020 18:39:47 +0000 (21:39 +0300)] 
DPP2: Allow CSR processing by CA/RA to reject configuration

"DPP_CA_SET name=status value=<int>" can now be used to explicitly
indicate that CSR was rejected by CA/RA.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Validate CSR on Configurator before forwarding to CA/RA
Jouni Malinen [Wed, 17 Jun 2020 17:33:07 +0000 (20:33 +0300)] 
DPP2: Validate CSR on Configurator before forwarding to CA/RA

Parse the received CSR, verify that it has been signed correctly, and
verify that the challengePassword is present and matches the derived cp.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add challengePassword into CSR
Jouni Malinen [Wed, 17 Jun 2020 09:22:08 +0000 (12:22 +0300)] 
DPP2: Add challengePassword into CSR

Derive challengePassword from bk and add it into the CSR.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOpenSSL: Use EVP-based interface for ECDSA sign/verify
Jouni Malinen [Tue, 16 Jun 2020 10:16:39 +0000 (13:16 +0300)] 
OpenSSL: Use EVP-based interface for ECDSA sign/verify

The low level ECDSA interface is not available in BoringSSL and has been
deprecetated in OpenSSL 3.0, so move to using a higher layer EVP-based
interface for performing the ECDSA sign/verify operations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP enterprise provisioning
Jouni Malinen [Mon, 15 Jun 2020 17:20:50 +0000 (20:20 +0300)] 
tests: DPP enterprise provisioning

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Enterprise provisioning (Enrollee)
Jouni Malinen [Mon, 15 Jun 2020 17:20:50 +0000 (20:20 +0300)] 
DPP2: Enterprise provisioning (Enrollee)

Add initial Enrollee functionality for provisioning enterprise (EAP-TLS)
configuration object. This commit is handling only the most basic case
and a number of TODO items remains to handle more complete CSR
generation and config object processing.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Enterprise provisioning (Configurator)
Jouni Malinen [Mon, 15 Jun 2020 17:20:50 +0000 (20:20 +0300)] 
DPP2: Enterprise provisioning (Configurator)

Add Configurator functionality for provisioning enterprise (EAP-TLS)
configuration object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Enterprise provisioning definitions for dot1x AKM
Jouni Malinen [Mon, 15 Jun 2020 17:20:50 +0000 (20:20 +0300)] 
DPP2: Enterprise provisioning definitions for dot1x AKM

Add shared AKM definitions for provisioning enterprise (EAP-TLS)
credentials.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOpenSSL: Support EC key from private_key blob
Jouni Malinen [Tue, 16 Jun 2020 14:48:47 +0000 (17:48 +0300)] 
OpenSSL: Support EC key from private_key blob

Try to parse the private_key blob as an ECPrivateKey in addition to the
previously supported RSA and DSA.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOpenSSL: Support PEM encoded chain from client_cert blob
Jouni Malinen [Tue, 16 Jun 2020 14:47:50 +0000 (17:47 +0300)] 
OpenSSL: Support PEM encoded chain from client_cert blob

Allow a chain of certificates to be configured through a client_cert
blob.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoGAS server: Support comeback delay from the request handler
Jouni Malinen [Mon, 15 Jun 2020 18:20:44 +0000 (21:20 +0300)] 
GAS server: Support comeback delay from the request handler

Allow GAS request handler function to request comeback delay before
providing the response.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoJSON: Add base64 helper functions
Jouni Malinen [Mon, 15 Jun 2020 17:19:19 +0000 (20:19 +0300)] 
JSON: Add base64 helper functions

These functions are similar to the base64url helpers but with the base64
(not url) alphabet.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agobase64: Add no-LF variant for encoding
Jouni Malinen [Mon, 15 Jun 2020 17:18:12 +0000 (20:18 +0300)] 
base64: Add no-LF variant for encoding

base64_encode_no_lf() is otherwise identical to base64_encode(), but it
does not add line-feeds to split the output.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoUpdate DFS terminology in attribute value documentation
Jouni Malinen [Thu, 11 Jun 2020 18:53:24 +0000 (21:53 +0300)] 
Update DFS terminology in attribute value documentation

Use "client device" as the term for the device that operates under a
guidance of the device responsible for enforcing DFS rules.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAllow HE-without-VHT to add the Channel Switch Wrapper element
Muna Sinada [Mon, 18 May 2020 13:57:16 +0000 (06:57 -0700)] 
Allow HE-without-VHT to add the Channel Switch Wrapper element

Modify the check for VHT to include an option for HE in
hostapd_eid_wb_chsw_wrapper() and its callers to allow the Channel
Switch Wrapper element with the Wide Bandwidth Channel Switch subelement
to be included in Beacon and Probe Response frames when AP is operating
in HE mode without VHT.

Signed-off-by: Muna Sinada <msinada@codeaurora.org>