[connections/fix-rdp-auth-issues: 2/4] connection: Never store credentials in plain-text




commit 3938507d76197e15ca1b3cd2fd3e2ad8a8d924e0
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Aug 6 10:22:41 2021 +0200

    connection: Never store credentials in plain-text

 src/connection.vala | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/connection.vala b/src/connection.vala
index ebd47cd..b8d3c9f 100644
--- a/src/connection.vala
+++ b/src/connection.vala
@@ -102,8 +102,8 @@ namespace Connections {
         private AuthNotification auth_notification = null;
         public bool need_password;
         public bool need_username;
-        public string? username;
-        public string? password;
+        public string? username { get; set; }
+        public string? password { get; set; }
         protected void handle_auth () {
             if (auth_notification != null)
                 return;
@@ -153,8 +153,14 @@ namespace Connections {
         }
 
         public void save (GLib.ParamSpec? pspec = null) {
-            if (uuid != null && pspec != null)
+            if (uuid != null && pspec != null) {
+                /* Don't save the credentials in plain text */
+                if (pspec.name == "username" || pspec.name == "password")
+                    return;
+
                 Database.get_default ().save_property (this, pspec.name);
+
+            }
         }
 
         public string get_visible_name () {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]