]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Send real status code to the driver when AP rejects external auth
authorVeerendranath Jakkam <quic_vjakkam@quicinc.com>
Tue, 26 Apr 2022 06:52:37 +0000 (12:22 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 5 May 2022 10:08:16 +0000 (13:08 +0300)
Send the status code from the AP authentication response instead of
sending the hardcoded WLAN_STATUS_UNSPECIFIED_FAILURE when the external
SAE authentication failure is due to an explicit rejection by the AP.
This will allow the driver to indicate the correct status in connect
response.

For example, an AP can send WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA in
SAE authentication response. With this change the driver gets the real
status for the SAE authentication failure and it can fill the correct
status in the connect response event.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
wpa_supplicant/sme.c

index 7f43216c6582a99787fddd0ea9972f60f493801b..be023c70120c8d3475e5105594b6c4b21403e3fc 100644 (file)
@@ -1362,7 +1362,7 @@ static int sme_sae_auth(struct wpa_supplicant *wpa_s, u16 auth_transaction,
                        " auth_type=%u auth_transaction=%u status_code=%u",
                        MAC2STR(bssid), WLAN_AUTH_SAE,
                        auth_transaction, status_code);
-               return -1;
+               return -2;
        }
 
        if (auth_transaction == 1) {
@@ -1513,7 +1513,10 @@ void sme_external_auth_mgmt_rx(struct wpa_supplicant *wpa_s,
                if (res < 0) {
                        /* Notify failure to the driver */
                        sme_send_external_auth_status(
-                               wpa_s, WLAN_STATUS_UNSPECIFIED_FAILURE);
+                               wpa_s,
+                               res == -2 ?
+                               le_to_host16(header->u.auth.status_code) :
+                               WLAN_STATUS_UNSPECIFIED_FAILURE);
                        return;
                }
                if (res != 1)