summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorDaniel Wagner <wagi@monom.org>2010-05-22 19:57:22 +0200
committerMarcel Holtmann <marcel@holtmann.org>2010-05-22 20:01:32 +0200
commit81cc256cb78dd57919cfbcc6598673d2797fb2f9 (patch)
tree9d0906d352f34d04439508880b85ffc9b985ab8b /src/config.c
parentfd6b4fd3904580140fbf8ad64763d46a189ff1c6 (diff)
downloadconnman-81cc256cb78dd57919cfbcc6598673d2797fb2f9.tar.gz
connman-81cc256cb78dd57919cfbcc6598673d2797fb2f9.tar.bz2
connman-81cc256cb78dd57919cfbcc6598673d2797fb2f9.zip
Add configuration file option for passphrase
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c11
1 files changed, 11 insertions, 0 deletions
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)