diff mbox series

brcmfmac: fix WPA/WPA2-PSK 4-way handshake offload and SAE offload failures

Message ID 1589277788-119966-1-git-send-email-chi-hsien.lin@cypress.com (mailing list archive)
State Accepted
Commit b2fe11f0777311a764e47e2f9437809b4673b7b1
Delegated to: Kalle Valo
Headers show
Series brcmfmac: fix WPA/WPA2-PSK 4-way handshake offload and SAE offload failures | expand

Commit Message

Chi-Hsien Lin May 12, 2020, 10:03 a.m. UTC
From: Chung-Hsien Hsu <stanley.hsu@cypress.com>

An incorrect value of use_fwsup is set for 4-way handshake offload for
WPA//WPA2-PSK, caused by commit 3b1e0a7bdfee ("brcmfmac: add support for
SAE authentication offload"). It results in missing bit
BRCMF_VIF_STATUS_EAP_SUCCESS set in brcmf_is_linkup() and causes the
failure. This patch correct the value for the case.

Also setting bit BRCMF_VIF_STATUS_EAP_SUCCESS for SAE offload case in
brcmf_is_linkup() to fix SAE offload failure.

Fixes: 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication
offload")
Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Kalle Valo May 12, 2020, 10:42 a.m. UTC | #1
Chi-Hsien Lin <chi-hsien.lin@cypress.com> writes:

> From: Chung-Hsien Hsu <stanley.hsu@cypress.com>
>
> An incorrect value of use_fwsup is set for 4-way handshake offload for
> WPA//WPA2-PSK, caused by commit 3b1e0a7bdfee ("brcmfmac: add support for
> SAE authentication offload"). It results in missing bit
> BRCMF_VIF_STATUS_EAP_SUCCESS set in brcmf_is_linkup() and causes the
> failure. This patch correct the value for the case.
>
> Also setting bit BRCMF_VIF_STATUS_EAP_SUCCESS for SAE offload case in
> brcmf_is_linkup() to fix SAE offload failure.
>
> Fixes: 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication
> offload")

Fixes line needs to be in one line. I can fix that during commit, no
need to resend because of this.
Chi-Hsien Lin May 12, 2020, 10:50 a.m. UTC | #2
On 05/12/2020 6:42, Kalle Valo wrote:
> Chi-Hsien Lin <chi-hsien.lin@cypress.com> writes:
> 
>> From: Chung-Hsien Hsu <stanley.hsu@cypress.com>
>>
>> An incorrect value of use_fwsup is set for 4-way handshake offload for
>> WPA//WPA2-PSK, caused by commit 3b1e0a7bdfee ("brcmfmac: add support for
>> SAE authentication offload"). It results in missing bit
>> BRCMF_VIF_STATUS_EAP_SUCCESS set in brcmf_is_linkup() and causes the
>> failure. This patch correct the value for the case.
>>
>> Also setting bit BRCMF_VIF_STATUS_EAP_SUCCESS for SAE offload case in
>> brcmf_is_linkup() to fix SAE offload failure.
>>
>> Fixes: 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication
>> offload")
> 
> Fixes line needs to be in one line. I can fix that during commit, no
> need to resend because of this.

Thanks a lot for fixing it. We'll use one line going forward.

>
Kalle Valo May 13, 2020, 3:48 p.m. UTC | #3
Chi-Hsien Lin <chi-hsien.lin@cypress.com> wrote:

> From: Chung-Hsien Hsu <stanley.hsu@cypress.com>
> 
> An incorrect value of use_fwsup is set for 4-way handshake offload for
> WPA//WPA2-PSK, caused by commit 3b1e0a7bdfee ("brcmfmac: add support for
> SAE authentication offload"). It results in missing bit
> BRCMF_VIF_STATUS_EAP_SUCCESS set in brcmf_is_linkup() and causes the
> failure. This patch correct the value for the case.
> 
> Also setting bit BRCMF_VIF_STATUS_EAP_SUCCESS for SAE offload case in
> brcmf_is_linkup() to fix SAE offload failure.
> 
> Fixes: 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication offload")
> Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
> Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>

Patch applied to wireless-drivers-next.git, thanks.

b2fe11f07773 brcmfmac: fix WPA/WPA2-PSK 4-way handshake offload and SAE offload failures
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 4bd69d85fab9..bc6a1c48affa 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -1819,6 +1819,10 @@  brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
 		switch (sme->crypto.akm_suites[0]) {
 		case WLAN_AKM_SUITE_SAE:
 			val = WPA3_AUTH_SAE_PSK;
+			if (sme->crypto.sae_pwd) {
+				brcmf_dbg(INFO, "using SAE offload\n");
+				profile->use_fwsup = BRCMF_PROFILE_FWSUP_SAE;
+			}
 			break;
 		default:
 			bphy_err(drvr, "invalid cipher group (%d)\n",
@@ -2104,11 +2108,6 @@  brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
 		goto done;
 	}
 
-	if (sme->crypto.sae_pwd) {
-		brcmf_dbg(INFO, "using SAE offload\n");
-		profile->use_fwsup = BRCMF_PROFILE_FWSUP_SAE;
-	}
-
 	if (sme->crypto.psk &&
 	    profile->use_fwsup != BRCMF_PROFILE_FWSUP_SAE) {
 		if (WARN_ON(profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE)) {
@@ -5505,7 +5504,8 @@  static bool brcmf_is_linkup(struct brcmf_cfg80211_vif *vif,
 	u32 event = e->event_code;
 	u32 status = e->status;
 
-	if (vif->profile.use_fwsup == BRCMF_PROFILE_FWSUP_PSK &&
+	if ((vif->profile.use_fwsup == BRCMF_PROFILE_FWSUP_PSK ||
+	     vif->profile.use_fwsup == BRCMF_PROFILE_FWSUP_SAE) &&
 	    event == BRCMF_E_PSK_SUP &&
 	    status == BRCMF_E_STATUS_FWSUP_COMPLETED)
 		set_bit(BRCMF_VIF_STATUS_EAP_SUCCESS, &vif->sme_state);