From: Daniel Wagner Date: Sat, 22 May 2010 17:57:22 +0000 (+0200) Subject: Add configuration file option for passphrase X-Git-Tag: 2.0_alpha~2733 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=81cc256cb78dd57919cfbcc6598673d2797fb2f9;p=framework%2Fconnectivity%2Fconnman.git Add configuration file option for passphrase --- diff --git a/doc/config-format.txt b/doc/config-format.txt index ef530e6..bc5a5c1 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 87c2bae..bdbb704 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)