aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/config_file.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-08-08 15:18:03 (GMT)
committerJouni Malinen <j@w1.fi>2015-08-08 15:18:03 (GMT)
commitbc02843e75e5b9a2dfc7469adceb3fa3b69bf5fb (patch)
tree6795a25c871062295cdaf92b67cac765e4e0e5f5 /hostapd/config_file.c
parent44fa5e747b7aca39285e2511d5c94684e0723b6b (diff)
downloadhostap-bc02843e75e5b9a2dfc7469adceb3fa3b69bf5fb.zip
hostap-bc02843e75e5b9a2dfc7469adceb3fa3b69bf5fb.tar.gz
hostap-bc02843e75e5b9a2dfc7469adceb3fa3b69bf5fb.tar.bz2
hostapd: Add testing option to override own WPA/RSN IE(s)
This allows the new own_ie_override=<hexdump> configuration parameter to be used to replace the normally generated WPA/RSN IE(s) for testing purposes in CONFIG_TESTING_OPTIONS=y builds. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'hostapd/config_file.c')
-rw-r--r--hostapd/config_file.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 0edf6af..f8ca6da 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3268,6 +3268,24 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->bss_load_test_set = 1;
} else if (os_strcmp(buf, "radio_measurements") == 0) {
bss->radio_measurements = atoi(pos);
+ } else if (os_strcmp(buf, "own_ie_override") == 0) {
+ struct wpabuf *tmp;
+ size_t len = os_strlen(pos) / 2;
+
+ tmp = wpabuf_alloc(len);
+ if (!tmp)
+ return 1;
+
+ if (hexstr2bin(pos, wpabuf_put(tmp, len), len)) {
+ wpabuf_free(tmp);
+ wpa_printf(MSG_ERROR,
+ "Line %d: Invalid own_ie_override '%s'",
+ line, pos);
+ return 1;
+ }
+
+ wpabuf_free(bss->own_ie_override);
+ bss->own_ie_override = tmp;
#endif /* CONFIG_TESTING_OPTIONS */
} else if (os_strcmp(buf, "vendor_elements") == 0) {
struct wpabuf *elems;