From c4fc7e31c7d520ba9c1f989fd6f8cc727aee1d60 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 27 Dec 2017 12:17:44 +0200 Subject: [PATCH] SAE: Set special Sc value when moving to Accepted state Set Sc to 2^16-1 when moving to Accepted state per IEEE Std 802.11-2016, 12.4.8.6.5 (Protocol instance behavior - Confirmed state). This allows the peer in Accepted state to silently ignore unnecessary retransmissions of the Confirm message. Signed-off-by: Jouni Malinen --- src/ap/ieee802_11.c | 1 + src/common/sae.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 53672a7d2..f6cea4017 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -728,6 +728,7 @@ static int sae_sm_step(struct hostapd_data *hapd, struct sta_info *sta, sae_set_retransmit_timer(hapd, sta); } else { + sta->sae->send_confirm = 0xffff; sae_accept_sta(hapd, sta); } break; diff --git a/src/common/sae.c b/src/common/sae.c index 588a62205..3b3249092 100644 --- a/src/common/sae.c +++ b/src/common/sae.c @@ -1235,7 +1235,8 @@ void sae_write_confirm(struct sae_data *sae, struct wpabuf *buf) /* Send-Confirm */ sc = wpabuf_put(buf, 0); wpabuf_put_le16(buf, sae->send_confirm); - sae->send_confirm++; + if (sae->send_confirm < 0xffff) + sae->send_confirm++; if (sae->tmp->ec) sae_cn_confirm_ecc(sae, sc, sae->tmp->own_commit_scalar,