summaryrefslogtreecommitdiff
path: root/libsylph/account.c
diff options
context:
space:
mode:
authorSimeon Simeonov2018-03-09 14:02:34 +0100
committerSimeon Simeonov2018-03-09 14:02:34 +0100
commitf1babd48f5259186cd1233288992f942d4b5b0bb (patch)
tree54d740ef2201fceb3e54fac31272e80e65079ec7 /libsylph/account.c
parent57944f6147f077ccf4d84b9d2659f4e8645e8858 (diff)
Complete rewrite of the master password implementation
Diffstat (limited to 'libsylph/account.c')
-rw-r--r--libsylph/account.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/libsylph/account.c b/libsylph/account.c
index 7440434..2431bf3 100644
--- a/libsylph/account.c
+++ b/libsylph/account.c
@@ -36,9 +36,6 @@
36#include "procheader.h" 36#include "procheader.h"
37#include "utils.h" 37#include "utils.h"
38#include "sylmain.h" 38#include "sylmain.h"
39#include "prefs_common.h"
40#include "masterpassword.h"
41
42 39
43PrefsAccount *cur_account; 40PrefsAccount *cur_account;
44 41
@@ -54,24 +51,6 @@ void account_read_config_all(void)
54 FILE *fp; 51 FILE *fp;
55 gchar buf[PREFSBUFSIZE]; 52 gchar buf[PREFSBUFSIZE];
56 PrefsAccount *ac_prefs; 53 PrefsAccount *ac_prefs;
57#if USE_SSL
58 if (prefs_common.use_master_password) {
59 if (prefs_common.master_password_hash != NULL) {
60 /* allow 3 attempts to enter the master password */
61 if (check_master_password_interactively(3) != 0) {
62 /* master password does not match the hash */
63 g_free(master_password);
64 master_password = NULL;
65 }
66 } else {
67 /* No master password set (no master_password_hash) */
68 set_master_password_interactively(3);
69 }
70 /* TODO: Warning if password is NULL */
71 } else {
72 master_password = NULL;
73 }
74#endif
75 54
76 debug_print(_("Reading all config for each account...\n")); 55 debug_print(_("Reading all config for each account...\n"));
77 56
@@ -100,9 +79,6 @@ void account_read_config_all(void)
100 for (cur = ac_label_list; cur != NULL; cur = cur->next) { 79 for (cur = ac_label_list; cur != NULL; cur = cur->next) {
101 ac_prefs = prefs_account_new(); 80 ac_prefs = prefs_account_new();
102 prefs_account_read_config(ac_prefs, (gchar *)cur->data); 81 prefs_account_read_config(ac_prefs, (gchar *)cur->data);
103#if USE_SSL
104 ac_prefs->master_password = master_password;
105#endif
106 account_list = g_list_append(account_list, ac_prefs); 82 account_list = g_list_append(account_list, ac_prefs);
107 if (ac_prefs->is_default) 83 if (ac_prefs->is_default)
108 cur_account = ac_prefs; 84 cur_account = ac_prefs;