[Commits] [SCM] claws branch, master, updated. 3.13.2-95-g14f31ef

ticho at claws-mail.org ticho at claws-mail.org
Wed Mar 30 23:07:31 CEST 2016


The branch, master has been updated
       via  14f31efdd61627e1e654347aff6e065c5eb5c2c6 (commit)
       via  c6bdd4be68b16e397b09d16078d06982585a01d1 (commit)
      from  73e0a2e64074bab0b6abfde58fdf569b183dde5d (commit)

Summary of changes:
 src/plugins/spam_report/spam_report_prefs.c |    4 +--
 src/plugins/vcalendar/claws.def             |    2 --
 src/plugins/vcalendar/plugin.c              |    5 ---
 src/plugins/vcalendar/plugin.def            |    1 -
 src/plugins/vcalendar/vcal_folder.c         |    6 ++--
 src/plugins/vcalendar/vcal_prefs.c          |   48 ++++++++++++++-------------
 src/plugins/vcalendar/vcal_prefs.h          |    1 -
 src/plugins/vcalendar/vcalendar.h           |    6 ++++
 8 files changed, 36 insertions(+), 37 deletions(-)


- Log -----------------------------------------------------------------
commit 14f31efdd61627e1e654347aff6e065c5eb5c2c6
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Mar 30 23:02:14 2016 +0200

    Migrate SpamReport passwords to password store correctly.

diff --git a/src/plugins/spam_report/spam_report_prefs.c b/src/plugins/spam_report/spam_report_prefs.c
index 1aaf293..86dd190 100644
--- a/src/plugins/spam_report/spam_report_prefs.c
+++ b/src/plugins/spam_report/spam_report_prefs.c
@@ -91,8 +91,8 @@ void spamreport_prefs_init(void)
 	/* Move passwords that are still in main config to password store. */
 	for (i = 0; i < INTF_LAST; i++) {
 		if (spamreport_prefs.pass[i] != NULL) {
-			spamreport_passwd_set(spam_interfaces[i].name,
-					spamreport_prefs.pass[i]);
+			passwd_store_set(PWS_PLUGIN, "SpamReport",
+					spam_interfaces[i].name, spamreport_prefs.pass[i], TRUE);
 			passwords_migrated = TRUE;
 		}
 	}

commit c6bdd4be68b16e397b09d16078d06982585a01d1
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Mar 30 22:59:09 2016 +0200

    Make vCalendar plugin use the password store.

diff --git a/src/plugins/vcalendar/claws.def b/src/plugins/vcalendar/claws.def
index 297aa5f..de9bbe5 100644
--- a/src/plugins/vcalendar/claws.def
+++ b/src/plugins/vcalendar/claws.def
@@ -109,8 +109,6 @@ mimeview_register_viewer_factory
 mimeview_unregister_viewer_factory
 move_file
 open_uri
-password_decrypt
-password_encrypt
 prefs_button_toggled
 prefs_common
 prefs_common_get_uri_cmd
diff --git a/src/plugins/vcalendar/plugin.c b/src/plugins/vcalendar/plugin.c
index 945cab5..575181d 100644
--- a/src/plugins/vcalendar/plugin.c
+++ b/src/plugins/vcalendar/plugin.c
@@ -99,11 +99,6 @@ const gchar *plugin_version(void)
 	return VERSION;
 }
 
-void plugin_master_passphrase_change (const gchar *oldp, const gchar *newp)
-{
-	vcal_prefs_master_passphrase_change(oldp, newp);
-}
-
 struct PluginFeature *plugin_provides(void)
 {
 	static struct PluginFeature features[] = 
diff --git a/src/plugins/vcalendar/plugin.def b/src/plugins/vcalendar/plugin.def
index f79dd57..8916a5d 100644
--- a/src/plugins/vcalendar/plugin.def
+++ b/src/plugins/vcalendar/plugin.def
@@ -7,5 +7,4 @@ EXPORTS
         plugin_type
 	plugin_provides
         plugin_version
-	plugin_master_passphrase_change
 
diff --git a/src/plugins/vcalendar/vcal_folder.c b/src/plugins/vcalendar/vcal_folder.c
index 96630cd..b495950 100644
--- a/src/plugins/vcalendar/vcal_folder.c
+++ b/src/plugins/vcalendar/vcal_folder.c
@@ -60,7 +60,7 @@
 #include "mainwindow.h"
 #include "statusbar.h"
 #include "msgcache.h"
-#include "password.h"
+#include "passwordstore.h"
 #include "timing.h"
 #include "messageview.h"
 
@@ -1178,8 +1178,8 @@ void vcal_folder_export(Folder *folder)
 		return;
 	vcal_folder_lock_count++;
 	
-	export_pass = password_decrypt(vcalprefs.export_pass, NULL);
-	export_freebusy_pass = password_decrypt(vcalprefs.export_freebusy_pass, NULL);
+	export_pass = vcal_passwd_get("export");
+	export_freebusy_pass = vcal_passwd_get("export_freebusy");
 
 	if (vcal_meeting_export_calendar(vcalprefs.export_path, 
 			vcalprefs.export_user, 
diff --git a/src/plugins/vcalendar/vcal_prefs.c b/src/plugins/vcalendar/vcal_prefs.c
index baf40d4..8686ba8 100644
--- a/src/plugins/vcalendar/vcal_prefs.c
+++ b/src/plugins/vcalendar/vcal_prefs.c
@@ -30,7 +30,7 @@
 #include "defs.h"
 
 #include "mainwindow.h"
-#include "password.h"
+#include "passwordstore.h"
 #include "prefs.h"
 #include "prefs_gtk.h"
 #include "prefswindow.h"
@@ -562,8 +562,8 @@ static void vcal_prefs_create_widget_func(PrefsPage * _page,
 	if (!vcalprefs.export_freebusy_pass)
 		vcalprefs.export_freebusy_pass = g_strdup("");
 
-	export_pass = password_decrypt(vcalprefs.export_pass, NULL);
-	export_freebusy_pass = password_decrypt(vcalprefs.export_freebusy_pass, NULL);
+	export_pass = vcal_passwd_get("export");
+	export_freebusy_pass = vcal_passwd_get("export_freebusy");
 	
 	gtk_entry_set_text(GTK_ENTRY(export_user_entry), vcalprefs.export_user);
 	gtk_entry_set_text(GTK_ENTRY(export_pass_entry), (export_pass != NULL ? export_pass : ""));
@@ -683,7 +683,7 @@ static void vcal_prefs_save_func(PrefsPage * _page)
 	g_free(vcalprefs.export_pass);
 	pass = gtk_editable_get_chars(GTK_EDITABLE(page->export_pass_entry), 0, -1);
 	
-	vcalprefs.export_pass = password_encrypt(pass, NULL);
+	vcal_passwd_set("export", pass);
 	memset(pass, 0, strlen(pass));
 	g_free(pass);
 	
@@ -705,7 +705,8 @@ static void vcal_prefs_save_func(PrefsPage * _page)
 	    gtk_editable_get_chars(GTK_EDITABLE(page->export_freebusy_user_entry), 0, -1);
 	g_free(vcalprefs.export_freebusy_pass);
 	pass = gtk_editable_get_chars(GTK_EDITABLE(page->export_freebusy_pass_entry), 0, -1);
-	vcalprefs.export_freebusy_pass = password_encrypt(pass, NULL);
+
+	vcal_passwd_set("export_freebusy", pass);
 	memset(pass, 0, strlen(pass));
 	g_free(pass);
 
@@ -720,31 +721,15 @@ static void vcal_prefs_save_func(PrefsPage * _page)
 					 (page->ssl_verify_peer_checkbtn));
 
 	vcal_prefs_save();
+	passwd_store_write_config();
 	vcal_folder_export(NULL);
 }
 
-void vcal_prefs_master_passphrase_change(const gchar *oldp, const gchar *newp) {
-	gchar *pass;
-	pass = password_decrypt(vcalprefs.export_pass, oldp);
-	if (pass != NULL) {
-		g_free(vcalprefs.export_pass);
-		vcalprefs.export_pass = password_encrypt(pass, newp);
-		memset(pass, 0, strlen(pass));
-	}
-	g_free(pass);
-	pass = password_decrypt(vcalprefs.export_freebusy_pass, oldp);
-	if (pass != NULL) {
-		g_free(vcalprefs.export_freebusy_pass);
-		vcalprefs.export_freebusy_pass = password_encrypt(pass, newp);
-		memset(pass, 0, strlen(pass));
-	}
-	g_free(pass);
-}
-
 void vcal_prefs_init(void)
 {
 	static gchar *path[3];
 	gchar *rcpath;
+	gboolean passwords_migrated = FALSE;
 
 	path[0] = _("Plugins");
 	path[1] = _("vCalendar");
@@ -755,6 +740,23 @@ void vcal_prefs_init(void)
 	prefs_read_config(param, PREFS_BLOCK_NAME, rcpath, NULL);
 	g_free(rcpath);
 
+	/* Move passwords that are still in main config to password store. */
+	if (vcalprefs.export_pass != NULL &&
+			strlen(vcalprefs.export_pass) > 0) {
+		passwd_store_set(PWS_PLUGIN, "vCalendar", "export",
+				vcalprefs.export_pass, TRUE);
+		passwords_migrated = TRUE;
+	}
+	if (vcalprefs.export_freebusy_pass != NULL &&
+			strlen(vcalprefs.export_freebusy_pass) > 0) {
+		passwd_store_set(PWS_PLUGIN, "vCalendar", "export",
+				vcalprefs.export_freebusy_pass, TRUE);
+		passwords_migrated = TRUE;
+	}
+
+	if (passwords_migrated)
+		passwd_store_write_config();
+
 	vcal_prefs_page.page.path = path;
 	vcal_prefs_page.page.create_widget = vcal_prefs_create_widget_func;
 	vcal_prefs_page.page.destroy_widget = vcal_prefs_destroy_widget_func;
diff --git a/src/plugins/vcalendar/vcal_prefs.h b/src/plugins/vcalendar/vcal_prefs.h
index 9e7d89f..8a89f37 100644
--- a/src/plugins/vcalendar/vcal_prefs.h
+++ b/src/plugins/vcalendar/vcal_prefs.h
@@ -51,6 +51,5 @@ extern VcalendarPrefs vcalprefs;
 void vcal_prefs_init	(void);
 void vcal_prefs_done	(void);
 void vcal_prefs_save	(void);
-void vcal_prefs_master_passphrase_change(const gchar *oldp, const gchar *newp);
 
 #endif
diff --git a/src/plugins/vcalendar/vcalendar.h b/src/plugins/vcalendar/vcalendar.h
index 92aa05b..09d7cbd 100644
--- a/src/plugins/vcalendar/vcalendar.h
+++ b/src/plugins/vcalendar/vcalendar.h
@@ -34,4 +34,10 @@ void vcalviewer_display_event (VCalViewer *vcalviewer, VCalEvent *event);
 gchar *vcalviewer_get_uid_from_mimeinfo(MimeInfo *mimeinfo);
 void vcalviewer_reload(FolderItem *item);
 void vcalendar_cancel_meeting(FolderItem *item, const gchar *uid);
+
+#define vcal_passwd_set(id, pwd) \
+	passwd_store_set(PWS_PLUGIN, "vCalendar", id, pwd, FALSE)
+#define vcal_passwd_get(id) \
+	passwd_store_get(PWS_PLUGIN, "vCalendar", id)
+
 #endif

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list