"Master password" is now called "master passphrase".
authorAndrej Kacian <ticho@claws-mail.org>
Thu, 3 Mar 2016 10:17:41 +0000 (11:17 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Thu, 3 Mar 2016 18:10:47 +0000 (19:10 +0100)
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.

23 files changed:
doc/src/password_encryption.txt
src/common/plugin.c
src/common/plugin.h
src/mainwindow.c
src/mainwindow.h
src/password.c
src/password.h
src/password_gtk.c
src/password_gtk.h
src/plugins/gdata/cm_gdata_prefs.c
src/plugins/gdata/cm_gdata_prefs.h
src/plugins/gdata/gdata_plugin.c
src/plugins/spam_report/plugin.def
src/plugins/spam_report/spam_report.c
src/plugins/spam_report/spam_report_prefs.c
src/plugins/spam_report/spam_report_prefs.h
src/plugins/vcalendar/plugin.c
src/plugins/vcalendar/plugin.def
src/plugins/vcalendar/vcal_prefs.c
src/plugins/vcalendar/vcal_prefs.h
src/prefs_common.c
src/prefs_common.h
src/prefs_other.c

index aed0cb02e0c1b0f103f110762cd176c45bafabda..76a8c9e7f6cc842ab7daccd9090ddba16f089c74 100644 (file)
@@ -2,14 +2,14 @@ Unless --with-password-encryption=old is active, account passwords are
 stored encrypted using AES-256-CBC, using following scheme:
 ----------------------------------------------------------------------
 
 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
 
 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.
 
 
 IV for the cipher is filled with random bytes.
 
index b7282b860386c94e54c1a6dc91c4d82f66c5eb8d..9822d614e5248b26a24de004411a5d921022ffc9 100644 (file)
@@ -51,7 +51,7 @@ struct _Plugin
        const gchar *(*version) (void);
        const gchar *(*type) (void);
        const gchar *(*licence) (void);
        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;
        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);
        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"));
 
        gint ok;
        START_TIMING((filename?filename:"NULL plugin"));
@@ -479,7 +479,7 @@ init_plugin:
        }
 
        /* Optional methods */
        }
 
        /* 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."));
        
        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->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;
 
        plugin->filename = g_strdup(filename);
        plugin->error = NULL;
 
@@ -752,13 +752,13 @@ const gchar *plugin_get_error(Plugin *plugin)
        return plugin->error;
 }
 
        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;
        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);
                }
        }
 }
                }
        }
 }
index 446df5e4be6496aaed53c370c01dde60a9d23da1..b153b6b3360781e8a6eb7a4d265e3dc6b23fdad2 100644 (file)
@@ -59,7 +59,7 @@ void plugin_unload_all                (const gchar     *type);
 void plugin_save_list          (void);
 void plugin_load_standard_plugins (void);
 
 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);
 
 GSList *plugin_get_list                (void);
 GSList *plugin_get_unloaded_list(void);
index 080d97f1ba2591972b73722d2b7a841ba15beaae..3df094976d56edca6fb40d5a205bfe49e62c2874 100644 (file)
@@ -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_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, 
                                         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/---",                        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 */       
 #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", "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)
 
 #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
        }
 
 #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
        }
 #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/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);
 
 #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
 }
 
 #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);
 {
        MainWindow *mainwin = (MainWindow *)data;
 
        main_window_lock(mainwin);
-       master_password_forget();
+       master_passphrase_forget();
        main_window_unlock(mainwin);
 }
 #endif
        main_window_unlock(mainwin);
 }
 #endif
index 6c924bfff1667245aff7c546513ef1c2546cb920..678ff2226fddfa97df84e98edf73057b5bc7f6d8 100644 (file)
@@ -64,7 +64,7 @@ typedef enum
        M_HAVE_MULTI_ACCOUNT,
        M_FOLDER_SELECTED,
        M_SESSION_PASSWORDS,
        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,
        M_DELETED_EXISTS,
        M_NOT_TRASH,
        M_HIDE_READ_THREADS,
index 9682a6a97c028afac7b33c6f2b2be07bb3f17e67..bda205f6e0f36a524c0966c5926c4acd3fadfbdd 100644 (file)
 #include "prefs_common.h"
 
 #ifndef PASSWORD_CRYPTO_OLD
 #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;
 
 {
        gchar *input;
        gboolean end = FALSE;
 
-       if (!prefs_common_get_prefs()->use_master_password) {
+       if (!prefs_common_get_prefs()->use_master_passphrase) {
                return PASSCRYPT_KEY;
        }
 
                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) {
        }
 
        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) {
 
                if (input == NULL) {
-                       debug_print("Cancel pressed at master password dialog.\n");
+                       debug_print("Cancel pressed at master passphrase dialog.\n");
                        break;
                }
 
                        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 {
                        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;
 }
 
                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 *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;
        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;
 
        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);
 
        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;
 }
 
        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. */
         * 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
 {
        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);
 
        }
        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) {
 
        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 {
                        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
        }
 
        /* Now go over all accounts, reencrypting their passwords using
-        * the new master password. */
+        * the new master passphrase. */
 
        if (oldp == NULL)
                oldp = PASSCRYPT_KEY;
 
        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
         */
        /* 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
 
 }
 #endif
 
@@ -221,7 +222,7 @@ gchar *password_decrypt_old(const gchar *password)
 #define BUFSIZE 128
 
 gchar *password_encrypt_gnutls(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
 {
        /* 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);
 #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);
 
        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);
        /* 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;
        }
                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,
 }
 
 gchar *password_decrypt_gnutls(const gchar *password,
-               const gchar *decryption_password)
+               const gchar *decryption_passphrase)
 {
        gchar **tokens, *tmp;
        gnutls_cipher_algorithm_t algo;
 {
        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);
 #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);
 
 
        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);
         * 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;
                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,
 #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 (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,
 #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;
 {
        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
 
        /* 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");
 
        if (*password == '{') {
                debug_print("Trying to decrypt password...\n");
-               return password_decrypt_real(password, decryption_password);
+               return password_decrypt_real(password, decryption_passphrase);
        }
 #endif
 
        }
 #endif
 
index 8423f4e6da3df9447ee9dbd512c07f32033e56a9..fcaaf4c088ed8f8547706111d357d74aea7ac86c 100644 (file)
 #include <glib.h>
 
 #ifndef PASSWORD_CRYPTO_OLD
 #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. */
  * 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. */
  * 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
 #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,
 #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,
 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
 #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,
 /* 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,
 
 /* 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 */
 
 #endif /* __PASSWORD_H */
index 77ec1425e35165f9b95247ea22f5b1b76022408a..96c462050d850f47a78f189c3d562f8dd4db2769 100644 (file)
@@ -61,29 +61,29 @@ static void ok_button_clicked(GtkButton *button, gpointer user_data)
 
        debug_print("OK button activated\n");
 
 
        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)) {
        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;
        }
 
                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. */
         * in entry_old. */
-       if (master_password_is_set()
+       if (master_passphrase_is_set()
                        && ((old = gtk_entry_get_text(GTK_ENTRY(ctx->entry_old))) == NULL
                        && ((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;
        }
 
                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->done = TRUE;
        gtk_widget_destroy(ctx->dialog);
@@ -105,7 +105,7 @@ static void dialog_destroy(GtkWidget *widget, gpointer user_data)
        ctx->dialog = NULL;
 }
 
        ctx->dialog = NULL;
 }
 
-void master_password_change_dialog()
+void master_passphrase_change_dialog()
 {
        static PangoFontDescription *font_desc;
        GtkWidget *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);
 
        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_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(
                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);
        );
        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);
 
 
        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_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);
 
                        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_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);
 
        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_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);
 
 
        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",
                gtk_widget_set_sensitive(entry_old, FALSE);
 
        g_signal_connect(G_OBJECT(entry_old), "activate",
index 86fa9d29de9f8a29c6d28b765a0c61b9743d9047..b8a19fbbecbd836e0a7b90f9454ad53f8e8dc6c4 100644 (file)
@@ -25,7 +25,7 @@
 #endif
 
 #ifndef PASSWORD_CRYPTO_OLD
 #endif
 
 #ifndef PASSWORD_CRYPTO_OLD
-void master_password_change_dialog();
+void master_passphrase_change_dialog();
 #endif
 
 #endif /* __PASSWORD_GTK_H */
 #endif
 
 #endif /* __PASSWORD_GTK_H */
index 8bac4fdfc1f8440501fde320b171b637ff9a402a..7ae6f555a64f166848c8c85b037e2c01c637106c 100644 (file)
@@ -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;
 
        gchar *pass;
        int i;
 
index aa91809728b73af42d3e69dc3179248042639601..5e917bda1e2bbaea164bfc30e9af1e89054a2fc9 100644 (file)
@@ -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_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_ */
 
 #endif /* CM_GDATA_PREFS_H_ */
index b383770ecfff3a321cfeb5059d8bd2c96c83dcdd..c001f99d4147831cf2a5f86dcc7d8b5801c75235 100644 (file)
@@ -181,9 +181,9 @@ const gchar *plugin_version(void)
   return VERSION;
 }
 
   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)
 }
 
 struct PluginFeature *plugin_provides(void)
index 47b05d7571eb8a2ff88f953e59f503bf642db92d..982dc5aeda62a9d46b5c7b1e0f063ae05b75e055 100644 (file)
@@ -7,4 +7,4 @@ EXPORTS
         plugin_type
        plugin_provides
         plugin_version
         plugin_type
        plugin_provides
         plugin_version
-       plugin_master_password_change
+       plugin_master_passphrase_change
index 0d2e22c781444c99866781d6a1897c733e7b4ed2..177f27952f0ba6f11bdb08aaec474709e73e072f 100644 (file)
@@ -407,9 +407,9 @@ const gchar *plugin_version(void)
        return VERSION;
 }
 
        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)
 }
 
 struct PluginFeature *plugin_provides(void)
index ec7ae8b56788c3c86dc66bd7f4981323c30e7d7e..fe98d4f503a4ca146bdb6bb8179afcffd008b5db 100644 (file)
@@ -233,7 +233,7 @@ static void save_spamreport_prefs(PrefsPage *page)
                prefs_file_close(pref_file);
 }
 
                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;
 
        gchar *pass;
        int i;
 
index 2667a3cd61382fb2631639bb7de2cf2dfc198485..48c27e20646e8e1a82f85c96757f8e6d15157e77 100644 (file)
@@ -65,6 +65,6 @@ extern SpamReportPrefs spamreport_prefs;
 
 void spamreport_prefs_init(void);
 void spamreport_prefs_done(void);
 
 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
 
 #endif
index 8c1e4e5d59e8ff2c882fbf1b8447c8cc0179f8b1..945cab558590fc4cb3b199fb349cad0e7a54d0bf 100644 (file)
@@ -99,9 +99,9 @@ const gchar *plugin_version(void)
        return VERSION;
 }
 
        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)
 }
 
 struct PluginFeature *plugin_provides(void)
index 17417b251d359f7d1dd2a4ae1e0d470ce99df376..f79dd579308b1e959d360e16765619ee42d3b6c6 100644 (file)
@@ -7,5 +7,5 @@ EXPORTS
         plugin_type
        plugin_provides
         plugin_version
         plugin_type
        plugin_provides
         plugin_version
-       plugin_master_password_change
+       plugin_master_passphrase_change
 
 
index 680e807e26b30ad0ddb86e33e04771bc71c81a0f..baf40d4d22b35bcf9ff3a805a8d759237169a589 100644 (file)
@@ -723,7 +723,7 @@ static void vcal_prefs_save_func(PrefsPage * _page)
        vcal_folder_export(NULL);
 }
 
        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) {
        gchar *pass;
        pass = password_decrypt(vcalprefs.export_pass, oldp);
        if (pass != NULL) {
index 9fcb96d283e71a765b0d21cf8d023a5ae418dea3..9e7d89ff52a3139745f51aa4c64d8a942f5b1a20 100644 (file)
@@ -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_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
 
 #endif
index 50f9ebf3451dc2aacf5bc1d55401e48f6a8212f0..8895b5f082dec046320d7f4fc596634a4b5f91ab 100644 (file)
@@ -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
         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}
 #endif
 
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
index ed86cd0c90ac2e4e7d31ede6dc1f7995641f542b..8a38e42d5e118f3864bbf165b2c1b529129eb313 100644 (file)
@@ -540,8 +540,8 @@ struct _PrefsCommon
        guint enable_avatars;
 
 #ifndef PASSWORD_CRYPTO_OLD
        guint enable_avatars;
 
 #ifndef PASSWORD_CRYPTO_OLD
-       gboolean use_master_password;
-       gchar *master_password_hash;
+       gboolean use_master_passphrase;
+       gchar *master_passphrase_hash;
 #endif
 };
 
 #endif
 };
 
index 2b7a93f8aa11126f7ad1bb5ee12b2002b3fbbfe2..9497bf76b49ebc216bb680a77af0f99e096f5a7e 100644 (file)
@@ -66,7 +66,7 @@ typedef struct _OtherPage
        GtkWidget *flush_metadata_faster_radiobtn;
        GtkWidget *flush_metadata_safer_radiobtn;
 #ifndef PASSWORD_CRYPTO_OLD
        GtkWidget *flush_metadata_faster_radiobtn;
        GtkWidget *flush_metadata_safer_radiobtn;
 #ifndef PASSWORD_CRYPTO_OLD
-       GtkWidget *checkbtn_use_password;
+       GtkWidget *checkbtn_use_passphrase;
 #endif
 } OtherPage;
 
 #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_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
 
 
 #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 *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;
 #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
                           _("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 "
                        _("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."));
 
                                "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);
        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);
                        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), 
 #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
                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;
 #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->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;
 }
 #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
                        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(
         * 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_set_active(
-                               GTK_TOGGLE_BUTTON(page->checkbtn_use_password), TRUE);
+                               GTK_TOGGLE_BUTTON(page->checkbtn_use_passphrase), TRUE);
                }
        }
 
        if (gtk_toggle_button_get_active(
                }
        }
 
        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_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_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(
 #endif
 
        gtk_can_change_accels = gtk_toggle_button_get_active(
@@ -800,13 +800,13 @@ void prefs_other_done(void)
 }
 
 #ifndef PASSWORD_CRYPTO_OLD
 }
 
 #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);
 {
        GtkWidget *button = GTK_WIDGET(data);
        gboolean active = gtk_toggle_button_get_active(chkbtn);