From 527be9ce7266cdff142df180ae97f8f1602cdc5a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 8 Apr 2021 23:55:03 +0300 Subject: [PATCH] SAE: Increment the Sc counter before generating each Confirm This changes the Send-Confirm value for the first SAE Confirm message to be 1 instead of 0 for all cases to match the design shown in IEEE Std 802.11-2020, Figure 12-4 (SAE finite state machine). Sc is defined to be "the number of SAE Confirm messages that have been sent" which is a bit vague on whether the current frame is included in the count or not. However, the state machine is showing inc(Sc) operation in all cases before the "2" event to build the Confirm. Signed-off-by: Jouni Malinen --- src/common/sae.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/sae.c b/src/common/sae.c index f0d4c228c..0f53c4df5 100644 --- a/src/common/sae.c +++ b/src/common/sae.c @@ -2268,10 +2268,10 @@ int sae_write_confirm(struct sae_data *sae, struct wpabuf *buf) hash_len = sae->tmp->kck_len; /* Send-Confirm */ - sc = wpabuf_put(buf, 0); - wpabuf_put_le16(buf, sae->send_confirm); if (sae->send_confirm < 0xffff) sae->send_confirm++; + sc = wpabuf_put(buf, 0); + wpabuf_put_le16(buf, sae->send_confirm); if (sae->tmp->ec) res = sae_cn_confirm_ecc(sae, sc, sae->tmp->own_commit_scalar,