aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-09-01 22:52:15 (GMT)
committerJouni Malinen <j@w1.fi>2017-09-04 10:32:03 (GMT)
commit3648d8a1854a403b3674ec55681c76bb713ee77a (patch)
tree8d849020370e0112687858aec00ef836a5099d13 /src
parent1342c47a3329f3d2dbca57c1948ef50df0cdbc7b (diff)
downloadhostap-3648d8a1854a403b3674ec55681c76bb713ee77a.zip
hostap-3648d8a1854a403b3674ec55681c76bb713ee77a.tar.gz
hostap-3648d8a1854a403b3674ec55681c76bb713ee77a.tar.bz2
SAE: Allow commit fields to be overridden for testing purposes
The new sae_commit_override=<hexdump> parameter can be used to force hostapd 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 'src')
-rw-r--r--src/ap/ap_config.c1
-rw-r--r--src/ap/ap_config.h1
-rw-r--r--src/ap/ieee802_11.c9
3 files changed, 11 insertions, 0 deletions
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index 07a13f8..b12cb19 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -617,6 +617,7 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf)
#ifdef CONFIG_TESTING_OPTIONS
wpabuf_free(conf->own_ie_override);
+ wpabuf_free(conf->sae_commit_override);
#endif /* CONFIG_TESTING_OPTIONS */
os_free(conf->no_probe_resp_if_seen_on);
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 79048de..28569ed 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -589,6 +589,7 @@ struct hostapd_bss_config {
u8 bss_load_test_set;
struct wpabuf *own_ie_override;
int sae_reflection_attack;
+ struct wpabuf *sae_commit_override;
#endif /* CONFIG_TESTING_OPTIONS */
#define MESH_ENABLED BIT(0)
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index e35ed3a..0be9b49 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -797,6 +797,15 @@ static void handle_auth_sae(struct hostapd_data *hapd, struct sta_info *sta,
auth_transaction, resp, pos, end - pos);
goto remove_sta;
}
+
+ if (hapd->conf->sae_commit_override && auth_transaction == 1) {
+ wpa_printf(MSG_DEBUG, "SAE: TESTING - commit override");
+ send_auth_reply(hapd, mgmt->sa, mgmt->bssid, WLAN_AUTH_SAE,
+ auth_transaction, resp,
+ wpabuf_head(hapd->conf->sae_commit_override),
+ wpabuf_len(hapd->conf->sae_commit_override));
+ goto remove_sta;
+ }
#endif /* CONFIG_TESTING_OPTIONS */
if (!sta->sae) {
if (auth_transaction != 1 ||