From 6c7b2be424bfe7504a32b7a1f57ac7e29ece07a3 Mon Sep 17 00:00:00 2001 From: Veerendranath Jakkam Date: Tue, 26 Apr 2022 12:22:37 +0530 Subject: [PATCH] SAE: Send real status code to the driver when AP rejects external auth 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 --- wpa_supplicant/sme.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 7f43216c6..be023c701 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -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)