aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-11-28 13:20:32 (GMT)
committerJouni Malinen <j@w1.fi>2019-11-28 14:39:09 (GMT)
commit71e2848eabe13b9e221916bc927b456fdf93077d (patch)
treea18c2f6ea1563d855729eb35b6652bdb5e1f3372
parent57a63b13185bb09b3afcf1644039f4a8bfa865cd (diff)
downloadhostap-71e2848eabe13b9e221916bc927b456fdf93077d.zip
hostap-71e2848eabe13b9e221916bc927b456fdf93077d.tar.gz
hostap-71e2848eabe13b9e221916bc927b456fdf93077d.tar.bz2
DPP2: ssid64/ssid_charset in Configurator
This allows Configurator to be configured to use the ssid64 option in the discovery object for a station Enrollee. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--src/common/dpp.c22
-rw-r--r--src/common/dpp.h1
2 files changed, 21 insertions, 2 deletions
diff --git a/src/common/dpp.c b/src/common/dpp.c
index cb4a031..6c20fc1 100644
--- a/src/common/dpp.c
+++ b/src/common/dpp.c
@@ -4432,6 +4432,16 @@ static int dpp_configuration_parse_helper(struct dpp_authentication *auth,
#endif /* CONFIG_TESTING_OPTIONS */
}
+ pos = os_strstr(cmd, " ssid_charset=");
+ if (pos) {
+ if (conf_ap) {
+ wpa_printf(MSG_INFO,
+ "DPP: ssid64 option (ssid_charset param) not allowed for AP enrollee");
+ goto fail;
+ }
+ conf->ssid_charset = atoi(pos + 14);
+ }
+
pos = os_strstr(cmd, " pass=");
if (pos) {
size_t pass_len;
@@ -4657,11 +4667,19 @@ dpp_build_conf_start(struct dpp_authentication *auth,
}
#endif /* CONFIG_TESTING_OPTIONS */
json_start_object(buf, "discovery");
- if (json_add_string_escape(buf, "ssid", conf->ssid,
- conf->ssid_len) < 0) {
+ if (((!conf->ssid_charset || auth->peer_version < 2) &&
+ json_add_string_escape(buf, "ssid", conf->ssid,
+ conf->ssid_len) < 0) ||
+ ((conf->ssid_charset && auth->peer_version >= 2) &&
+ json_add_base64url(buf, "ssid64", conf->ssid,
+ conf->ssid_len) < 0)) {
wpabuf_free(buf);
return NULL;
}
+ if (conf->ssid_charset > 0) {
+ json_value_sep(buf);
+ json_add_int(buf, "ssid_charset", conf->ssid_charset);
+ }
json_end_object(buf);
json_value_sep(buf);
diff --git a/src/common/dpp.h b/src/common/dpp.h
index d78e9aa..2a558b6 100644
--- a/src/common/dpp.h
+++ b/src/common/dpp.h
@@ -169,6 +169,7 @@ enum dpp_netrole {
struct dpp_configuration {
u8 ssid[32];
size_t ssid_len;
+ int ssid_charset;
enum dpp_akm akm;
enum dpp_netrole netrole;