qtnfmac: enable WPA3 SAE support

In the case of SAE AP, drivers offload authentication to user-space
software, e.g. hostapd. For FullMAC drivers the procedure is as follows.
If auth_type is SAE and user space indicates external authentication
capability, then driver requests authentication offload to user-space
software using cfg80211_external_auth_request call. From that point,
auth frame exchange is performed transparently for driver: user-space
software sends/receives mgmt frames using mgmt_tx/mgmt_frame_register
cfg80211 callbacks. As soon as authenitcation is completed, user-space
software notifies driver about its status using external_auth cfg80211
callback.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Sergey Matyukevich
2019-02-05 09:48:57 +00:00
committed by Kalle Valo
parent 524d6323af
commit 47b08e75a6
5 changed files with 145 additions and 2 deletions

View File

@@ -574,6 +574,43 @@ static int qtnf_event_handle_radar(struct qtnf_vif *vif,
return 0;
}
static int
qtnf_event_handle_external_auth(struct qtnf_vif *vif,
const struct qlink_event_external_auth *ev,
u16 len)
{
struct cfg80211_external_auth_params auth = {0};
struct wiphy *wiphy = priv_to_wiphy(vif->mac);
int ret;
if (len < sizeof(*ev)) {
pr_err("MAC%u: payload is too short\n", vif->mac->macid);
return -EINVAL;
}
if (!wiphy->registered || !vif->netdev)
return 0;
if (ev->ssid_len) {
memcpy(auth.ssid.ssid, ev->ssid, ev->ssid_len);
auth.ssid.ssid_len = ev->ssid_len;
}
auth.key_mgmt_suite = le32_to_cpu(ev->akm_suite);
ether_addr_copy(auth.bssid, ev->bssid);
auth.action = ev->action;
pr_info("%s: external auth bss=%pM action=%u akm=%u\n",
vif->netdev->name, auth.bssid, auth.action,
auth.key_mgmt_suite);
ret = cfg80211_external_auth_request(vif->netdev, &auth, GFP_KERNEL);
if (ret)
pr_warn("failed to offload external auth request\n");
return ret;
}
static int qtnf_event_parse(struct qtnf_wmac *mac,
const struct sk_buff *event_skb)
{
@@ -632,6 +669,10 @@ static int qtnf_event_parse(struct qtnf_wmac *mac,
ret = qtnf_event_handle_radar(vif, (const void *)event,
event_len);
break;
case QLINK_EVENT_EXTERNAL_AUTH:
ret = qtnf_event_handle_external_auth(vif, (const void *)event,
event_len);
break;
default:
pr_warn("unknown event type: %x\n", event_id);
break;