[Commits] [SCM] claws branch, master, updated. 3.18.0-351-g40b08ed52

wwp at claws-mail.org wwp at claws-mail.org
Tue Mar 29 17:02:22 UTC 2022


The branch, master has been updated
       via  40b08ed52e09f853f6be31596db2576505c2031e (commit)
      from  ffc5c31b61e5e0f1cb9402f77c785fb61f618162 (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 40b08ed52e09f853f6be31596db2576505c2031e
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 240cbb21f..5c07df4a7 100644
--- a/src/addressbook.c
+++ b/src/addressbook.c
@@ -4773,8 +4773,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 f1f5c3e9e..d81dd3091 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -7315,11 +7315,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 695826b09..2b7d2afd2 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -442,7 +442,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, 
@@ -796,7 +796,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 */	
@@ -1861,7 +1861,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)
 
@@ -3109,7 +3109,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
@@ -3247,7 +3247,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);
 
@@ -5463,12 +5463,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 33e21b873..3e514b047 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;
@@ -175,7 +175,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;
 	}
@@ -185,7 +185,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;
@@ -203,57 +203,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;
@@ -263,7 +263,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
 
@@ -318,7 +318,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);
@@ -563,7 +563,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
@@ -588,7 +588,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 2764fbe44..d514f6b7c 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 The Claws Mail Team
+ * 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
@@ -71,19 +71,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);
@@ -105,7 +105,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_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,7 +162,7 @@ void master_passphrase_change_dialog()
 		gtk_widget_modify_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_misc_set_alignment(GTK_MISC(label), 0, 0.5);
@@ -223,8 +223,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 a1ecbeb16..195bc6c50 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
@@ -1294,10 +1294,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 430de5c11..f0fbfe167 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -579,10 +579,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 30c18b9ee..c55f274fd 100644
--- a/src/prefs_other.c
+++ b/src/prefs_other.c
@@ -87,7 +87,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
 
@@ -612,18 +612,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_hbox_new (FALSE, 8);
 	gtk_widget_show (hbox1);
@@ -633,7 +633,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, checkbtn_gtk_can_change_accels);
 	SET_TOGGLE_SENSITIVITY(checkbtn_gtk_enable_accels, button_keybind);
@@ -667,9 +667,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;
@@ -729,18 +729,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);
 		}
@@ -748,18 +748,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
@@ -846,10 +846,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