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.
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;
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"));
}
/* 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."));
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;
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);
}
}
}
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);
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,
/* {"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 */
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)
}
#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
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);
}
#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
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,
#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;
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);
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;
/* 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
#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
#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);
/* 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;
}
}
gchar *password_decrypt_gnutls(const gchar *password,
- const gchar *decryption_password)
+ const gchar *decryption_passphrase)
{
gchar **tokens, *tmp;
gnutls_cipher_algorithm_t algo;
#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);
* 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;
#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;
/* 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
#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
#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
/* 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 */
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);
ctx->dialog = NULL;
}
-void master_password_change_dialog()
+void master_passphrase_change_dialog()
{
static PangoFontDescription *font_desc;
GtkWidget *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);
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);
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);
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);
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);
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",
#endif
#ifndef PASSWORD_CRYPTO_OLD
-void master_password_change_dialog();
+void master_passphrase_change_dialog();
#endif
#endif /* __PASSWORD_GTK_H */
}
}
-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;
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_ */
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)
plugin_type
plugin_provides
plugin_version
- plugin_master_password_change
+ plugin_master_passphrase_change
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)
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;
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
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)
plugin_type
plugin_provides
plugin_version
- plugin_master_password_change
+ plugin_master_passphrase_change
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) {
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
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}
guint enable_avatars;
#ifndef PASSWORD_CRYPTO_OLD
- gboolean use_master_password;
- gchar *master_password_hash;
+ gboolean use_master_passphrase;
+ gchar *master_passphrase_hash;
#endif
};
GtkWidget *flush_metadata_faster_radiobtn;
GtkWidget *flush_metadata_safer_radiobtn;
#ifndef PASSWORD_CRYPTO_OLD
- GtkWidget *checkbtn_use_password;
+ GtkWidget *checkbtn_use_passphrase;
#endif
} OtherPage;
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
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;
_("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),
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;
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;
}
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(
}
#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);