Modified to support EAP in GetConfigPassphrase dbus method 85/315685/1 accepted/tizen_9.0_unified accepted/tizen/9.0/unified/20241205.174732
authorJaehyun Kim <jeik01.kim@samsung.com>
Wed, 4 Dec 2024 04:49:50 +0000 (13:49 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Wed, 4 Dec 2024 04:51:11 +0000 (13:51 +0900)
The dbus method that provides the existing wifi passphrase
has been modified to support the EAP type as well.

Change-Id: Idd9e2841e025cf2253c8035e9f57add845dac843
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/wifi-config.c

index 88cda23a441c39b60a10d0e6aed1ed631f86b10a..ab74512c052d3cff2e185e6edd8c669686b2fa41 100755 (executable)
@@ -628,6 +628,28 @@ static gboolean _set_field(const gchar *interface_name,
        return ret;
 }
 
+static gchar *_check_passphrase_decryption(gchar *group_name, gchar *enc_pass)
+{
+       gchar *val = NULL;
+       gchar *security_type;
+
+       __get_security_type(group_name, &security_type);
+       if (security_type == NULL) {
+               ERR("Fail to _get_security_type");
+               return val;
+       }
+
+       if (g_strcmp0(security_type, WIFI_SECURITY_NONE) == 0)
+               return val;
+
+       if (g_strcmp0(security_type, WIFI_SECURITY_EAP) != 0)
+               val = _netconfig_decrypt_passphrase(enc_pass);
+       else
+               val = g_strdup(enc_pass);
+
+       return val;
+}
+
 static gboolean _get_field(const gchar *interface_name,
                const gchar *config_id, const gchar *key, gchar **value)
 {
@@ -657,7 +679,7 @@ static gboolean _get_field(const gchar *interface_name,
        } else if (g_strcmp0(key, WIFI_CONFIG_PASSPHRASE) == 0) {
                gchar *enc_pass = g_key_file_get_string(keyfile, group_name, WIFI_CONFIG_PASSPHRASE, NULL);
                if (enc_pass) {
-                       val = _netconfig_decrypt_passphrase(enc_pass);
+                       val = _check_passphrase_decryption(group_name, enc_pass);
                        g_free(enc_pass);
 
                        if (!val)