diff options
-rw-r--r-- | doc/config-format.txt | 1 | ||||
-rw-r--r-- | src/config.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/config-format.txt b/doc/config-format.txt index ef530e60..bc5a5c18 100644 --- a/doc/config-format.txt +++ b/doc/config-format.txt @@ -39,6 +39,7 @@ passphrase. The PrivateKeyPassphrase field is ignored when this field is set to fsid. - Identity: Identity string for EAP. - Phase2: Phase2 (inner authentication with TLS tunnel) parameters. +- Passphrase: RSN/WPA/WPA2 Passphrase Example diff --git a/src/config.c b/src/config.c index 87c2bae1..bdbb7045 100644 --- a/src/config.c +++ b/src/config.c @@ -44,6 +44,7 @@ struct connman_config_service { char *private_key_passphrase; char *private_key_passphrase_type; char *phase2; + char *passphrase; }; struct connman_config { @@ -87,6 +88,7 @@ static void unregister_service(gpointer data) g_free(service->private_key_passphrase); g_free(service->private_key_passphrase_type); g_free(service->phase2); + g_free(service->passphrase); g_free(service); } @@ -211,6 +213,12 @@ static int load_service(GKeyFile *keyfile, const char *group, service->phase2 = str; } + str = g_key_file_get_string(keyfile, group, "Passphrase", NULL); + if (str != NULL) { + g_free(service->passphrase); + service->passphrase = str; + } + g_hash_table_replace(config->service_table, service->ident, service); connman_info("Adding service configuration %s", service->ident); @@ -440,6 +448,9 @@ static void provision_service(gpointer key, gpointer value, gpointer user_data) if (config->phase2 != NULL) __connman_service_set_string(service, "Phase2", config->phase2); + + if (config->passphrase != NULL) + __connman_service_set_string(service, "Passphrase", config->passphrase); } int __connman_config_provision_service(struct connman_service *service) |