aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/ieee802_11.c
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2015-01-07 06:10:56 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-10 09:43:29 (GMT)
commita206e2a1755cefa3ec041d00dd97cc88f05b87f1 (patch)
tree17937a1a960f499b0879b7d5a98c5a5d680e1549 /src/ap/ieee802_11.c
parent28c91ee1242755687c722ef883ad00efc74fae0a (diff)
downloadhostap-a206e2a1755cefa3ec041d00dd97cc88f05b87f1.zip
hostap-a206e2a1755cefa3ec041d00dd97cc88f05b87f1.tar.gz
hostap-a206e2a1755cefa3ec041d00dd97cc88f05b87f1.tar.bz2
SAE: Centralize function for sending initial COMMIT
When performing SAE authentication in mesh, one station may initiate authentication by sending a COMMIT as soon as a peer candidate is discovered. Previously we did this in mesh_rsn.c, but this left some of the state initialization in a different part of the code from the rest of the state machine, and we may need to add other initializations here in the future, so move that to a more central function. Signed-off-by: Bob Copeland <me@bobcopeland.com>
Diffstat (limited to 'src/ap/ieee802_11.c')
-rw-r--r--src/ap/ieee802_11.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 97f98f2..0459a17 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -755,6 +755,37 @@ reply:
}
wpabuf_free(data);
}
+
+
+/**
+ * auth_sae_init_committed - Send COMMIT and start SAE in committed state
+ * @hapd: BSS data for the device initiating the authentication
+ * @sta: the peer to which commit authentication frame is sent
+ *
+ * This function implements Init event handling (IEEE Std 802.11-2012,
+ * 11.3.8.6.3) in which initial COMMIT message is sent. Prior to calling, the
+ * sta->sae structure should be initialized appropriately via a call to
+ * sae_prepare_commit().
+ */
+int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta)
+{
+ int ret;
+
+ if (!sta->sae || !sta->sae->tmp)
+ return -1;
+
+ if (sta->sae->state != SAE_NOTHING)
+ return -1;
+
+ ret = auth_sae_send_commit(hapd, sta, hapd->own_addr, 0);
+ if (ret)
+ return -1;
+
+ sta->sae->state = SAE_COMMITTED;
+
+ return 0;
+}
+
#endif /* CONFIG_SAE */