From 479e412a67e0c7083d2c9b47380dd30b3d738aac Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 18 Jul 2022 23:57:22 +0300 Subject: [PATCH] DPP3: Default value for dpp_connector_privacy The new global configuration parameter dpp_connector_privacy_default=<0/1> can now be used to set the default value for the dpp_connector_privacy parameter for all new networks provisioned using DPP. Signed-off-by: Jouni Malinen --- wpa_supplicant/config.c | 1 + wpa_supplicant/config.h | 7 +++++++ wpa_supplicant/config_file.c | 3 +++ wpa_supplicant/dpp_supplicant.c | 3 +++ 4 files changed, 14 insertions(+) diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index dcc4e4971..082ddd84e 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -5306,6 +5306,7 @@ static const struct global_parse_data global_fields[] = { { STR(dpp_mud_url), 0 }, { STR(dpp_extra_conf_req_name), 0 }, { STR(dpp_extra_conf_req_value), 0 }, + { INT_RANGE(dpp_connector_privacy_default, 0, 1), 0 }, #endif /* CONFIG_DPP */ { INT_RANGE(coloc_intf_reporting, 0, 1), 0 }, #ifdef CONFIG_WNM diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index d16913692..8b8be2a45 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -1629,6 +1629,13 @@ struct wpa_config { */ char *dpp_extra_conf_req_value; + /* dpp_connector_privacy_default - Default valur for Connector privacy + * + * This value is used as the default for the dpp_connector_privacy + * network parameter for all new networks provisioned using DPP. + */ + int dpp_connector_privacy_default; + /** * coloc_intf_reporting - Colocated interference reporting * diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index fcb4c31e7..b637dbfbc 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -1554,6 +1554,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) if (config->dpp_extra_conf_req_value) fprintf(f, "dpp_extra_conf_req_value=%s\n", config->dpp_extra_conf_req_value); + if (config->dpp_connector_privacy_default) + fprintf(f, "dpp_connector_privacy_default=%d\n", + config->dpp_connector_privacy_default); if (config->coloc_intf_reporting) fprintf(f, "coloc_intf_reporting=%d\n", config->coloc_intf_reporting); diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c index 70d3136d8..c57c3531e 100644 --- a/wpa_supplicant/dpp_supplicant.c +++ b/wpa_supplicant/dpp_supplicant.c @@ -1277,6 +1277,9 @@ static struct wpa_ssid * wpas_dpp_add_network(struct wpa_supplicant *wpa_s, ssid->dpp_connector = os_strdup(conf->connector); if (!ssid->dpp_connector) goto fail; + + ssid->dpp_connector_privacy = + wpa_s->conf->dpp_connector_privacy_default; } if (conf->c_sign_key) {