]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Increment the Sc counter before generating each Confirm
authorJouni Malinen <jouni@codeaurora.org>
Thu, 8 Apr 2021 20:55:03 +0000 (23:55 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 9 Apr 2021 18:51:46 +0000 (21:51 +0300)
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 <jouni@codeaurora.org>
src/common/sae.c

index f0d4c228c5dada0d3d84071d43c128a2ac8e28cc..0f53c4df5e7aaf6ba9f66ea8f75f137fec08f4b3 100644 (file)
@@ -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,