[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-78-g76fe80e6d

paul at claws-mail.org paul at claws-mail.org
Tue Aug 24 16:30:38 UTC 2021


The branch, gtk3 has been updated
       via  76fe80e6d6e9ee0966ac2e6f15730581fc39ebf2 (commit)
      from  810e41b67dbb24919afb90d7c277f873fc8ee91c (commit)

Summary of changes:
 src/addressbook.c  |   4 +--
 src/compose.c      |   6 ++--
 src/mainwindow.c   |  14 ++++----
 src/password.c     | 104 ++++++++++++++++++++++++++---------------------------
 src/password_gtk.c |  22 ++++++------
 src/prefs_common.c |  10 +++---
 src/prefs_common.h |   8 ++---
 src/prefs_other.c  |  44 +++++++++++------------
 8 files changed, 106 insertions(+), 106 deletions(-)


- Log -----------------------------------------------------------------
commit 76fe80e6d6e9ee0966ac2e6f15730581fc39ebf2
Author: paul <paul at claws-mail.org>
Date:   Tue Aug 24 17:30:33 2021 +0100

    'master passphrase' becomes 'primary passphrase'

diff --git a/src/addressbook.c b/src/addressbook.c
index d31d7da6b..edfb8288b 100644
--- a/src/addressbook.c
+++ b/src/addressbook.c
@@ -4772,8 +4772,8 @@ static void addressbook_lup_clicked( GtkButton *button, gpointer data ) {
 				ldap_ctl->bindDN != NULL && strlen(ldap_ctl->bindDN) > 0) {
 #ifndef PASSWORD_CRYPTO_OLD
 			/* LDAP server is password-protected. */
-			if (master_passphrase() == NULL) {
-				/* User did not enter master passphrase, do not start a search. */
+			if (primary_passphrase() == NULL) {
+				/* User did not enter primary passphrase, do not start a search. */
 				return;
 			}
 #endif /* PASSWORD_CRYPTO_OLD */
diff --git a/src/compose.c b/src/compose.c
index 6b32f89d4..71de99552 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -7257,11 +7257,11 @@ static void compose_create_header_entry(Compose *compose)
 #ifdef USE_LDAP
 #ifndef PASSWORD_CRYPTO_OLD
 	GSList *pwd_servers = addrindex_get_password_protected_ldap_servers();
-	if (pwd_servers != NULL && master_passphrase() == NULL) {
+	if (pwd_servers != NULL && primary_passphrase() == NULL) {
 		gboolean enable = FALSE;
-		debug_print("Master passphrase not available, disabling password-protected LDAP servers for this compose window.\n");
+		debug_print("Primary passphrase not available, disabling password-protected LDAP servers for this compose window.\n");
 		/* Temporarily disable password-protected LDAP servers,
-		 * because user did not provide a master passphrase.
+		 * because user did not provide a primary passphrase.
 		 * We can safely enable searchFlag on all servers in this list
 		 * later, since addrindex_get_password_protected_ldap_servers()
 		 * includes servers which have it enabled initially. */
diff --git a/src/mainwindow.c b/src/mainwindow.c
index ab854ee5d..adb127e0f 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -435,7 +435,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_passphrase_cb	(GtkAction	*action,
+static void forget_primary_passphrase_cb	(GtkAction	*action,
 					 gpointer	 data );
 #endif
 static gboolean mainwindow_focus_in_event	(GtkWidget	*widget, 
@@ -787,7 +787,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/ForgetMasterPassphrase",             NULL, N_("Forget _master passphrase"), NULL, NULL, G_CALLBACK(forget_master_passphrase_cb) },
+	{"Tools/ForgetPrimaryPassphrase",             NULL, N_("Forget _primary passphrase"), NULL, NULL, G_CALLBACK(forget_primary_passphrase_cb) },
 #endif
 
 /* Configuration menu */	
@@ -1846,7 +1846,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", "ForgetMasterPassphrase", "Tools/ForgetMasterPassphrase", GTK_UI_MANAGER_MENUITEM)
+	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "ForgetPrimaryPassphrase", "Tools/ForgetPrimaryPassphrase", GTK_UI_MANAGER_MENUITEM)
 #endif
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator9", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
 
@@ -3083,7 +3083,7 @@ SensitiveCondMask main_window_get_current_state(MainWindow *mainwin)
 	}
 
 #ifndef PASSWORD_CRYPTO_OLD
-	if (master_passphrase_is_entered()) {
+	if (primary_passphrase_is_entered()) {
 		UPDATE_STATE(M_MASTER_PASSPHRASE);
 	}
 #endif
@@ -3221,7 +3221,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
 	SET_SENSITIVE("Menu/Tools/Expunge", M_DELETED_EXISTS);
 	SET_SENSITIVE("Menu/Tools/ForgetSessionPasswords", M_SESSION_PASSWORDS);
 #ifndef PASSWORD_CRYPTO_OLD
-	SET_SENSITIVE("Menu/Tools/ForgetMasterPassphrase", M_MASTER_PASSPHRASE);
+	SET_SENSITIVE("Menu/Tools/ForgetPrimaryPassphrase", M_MASTER_PASSPHRASE);
 #endif
 	SET_SENSITIVE("Menu/Tools/DeleteDuplicates/SelFolder", M_MSG_EXIST, M_ALLOW_DELETE);
 
@@ -5374,12 +5374,12 @@ static void forget_session_passwords_cb(GtkAction *action, gpointer data)
 }
 
 #ifndef PASSWORD_CRYPTO_OLD
-static void forget_master_passphrase_cb(GtkAction *action, gpointer data)
+static void forget_primary_passphrase_cb(GtkAction *action, gpointer data)
 {
 	MainWindow *mainwin = (MainWindow *)data;
 
 	main_window_lock(mainwin);
-	master_passphrase_forget();
+	primary_passphrase_forget();
 	main_window_unlock(mainwin);
 }
 #endif
diff --git a/src/password.c b/src/password.c
index 8105820f8..1f61daf54 100644
--- a/src/password.c
+++ b/src/password.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2016 The Claws Mail Team
+ * Copyright (C) 2016-2021 The Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@
 #include "prefs_common.h"
 
 #ifndef PASSWORD_CRYPTO_OLD
-static gchar *_master_passphrase = NULL;
+static gchar *_primary_passphrase = NULL;
 
 /* Length of stored key derivation, before base64. */
 #define KD_LENGTH 64
@@ -64,8 +64,8 @@ static void _generate_salt()
 {
 	guchar salt[KD_SALT_LENGTH];
 
-	if (prefs_common_get_prefs()->master_passphrase_salt != NULL) {
-		g_free(prefs_common_get_prefs()->master_passphrase_salt);
+	if (prefs_common_get_prefs()->primary_passphrase_salt != NULL) {
+		g_free(prefs_common_get_prefs()->primary_passphrase_salt);
 	}
 
 	if (!get_random_bytes(salt, KD_SALT_LENGTH)) {
@@ -73,7 +73,7 @@ static void _generate_salt()
 		return;
 	}
 
-	prefs_common_get_prefs()->master_passphrase_salt =
+	prefs_common_get_prefs()->primary_passphrase_salt =
 		g_base64_encode(salt, KD_SALT_LENGTH);
 }
 
@@ -83,14 +83,14 @@ static guchar *_make_key_deriv(const gchar *passphrase, guint rounds,
 		guint length)
 {
 	guchar *kd, *salt;
-	gchar *saltpref = prefs_common_get_prefs()->master_passphrase_salt;
+	gchar *saltpref = prefs_common_get_prefs()->primary_passphrase_salt;
 	gsize saltlen;
 	gint ret;
 
 	/* Grab our salt, generating and saving a new random one if needed. */
 	if (saltpref == NULL || strlen(saltpref) == 0) {
 		_generate_salt();
-		saltpref = prefs_common_get_prefs()->master_passphrase_salt;
+		saltpref = prefs_common_get_prefs()->primary_passphrase_salt;
 	}
 	salt = g_base64_decode(saltpref, &saltlen);
 	kd = g_malloc0(length);
@@ -110,55 +110,55 @@ static guchar *_make_key_deriv(const gchar *passphrase, guint rounds,
 	return NULL;
 }
 
-const gchar *master_passphrase()
+const gchar *primary_passphrase()
 {
 	gchar *input;
 	gboolean end = FALSE;
 
-	if (!prefs_common_get_prefs()->use_master_passphrase) {
+	if (!prefs_common_get_prefs()->use_primary_passphrase) {
 		return PASSCRYPT_KEY;
 	}
 
-	if (_master_passphrase != NULL) {
-		debug_print("Master passphrase is in memory, offering it.\n");
-		return _master_passphrase;
+	if (_primary_passphrase != NULL) {
+		debug_print("Primary passphrase is in memory, offering it.\n");
+		return _primary_passphrase;
 	}
 
 	while (!end) {
-		input = input_dialog_with_invisible(_("Input master passphrase"),
-				_("Input master passphrase"), NULL);
+		input = input_dialog_with_invisible(_("Input primary passphrase"),
+				_("Input primary passphrase"), NULL);
 
 		if (input == NULL) {
-			debug_print("Cancel pressed at master passphrase dialog.\n");
+			debug_print("Cancel pressed at primary passphrase dialog.\n");
 			break;
 		}
 
-		if (master_passphrase_is_correct(input)) {
-			debug_print("Entered master passphrase seems to be correct, remembering it.\n");
-			_master_passphrase = input;
+		if (primary_passphrase_is_correct(input)) {
+			debug_print("Entered primary passphrase seems to be correct, remembering it.\n");
+			_primary_passphrase = input;
 			end = TRUE;
 		} else {
-			alertpanel_error(_("Incorrect master passphrase."));
+			alertpanel_error(_("Incorrect primary passphrase."));
 		}
 	}
 
-	return _master_passphrase;
+	return _primary_passphrase;
 }
 
-gboolean master_passphrase_is_set()
+gboolean primary_passphrase_is_set()
 {
-	if (prefs_common_get_prefs()->master_passphrase == NULL
-			|| strlen(prefs_common_get_prefs()->master_passphrase) == 0)
+	if (prefs_common_get_prefs()->primary_passphrase == NULL
+			|| strlen(prefs_common_get_prefs()->primary_passphrase) == 0)
 		return FALSE;
 
 	return TRUE;
 }
 
-gboolean master_passphrase_is_correct(const gchar *input)
+gboolean primary_passphrase_is_correct(const gchar *input)
 {
 	guchar *kd, *input_kd;
 	gchar **tokens;
-	gchar *stored_kd = prefs_common_get_prefs()->master_passphrase;
+	gchar *stored_kd = prefs_common_get_prefs()->primary_passphrase;
 	gsize kd_len;
 	guint rounds = 0;
 	gint ret;
@@ -178,7 +178,7 @@ gboolean master_passphrase_is_correct(const gchar *input)
 			(rounds = atoi(tokens[1] + 17)) <= 0 || /* valid rounds # */
 			tokens[2] == NULL ||
 			strlen(tokens[2]) == 0) { /* string continues after } */
-		debug_print("Mangled master_passphrase format in config, can not use it.\n");
+		debug_print("Mangled primary_passphrase format in config, can not use it.\n");
 		g_strfreev(tokens);
 		return FALSE;
 	}
@@ -188,7 +188,7 @@ gboolean master_passphrase_is_correct(const gchar *input)
 	g_strfreev(tokens);
 
 	if (kd_len != KD_LENGTH) {
-		debug_print("master_passphrase is %"G_GSIZE_FORMAT" bytes long, should be %d.\n",
+		debug_print("primary_passphrase is %"G_GSIZE_FORMAT" bytes long, should be %d.\n",
 				kd_len, KD_LENGTH);
 		g_free(kd);
 		return FALSE;
@@ -206,57 +206,57 @@ gboolean master_passphrase_is_correct(const gchar *input)
 	return FALSE;
 }
 
-gboolean master_passphrase_is_entered()
+gboolean primary_passphrase_is_entered()
 {
-	return (_master_passphrase == NULL) ? FALSE : TRUE;
+	return (_primary_passphrase == NULL) ? FALSE : TRUE;
 }
 
-void master_passphrase_forget()
+void primary_passphrase_forget()
 {
-	/* If master passphrase is currently in memory (entered by user),
+	/* If primary passphrase is currently in memory (entered by user),
 	 * get rid of it. User will have to enter the new one again. */
-	if (_master_passphrase != NULL) {
-		memset(_master_passphrase, 0, strlen(_master_passphrase));
-		g_free(_master_passphrase);
-		_master_passphrase = NULL;
+	if (_primary_passphrase != NULL) {
+		memset(_primary_passphrase, 0, strlen(_primary_passphrase));
+		g_free(_primary_passphrase);
+		_primary_passphrase = NULL;
 	}
 }
 
-void master_passphrase_change(const gchar *oldp, const gchar *newp)
+void primary_passphrase_change(const gchar *oldp, const gchar *newp)
 {
 	guchar *kd;
 	gchar *base64_kd;
-	guint rounds = prefs_common_get_prefs()->master_passphrase_pbkdf2_rounds;
+	guint rounds = prefs_common_get_prefs()->primary_passphrase_pbkdf2_rounds;
 
 	g_return_if_fail(rounds > 0);
 
 	if (oldp == NULL) {
 		/* If oldp is NULL, make sure the user has to enter the
-		 * current master passphrase before being able to change it. */
-		master_passphrase_forget();
-		oldp = master_passphrase();
+		 * current primary passphrase before being able to change it. */
+		primary_passphrase_forget();
+		oldp = primary_passphrase();
 	}
 	g_return_if_fail(oldp != NULL);
 
-	/* Update master passphrase hash in prefs */
-	if (prefs_common_get_prefs()->master_passphrase != NULL)
-		g_free(prefs_common_get_prefs()->master_passphrase);
+	/* Update primary passphrase hash in prefs */
+	if (prefs_common_get_prefs()->primary_passphrase != NULL)
+		g_free(prefs_common_get_prefs()->primary_passphrase);
 
 	if (newp != NULL) {
-		debug_print("Storing key derivation of new master passphrase\n");
+		debug_print("Storing key derivation of new primary passphrase\n");
 		kd = _make_key_deriv(newp, rounds, KD_LENGTH);
 		base64_kd = g_base64_encode(kd, 64);
-		prefs_common_get_prefs()->master_passphrase =
+		prefs_common_get_prefs()->primary_passphrase =
 			g_strdup_printf("{PBKDF2-HMAC-SHA1,%d}%s", rounds, base64_kd);
 		g_free(kd);
 		g_free(base64_kd);
 	} else {
-		debug_print("Setting master_passphrase to NULL\n");
-		prefs_common_get_prefs()->master_passphrase = NULL;
+		debug_print("Setting primary_passphrase to NULL\n");
+		prefs_common_get_prefs()->primary_passphrase = NULL;
 	}
 
 	/* Now go over all accounts, reencrypting their passwords using
-	 * the new master passphrase. */
+	 * the new primary passphrase. */
 
 	if (oldp == NULL)
 		oldp = PASSCRYPT_KEY;
@@ -266,7 +266,7 @@ void master_passphrase_change(const gchar *oldp, const gchar *newp)
 	debug_print("Reencrypting all account passwords...\n");
 	passwd_store_reencrypt_all(oldp, newp);
 
-	master_passphrase_forget();
+	primary_passphrase_forget();
 }
 #endif
 
@@ -321,7 +321,7 @@ gchar *password_encrypt_gnutls(const gchar *password,
 	gnutls_datum_t key, iv;
 	int keylen, blocklen, ret, len, i;
 	unsigned char *buf, *encbuf, *base, *output;
-	guint rounds = prefs_common_get_prefs()->master_passphrase_pbkdf2_rounds;
+	guint rounds = prefs_common_get_prefs()->primary_passphrase_pbkdf2_rounds;
 
 	g_return_val_if_fail(password != NULL, NULL);
 	g_return_val_if_fail(encryption_passphrase != NULL, NULL);
@@ -566,7 +566,7 @@ gchar *password_encrypt(const gchar *password,
 
 #ifndef PASSWORD_CRYPTO_OLD
 	if (encryption_passphrase == NULL)
-		encryption_passphrase = master_passphrase();
+		encryption_passphrase = primary_passphrase();
 
 	return password_encrypt_real(password, encryption_passphrase);
 #else
@@ -591,7 +591,7 @@ gchar *password_decrypt(const gchar *password,
 	/* Try available crypto backend */
 #ifndef PASSWORD_CRYPTO_OLD
 	if (decryption_passphrase == NULL)
-		decryption_passphrase = master_passphrase();
+		decryption_passphrase = primary_passphrase();
 
 	if (*password == '{') {
 		debug_print("Trying to decrypt password...\n");
diff --git a/src/password_gtk.c b/src/password_gtk.c
index 27bfb7e17..550a18e84 100644
--- a/src/password_gtk.c
+++ b/src/password_gtk.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2016-2019 the Claws Mail team and Andrej Kacian
+ * Copyright (C) 2016-2021 the Claws Mail team and Andrej Kacian
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -70,19 +70,19 @@ static void ok_button_clicked(GtkButton *button, gpointer user_data)
 		return;
 	}
 
-	/* If there is an existing master passphrase, check for its correctness
+	/* If there is an existing primary passphrase, check for its correctness
 	 * in entry_old. */
-	if (master_passphrase_is_set()
+	if (primary_passphrase_is_set()
 			&& ((old = gtk_entry_get_text(GTK_ENTRY(ctx->entry_old))) == NULL
-				|| strlen(old) == 0 || !master_passphrase_is_correct(old))) {
+				|| strlen(old) == 0 || !primary_passphrase_is_correct(old))) {
 		debug_print("old passphrase incorrect\n");
-		alertpanel_warning(_("Incorrect old master passphrase entered, try again."));
+		alertpanel_warning(_("Incorrect old primary passphrase entered, try again."));
 		gtk_entry_set_text(GTK_ENTRY(ctx->entry_old), "");
 		gtk_widget_grab_focus(ctx->entry_old);
 		return;
 	}
 
-	master_passphrase_change(old, new1);
+	primary_passphrase_change(old, new1);
 
 	ctx->done = TRUE;
 	gtk_widget_destroy(ctx->dialog);
@@ -104,7 +104,7 @@ static void dialog_destroy(GtkWidget *widget, gpointer user_data)
 	ctx->dialog = NULL;
 }
 
-void master_passphrase_change_dialog()
+void primary_passphrase_change_dialog()
 {
 	static PangoFontDescription *font_desc;
 	GtkWidget *dialog;
@@ -141,7 +141,7 @@ void master_passphrase_change_dialog()
 	gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0);
 	gtk_widget_show(vbox);
 
-	msg_title = gtk_label_new(_("Changing master passphrase"));
+	msg_title = gtk_label_new(_("Changing primary passphrase"));
 	gtk_label_set_xalign(GTK_LABEL(msg_title), 0.0);
 	gtk_label_set_justify(GTK_LABEL(msg_title), GTK_JUSTIFY_LEFT);
 	gtk_label_set_use_markup (GTK_LABEL (msg_title), TRUE);
@@ -162,7 +162,7 @@ void master_passphrase_change_dialog()
 		gtk_widget_override_font(msg_title, font_desc);
 
 	label = gtk_label_new(
-        _("If a master passphrase is currently active, it\n"
+        _("If a primary passphrase is currently active, it\n"
         "needs to be entered.")
 	);
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
@@ -221,8 +221,8 @@ void master_passphrase_change_dialog()
 
 	gtk_widget_grab_default(ok_button);
 
-	/* If no master passphrase is set, disable the "old passphrase" entry */
-	if (!master_passphrase_is_set())
+	/* If no primary passphrase is set, disable the "old passphrase" entry */
+	if (!primary_passphrase_is_set())
 		gtk_widget_set_sensitive(entry_old, FALSE);
 
 	g_signal_connect(G_OBJECT(entry_old), "activate",
diff --git a/src/prefs_common.c b/src/prefs_common.c
index 0b196eaae..36f1b34ed 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2020 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1289,10 +1289,10 @@ static PrefParam param[] = {
 	 NULL, NULL, NULL},
 	{"enable_avatars", "3", &prefs_common.enable_avatars, P_INT, NULL, NULL, NULL},
 #ifndef PASSWORD_CRYPTO_OLD
-	{"use_master_passphrase", FALSE, &prefs_common.use_master_passphrase, P_BOOL, NULL, NULL, NULL },
-	{"master_passphrase", "", &prefs_common.master_passphrase, P_STRING, NULL, NULL, NULL },
-	{"master_passphrase_salt", "", &prefs_common.master_passphrase_salt, P_STRING, NULL, NULL, NULL },
-	{"master_passphrase_pbkdf2_rounds", "50000", &prefs_common.master_passphrase_pbkdf2_rounds, P_INT, NULL, NULL, NULL},
+	{"use_master_passphrase", FALSE, &prefs_common.use_primary_passphrase, P_BOOL, NULL, NULL, NULL },
+	{"master_passphrase", "", &prefs_common.primary_passphrase, P_STRING, NULL, NULL, NULL },
+	{"master_passphrase_salt", "", &prefs_common.primary_passphrase_salt, P_STRING, NULL, NULL, NULL },
+	{"master_passphrase_pbkdf2_rounds", "50000", &prefs_common.primary_passphrase_pbkdf2_rounds, P_INT, NULL, NULL, NULL},
 #endif
 
 	{"use_proxy", "FALSE", &prefs_common.use_proxy, P_BOOL, NULL, NULL, NULL},
diff --git a/src/prefs_common.h b/src/prefs_common.h
index 188fa17e1..dde021e2c 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -577,10 +577,10 @@ struct _PrefsCommon
 	guint enable_avatars;
 
 #ifndef PASSWORD_CRYPTO_OLD
-	gboolean use_master_passphrase;
-	gchar *master_passphrase;
-	gchar *master_passphrase_salt;
-	guint master_passphrase_pbkdf2_rounds;
+	gboolean use_primary_passphrase;
+	gchar *primary_passphrase;
+	gchar *primary_passphrase_salt;
+	guint primary_passphrase_pbkdf2_rounds;
 #endif
 
 	/* Proxy */
diff --git a/src/prefs_other.c b/src/prefs_other.c
index a31797877..d4dfa8546 100644
--- a/src/prefs_other.c
+++ b/src/prefs_other.c
@@ -86,7 +86,7 @@ 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_passphrase(GtkButton *button, gpointer data);
+static void prefs_change_primary_passphrase(GtkButton *button, gpointer data);
 static void prefs_use_passphrase_toggled(GtkToggleButton *button, gpointer data);
 #endif
 
@@ -601,18 +601,18 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 			   _("Synchronise offline folders as soon as possible"));
 
 #ifndef PASSWORD_CRYPTO_OLD
-	vbox_passphrase = gtkut_get_options_frame(vbox1, &frame_passphrase, _("Master passphrase"));
+	vbox_passphrase = gtkut_get_options_frame(vbox1, &frame_passphrase, _("Primary passphrase"));
 
 	PACK_CHECK_BUTTON(vbox_passphrase, checkbtn_use_passphrase,
-			_("Use a master passphrase"));
+			_("Use a primary passphrase"));
 
 	CLAWS_SET_TIP(checkbtn_use_passphrase,
 			_("If checked, your saved account passwords will be protected "
-				"by a master passphrase. If no master passphrase is set, "
+				"by a primary passphrase. If no primary passphrase is set, "
 				"you will be prompted to set one."));
 
 	button_change_passphrase = gtk_button_new_with_label(
-			_("Change master passphrase"));
+			_("Change primary passphrase"));
 	gtk_widget_show (button_change_passphrase);
 	hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
 	gtk_widget_show (hbox1);
@@ -622,7 +622,7 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 	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);
+			  G_CALLBACK (prefs_change_primary_passphrase), NULL);
 #endif
 	SET_TOGGLE_SENSITIVITY(checkbtn_gtk_enable_accels, button_keybind);
 
@@ -653,9 +653,9 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 
 #ifndef PASSWORD_CRYPTO_OLD
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_use_passphrase),
-		prefs_common.use_master_passphrase);
+		prefs_common.use_primary_passphrase);
 	gtk_widget_set_sensitive(button_change_passphrase,
-			prefs_common.use_master_passphrase);
+			prefs_common.use_primary_passphrase);
 #endif
 
 	prefs_other->checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
@@ -714,18 +714,18 @@ 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 passphrase, we need to reencrypt
+	/* If we're disabling use of primary passphrase, we need to reencrypt
 	 * all account passwords with hardcoded key. */
 	if (!gtk_toggle_button_get_active(
 			GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase))
-			&& master_passphrase_is_set()) {
-		master_passphrase_change(NULL, NULL);
+			&& primary_passphrase_is_set()) {
+		primary_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()) {
+		 * (e.g. did not enter a correct current primary passphrase),
+		 * we need to enable the "use primary passphrase" checkbox again,
+		 * since the old primary passphrase is still valid. */
+		if (primary_passphrase_is_set()) {
 			gtk_toggle_button_set_active(
 				GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase), TRUE);
 		}
@@ -733,18 +733,18 @@ static void prefs_other_save(PrefsPage *_page)
 
 	if (gtk_toggle_button_get_active(
 			GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase))
-			&& !master_passphrase_is_set()) {
-		master_passphrase_change_dialog();
+			&& !primary_passphrase_is_set()) {
+		primary_passphrase_change_dialog();
 
 		/* In case user cancelled the passphrase change dialog, we need
-		 * to disable the "use master passphrase" checkbox. */
-		if (!master_passphrase_is_set()) {
+		 * to disable the "use primary passphrase" checkbox. */
+		if (!primary_passphrase_is_set()) {
 			gtk_toggle_button_set_active(
 				GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase), FALSE);
 		}
 	}
 
-	prefs_common.use_master_passphrase =
+	prefs_common.use_primary_passphrase =
 		gtk_toggle_button_get_active(
 			GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase));
 #endif
@@ -810,10 +810,10 @@ void prefs_other_done(void)
 }
 
 #ifndef PASSWORD_CRYPTO_OLD
-void prefs_change_master_passphrase(GtkButton *button, gpointer data)
+void prefs_change_primary_passphrase(GtkButton *button, gpointer data)
 {
 	/* Call the passphrase change dialog */
-	master_passphrase_change_dialog();
+	primary_passphrase_change_dialog();
 }
 
 void prefs_use_passphrase_toggled(GtkToggleButton *chkbtn, gpointer data)

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list