aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2020-03-27 15:14:06 (GMT)
committerJouni Malinen <j@w1.fi>2020-03-27 15:44:06 (GMT)
commit804fc268af6513706a210edc1eeeb8238bcedb00 (patch)
tree190b40c57f5e935fd9c8853759d585e6289c9265 /src/common
parent514cc49ba588be6913fb68ae057477dc8fd929aa (diff)
downloadhostap-804fc268af6513706a210edc1eeeb8238bcedb00.zip
hostap-804fc268af6513706a210edc1eeeb8238bcedb00.tar.gz
hostap-804fc268af6513706a210edc1eeeb8238bcedb00.tar.bz2
DPP: Allow per-peer configurator parameters to be set
This is a more convenient way of addressing cases where a Configurator/Controller may store a large number of peer bootstrapping information instances and may need to manage different configuration parameters for each peer while operating as the Responder. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/dpp.c11
-rw-r--r--src/common/dpp.h2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/common/dpp.c b/src/common/dpp.c
index 57afbd5..7f0f0b6 100644
--- a/src/common/dpp.c
+++ b/src/common/dpp.c
@@ -894,6 +894,7 @@ void dpp_bootstrap_info_free(struct dpp_bootstrap_info *info)
os_free(info->chan);
os_free(info->pk);
EVP_PKEY_free(info->pubkey);
+ str_clear_free(info->configurator_params);
os_free(info);
}
@@ -2370,6 +2371,9 @@ struct dpp_authentication * dpp_auth_init(struct dpp_global *dpp, void *msg_ctx,
auth = dpp_alloc_auth(dpp, msg_ctx);
if (!auth)
return NULL;
+ if (peer_bi->configurator_params &&
+ dpp_set_configurator(auth, peer_bi->configurator_params) < 0)
+ goto fail;
auth->initiator = 1;
auth->waiting_auth_resp = 1;
auth->allowed_roles = dpp_allowed_roles;
@@ -3306,6 +3310,9 @@ dpp_auth_req_rx(struct dpp_global *dpp, void *msg_ctx, u8 dpp_allowed_roles,
auth = dpp_alloc_auth(dpp, msg_ctx);
if (!auth)
goto fail;
+ if (peer_bi && peer_bi->configurator_params &&
+ dpp_set_configurator(auth, peer_bi->configurator_params) < 0)
+ goto fail;
auth->peer_bi = peer_bi;
auth->own_bi = own_bi;
auth->curve = own_bi->curve;
@@ -4683,8 +4690,10 @@ int dpp_set_configurator(struct dpp_authentication *auth, const char *cmd)
char *tmp = NULL;
int ret = -1;
- if (!cmd)
+ if (!cmd || auth->configurator_set)
return 0;
+ auth->configurator_set = 1;
+
if (cmd[0] != ' ') {
size_t len;
diff --git a/src/common/dpp.h b/src/common/dpp.h
index d6da046..0ec0024 100644
--- a/src/common/dpp.h
+++ b/src/common/dpp.h
@@ -126,6 +126,7 @@ struct dpp_bootstrap_info {
const struct dpp_curve_params *curve;
unsigned int pkex_t; /* number of failures before dpp_pkex
* instantiation */
+ char *configurator_params;
};
#define PKEX_COUNTER_T_LIMIT 5
@@ -275,6 +276,7 @@ struct dpp_authentication {
int send_conn_status;
int conn_status_requested;
int akm_use_selector;
+ int configurator_set;
#ifdef CONFIG_TESTING_OPTIONS
char *config_obj_override;
char *discovery_override;