aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2020-03-27 15:28:59 (GMT)
committerJouni Malinen <j@w1.fi>2020-03-27 15:44:06 (GMT)
commit547dc7eaa30d5232933d78618a690714f7c59705 (patch)
treebf4596d6b1f1e599e1ce59624db5100d507aa66b /src/common
parent804fc268af6513706a210edc1eeeb8238bcedb00 (diff)
downloadhostap-547dc7eaa30d5232933d78618a690714f7c59705.zip
hostap-547dc7eaa30d5232933d78618a690714f7c59705.tar.gz
hostap-547dc7eaa30d5232933d78618a690714f7c59705.tar.bz2
DPP: Add DPP_BOOTSTRAP_SET command
"DPP_BOOTSTRAP_SET <ID> <configurator parameters..>" can now be used to set peer specific configurator parameters which will override any global parameters from dpp_configurator_params. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/dpp.c20
-rw-r--r--src/common/dpp.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/src/common/dpp.c b/src/common/dpp.c
index 7f0f0b6..6bb1311 100644
--- a/src/common/dpp.c
+++ b/src/common/dpp.c
@@ -10532,6 +10532,26 @@ int dpp_bootstrap_info(struct dpp_global *dpp, int id,
}
+int dpp_bootstrap_set(struct dpp_global *dpp, int id, const char *params)
+{
+ struct dpp_bootstrap_info *bi;
+
+ bi = dpp_bootstrap_get_id(dpp, id);
+ if (!bi)
+ return -1;
+
+ str_clear_free(bi->configurator_params);
+
+ if (params) {
+ bi->configurator_params = os_strdup(params);
+ return bi->configurator_params ? 0 : -1;
+ }
+
+ bi->configurator_params = NULL;
+ return 0;
+}
+
+
void dpp_bootstrap_find_pair(struct dpp_global *dpp, const u8 *i_bootstrap,
const u8 *r_bootstrap,
struct dpp_bootstrap_info **own_bi,
diff --git a/src/common/dpp.h b/src/common/dpp.h
index 0ec0024..bab83a8 100644
--- a/src/common/dpp.h
+++ b/src/common/dpp.h
@@ -562,6 +562,7 @@ dpp_pkex_finish(struct dpp_global *dpp, struct dpp_pkex *pkex, const u8 *peer,
const char * dpp_bootstrap_get_uri(struct dpp_global *dpp, unsigned int id);
int dpp_bootstrap_info(struct dpp_global *dpp, int id,
char *reply, int reply_size);
+int dpp_bootstrap_set(struct dpp_global *dpp, int id, const char *params);
void dpp_bootstrap_find_pair(struct dpp_global *dpp, const u8 *i_bootstrap,
const u8 *r_bootstrap,
struct dpp_bootstrap_info **own_bi,