diff mbox series

SAE: nl80211 send mlme frame fail (external auth)

Message ID CACYaJDRUXA-QmvXkm-DGtqKghNe7VL8ey4tvOkcEr4rQ+nW82w@mail.gmail.com
State Superseded
Headers show
Series SAE: nl80211 send mlme frame fail (external auth) | expand

Commit Message

Ouden Lin Jan. 16, 2020, 9:12 a.m. UTC
When external authentication is used, the station send mlme frame (auth)
to driver that can't get the frequency (bss->freq) after hostap.git commit
b6f8b5a9 ("nl80211: Update freq only when CSA completes").

This patch will use the assoc_freq to send the mlem frame,
when external authentication is used.

Change-Id: Ic1629e2bba655645ada942d425f94dff7d90fbd7
Signed-off-by: Ouden Lin <ouden.biz@gmail.com>
---
 src/drivers/driver_nl80211.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

  wpa_printf(MSG_DEBUG, "nl80211: Use bss->freq=%d",
@@ -3747,6 +3768,20 @@ static int wpa_driver_nl80211_send_mlme(struct
i802_bss *bss, const u8 *data,
  encrypt = 0;
  }

+ if (freq == 0 && drv->nlmode == NL80211_IFTYPE_STATION &&
+ ((drv->capa.flags & WPA_DRIVER_FLAGS_SAE) &&
+ !(drv->capa.flags & WPA_DRIVER_FLAGS_SME)) &&
+ WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
+ WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_AUTH) {
+
+ if (freq == 0) {
+ freq = nl80211_get_assoc_freq(drv);
+ wpa_printf(MSG_DEBUG,
+    "nl80211: send_mlme - Use assoc_freq=%u for external auth",
+    freq);
+ }
+ }
+
  if (freq == 0 && drv->nlmode == NL80211_IFTYPE_ADHOC) {
  freq = nl80211_get_assoc_freq(drv);
  wpa_printf(MSG_DEBUG,

Comments

Ouden Lin Jan. 16, 2020, 9:17 a.m. UTC | #1
When external authentication is used, the station send mlme frame (auth)
to driver that can't get the frequency (bss->freq) after hostap.git commit
b6f8b5a9 ("nl80211: Update freq only when CSA completes").

This patch will use the assoc_freq to send the mlem frame,
when external authentication is used.

Change-Id: Ic1629e2bba655645ada942d425f94dff7d90fbd7
Signed-off-by: Ouden Lin <ouden.biz@gmail.com>
---
 src/drivers/driver_nl80211.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 64bea49e1..fa0a73094 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3747,6 +3747,20 @@ static int wpa_driver_nl80211_send_mlme(struct
i802_bss *bss, const u8 *data,
  encrypt = 0;
  }

+ if (freq == 0 && drv->nlmode == NL80211_IFTYPE_STATION &&
+ ((drv->capa.flags & WPA_DRIVER_FLAGS_SAE) &&
+ !(drv->capa.flags & WPA_DRIVER_FLAGS_SME)) &&
+ WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
+ WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_AUTH) {
+
+ if (freq == 0) {
+ freq = nl80211_get_assoc_freq(drv);
+ wpa_printf(MSG_DEBUG,
+    "nl80211: send_mlme - Use assoc_freq=%u for external auth",
+    freq);
+ }
+ }
+
  if (freq == 0 && drv->nlmode == NL80211_IFTYPE_ADHOC) {
  freq = nl80211_get_assoc_freq(drv);
  wpa_printf(MSG_DEBUG,
Ouden Lin Jan. 21, 2020, 2:39 a.m. UTC | #2
Hi there,

Does someone can help review and comment this patch?
Because the WPA3 external auth can't work.

Thank you very much.
Jouni Malinen Jan. 21, 2020, 3:38 p.m. UTC | #3
On Tue, Jan 21, 2020 at 10:39:28AM +0800, Ouden.Biz Lin wrote:
> Does someone can help review and comment this patch?
> Because the WPA3 external auth can't work.

Would you be able to send the patch without whitespace damage? It does
not apply due to tabs having been converted to spaces and lines having
been wrapped..

It would also be helpful to get a wpa_supplicant debug log with and
without the patch for a case where authentication fails.
diff mbox series

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 64bea49e1..4741f23b8 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3722,6 +3722,27 @@  static int wpa_driver_nl80211_send_mlme(struct
i802_bss *bss, const u8 *data,
  goto send_frame_cmd;
  }

+ if ((is_sta_interface(drv->nlmode) ||
+      drv->nlmode == NL80211_IFTYPE_P2P_DEVICE) &&
+     WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
+     WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_PROBE_RESP) {
+ /*
+ * The use of last_mgmt_freq is a bit of a hack,
+ * but it works due to the single-threaded nature
+ * of wpa_supplicant.
+ */
+ if (freq == 0) {
+ wpa_printf(MSG_DEBUG, "nl80211: Use last_mgmt_freq=%d",
+    drv->last_mgmt_freq);
+ freq = drv->last_mgmt_freq;
+ }
+ wait_time = 0;
+ use_cookie = 0;
+ no_cck = 1;
+ offchanok = 1;
+ goto send_frame_cmd;
+ }
+
  if (drv->device_ap_sme && is_ap_interface(drv->nlmode)) {
  if (freq == 0) {