]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Support external authentication offload in AP mode
authorSrinivas Dasari <dasaris@codeaurora.org>
Mon, 18 Mar 2019 09:34:04 +0000 (15:04 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 12 Apr 2019 17:33:35 +0000 (20:33 +0300)
Extend commit 5ff39c1380d9 ("SAE: Support external authentication
offload for driver-SME cases") to support external authentication
with drivers that implement AP SME by notifying the status of
SAE authentication to the driver after SAE handshake as the
driver acts as a pass through for the SAE Authentication frames.

Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
src/ap/ap_drv_ops.h
src/ap/ieee802_11.c

index d45ab8462147a074591fa07ae8e1f5a8a533f338..de40171e18dcbfcb4ea072eafefcd7e7efbd498f 100644 (file)
@@ -364,4 +364,14 @@ static inline int hostapd_drv_channel_info(struct hostapd_data *hapd,
        return hapd->driver->channel_info(hapd->drv_priv, ci);
 }
 
+static inline int
+hostapd_drv_send_external_auth_status(struct hostapd_data *hapd,
+                                     struct external_auth *params)
+{
+       if (!hapd->driver || !hapd->drv_priv ||
+           !hapd->driver->send_external_auth_status)
+               return -1;
+       return hapd->driver->send_external_auth_status(hapd->drv_priv, params);
+}
+
 #endif /* AP_DRV_OPS */
index 096ad9906d47af0dfc85ca7fffcb2c5b96339b4b..a8f3fc1d863f840c1f25a1fb9e54dd55845aa706 100644 (file)
@@ -701,6 +701,21 @@ static void sae_set_retransmit_timer(struct hostapd_data *hapd,
 }
 
 
+static void sae_sme_send_external_auth_status(struct hostapd_data *hapd,
+                                             struct sta_info *sta, u16 status)
+{
+       struct external_auth params;
+
+       os_memset(&params, 0, sizeof(params));
+       params.status = status;
+       os_memcpy(params.bssid, sta->addr, ETH_ALEN);
+       if (status == WLAN_STATUS_SUCCESS && sta->sae)
+               params.pmkid = sta->sae->pmkid;
+
+       hostapd_drv_send_external_auth_status(hapd, &params);
+}
+
+
 void sae_accept_sta(struct hostapd_data *hapd, struct sta_info *sta)
 {
 #ifndef CONFIG_NO_VLAN
@@ -739,6 +754,7 @@ void sae_accept_sta(struct hostapd_data *hapd, struct sta_info *sta)
        sae_set_state(sta, SAE_ACCEPTED, "Accept Confirm");
        wpa_auth_pmksa_add_sae(hapd->wpa_auth, sta->addr,
                               sta->sae->pmk, sta->sae->pmkid);
+       sae_sme_send_external_auth_status(hapd, sta, WLAN_STATUS_SUCCESS);
 }
 
 
@@ -1220,6 +1236,7 @@ reply:
                    !data && end - pos >= 2)
                        data = wpabuf_alloc_copy(pos, 2);
 
+               sae_sme_send_external_auth_status(hapd, sta, resp);
                send_auth_reply(hapd, mgmt->sa, mgmt->bssid, WLAN_AUTH_SAE,
                                auth_transaction, resp,
                                data ? wpabuf_head(data) : (u8 *) "",