aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/sme.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-09-01 23:12:44 (GMT)
committerJouni Malinen <j@w1.fi>2017-09-04 10:32:03 (GMT)
commita0f19e9c74f2f458fc435c01c04124bdc7979b3e (patch)
treeb96981b63419b27cb690c2096ec928471eb6aa34 /wpa_supplicant/sme.c
parentcd06e2663b435810cd11340836dcf6589abbddca (diff)
downloadhostap-a0f19e9c74f2f458fc435c01c04124bdc7979b3e.zip
hostap-a0f19e9c74f2f458fc435c01c04124bdc7979b3e.tar.gz
hostap-a0f19e9c74f2f458fc435c01c04124bdc7979b3e.tar.bz2
SAE: Allow commit fields to be overridden for testing purposes (STA)
The new "SET sae_commit_override <hexdump>" control interface command can be used to force wpa_supplicant to override SAE commit message fields for testing purposes. This is included only in CONFIG_TESTING_OPTIONS=y builds. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/sme.c')
-rw-r--r--wpa_supplicant/sme.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index f1bd89e..a4d5f75 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -88,6 +88,19 @@ static struct wpabuf * sme_auth_build_sae_commit(struct wpa_supplicant *wpa_s,
struct wpabuf *buf;
size_t len;
+#ifdef CONFIG_TESTING_OPTIONS
+ if (wpa_s->sae_commit_override) {
+ wpa_printf(MSG_DEBUG, "SAE: TESTING - commit override");
+ buf = wpabuf_alloc(4 + wpabuf_len(wpa_s->sae_commit_override));
+ if (!buf)
+ return NULL;
+ wpabuf_put_le16(buf, 1); /* Transaction seq# */
+ wpabuf_put_le16(buf, WLAN_STATUS_SUCCESS);
+ wpabuf_put_buf(buf, wpa_s->sae_commit_override);
+ return buf;
+ }
+#endif /* CONFIG_TESTING_OPTIONS */
+
if (ssid->passphrase == NULL) {
wpa_printf(MSG_DEBUG, "SAE: No password available");
return NULL;