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>
This commit is contained in:
Jouni Malinen 2020-03-27 17:14:06 +02:00 committed by Jouni Malinen
parent 514cc49ba5
commit 804fc268af
2 changed files with 12 additions and 1 deletions

View File

@ -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;

View File

@ -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;