summaryrefslogtreecommitdiff
path: root/src/prefs_ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/prefs_ui.c')
-rw-r--r--src/prefs_ui.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/prefs_ui.c b/src/prefs_ui.c
index 051a058..2ab1d45 100644
--- a/src/prefs_ui.c
+++ b/src/prefs_ui.c
@@ -279,23 +279,28 @@ void prefs_set_data_from_epass_entry(PrefParam *pparam)
279 279
280 /* This is where decrypted passwords are encrypted and stored again */ 280 /* This is where decrypted passwords are encrypted and stored again */
281 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: 282 /* master_password == NULL for any of the following reasons:
287 * - use_master_password is not enabled (we just save without encrypting) 283 * - use_master_password is not enabled (we just save without encrypting)
288 * - master_password is auto unloaded (let the encrypt function handle it) 284 * - master_password is auto unloaded (prompt for the master password)
289 * - undefined reason (refure to store the password) 285 * - undefined reason (refure to store the password)
290 */ 286 */
291 if (!prefs_common.use_master_password) { 287 if (!prefs_common.use_master_password) {
292 prefs_set_data_from_entry(pparam); 288 /* check if use_master_password was enabled when Sylpheed started */
293 return; 289 if (!master_password_enabled_on_init) {
294 } else if ((master_password == NULL) && 290 prefs_set_data_from_entry(pparam);
295 (!prefs_common.auto_unload_master_password)) { 291 }
296 debug_print("Master password enabled, but not loaded for no "
297 "apparent reason. Not storing\n");
298 return; 292 return;
293 } else if (master_password == NULL) {
294 if (!prefs_common.auto_unload_master_password) {
295 debug_print("Master password enabled, but not loaded for no "
296 "apparent reason. Not storing\n");
297 return;
298 } else {
299 if (check_master_password_interactively(3) != MP_RC_OK) {
300 debug_print("Failed to reload the master password\n");
301 return;
302 }
303 }
299 } 304 }
300 305
301 ui_data = (PrefsUIData *)pparam->ui_data; 306 ui_data = (PrefsUIData *)pparam->ui_data;