[Commits] [SCM] claws branch, master, updated. 3.13.2-69-g499c9fe

ticho at claws-mail.org ticho at claws-mail.org
Thu Mar 3 19:11:29 CET 2016


The branch, master has been updated
       via  499c9fec4dda5f698378c506af1001cdcb41b04e (commit)
      from  56300484d6eddaf3d077a9dfa97da1b981fa110b (commit)

Summary of changes:
 doc/src/password_encryption.txt             |    4 +-
 src/common/plugin.c                         |   14 ++--
 src/common/plugin.h                         |    2 +-
 src/mainwindow.c                            |   16 ++--
 src/mainwindow.h                            |    2 +-
 src/password.c                              |  115 ++++++++++++++-------------
 src/password.h                              |   36 ++++-----
 src/password_gtk.c                          |   42 +++++-----
 src/password_gtk.h                          |    2 +-
 src/plugins/gdata/cm_gdata_prefs.c          |    2 +-
 src/plugins/gdata/cm_gdata_prefs.h          |    2 +-
 src/plugins/gdata/gdata_plugin.c            |    4 +-
 src/plugins/spam_report/plugin.def          |    2 +-
 src/plugins/spam_report/spam_report.c       |    4 +-
 src/plugins/spam_report/spam_report_prefs.c |    2 +-
 src/plugins/spam_report/spam_report_prefs.h |    2 +-
 src/plugins/vcalendar/plugin.c              |    4 +-
 src/plugins/vcalendar/plugin.def            |    2 +-
 src/plugins/vcalendar/vcal_prefs.c          |    2 +-
 src/plugins/vcalendar/vcal_prefs.h          |    2 +-
 src/prefs_common.c                          |    4 +-
 src/prefs_common.h                          |    4 +-
 src/prefs_other.c                           |  100 +++++++++++------------
 23 files changed, 185 insertions(+), 184 deletions(-)


- Log -----------------------------------------------------------------
commit 499c9fec4dda5f698378c506af1001cdcb41b04e
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Mar 3 11:17:41 2016 +0100

    "Master password" is now called "master passphrase".
    
    This is to help diferentiate between passwords coming from
    accounts, plugins, etc., and the master passphrase used in
    an AES encryption key for encrypting these passwords.

diff --git a/doc/src/password_encryption.txt b/doc/src/password_encryption.txt
index aed0cb0..76a8c9e 100644
--- a/doc/src/password_encryption.txt
+++ b/doc/src/password_encryption.txt
@@ -2,14 +2,14 @@ Unless --with-password-encryption=old is active, account passwords are
 stored encrypted using AES-256-CBC, using following scheme:
 ----------------------------------------------------------------------
 
-Encryption/decryption key is either PASSCRYPT_KEY, or user-selected master password.
+Encryption/decryption key is either PASSCRYPT_KEY, or user-selected master passphrase.
 
 We take the digest of the key using SHA-512, which gives us a 64 bytes
 long hash.
 
 The first half of the hash is XORed with the second (1st byte with
 33rd, 2nd with 34th, etc.). This is gives us 32 bytes, which is
-ey length required for AES-256-CBC.
+the exact length required for AES-256-CBC.
 
 IV for the cipher is filled with random bytes.
 
diff --git a/src/common/plugin.c b/src/common/plugin.c
index b7282b8..9822d61 100644
--- a/src/common/plugin.c
+++ b/src/common/plugin.c
@@ -51,7 +51,7 @@ struct _Plugin
 	const gchar *(*version) (void);
 	const gchar *(*type) (void);
 	const gchar *(*licence) (void);
-	void (*master_password_change) (const gchar *oldp, const gchar *newp);
+	void (*master_passphrase_change) (const gchar *oldp, const gchar *newp);
 	struct PluginFeature *(*provides) (void);
 	
 	GSList *rdeps;
@@ -420,7 +420,7 @@ Plugin *plugin_load(const gchar *filename, gchar **error)
 	const gchar *(*plugin_type)(void);
 	const gchar *(*plugin_licence)(void);
 	struct PluginFeature *(*plugin_provides)(void);
-	void (*plugin_master_password_change) (const gchar *oldp, const gchar *newp) = NULL;
+	void (*plugin_master_passphrase_change) (const gchar *oldp, const gchar *newp) = NULL;
 
 	gint ok;
 	START_TIMING((filename?filename:"NULL plugin"));
@@ -479,7 +479,7 @@ init_plugin:
 	}
 
 	/* Optional methods */
-	g_module_symbol(plugin->module, "plugin_master_password_change", (gpointer)&plugin_master_password_change);
+	g_module_symbol(plugin->module, "plugin_master_passphrase_change", (gpointer)&plugin_master_passphrase_change);
 	
 	if (plugin_licence_check(plugin_licence()) != TRUE) {
 		*error = g_strdup(_("This module is not licensed under a GPL v3 or later compatible license."));
@@ -512,7 +512,7 @@ init_plugin:
 	plugin->type = plugin_type;
 	plugin->licence = plugin_licence;
 	plugin->provides = plugin_provides;
-	plugin->master_password_change = plugin_master_password_change;
+	plugin->master_passphrase_change = plugin_master_passphrase_change;
 	plugin->filename = g_strdup(filename);
 	plugin->error = NULL;
 
@@ -752,13 +752,13 @@ const gchar *plugin_get_error(Plugin *plugin)
 	return plugin->error;
 }
 
-void plugins_master_password_change(const gchar *oldp, const gchar *newp) {
+void plugins_master_passphrase_change(const gchar *oldp, const gchar *newp) {
 	Plugin *plugin = NULL;
 	GSList *cur;
 	for (cur = plugin_get_list(); cur; cur = g_slist_next(cur)) {
 		plugin = (Plugin *)cur->data;
-		if (plugin->master_password_change != NULL) {
-			plugin->master_password_change(oldp, newp);
+		if (plugin->master_passphrase_change != NULL) {
+			plugin->master_passphrase_change(oldp, newp);
 		}
 	}
 }
diff --git a/src/common/plugin.h b/src/common/plugin.h
index 446df5e..b153b6b 100644
--- a/src/common/plugin.h
+++ b/src/common/plugin.h
@@ -59,7 +59,7 @@ void plugin_unload_all		(const gchar	 *type);
 void plugin_save_list		(void);
 void plugin_load_standard_plugins (void);
 
-void plugins_master_password_change(const gchar *oldp, const gchar *newp);
+void plugins_master_passphrase_change(const gchar *oldp, const gchar *newp);
 
 GSList *plugin_get_list		(void);
 GSList *plugin_get_unloaded_list(void);
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 080d97f..3df0949 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -430,7 +430,7 @@ static void sync_cb		 ( GtkAction	*action,
 static void forget_session_passwords_cb	(GtkAction	*action,
 					 gpointer	 data );
 #ifndef PASSWORD_CRYPTO_OLD
-static void forget_master_password_cb	(GtkAction	*action,
+static void forget_master_passphrase_cb	(GtkAction	*action,
 					 gpointer	 data );
 #endif
 static gboolean mainwindow_focus_in_event	(GtkWidget	*widget, 
@@ -781,7 +781,7 @@ static GtkActionEntry mainwin_entries[] =
 	/* {"Tools/---",			NULL, "---", NULL, NULL, NULL }, */
 	{"Tools/ForgetSessionPasswords",		NULL, N_("_Forget all session passwords"), NULL, NULL, G_CALLBACK(forget_session_passwords_cb) }, 
 #ifndef PASSWORD_CRYPTO_OLD
-	{"Tools/ForgetMasterPassword",		NULL, N_("Forget _master password"), NULL, NULL, G_CALLBACK(forget_master_password_cb) },
+	{"Tools/ForgetMasterPassphrase",		NULL, N_("Forget _master passphrase"), NULL, NULL, G_CALLBACK(forget_master_passphrase_cb) },
 #endif
 
 /* Configuration menu */	
@@ -1858,7 +1858,7 @@ MainWindow *main_window_create()
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator8", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "ForgetSessionPasswords", "Tools/ForgetSessionPasswords", GTK_UI_MANAGER_MENUITEM)
 #ifndef PASSWORD_CRYPTO_OLD
-	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "ForgetMasterPassword", "Tools/ForgetMasterPassword", GTK_UI_MANAGER_MENUITEM)
+	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "ForgetMasterPassphrase", "Tools/ForgetMasterPassphrase", GTK_UI_MANAGER_MENUITEM)
 #endif
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator9", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
 
@@ -3103,8 +3103,8 @@ SensitiveCondMask main_window_get_current_state(MainWindow *mainwin)
 	}
 
 #ifndef PASSWORD_CRYPTO_OLD
-	if (master_password_is_entered()) {
-		UPDATE_STATE(M_MASTER_PASSWORD);
+	if (master_passphrase_is_entered()) {
+		UPDATE_STATE(M_MASTER_PASSPHRASE);
 	}
 #endif
 #undef UPDATE_STATE
@@ -3241,7 +3241,7 @@ do { \
 	FILL_TABLE("Menu/Tools/Expunge", M_DELETED_EXISTS);
 	FILL_TABLE("Menu/Tools/ForgetSessionPasswords", M_SESSION_PASSWORDS);
 #ifndef PASSWORD_CRYPTO_OLD
-	FILL_TABLE("Menu/Tools/ForgetMasterPassword", M_MASTER_PASSWORD);
+	FILL_TABLE("Menu/Tools/ForgetMasterPassphrase", M_MASTER_PASSPHRASE);
 #endif
 	FILL_TABLE("Menu/Tools/DeleteDuplicates/SelFolder", M_MSG_EXIST, M_ALLOW_DELETE);
 
@@ -5340,12 +5340,12 @@ static void forget_session_passwords_cb(GtkAction *action, gpointer data)
 }
 
 #ifndef PASSWORD_CRYPTO_OLD
-static void forget_master_password_cb(GtkAction *action, gpointer data)
+static void forget_master_passphrase_cb(GtkAction *action, gpointer data)
 {
 	MainWindow *mainwin = (MainWindow *)data;
 
 	main_window_lock(mainwin);
-	master_password_forget();
+	master_passphrase_forget();
 	main_window_unlock(mainwin);
 }
 #endif
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 6c924bf..678ff22 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -64,7 +64,7 @@ typedef enum
 	M_HAVE_MULTI_ACCOUNT,
 	M_FOLDER_SELECTED,
 	M_SESSION_PASSWORDS,
-	M_MASTER_PASSWORD,
+	M_MASTER_PASSPHRASE,
 	M_DELETED_EXISTS,
 	M_NOT_TRASH,
 	M_HIDE_READ_THREADS,
diff --git a/src/password.c b/src/password.c
index 9682a6a..bda205f 100644
--- a/src/password.c
+++ b/src/password.c
@@ -49,56 +49,56 @@
 #include "prefs_common.h"
 
 #ifndef PASSWORD_CRYPTO_OLD
-static gchar *_master_password = NULL;
+static gchar *_master_passphrase = NULL;
 
-static const gchar *master_password()
+static const gchar *master_passphrase()
 {
 	gchar *input;
 	gboolean end = FALSE;
 
-	if (!prefs_common_get_prefs()->use_master_password) {
+	if (!prefs_common_get_prefs()->use_master_passphrase) {
 		return PASSCRYPT_KEY;
 	}
 
-	if (_master_password != NULL) {
-		debug_print("Master password is in memory, offering it.\n");
-		return _master_password;
+	if (_master_passphrase != NULL) {
+		debug_print("Master passphrase is in memory, offering it.\n");
+		return _master_passphrase;
 	}
 
 	while (!end) {
-		input = input_dialog_with_invisible(_("Input master password"),
-				_("Input master password"), NULL);
+		input = input_dialog_with_invisible(_("Input master passphrase"),
+				_("Input master passphrase"), NULL);
 
 		if (input == NULL) {
-			debug_print("Cancel pressed at master password dialog.\n");
+			debug_print("Cancel pressed at master passphrase dialog.\n");
 			break;
 		}
 
-		if (master_password_is_correct(input)) {
-			debug_print("Entered master password seems to be correct, remembering it.\n");
-			_master_password = input;
+		if (master_passphrase_is_correct(input)) {
+			debug_print("Entered master passphrase seems to be correct, remembering it.\n");
+			_master_passphrase = input;
 			end = TRUE;
 		} else {
-			alertpanel_error(_("Incorrect master password."));
+			alertpanel_error(_("Incorrect master passphrase."));
 		}
 	}
 
-	return _master_password;
+	return _master_passphrase;
 }
 
-const gboolean master_password_is_set()
+const gboolean master_passphrase_is_set()
 {
-	if (prefs_common_get_prefs()->master_password_hash == NULL
-			|| strlen(prefs_common_get_prefs()->master_password_hash) == 0)
+	if (prefs_common_get_prefs()->master_passphrase_hash == NULL
+			|| strlen(prefs_common_get_prefs()->master_passphrase_hash) == 0)
 		return FALSE;
 
 	return TRUE;
 }
 
-const gboolean master_password_is_correct(const gchar *input)
+const gboolean master_passphrase_is_correct(const gchar *input)
 {
 	gchar *hash;
-	gchar *stored_hash = prefs_common_get_prefs()->master_password_hash;
+	gchar *stored_hash = prefs_common_get_prefs()->master_passphrase_hash;
 	const GChecksumType hashtype = G_CHECKSUM_SHA512;
 	const gssize hashlen = g_checksum_type_get_length(hashtype);
 	gssize stored_len;
@@ -108,6 +108,7 @@ const gboolean master_password_is_correct(const gchar *input)
 	if (stored_hash == NULL)
 		return FALSE;
 
+	debug_print("|stored_hash|%s|\n", stored_hash);
 	stored_len = strlen(stored_hash);
 	g_return_val_if_fail(stored_len == 2*hashlen, FALSE);
 
@@ -122,47 +123,47 @@ const gboolean master_password_is_correct(const gchar *input)
 	return FALSE;
 }
 
-gboolean master_password_is_entered()
+gboolean master_passphrase_is_entered()
 {
-	return (_master_password == NULL) ? FALSE : TRUE;
+	return (_master_passphrase == NULL) ? FALSE : TRUE;
 }
 
-void master_password_forget()
+void master_passphrase_forget()
 {
-	/* If master password is currently in memory (entered by user),
+	/* If master passphrase is currently in memory (entered by user),
 	 * get rid of it. User will have to enter the new one again. */
-	if (_master_password != NULL) {
-		memset(_master_password, 0, strlen(_master_password));
-		g_free(_master_password);
+	if (_master_passphrase != NULL) {
+		memset(_master_passphrase, 0, strlen(_master_passphrase));
+		g_free(_master_passphrase);
 	}
-	_master_password = NULL;
+	_master_passphrase = NULL;
 }
 
-void master_password_change(const gchar *oldp, const gchar *newp)
+void master_passphrase_change(const gchar *oldp, const gchar *newp)
 {
 	if (oldp == NULL) {
 		/* If oldp is NULL, make sure the user has to enter the
-		 * current master password before being able to change it. */
-		master_password_forget();
-		oldp = master_password();
+		 * current master passphrase before being able to change it. */
+		master_passphrase_forget();
+		oldp = master_passphrase();
 	}
 	g_return_if_fail(oldp != NULL);
 
-	/* Update master password hash in prefs */
-	if (prefs_common_get_prefs()->master_password_hash != NULL)
-		g_free(prefs_common_get_prefs()->master_password_hash);
+	/* Update master passphrase hash in prefs */
+	if (prefs_common_get_prefs()->master_passphrase_hash != NULL)
+		g_free(prefs_common_get_prefs()->master_passphrase_hash);
 
 	if (newp != NULL) {
-		debug_print("Storing hash of new master password\n");
-		prefs_common_get_prefs()->master_password_hash =
+		debug_print("Storing hash of new master passphrase\n");
+		prefs_common_get_prefs()->master_passphrase_hash =
 			g_compute_checksum_for_string(G_CHECKSUM_SHA512, newp, -1);
 	} else {
-		debug_print("Setting master_password_hash to NULL\n");
-		prefs_common_get_prefs()->master_password_hash = NULL;
+		debug_print("Setting master_passphrase_hash to NULL\n");
+		prefs_common_get_prefs()->master_passphrase_hash = NULL;
 	}
 
 	/* Now go over all accounts, reencrypting their passwords using
-	 * the new master password. */
+	 * the new master passphrase. */
 
 	if (oldp == NULL)
 		oldp = PASSCRYPT_KEY;
@@ -175,9 +176,9 @@ void master_password_change(const gchar *oldp, const gchar *newp)
 	/* Now reencrypt all plugins passwords fields 
 	 * FIXME: Unloaded plugins won't be able to update their stored passwords
 	 */
-	plugins_master_password_change(oldp, newp);
+	plugins_master_passphrase_change(oldp, newp);
 
-	master_password_forget();
+	master_passphrase_forget();
 }
 #endif
 
@@ -221,7 +222,7 @@ gchar *password_decrypt_old(const gchar *password)
 #define BUFSIZE 128
 
 gchar *password_encrypt_gnutls(const gchar *password,
-		const gchar *encryption_password)
+		const gchar *encryption_passphrase)
 {
 	/* Another, slightly inferior combination is AES-128-CBC + SHA-256.
 	 * Any block cipher in CBC mode with keysize N and a hash algo with
@@ -239,7 +240,7 @@ gchar *password_encrypt_gnutls(const gchar *password,
 #endif
 
 	g_return_val_if_fail(password != NULL, NULL);
-	g_return_val_if_fail(encryption_password != NULL, NULL);
+	g_return_val_if_fail(encryption_passphrase != NULL, NULL);
 
 	ivlen = gnutls_cipher_get_iv_size(algo);
 	keylen = gnutls_cipher_get_key_size(algo);
@@ -249,8 +250,8 @@ gchar *password_encrypt_gnutls(const gchar *password,
 	/* Prepare key for cipher - first half of hash of passkey XORed with
 	 * the second. */
 	memset(&hashbuf, 0, BUFSIZE);
-	if ((ret = gnutls_hash_fast(digest, encryption_password,
-					strlen(encryption_password), &hashbuf)) < 0) {
+	if ((ret = gnutls_hash_fast(digest, encryption_passphrase,
+					strlen(encryption_passphrase), &hashbuf)) < 0) {
 		debug_print("Hashing passkey failed: %s\n", gnutls_strerror(ret));
 		return NULL;
 	}
@@ -369,7 +370,7 @@ gchar *password_encrypt_gnutls(const gchar *password,
 }
 
 gchar *password_decrypt_gnutls(const gchar *password,
-		const gchar *decryption_password)
+		const gchar *decryption_passphrase)
 {
 	gchar **tokens, *tmp;
 	gnutls_cipher_algorithm_t algo;
@@ -386,7 +387,7 @@ gchar *password_decrypt_gnutls(const gchar *password,
 #endif
 
 	g_return_val_if_fail(password != NULL, NULL);
-	g_return_val_if_fail(decryption_password != NULL, NULL);
+	g_return_val_if_fail(decryption_passphrase != NULL, NULL);
 
 	tokens = g_strsplit_set(password, "{}", 3);
 
@@ -421,8 +422,8 @@ gchar *password_decrypt_gnutls(const gchar *password,
 	 * the second. AES-256 has key length 32 and length of SHA-512 hash
 	 * is exactly twice that, 64. */
 	memset(&hashbuf, 0, BUFSIZE);
-	if ((ret = gnutls_hash_fast(digest, decryption_password,
-					strlen(decryption_password), &hashbuf)) < 0) {
+	if ((ret = gnutls_hash_fast(digest, decryption_passphrase,
+					strlen(decryption_passphrase), &hashbuf)) < 0) {
 		debug_print("Hashing passkey failed: %s\n", gnutls_strerror(ret));
 		g_strfreev(tokens);
 		return NULL;
@@ -518,24 +519,24 @@ gchar *password_decrypt_gnutls(const gchar *password,
 #endif
 
 gchar *password_encrypt(const gchar *password,
-		const gchar *encryption_password)
+		const gchar *encryption_passphrase)
 {
 	if (password == NULL || strlen(password) == 0) {
 		return NULL;
 	}
 
 #ifndef PASSWORD_CRYPTO_OLD
-	if (encryption_password == NULL)
-		encryption_password = master_password();
+	if (encryption_passphrase == NULL)
+		encryption_passphrase = master_passphrase();
 
-	return password_encrypt_real(password, encryption_password);
+	return password_encrypt_real(password, encryption_passphrase);
 #endif
 
 	return password_encrypt_old(password);
 }
 
 gchar *password_decrypt(const gchar *password,
-		const gchar *decryption_password)
+		const gchar *decryption_passphrase)
 {
 	if (password == NULL || strlen(password) == 0) {
 		return NULL;
@@ -550,12 +551,12 @@ gchar *password_decrypt(const gchar *password,
 
 	/* Try available crypto backend */
 #ifndef PASSWORD_CRYPTO_OLD
-	if (decryption_password == NULL)
-		decryption_password = master_password();
+	if (decryption_passphrase == NULL)
+		decryption_passphrase = master_passphrase();
 
 	if (*password == '{') {
 		debug_print("Trying to decrypt password...\n");
-		return password_decrypt_real(password, decryption_password);
+		return password_decrypt_real(password, decryption_passphrase);
 	}
 #endif
 
diff --git a/src/password.h b/src/password.h
index 8423f4e..fcaaf4c 100644
--- a/src/password.h
+++ b/src/password.h
@@ -27,23 +27,23 @@
 #include <glib.h>
 
 #ifndef PASSWORD_CRYPTO_OLD
-/* Returns TRUE if there is a master password set in preferences. */
-const gboolean master_password_is_set();
-/* Returns TRUE if input contains correct master password, as set
+/* Returns TRUE if there is a master passphrase set in preferences. */
+const gboolean master_passphrase_is_set();
+/* Returns TRUE if input contains correct master passphrase, as set
  * in preferences. */
-const gboolean master_password_is_correct(const gchar *input);
-/* Returns TRUE if master password is entered (unlocked). */
-gboolean master_password_is_entered();
-/* Removes (locks) master password, if it was entered previously
+const gboolean master_passphrase_is_correct(const gchar *input);
+/* Returns TRUE if master passphrase is entered (unlocked). */
+gboolean master_passphrase_is_entered();
+/* Removes (locks) master passphrase, if it was entered previously
  * in current session. */
-void master_password_forget();
+void master_passphrase_forget();
 
-/* Changes master password. Also triggers reencryption of all stored
- * password using the new master password.
- * oldp - old master password; if NULL, it will be retrieved using
- *        master_password()
- * newp - new master password */
-void master_password_change(const gchar *oldp, const gchar *newp);
+/* Changes master passphrase. Also triggers reencryption of all stored
+ * passwords using the new master passphrase.
+ * oldp - old master passphrase; if NULL, it will be retrieved using
+ *        master_passphrase()
+ * newp - new master passphrase */
+void master_passphrase_change(const gchar *oldp, const gchar *newp);
 #endif
 
 /* Wrapper around the old, DES-CBC-broken implementation which
@@ -56,9 +56,9 @@ gchar *password_decrypt_old(const gchar *password);
 #ifdef PASSWORD_CRYPTO_GNUTLS
 /* GNUTLS implementation */
 gchar *password_encrypt_gnutls(const gchar *password,
-		const gchar *encryption_password);
+		const gchar *encryption_passphrase);
 gchar *password_decrypt_gnutls(const gchar *password,
-		const gchar *decryption_password);
+		const gchar *decryption_passphrase);
 #define password_encrypt_real(n, m) password_encrypt_gnutls(n, m)
 #define password_decrypt_real(n, m) password_decrypt_gnutls(n, m)
 #endif
@@ -66,12 +66,12 @@ gchar *password_decrypt_gnutls(const gchar *password,
 /* Wrapper function that will apply best encryption available,
  * and return a string ready to be saved as-is in preferences. */
 gchar *password_encrypt(const gchar *password,
-		const gchar *encryption_password);
+		const gchar *encryption_passphrase);
 
 /* This is a wrapper function that looks at the whole string from
  * prefs (e.g. including the leading '!' for old implementation),
  * and tries to do the smart thing. */
 gchar *password_decrypt(const gchar *password,
-		const gchar *decryption_password);
+		const gchar *decryption_passphrase);
 
 #endif /* __PASSWORD_H */
diff --git a/src/password_gtk.c b/src/password_gtk.c
index 77ec142..96c4620 100644
--- a/src/password_gtk.c
+++ b/src/password_gtk.c
@@ -61,29 +61,29 @@ static void ok_button_clicked(GtkButton *button, gpointer user_data)
 
 	debug_print("OK button activated\n");
 
-	/* Now we check the new password - same in both entries. */
+	/* Now we check the new passphrase - same in both entries. */
 	if (strcmp(new1, new2)) {
-		debug_print("passwords do not match\n");
-		alertpanel_warning(_("New passwords do not match, try again."));
+		debug_print("passphrases do not match\n");
+		alertpanel_warning(_("New passwphrases do not match, try again."));
 		gtk_entry_set_text(GTK_ENTRY(ctx->entry_new1), "");
 		gtk_entry_set_text(GTK_ENTRY(ctx->entry_new2), "");
 		gtk_widget_grab_focus(ctx->entry_new1);
 		return;
 	}
 
-	/* If there is an existing master password, check for its correctness
+	/* If there is an existing master passphrase, check for its correctness
 	 * in entry_old. */
-	if (master_password_is_set()
+	if (master_passphrase_is_set()
 			&& ((old = gtk_entry_get_text(GTK_ENTRY(ctx->entry_old))) == NULL
-				|| strlen(old) == 0 || !master_password_is_correct(old))) {
-		debug_print("old password incorrect\n");
-		alertpanel_warning(_("Incorrect old master password entered, try again."));
+				|| strlen(old) == 0 || !master_passphrase_is_correct(old))) {
+		debug_print("old passphrase incorrect\n");
+		alertpanel_warning(_("Incorrect old master passphrase entered, try again."));
 		gtk_entry_set_text(GTK_ENTRY(ctx->entry_old), "");
 		gtk_widget_grab_focus(ctx->entry_old);
 		return;
 	}
 
-	master_password_change(old, new1);
+	master_passphrase_change(old, new1);
 
 	ctx->done = TRUE;
 	gtk_widget_destroy(ctx->dialog);
@@ -105,7 +105,7 @@ static void dialog_destroy(GtkWidget *widget, gpointer user_data)
 	ctx->dialog = NULL;
 }
 
-void master_password_change_dialog()
+void master_passphrase_change_dialog()
 {
 	static PangoFontDescription *font_desc;
 	GtkWidget *dialog;
@@ -141,7 +141,7 @@ void master_password_change_dialog()
 	gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0);
 	gtk_widget_show(vbox);
 
-	msg_title = gtk_label_new(_("Changing master password"));
+	msg_title = gtk_label_new(_("Changing master passphrase"));
 	gtk_misc_set_alignment(GTK_MISC(msg_title), 0, 0.5);
 	gtk_label_set_justify(GTK_LABEL(msg_title), GTK_JUSTIFY_LEFT);
 	gtk_label_set_use_markup (GTK_LABEL (msg_title), TRUE);
@@ -162,8 +162,8 @@ void master_password_change_dialog()
 		gtk_widget_modify_font(msg_title, font_desc);
 
 	label = gtk_label_new(
-        _("If a master password is currently active the\n"
-        "current password is required to change password.")
+        _("If a master passphrase is currently active, it\n"
+        "needs to be entered.")
 	);
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
@@ -171,8 +171,8 @@ void master_password_change_dialog()
 
 	table = gtk_table_new(4, 2, FALSE);
 
-	/* Old password */
-	label = gtk_label_new(_("Old password:"));
+	/* Old passphrase */
+	label = gtk_label_new(_("Old passphrase:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
 			GTK_EXPAND | GTK_FILL, 0, 0, 0);
@@ -187,8 +187,8 @@ void master_password_change_dialog()
 			gtk_hseparator_new(), 0, 2, 1, 2,
 			GTK_FILL | GTK_EXPAND, 0, 0, 5);
 
-	/* New password */
-	label = gtk_label_new(_("New password:"));
+	/* New passphrase */
+	label = gtk_label_new(_("New passphrase:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
 			GTK_EXPAND | GTK_FILL, 0, 0, 0);
@@ -198,8 +198,8 @@ void master_password_change_dialog()
 	gtk_table_attach(GTK_TABLE(table), entry_new1, 1, 2, 2, 3,
 			GTK_FILL | GTK_EXPAND, 0, 0, 0);
 
-	/* New password again */
-	label = gtk_label_new(_("Confirm password:"));
+	/* New passphrase again */
+	label = gtk_label_new(_("Confirm passphrase:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4,
 			GTK_EXPAND | GTK_FILL, 0, 0, 0);
@@ -223,8 +223,8 @@ void master_password_change_dialog()
 
 	gtk_widget_grab_default(ok_button);
 
-	/* If no master password is set, disable the "old password" entry */
-	if (!master_password_is_set())
+	/* If no master passphrase is set, disable the "old passphrase" entry */
+	if (!master_passphrase_is_set())
 		gtk_widget_set_sensitive(entry_old, FALSE);
 
 	g_signal_connect(G_OBJECT(entry_old), "activate",
diff --git a/src/password_gtk.h b/src/password_gtk.h
index 86fa9d2..b8a19fb 100644
--- a/src/password_gtk.h
+++ b/src/password_gtk.h
@@ -25,7 +25,7 @@
 #endif
 
 #ifndef PASSWORD_CRYPTO_OLD
-void master_password_change_dialog();
+void master_passphrase_change_dialog();
 #endif
 
 #endif /* __PASSWORD_GTK_H */
diff --git a/src/plugins/gdata/cm_gdata_prefs.c b/src/plugins/gdata/cm_gdata_prefs.c
index 8bac4fd..7ae6f55 100644
--- a/src/plugins/gdata/cm_gdata_prefs.c
+++ b/src/plugins/gdata/cm_gdata_prefs.c
@@ -153,7 +153,7 @@ void cm_gdata_prefs_done(void)
   }
 }
 
-void cm_gdata_prefs_master_password_change(const gchar *oldp, const gchar *newp) {
+void cm_gdata_prefs_master_passphrase_change(const gchar *oldp, const gchar *newp) {
 	gchar *pass;
 	int i;
 
diff --git a/src/plugins/gdata/cm_gdata_prefs.h b/src/plugins/gdata/cm_gdata_prefs.h
index aa91809..5e917bd 100644
--- a/src/plugins/gdata/cm_gdata_prefs.h
+++ b/src/plugins/gdata/cm_gdata_prefs.h
@@ -33,6 +33,6 @@ extern PrefParam    cm_gdata_param[];
 
 void cm_gdata_prefs_init(void);
 void cm_gdata_prefs_done(void);
-void cm_gdata_prefs_master_password_change(const gchar *oldp, const gchar *newp);
+void cm_gdata_prefs_master_passphrase_change(const gchar *oldp, const gchar *newp);
 
 #endif /* CM_GDATA_PREFS_H_ */
diff --git a/src/plugins/gdata/gdata_plugin.c b/src/plugins/gdata/gdata_plugin.c
index b383770..c001f99 100644
--- a/src/plugins/gdata/gdata_plugin.c
+++ b/src/plugins/gdata/gdata_plugin.c
@@ -181,9 +181,9 @@ const gchar *plugin_version(void)
   return VERSION;
 }
 
-void plugin_master_password_change (const gchar *oldp, const gchar *newp)
+void plugin_master_passphrase_change (const gchar *oldp, const gchar *newp)
 {
-	cm_gdata_prefs_master_password_change(oldp, newp);
+	cm_gdata_prefs_master_passphrase_change(oldp, newp);
 }
 
 struct PluginFeature *plugin_provides(void)
diff --git a/src/plugins/spam_report/plugin.def b/src/plugins/spam_report/plugin.def
index 47b05d7..982dc5a 100644
--- a/src/plugins/spam_report/plugin.def
+++ b/src/plugins/spam_report/plugin.def
@@ -7,4 +7,4 @@ EXPORTS
         plugin_type
 	plugin_provides
         plugin_version
-	plugin_master_password_change
+	plugin_master_passphrase_change
diff --git a/src/plugins/spam_report/spam_report.c b/src/plugins/spam_report/spam_report.c
index 0d2e22c..177f279 100644
--- a/src/plugins/spam_report/spam_report.c
+++ b/src/plugins/spam_report/spam_report.c
@@ -407,9 +407,9 @@ const gchar *plugin_version(void)
 	return VERSION;
 }
 
-void plugin_master_password_change (const gchar *oldp, const gchar *newp)
+void plugin_master_passphrase_change (const gchar *oldp, const gchar *newp)
 {
-	spamreport_master_password_change(oldp, newp);
+	spamreport_master_passphrase_change(oldp, newp);
 }
 
 struct PluginFeature *plugin_provides(void)
diff --git a/src/plugins/spam_report/spam_report_prefs.c b/src/plugins/spam_report/spam_report_prefs.c
index ec7ae8b..fe98d4f 100644
--- a/src/plugins/spam_report/spam_report_prefs.c
+++ b/src/plugins/spam_report/spam_report_prefs.c
@@ -233,7 +233,7 @@ static void save_spamreport_prefs(PrefsPage *page)
 	        prefs_file_close(pref_file);
 }
 
-void spamreport_master_password_change(const gchar *oldp, const gchar *newp) {
+void spamreport_master_passphrase_change(const gchar *oldp, const gchar *newp) {
 	gchar *pass;
 	int i;
 
diff --git a/src/plugins/spam_report/spam_report_prefs.h b/src/plugins/spam_report/spam_report_prefs.h
index 2667a3c..48c27e2 100644
--- a/src/plugins/spam_report/spam_report_prefs.h
+++ b/src/plugins/spam_report/spam_report_prefs.h
@@ -65,6 +65,6 @@ extern SpamReportPrefs spamreport_prefs;
 
 void spamreport_prefs_init(void);
 void spamreport_prefs_done(void);
-void spamreport_master_password_change(const gchar *oldp, const gchar *newp);
+void spamreport_master_passphrase_change(const gchar *oldp, const gchar *newp);
 
 #endif
diff --git a/src/plugins/vcalendar/plugin.c b/src/plugins/vcalendar/plugin.c
index 8c1e4e5..945cab5 100644
--- a/src/plugins/vcalendar/plugin.c
+++ b/src/plugins/vcalendar/plugin.c
@@ -99,9 +99,9 @@ const gchar *plugin_version(void)
 	return VERSION;
 }
 
-void plugin_master_password_change (const gchar *oldp, const gchar *newp)
+void plugin_master_passphrase_change (const gchar *oldp, const gchar *newp)
 {
-	vcal_prefs_master_password_change(oldp, newp);
+	vcal_prefs_master_passphrase_change(oldp, newp);
 }
 
 struct PluginFeature *plugin_provides(void)
diff --git a/src/plugins/vcalendar/plugin.def b/src/plugins/vcalendar/plugin.def
index 17417b2..f79dd57 100644
--- a/src/plugins/vcalendar/plugin.def
+++ b/src/plugins/vcalendar/plugin.def
@@ -7,5 +7,5 @@ EXPORTS
         plugin_type
 	plugin_provides
         plugin_version
-	plugin_master_password_change
+	plugin_master_passphrase_change
 
diff --git a/src/plugins/vcalendar/vcal_prefs.c b/src/plugins/vcalendar/vcal_prefs.c
index 680e807..baf40d4 100644
--- a/src/plugins/vcalendar/vcal_prefs.c
+++ b/src/plugins/vcalendar/vcal_prefs.c
@@ -723,7 +723,7 @@ static void vcal_prefs_save_func(PrefsPage * _page)
 	vcal_folder_export(NULL);
 }
 
-void vcal_prefs_master_password_change(const gchar *oldp, const gchar *newp) {
+void vcal_prefs_master_passphrase_change(const gchar *oldp, const gchar *newp) {
 	gchar *pass;
 	pass = password_decrypt(vcalprefs.export_pass, oldp);
 	if (pass != NULL) {
diff --git a/src/plugins/vcalendar/vcal_prefs.h b/src/plugins/vcalendar/vcal_prefs.h
index 9fcb96d..9e7d89f 100644
--- a/src/plugins/vcalendar/vcal_prefs.h
+++ b/src/plugins/vcalendar/vcal_prefs.h
@@ -51,6 +51,6 @@ extern VcalendarPrefs vcalprefs;
 void vcal_prefs_init	(void);
 void vcal_prefs_done	(void);
 void vcal_prefs_save	(void);
-void vcal_prefs_master_password_change(const gchar *oldp, const gchar *newp);
+void vcal_prefs_master_passphrase_change(const gchar *oldp, const gchar *newp);
 
 #endif
diff --git a/src/prefs_common.c b/src/prefs_common.c
index 50f9ebf..8895b5f 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -1190,8 +1190,8 @@ static PrefParam param[] = {
 	 NULL, NULL, NULL},
 	{"enable_avatars", "3", &prefs_common.enable_avatars, P_INT, NULL, NULL, NULL},
 #ifndef PASSWORD_CRYPTO_OLD
-	{"use_master_password", FALSE, &prefs_common.use_master_password, P_BOOL, NULL, NULL, NULL },
-	{"master_password_hash", "", &prefs_common.master_password_hash, P_STRING, NULL, NULL, NULL },
+	{"use_master_passphrase", FALSE, &prefs_common.use_master_passphrase, P_BOOL, NULL, NULL, NULL },
+	{"master_passphrase_hash", "", &prefs_common.master_passphrase_hash, P_STRING, NULL, NULL, NULL },
 #endif
 
 	{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
diff --git a/src/prefs_common.h b/src/prefs_common.h
index ed86cd0..8a38e42 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -540,8 +540,8 @@ struct _PrefsCommon
 	guint enable_avatars;
 
 #ifndef PASSWORD_CRYPTO_OLD
-	gboolean use_master_password;
-	gchar *master_password_hash;
+	gboolean use_master_passphrase;
+	gchar *master_passphrase_hash;
 #endif
 };
 
diff --git a/src/prefs_other.c b/src/prefs_other.c
index 2b7a93f..9497bf7 100644
--- a/src/prefs_other.c
+++ b/src/prefs_other.c
@@ -66,7 +66,7 @@ typedef struct _OtherPage
 	GtkWidget *flush_metadata_faster_radiobtn;
 	GtkWidget *flush_metadata_safer_radiobtn;
 #ifndef PASSWORD_CRYPTO_OLD
-	GtkWidget *checkbtn_use_password;
+	GtkWidget *checkbtn_use_passphrase;
 #endif
 } OtherPage;
 
@@ -85,8 +85,8 @@ static gboolean prefs_keybind_key_pressed	(GtkWidget	*widget,
 static void prefs_keybind_cancel		(void);
 static void prefs_keybind_apply_clicked		(GtkWidget	*widget);
 #ifndef PASSWORD_CRYPTO_OLD
-static void prefs_change_master_password(GtkButton *button, gpointer data);
-static void prefs_use_password_toggled(GtkToggleButton *button, gpointer data);
+static void prefs_change_master_passphrase(GtkButton *button, gpointer data);
+static void prefs_use_passphrase_toggled(GtkToggleButton *button, gpointer data);
 #endif
 
 
@@ -477,10 +477,10 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 	GtkWidget *flush_metadata_safer_radiobtn;
 
 #ifndef PASSWORD_CRYPTO_OLD
-	GtkWidget *vbox_password;
-	GtkWidget *frame_password;
-	GtkWidget *checkbtn_use_password;
-	GtkWidget *button_change_password;
+	GtkWidget *vbox_passphrase;
+	GtkWidget *frame_passphrase;
+	GtkWidget *checkbtn_use_passphrase;
+	GtkWidget *button_change_passphrase;
 #endif
 
 	gchar *shred_binary = NULL;
@@ -604,28 +604,28 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 			   _("Synchronise offline folders as soon as possible"));
 
 #ifndef PASSWORD_CRYPTO_OLD
-	vbox_password = gtkut_get_options_frame(vbox1, &frame_password, _("Master password"));
+	vbox_passphrase = gtkut_get_options_frame(vbox1, &frame_passphrase, _("Master passphrase"));
 
-	PACK_CHECK_BUTTON(vbox_password, checkbtn_use_password,
-			_("Use a master password"));
+	PACK_CHECK_BUTTON(vbox_passphrase, checkbtn_use_passphrase,
+			_("Use a master passphrase"));
 
-	CLAWS_SET_TIP(checkbtn_use_password,
+	CLAWS_SET_TIP(checkbtn_use_passphrase,
 			_("If checked, your saved account passwords will be protected "
-				"by a master password. If no master password is set, "
+				"by a master passphrase. If no master passphrase is set, "
 				"you will be prompted to set one."));
 
-	button_change_password = gtk_button_new_with_label(
-			_("Change master password"));
-	gtk_widget_show (button_change_password);
+	button_change_passphrase = gtk_button_new_with_label(
+			_("Change master passphrase"));
+	gtk_widget_show (button_change_passphrase);
 	hbox1 = gtk_hbox_new (FALSE, 8);
 	gtk_widget_show (hbox1);
-	gtk_box_pack_start (GTK_BOX (vbox_password), hbox1, FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (hbox1), button_change_password,
+	gtk_box_pack_start (GTK_BOX (vbox_passphrase), hbox1, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (hbox1), button_change_passphrase,
 			FALSE, FALSE, 0);
-	g_signal_connect (G_OBJECT (checkbtn_use_password), "toggled",
-				G_CALLBACK (prefs_use_password_toggled), button_change_password);
-	g_signal_connect (G_OBJECT (button_change_password), "clicked",
-			  G_CALLBACK (prefs_change_master_password), NULL);
+	g_signal_connect (G_OBJECT (checkbtn_use_passphrase), "toggled",
+				G_CALLBACK (prefs_use_passphrase_toggled), button_change_passphrase);
+	g_signal_connect (G_OBJECT (button_change_passphrase), "clicked",
+			  G_CALLBACK (prefs_change_master_passphrase), NULL);
 #endif
 
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_addaddrbyclick), 
@@ -652,10 +652,10 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 		prefs_common.real_time_sync);
 
 #ifndef PASSWORD_CRYPTO_OLD
-	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_use_password),
-		prefs_common.use_master_password);
-	gtk_widget_set_sensitive(button_change_password,
-			prefs_common.use_master_password);
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_use_passphrase),
+		prefs_common.use_master_passphrase);
+	gtk_widget_set_sensitive(button_change_passphrase,
+			prefs_common.use_master_passphrase);
 #endif
 
 	prefs_other->checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
@@ -671,7 +671,7 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 	prefs_other->flush_metadata_safer_radiobtn = flush_metadata_safer_radiobtn;
 	prefs_other->flush_metadata_faster_radiobtn = flush_metadata_faster_radiobtn;
 #ifndef PASSWORD_CRYPTO_OLD
-	prefs_other->checkbtn_use_password = checkbtn_use_password;
+	prefs_other->checkbtn_use_passphrase = checkbtn_use_passphrase;
 #endif
 	prefs_other->page.widget = vbox1;
 }
@@ -710,39 +710,39 @@ static void prefs_other_save(PrefsPage *_page)
 			GTK_TOGGLE_BUTTON(page->checkbtn_real_time_sync));
 
 #ifndef PASSWORD_CRYPTO_OLD
-	/* If we're disabling use of master password, we need to reencrypt
+	/* If we're disabling use of master passphrase, we need to reencrypt
 	 * all account passwords with hardcoded key. */
 	if (!gtk_toggle_button_get_active(
-			GTK_TOGGLE_BUTTON(page->checkbtn_use_password))
-			&& master_password_is_set()) {
-		master_password_change(NULL, NULL);
-
-		/* In case user did not finish the password change process
-		 * (e.g. did not enter a correct current master password),
-		 * we need to enable the "use master password" checkbox again,
-		 * since the old master password is still valid. */
-		if (master_password_is_set()) {
+			GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase))
+			&& master_passphrase_is_set()) {
+		master_passphrase_change(NULL, NULL);
+
+		/* In case user did not finish the passphrase change process
+		 * (e.g. did not enter a correct current master passphrase),
+		 * we need to enable the "use master passphrase" checkbox again,
+		 * since the old master passphrase is still valid. */
+		if (master_passphrase_is_set()) {
 			gtk_toggle_button_set_active(
-				GTK_TOGGLE_BUTTON(page->checkbtn_use_password), TRUE);
+				GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase), TRUE);
 		}
 	}
 
 	if (gtk_toggle_button_get_active(
-			GTK_TOGGLE_BUTTON(page->checkbtn_use_password))
-			&& !master_password_is_set()) {
-		master_password_change_dialog();
+			GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase))
+			&& !master_passphrase_is_set()) {
+		master_passphrase_change_dialog();
 
-		/* In case user cancelled the password change dialog, we need
-		 * to disable the "use master password" checkbox. */
-		if (!master_password_is_set()) {
+		/* In case user cancelled the passphrase change dialog, we need
+		 * to disable the "use master passphrase" checkbox. */
+		if (!master_passphrase_is_set()) {
 			gtk_toggle_button_set_active(
-				GTK_TOGGLE_BUTTON(page->checkbtn_use_password), FALSE);
+				GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase), FALSE);
 		}
 	}
 
-	prefs_common.use_master_password =
+	prefs_common.use_master_passphrase =
 		gtk_toggle_button_get_active(
-			GTK_TOGGLE_BUTTON(page->checkbtn_use_password));
+			GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase));
 #endif
 
 	gtk_can_change_accels = gtk_toggle_button_get_active(
@@ -800,13 +800,13 @@ void prefs_other_done(void)
 }
 
 #ifndef PASSWORD_CRYPTO_OLD
-void prefs_change_master_password(GtkButton *button, gpointer data)
+void prefs_change_master_passphrase(GtkButton *button, gpointer data)
 {
-	/* Call the password change dialog */
-	master_password_change_dialog();
+	/* Call the passphrase change dialog */
+	master_passphrase_change_dialog();
 }
 
-void prefs_use_password_toggled(GtkToggleButton *chkbtn, gpointer data)
+void prefs_use_passphrase_toggled(GtkToggleButton *chkbtn, gpointer data)
 {
 	GtkWidget *button = GTK_WIDGET(data);
 	gboolean active = gtk_toggle_button_get_active(chkbtn);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list