[Commits] [SCM] claws branch, master, updated. 3.13.2-39-g0ab9bbd

Colin colin at claws-mail.org
Thu Feb 11 11:37:58 CET 2016


The branch, master has been updated
       via  0ab9bbd83def20e1abf974238f0a712a52222fa7 (commit)
       via  b4ec5f3b2df7ff74a25369f05ce164c8ae94bfab (commit)
       via  1707a23f562534e9b9d2a092e28e451baf8acff2 (commit)
       via  e5bb832c169c89c8cba735e25f639774eccf7324 (commit)
      from  f2c16c568e087c313883c5e5356e06a2f594e3cc (commit)

Summary of changes:
 src/plugins/gdata/cm_gdata_contacts.c       |    8 +++++++-
 src/plugins/spam_report/claws.def           |    1 +
 src/plugins/spam_report/spam_report.c       |    8 +++++++-
 src/plugins/spam_report/spam_report_prefs.c |   11 +++++++++--
 src/plugins/vcalendar/claws.def             |    1 +
 src/plugins/vcalendar/vcal_folder.c         |   19 +++++++++++++++++--
 src/plugins/vcalendar/vcal_meeting_gtk.c    |    4 ++--
 src/plugins/vcalendar/vcal_prefs.c          |   20 ++++++++++++++++++--
 src/prefs_gtk.c                             |    3 +++
 9 files changed, 65 insertions(+), 10 deletions(-)


- Log -----------------------------------------------------------------
commit 0ab9bbd83def20e1abf974238f0a712a52222fa7
Author: Colin Leroy <colin at colino.net>
Date:   Thu Feb 11 11:33:19 2016 +0100

    SpamReport: use new password API

diff --git a/src/plugins/spam_report/claws.def b/src/plugins/spam_report/claws.def
index 15f8289..723dae8 100644
--- a/src/plugins/spam_report/claws.def
+++ b/src/plugins/spam_report/claws.def
@@ -33,6 +33,7 @@ matcherlist_free
 matcherlist_match
 matcherlist_new
 matcherprop_new
+password_decrypt
 pref_get_escaped_pref
 pref_get_unescaped_pref
 prefs_common
diff --git a/src/plugins/spam_report/spam_report.c b/src/plugins/spam_report/spam_report.c
index a194138..ce2fadc 100644
--- a/src/plugins/spam_report/spam_report.c
+++ b/src/plugins/spam_report/spam_report.c
@@ -32,6 +32,7 @@
 #include "common/claws.h"
 #include "common/version.h"
 #include "main.h"
+#include "password.h"
 #include "plugin.h"
 #include "prefs_common.h"
 #include "utils.h"
@@ -221,7 +222,12 @@ static void report_spam(gint id, ReportInterface *intf, MsgInfo *msginfo, gchar
 	switch(intf->type) {
 	case INTF_HTTP_AUTH:
 		if (spamreport_prefs.user[id] && *(spamreport_prefs.user[id])) {
-			auth = g_strdup_printf("%s:%s", spamreport_prefs.user[id], spamreport_prefs.pass[id]);
+			gchar *pass = password_decrypt(spamreport_prefs.pass[id], NULL);
+			auth = g_strdup_printf("%s:%s", spamreport_prefs.user[id], (pass != NULL ? pass : ""));
+			if (pass != NULL) {
+				memset(pass, 0, strlen(pass));
+			}
+			g_free(pass);
 
 			curl = curl_easy_init();
 			curl_easy_setopt(curl, CURLOPT_URL, intf->url);
diff --git a/src/plugins/spam_report/spam_report_prefs.c b/src/plugins/spam_report/spam_report_prefs.c
index 772bd57..f2353e7 100644
--- a/src/plugins/spam_report/spam_report_prefs.c
+++ b/src/plugins/spam_report/spam_report_prefs.c
@@ -30,6 +30,7 @@
 #include <gtk/gtk.h>
 
 #include "gtkutils.h"
+#include "password.h"
 #include "prefs.h"
 #include "prefs_gtk.h"
 #include "prefswindow.h"
@@ -114,6 +115,7 @@ static void create_spamreport_prefs_page(PrefsPage *page,
  	gtk_widget_show(vbox);
        
 	for (i = 0; i < INTF_LAST; i++) {
+		gchar *pass;
 		prefs_page->frame[i] = gtk_frame_new(spam_interfaces[i].name);
 		gtk_box_pack_start(GTK_BOX(vbox), prefs_page->frame[i], FALSE, FALSE, 6);
 
@@ -125,8 +127,13 @@ static void create_spamreport_prefs_page(PrefsPage *page,
 
 		gtk_entry_set_text(GTK_ENTRY(prefs_page->user_entry[i]),
 			spamreport_prefs.user[i] ? spamreport_prefs.user[i]:"");
-		gtk_entry_set_text(GTK_ENTRY(prefs_page->pass_entry[i]),
-			spamreport_prefs.pass[i] ? spamreport_prefs.pass[i]:"");
+
+		pass = password_decrypt(spamreport_prefs.pass[i], NULL);
+		gtk_entry_set_text(GTK_ENTRY(prefs_page->pass_entry[i]), pass ? pass:"");
+		if (pass != NULL) {
+			memset(pass, 0, strlen(pass));
+		}
+		g_free(pass);
 		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_page->enabled_chkbtn[i]),
 			spamreport_prefs.enabled[i]);
 

commit b4ec5f3b2df7ff74a25369f05ce164c8ae94bfab
Author: Colin Leroy <colin at colino.net>
Date:   Thu Feb 11 11:28:07 2016 +0100

    GData: use new password API. Completely untested as I don't have the dependancies available to build!

diff --git a/src/plugins/gdata/cm_gdata_contacts.c b/src/plugins/gdata/cm_gdata_contacts.c
index 6cde920..9a30763 100644
--- a/src/plugins/gdata/cm_gdata_contacts.c
+++ b/src/plugins/gdata/cm_gdata_contacts.c
@@ -31,6 +31,7 @@
 
 #include "addr_compl.h"
 #include "main.h"
+#include "password.h"
 #include "prefs_common.h"
 #include "mainwindow.h"
 #include "common/log.h"
@@ -553,8 +554,13 @@ static void query()
     /* Try to restore from saved refresh token.*/
     if(cm_gdata_config.oauth2_refresh_token)
     {
+      gchar *token = password_decrypt(cm_gdata_config.oauth2_refresh_token, NULL);
       log_message(LOG_PROTOCOL, _("GData plugin: Trying to refresh authorization\n"));
-      gdata_oauth2_authorizer_set_refresh_token(authorizer, cm_gdata_config.oauth2_refresh_token);
+      gdata_oauth2_authorizer_set_refresh_token(authorizer, (token != NULL ? token : ""));
+      if (token != NULL) {
+        memset(token, 0, strlen(token));
+      }
+      g_free(token);
       gdata_authorizer_refresh_authorization_async(GDATA_AUTHORIZER(authorizer), NULL, (GAsyncReadyCallback)cm_gdata_refresh_ready, NULL);
     }
     else

commit 1707a23f562534e9b9d2a092e28e451baf8acff2
Author: Colin Leroy <colin at colino.net>
Date:   Thu Feb 11 11:22:47 2016 +0100

    Forgot to memset. We should add an helper function for this.

diff --git a/src/prefs_gtk.c b/src/prefs_gtk.c
index f04a5e5..3d6ddec 100644
--- a/src/prefs_gtk.c
+++ b/src/prefs_gtk.c
@@ -690,6 +690,9 @@ void prefs_set_entry(PrefParam *pparam)
 		decrypted_pass = password_decrypt(*str, NULL);
 		gtk_entry_set_text(GTK_ENTRY(*pparam->widget),
 			(decrypted_pass != NULL ? decrypted_pass : ""));
+		if (decrypted_pass != NULL) {
+			memset(decrypted_pass, 0, strlen(decrypted_pass));
+		}
 		g_free(decrypted_pass);
 		break;
 	default:

commit e5bb832c169c89c8cba735e25f639774eccf7324
Author: Colin Leroy <colin at colino.net>
Date:   Thu Feb 11 11:21:52 2016 +0100

    vCalendar: Use new password API

diff --git a/src/plugins/vcalendar/claws.def b/src/plugins/vcalendar/claws.def
index de9bbe5..1d38f53 100644
--- a/src/plugins/vcalendar/claws.def
+++ b/src/plugins/vcalendar/claws.def
@@ -109,6 +109,7 @@ mimeview_register_viewer_factory
 mimeview_unregister_viewer_factory
 move_file
 open_uri
+password_decrypt
 prefs_button_toggled
 prefs_common
 prefs_common_get_uri_cmd
diff --git a/src/plugins/vcalendar/vcal_folder.c b/src/plugins/vcalendar/vcal_folder.c
index c52a399..96630cd 100644
--- a/src/plugins/vcalendar/vcal_folder.c
+++ b/src/plugins/vcalendar/vcal_folder.c
@@ -60,6 +60,7 @@
 #include "mainwindow.h"
 #include "statusbar.h"
 #include "msgcache.h"
+#include "password.h"
 #include "timing.h"
 #include "messageview.h"
 
@@ -1170,13 +1171,19 @@ void vcal_folder_export(Folder *folder)
 {	
 	FolderItem *item = folder?folder->inbox:NULL;
 	gboolean need_scan = folder?vcal_scan_required(folder, item):TRUE;
+	gchar *export_pass = NULL;
+	gchar *export_freebusy_pass = NULL;
 
 	if (vcal_folder_lock_count) /* blocked */
 		return;
 	vcal_folder_lock_count++;
+	
+	export_pass = password_decrypt(vcalprefs.export_pass, NULL);
+	export_freebusy_pass = password_decrypt(vcalprefs.export_freebusy_pass, NULL);
+
 	if (vcal_meeting_export_calendar(vcalprefs.export_path, 
 			vcalprefs.export_user, 
-			vcalprefs.export_pass,
+			export_pass,
 			TRUE)) {
 		debug_print("exporting calendar\n");
 		if (vcalprefs.export_enable &&
@@ -1185,9 +1192,13 @@ void vcal_folder_export(Folder *folder)
 			execute_command_line(
 				vcalprefs.export_command, TRUE);
 	}
+	if (export_pass != NULL) {
+		memset(export_pass, 0, strlen(export_pass));
+	}
+	g_free(export_pass);
 	if (vcal_meeting_export_freebusy(vcalprefs.export_freebusy_path,
 			vcalprefs.export_freebusy_user,
-			vcalprefs.export_freebusy_pass)) {
+			export_freebusy_pass)) {
 		debug_print("exporting freebusy\n");
 		if (vcalprefs.export_freebusy_enable &&
 		    vcalprefs.export_freebusy_command &&
@@ -1195,6 +1206,10 @@ void vcal_folder_export(Folder *folder)
 			execute_command_line(
 				vcalprefs.export_freebusy_command, TRUE);
 	}
+	if (export_freebusy_pass != NULL) {
+		memset(export_freebusy_pass, 0, strlen(export_freebusy_pass));
+	}
+	g_free(export_freebusy_pass);
 	vcal_folder_lock_count--;
 	if (!need_scan && folder) {
 		vcal_set_mtime(folder, folder->inbox);
diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c
index 2b99c08..0c7a36c 100644
--- a/src/plugins/vcalendar/vcal_meeting_gtk.c
+++ b/src/plugins/vcalendar/vcal_meeting_gtk.c
@@ -2127,7 +2127,7 @@ putfile:
 			file = tmp;
 		}
 		if (fp) {
-			res = vcal_curl_put(file, fp, filesize, user, pass);
+			res = vcal_curl_put(file, fp, filesize, user, (pass != NULL ? pass : ""));
 			fclose(fp);
 		}
 		g_free(file);
@@ -2275,7 +2275,7 @@ gboolean vcal_meeting_export_freebusy(const gchar *path, const gchar *user,
 			file = tmp;
 		}
 		if (fp) {
-			res = vcal_curl_put(file, fp, filesize, user, pass);
+			res = vcal_curl_put(file, fp, filesize, user, (pass != NULL ? pass : ""));
 			fclose(fp);
 		}
 		g_free(file);
diff --git a/src/plugins/vcalendar/vcal_prefs.c b/src/plugins/vcalendar/vcal_prefs.c
index 4d42040..06c6fd4 100644
--- a/src/plugins/vcalendar/vcal_prefs.c
+++ b/src/plugins/vcalendar/vcal_prefs.c
@@ -30,6 +30,7 @@
 #include "defs.h"
 
 #include "mainwindow.h"
+#include "password.h"
 #include "prefs.h"
 #include "prefs_gtk.h"
 #include "prefswindow.h"
@@ -268,6 +269,8 @@ static void vcal_prefs_create_widget_func(PrefsPage * _page,
 
 	GtkWidget *frame_ssl_options;
 	GtkWidget *ssl_verify_peer_checkbtn;
+	gchar *export_pass = NULL;
+	gchar *export_freebusy_pass = NULL;
 
 	vbox1 = gtk_vbox_new (FALSE, VSPACING);
 	gtk_widget_show (vbox1);
@@ -559,10 +562,23 @@ 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);
+	
 	gtk_entry_set_text(GTK_ENTRY(export_user_entry), vcalprefs.export_user);
-	gtk_entry_set_text(GTK_ENTRY(export_pass_entry), vcalprefs.export_pass);
+	gtk_entry_set_text(GTK_ENTRY(export_pass_entry), (export_pass != NULL ? export_pass : ""));
 	gtk_entry_set_text(GTK_ENTRY(export_freebusy_user_entry), vcalprefs.export_freebusy_user);
-	gtk_entry_set_text(GTK_ENTRY(export_freebusy_pass_entry), vcalprefs.export_freebusy_pass);
+	gtk_entry_set_text(GTK_ENTRY(export_freebusy_pass_entry), (export_freebusy_pass != NULL ? export_freebusy_pass : ""));
+
+	if (export_pass != NULL) {
+		memset(export_pass, 0, strlen(export_pass));
+	}
+	g_free(export_pass);
+
+	if (export_freebusy_pass != NULL) {
+		memset(export_freebusy_pass, 0, strlen(export_freebusy_pass));
+	}
+	g_free(export_freebusy_pass);
 
 	g_signal_connect(G_OBJECT(export_enable_checkbtn),
 			 "toggled", G_CALLBACK(path_changed), page);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list