summaryrefslogtreecommitdiff
path: root/src/prefs_ui.c
diff options
context:
space:
mode:
authorSimeon Simeonov2018-04-13 15:24:01 +0200
committerSimeon Simeonov2018-04-13 15:24:01 +0200
commit46275eef3de4e025b5657e67e142fc58125779be (patch)
tree2c4e86aa5f7e286d64a74a35d749c5e381110cad /src/prefs_ui.c
parent42772c59f490d54d9766e1853daa35c08298f985 (diff)
Add support for auto-unloading av the master password
Diffstat (limited to 'src/prefs_ui.c')
-rw-r--r--src/prefs_ui.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/prefs_ui.c b/src/prefs_ui.c
index 5539f4a..051a058 100644
--- a/src/prefs_ui.c
+++ b/src/prefs_ui.c
@@ -31,6 +31,7 @@
31#include <errno.h> 31#include <errno.h>
32 32
33#include "prefs.h" 33#include "prefs.h"
34#include "prefs_common.h"
34#include "prefs_ui.h" 35#include "prefs_ui.h"
35#include "menu.h" 36#include "menu.h"
36#include "codeconv.h" 37#include "codeconv.h"
@@ -276,9 +277,25 @@ void prefs_set_data_from_epass_entry(PrefParam *pparam)
276 gchar **str; 277 gchar **str;
277 const gchar *entry_str; 278 const gchar *entry_str;
278 279
279 if (!master_password_active()) { 280 /* This is where decrypted passwords are encrypted and stored again */
281
282 /* TODO: A potential exploit is disabling master password and then forcing
283 * Sylpheed to store the password
284 */
285
286 /* master_password == NULL for any of the following reasons:
287 * - use_master_password is not enabled (we just save without encrypting)
288 * - master_password is auto unloaded (let the encrypt function handle it)
289 * - undefined reason (refure to store the password)
290 */
291 if (!prefs_common.use_master_password) {
280 prefs_set_data_from_entry(pparam); 292 prefs_set_data_from_entry(pparam);
281 return; 293 return;
294 } else if ((master_password == NULL) &&
295 (!prefs_common.auto_unload_master_password)) {
296 debug_print("Master password enabled, but not loaded for no "
297 "apparent reason. Not storing\n");
298 return;
282 } 299 }
283 300
284 ui_data = (PrefsUIData *)pparam->ui_data; 301 ui_data = (PrefsUIData *)pparam->ui_data;