Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAntenore Gatta (tmow) <antenore@simbiosi.org>2022-01-13 16:45:22 +0300
committerAntenore Gatta (tmow) <antenore@simbiosi.org>2022-01-13 16:45:22 +0300
commit69ec5876e561f7905986952a18228900226f2186 (patch)
treebfda6276f73b2262ce4cdff7d9df7c46e06171b4 /src
parenta814029dfc4c0c6585be557e34c9e5b868e09da2 (diff)
Code cleaning
Diffstat (limited to 'src')
-rw-r--r--src/remmina_file.c30
-rw-r--r--src/remmina_passwd.c2
-rw-r--r--src/remmina_pref.h9
-rw-r--r--src/remmina_pref_dialog.c1
-rw-r--r--src/remmina_unlock.c4
5 files changed, 37 insertions, 9 deletions
diff --git a/src/remmina_file.c b/src/remmina_file.c
index 11be7054e..b27056ab3 100644
--- a/src/remmina_file.c
+++ b/src/remmina_file.c
@@ -52,16 +52,17 @@
#include <glib/gi18n.h>
#include <glib/gstdio.h>
-#include "remmina_public.h"
-#include "remmina_log.h"
+#include "remmina/remmina_trace_calls.h"
#include "remmina_crypt.h"
#include "remmina_file_manager.h"
-#include "remmina_plugin_manager.h"
-#include "remmina_pref.h"
+#include "remmina_log.h"
#include "remmina_main.h"
#include "remmina_masterthread_exec.h"
+#include "remmina_plugin_manager.h"
+#include "remmina_pref.h"
+#include "remmina_public.h"
+#include "remmina_sodium.h"
#include "remmina_utils.h"
-#include "remmina/remmina_trace_calls.h"
#define MIN_WINDOW_WIDTH 10
#define MIN_WINDOW_HEIGHT 10
@@ -399,8 +400,27 @@ remmina_file_load(const gchar *filename)
}
for (keyindex = 0; keyindex < nkeys; ++keyindex) {
key = keys[keyindex];
+ /* It may contain an encrypted password
+ * - password = . // secret_service
+ * - password = $argon2id$v=19$m=262144,t=3,p=… // libsodium
+ */
if (protocol_plugin && remmina_plugin_manager_is_encrypted_setting(protocol_plugin, key)) {
s = g_key_file_get_string(gkeyfile, KEYFILE_GROUP_REMMINA, key, NULL);
+#if 0
+ switch (remmina_pref.enc_mode) {
+ case RM_ENC_MODE_SODIUM_INTERACTIVE:
+ case RM_ENC_MODE_SODIUM_MODERATE:
+ case RM_ENC_MODE_SODIUM_SENSITIVE:
+#if SODIUM_VERSION_INT >= 90200
+#endif
+ break;
+ case RM_ENC_MODE_GCRYPT:
+ break;
+ case RM_ENC_MODE_SECRET:
+ default:
+ break;
+ }
+#endif
if ((g_strcmp0(s, ".") == 0) && (secret_service_available)) {
gchar *sec = secret_plugin->get_password(remminafile, key);
remmina_file_set_string(remminafile, key, sec);
diff --git a/src/remmina_passwd.c b/src/remmina_passwd.c
index ad23ffde7..f1706a463 100644
--- a/src/remmina_passwd.c
+++ b/src/remmina_passwd.c
@@ -147,7 +147,7 @@ gboolean remmina_passwd(GtkWindow *parent, gchar **unlock_password)
#else
*unlock_password = g_strdup(remmina_passwd_dialog->password);
#endif
- REMMINA_DEBUG ("Password after encryption is: %s", *unlock_password);
+ //REMMINA_DEBUG ("Password after encryption is: %s", *unlock_password);
remmina_passwd_dialog->password = NULL;
rc = TRUE;
break;
diff --git a/src/remmina_pref.h b/src/remmina_pref.h
index 1f7e9f0f1..198197b80 100644
--- a/src/remmina_pref.h
+++ b/src/remmina_pref.h
@@ -36,6 +36,12 @@
#pragma once
#include <gtk/gtk.h>
+#include "remmina_sodium.h"
+
+#ifdef HAVE_LIBGCRYPT
+#include <gcrypt.h>
+#endif
+
/*
* Remmina Preference Loader
@@ -85,7 +91,8 @@ enum {
RM_ENC_MODE_SODIUM_INTERACTIVE = 1, /* Using libsodium */
RM_ENC_MODE_SODIUM_MODERATE = 2, /* Using libsodium */
RM_ENC_MODE_SODIUM_SENSITIVE = 3, /* Using libsodium */
- RM_ENC_MODE_GCRYPT = 4 /* Using GCrypt */
+ RM_ENC_MODE_GCRYPT = 4, /* Using GCrypt */
+ RM_ENC_MODE_NONE = 5 /* No encryption */
};
enum {
diff --git a/src/remmina_pref_dialog.c b/src/remmina_pref_dialog.c
index b44491654..3a2f7d385 100644
--- a/src/remmina_pref_dialog.c
+++ b/src/remmina_pref_dialog.c
@@ -729,6 +729,7 @@ GtkWidget *remmina_pref_dialog_new(gint default_tab, GtkWindow *parent)
remmina_pref_dialog->switch_security_lock_connect = GTK_SWITCH(GET_OBJECT("switch_security_lock_connect"));
remmina_pref_dialog->switch_security_lock_edit = GTK_SWITCH(GET_OBJECT("switch_security_lock_edit"));
remmina_pref_dialog->comboboxtext_security_enc_method = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_security_enc_method"));
+
remmina_pref_dialog->switch_security_audit = GTK_SWITCH(GET_OBJECT("switch_security_audit"));
remmina_pref_dialog->switch_security_trust_all = GTK_SWITCH(GET_OBJECT("switch_security_trust_all"));
remmina_pref_dialog->checkbutton_options_save_settings = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_options_save_settings"));
diff --git a/src/remmina_unlock.c b/src/remmina_unlock.c
index cfcfdb0b7..b137b4da2 100644
--- a/src/remmina_unlock.c
+++ b/src/remmina_unlock.c
@@ -182,10 +182,10 @@ gint remmina_unlock_new(GtkWindow *parent)
gchar *unlock_password = NULL;
unlock_password = g_strdup(remmina_pref_get_value("unlock_password"));
- REMMINA_DEBUG ("Password from preferences is: %s", unlock_password);
+ //REMMINA_DEBUG ("Password from preferences is: %s", unlock_password);
if ((unlock_password == NULL) || (g_strcmp0(unlock_password, "") == 0)) {
if (remmina_passwd (GTK_WINDOW(remmina_unlock_dialog->dialog), &unlock_password)) {
- REMMINA_DEBUG ("Password is: %s", unlock_password);
+ //REMMINA_DEBUG ("Password is: %s", unlock_password);
remmina_pref_set_value("unlock_password", g_strdup(unlock_password));
remmina_unlock_dialog->retval = TRUE;
} else {