Merge tag 'upstream/1.40' into tizen.
[platform/upstream/connman.git] / src / technology.c
index f16ee38..7480ce9 100644 (file)
@@ -216,10 +216,12 @@ static void technology_save(struct connman_technology *technology)
                                        "Tethering.Identifier",
                                        technology->tethering_ident);
 
-       if (technology->tethering_passphrase)
+       if (technology->tethering_passphrase) {
+               char *enc = g_strescape(technology->tethering_passphrase, NULL);
                g_key_file_set_string(keyfile, identifier,
-                                       "Tethering.Passphrase",
-                                       technology->tethering_passphrase);
+                                       "Tethering.Passphrase", enc);
+               g_free(enc);
+       }
 
 #ifdef TIZEN_EXT
        if (technology->type == CONNMAN_SERVICE_TYPE_WIFI) {
@@ -446,6 +448,7 @@ static void technology_load(struct connman_technology *technology)
        gchar *identifier;
        GError *error = NULL;
        bool enable, need_saving = false;
+       char *enc;
 
        DBG("technology %p", technology);
 
@@ -502,9 +505,10 @@ static void technology_load(struct connman_technology *technology)
        technology->tethering_ident = g_key_file_get_string(keyfile,
                                identifier, "Tethering.Identifier", NULL);
 
-       technology->tethering_passphrase = g_key_file_get_string(keyfile,
+       enc = g_key_file_get_string(keyfile,
                                identifier, "Tethering.Passphrase", NULL);
-
+       if (enc)
+               technology->tethering_passphrase = g_strcompress(enc);
 #ifdef TIZEN_EXT
        if (technology->type == CONNMAN_SERVICE_TYPE_WIFI) {
                unsigned int val = 0;