From 4da10640a74b73f7e77fa5a0036417f2e8fce8b9 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 16 Dec 2012 19:27:09 +0200 Subject: [PATCH] WNM: Fix AP logic on when to include GTK/IGTK in WNM-Sleep Mode exit Signed-hostap: Jouni Malinen --- src/ap/wnm_ap.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c index 9f34db258..51a0e40df 100644 --- a/src/ap/wnm_ap.c +++ b/src/ap/wnm_ap.c @@ -104,7 +104,7 @@ static int ieee802_11_send_wnmsleep_resp(struct hostapd_data *hapd, mgmt->u.action.u.wnm_sleep_resp.dialogtoken = dialog_token; pos = (u8 *)mgmt->u.action.u.wnm_sleep_resp.variable; /* add key data if MFP is enabled */ - if (wpa_auth_uses_mfp(sta->wpa_sm) || + if (!wpa_auth_uses_mfp(sta->wpa_sm) || action_type != WNM_SLEEP_MODE_EXIT) { mgmt->u.action.u.wnm_sleep_resp.keydata_len = 0; } else { @@ -162,13 +162,14 @@ static int ieee802_11_send_wnmsleep_resp(struct hostapd_data *hapd, * 2. start GTK/IGTK update if MFP is not used * 3. unpause the node in driver */ - if (wnmsleep_ie.status == WNM_STATUS_SLEEP_ACCEPT && + if ((wnmsleep_ie.status == WNM_STATUS_SLEEP_ACCEPT || + wnmsleep_ie.status == + WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) && wnmsleep_ie.action_type == WNM_SLEEP_MODE_EXIT) { wpa_set_wnmsleep(sta->wpa_sm, 0); hostapd_drv_wnm_oper(hapd, WNM_SLEEP_EXIT_CONFIRM, addr, NULL, NULL); - if (wpa_auth_uses_mfp(sta->wpa_sm) && - action_type == WNM_SLEEP_MODE_EXIT) + if (!wpa_auth_uses_mfp(sta->wpa_sm)) wpa_wnmsleep_rekey_gtk(sta->wpa_sm); } } else -- 2.39.2