aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorPurushottam Kushwaha <pkushwah@codeaurora.org>2018-08-10 07:03:14 (GMT)
committerJouni Malinen <j@w1.fi>2018-08-30 20:34:00 (GMT)
commit20f612d99893259136fb5e4937dbe165c4268978 (patch)
treea8dfc5ac06089c9e720d6df7d662bc8aedd862a0 /wpa_supplicant
parent495aebd39fc006e25a090b1f51e6d97d3e42d77f (diff)
downloadhostap-20f612d99893259136fb5e4937dbe165c4268978.zip
hostap-20f612d99893259136fb5e4937dbe165c4268978.tar.gz
hostap-20f612d99893259136fb5e4937dbe165c4268978.tar.bz2
DPP: Set group id through DPP_AUTH_INIT or dpp_configurator_params
This enhances DPP_AUTH_INIT, DPP_CONFIGURATOR_SIGN, and SET dpp_configurator_params to allow optional setting of the DPP groupId string for a Connector. If the value is not set, the previously wildcard value ("*") is used by default. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/dpp_supplicant.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
index d14203f..899c4c2 100644
--- a/wpa_supplicant/dpp_supplicant.c
+++ b/wpa_supplicant/dpp_supplicant.c
@@ -540,6 +540,7 @@ static void wpas_dpp_set_configurator(struct wpa_supplicant *wpa_s,
size_t pass_len = 0;
u8 psk[PMK_LEN];
int psk_set = 0;
+ char *group_id = NULL;
if (!cmd)
return;
@@ -575,6 +576,20 @@ static void wpas_dpp_set_configurator(struct wpa_supplicant *wpa_s,
psk_set = 1;
}
+ pos = os_strstr(cmd, " group_id=");
+ if (pos) {
+ size_t group_id_len;
+
+ pos += 10;
+ end = os_strchr(pos, ' ');
+ group_id_len = end ? (size_t) (end - pos) : os_strlen(pos);
+ group_id = os_malloc(group_id_len + 1);
+ if (!group_id)
+ goto fail;
+ os_memcpy(group_id, pos, group_id_len);
+ group_id[group_id_len] = '\0';
+ }
+
if (os_strstr(cmd, " conf=sta-")) {
conf_sta = os_zalloc(sizeof(struct dpp_configuration));
if (!conf_sta)
@@ -602,6 +617,10 @@ static void wpas_dpp_set_configurator(struct wpa_supplicant *wpa_s,
} else {
goto fail;
}
+ if (os_strstr(cmd, " group_id=")) {
+ conf_sta->group_id = group_id;
+ group_id = NULL;
+ }
}
if (os_strstr(cmd, " conf=ap-")) {
@@ -631,6 +650,10 @@ static void wpas_dpp_set_configurator(struct wpa_supplicant *wpa_s,
} else {
goto fail;
}
+ if (os_strstr(cmd, " group_id=")) {
+ conf_ap->group_id = group_id;
+ group_id = NULL;
+ }
}
pos = os_strstr(cmd, " expiry=");
@@ -660,12 +683,14 @@ static void wpas_dpp_set_configurator(struct wpa_supplicant *wpa_s,
auth->conf_sta = conf_sta;
auth->conf_ap = conf_ap;
auth->conf = conf;
+ os_free(group_id);
return;
fail:
wpa_printf(MSG_DEBUG, "DPP: Failed to set configurator parameters");
dpp_configuration_free(conf_sta);
dpp_configuration_free(conf_ap);
+ os_free(group_id);
}