gboolean favorite;
gboolean autoconnect;
gchar *is_hidden;
+ gboolean is_created;
gchar *proxy_address;
struct wifi_eap_config *eap_config;
wifi_ip_info_s *ip_info;
}
DBG("security_type [%s]", config->security_type);
+ config->passphrase = g_key_file_get_string(keyfile, group_name, WIFI_CONFIG_PASSPHRASE, NULL);
+ DBG("passphrase []");
+
config->proxy_address = g_key_file_get_string(keyfile, group_name, WIFI_CONFIG_PROXY_SERVER, NULL);
if (config->proxy_address)
DBG("proxy_address [%s]", config->proxy_address);
b = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
g_variant_builder_add(b, "{sv}", WIFI_CONFIG_NAME, g_variant_new_string(conf->name));
g_variant_builder_add(b, "{sv}", WIFI_CONFIG_SECURITY_TYPE, g_variant_new_string(conf->security_type));
+ g_variant_builder_add(b, "{sv}", WIFI_CONFIG_PASSPHRASE, g_variant_new_string(conf->passphrase));
g_variant_builder_add(b, "{sv}", WIFI_CONFIG_HIDDEN, g_variant_new_string(conf->is_hidden));
if (conf->proxy_address != NULL)
} else {
conf->is_hidden = NULL;
}
+ } else if (g_strcmp0(field, WIFI_CONFIG_CREATED) == 0) {
+ if (g_variant_is_of_type(value, G_VARIANT_TYPE_BOOLEAN)) {
+ conf->is_created = g_variant_get_boolean(value);
+ DBG("is_created [%d]", conf->is_created);
+ } else {
+ conf->is_created = FALSE;
+ }
} else if (g_strcmp0(field, WIFI_CONFIG_IPV4_METHOD) == 0) {
if (g_variant_is_of_type(value, G_VARIANT_TYPE_STRING)) {
conf->ip_info->ip_type = g_strdup(g_variant_get_string(value, NULL));
if (conf->passphrase != NULL) {
gchar *enc_data = NULL;
- enc_data = _netconfig_encrypt_passphrase(conf->passphrase);
+
+ if (conf->is_created == true)
+ enc_data = _netconfig_encrypt_passphrase(conf->passphrase);
+ else
+ enc_data = g_strdup(conf->passphrase);
if (!enc_data) {
ERR("Failed to encrypt the passphrase");
} else {
conf->is_hidden = NULL;
}
+ } else if (g_strcmp0(field, WIFI_CONFIG_CREATED) == 0) {
+ if (g_variant_is_of_type(value, G_VARIANT_TYPE_BOOLEAN)) {
+ conf->is_created = g_variant_get_boolean(value);
+ DBG("is_created [%d]", conf->is_created);
+ } else {
+ conf->is_created = FALSE;
+ }
} else if (g_strcmp0(field, WIFI_CONFIG_PROXYADDRESS) == 0) {
if (g_variant_is_of_type(value, G_VARIANT_TYPE_STRING)) {
conf->proxy_address = g_strdup(g_variant_get_string(value, NULL));
if (conf->passphrase != NULL) {
gchar *enc_data = NULL;
- enc_data = _netconfig_encrypt_passphrase(conf->passphrase);
+
+ if (conf->is_created == true)
+ enc_data = _netconfig_encrypt_passphrase(conf->passphrase);
+ else
+ enc_data = g_strdup(conf->passphrase);
if (!enc_data) {
ERR("Failed to encrypt the passphrase");