[PATCH 0/2] implement SAE retry timer

Bob Copeland me at bobcopeland.com
Wed Jan 7 01:10:55 EST 2015


These two patches add a timer for resending auth frames in the SAE
state machine.  Tested with the following patch applied, SAE nearly
always succeeds, whereas it almost always failed prior to the series.

--- 
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 5cd9f7e..f343c03 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -386,6 +386,13 @@ static int auth_sae_send_commit(struct hostapd_data *hapd,
 	if (data == NULL)
 		return WLAN_STATUS_UNSPECIFIED_FAILURE;
 
+	/* simulate 20% frame drops */
+	if (drand48() < 0.20) {
+		wpa_printf(MSG_ERROR, "SAE: drop send %d to " MACSTR,
+				      1, MAC2STR(sta->addr));
+		return WLAN_STATUS_SUCCESS;
+	}
+
 	send_auth_reply(hapd, sta->addr, bssid,
 			WLAN_AUTH_SAE, 1, WLAN_STATUS_SUCCESS,
 			wpabuf_head(data), wpabuf_len(data));
@@ -406,6 +413,13 @@ static int auth_sae_send_confirm(struct hostapd_data *hapd,
 	if (data == NULL)
 		return WLAN_STATUS_UNSPECIFIED_FAILURE;
 
+	/* simulate 20% frame drops */
+	if (drand48() < 0.20) {
+		wpa_printf(MSG_ERROR, "SAE: drop send auth_transaction %d to " MACSTR,
+				      2, MAC2STR(sta->addr));
+		return WLAN_STATUS_SUCCESS;
+	}
+
 	send_auth_reply(hapd, sta->addr, bssid,
 			WLAN_AUTH_SAE, 2, WLAN_STATUS_SUCCESS,
 			wpabuf_head(data), wpabuf_len(data));
@@ -503,6 +517,8 @@ static void auth_sae_retransmit_timer(void *eloop_ctx, void *eloop_data)
 	struct hostapd_data *hapd = eloop_ctx;
 	struct sta_info *sta = eloop_data;
 
+	wpa_printf(MSG_ERROR, "SAE: retransmit fired, state: %d, sync: %d\n", sta->sae->state, sta->sae->sync);
+
 	if (sae_check_big_sync(sta))
 		return;
 	sta->sae->sync++;
-- 
2.1.4


Bob Copeland (2):
  SAE: centralize function for sending initial COMMIT
  SAE: implement retransmission timer

 src/ap/ieee802_11.c       | 108 +++++++++++++++++++++++++++++++++++++++++++++-
 src/ap/ieee802_11.h       |   4 ++
 src/common/sae.h          |   1 +
 wpa_supplicant/mesh_rsn.c |  85 ++++++------------------------------
 4 files changed, 125 insertions(+), 73 deletions(-)

-- 
2.1.4



More information about the HostAP mailing list