From c6f80c49de727b9857d2bbd1eeaf85930612d0ce Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Mon, 19 Mar 2018 22:06:25 +0100 Subject: Add min password length spinbutton to common preferences --- libsylph/masterpassword.c | 2 +- libsylph/prefs_common.c | 2 ++ libsylph/prefs_common.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'libsylph') diff --git a/libsylph/masterpassword.c b/libsylph/masterpassword.c index 77ff281..b86f06b 100644 --- a/libsylph/masterpassword.c +++ b/libsylph/masterpassword.c @@ -111,7 +111,7 @@ gchar *encrypt_with_master_password(const gchar *str) { str, master_password, strlen(str), - 32, /* TODO: to be set in prefs_common */ + prefs_common.encrypted_password_min_length, TRUE) != RC_OK) { OPENSSL_cleanse(new_str, strlen(new_str)); g_free(new_str); diff --git a/libsylph/prefs_common.c b/libsylph/prefs_common.c index 6c20319..dda4a0f 100644 --- a/libsylph/prefs_common.c +++ b/libsylph/prefs_common.c @@ -423,6 +423,8 @@ static PrefParam param[] = { P_BOOL}, {"master_password_hash", NULL, &prefs_common.master_password_hash, P_STRING}, + {"encrypted_password_min_length", "32", + &prefs_common.encrypted_password_min_length, P_INT}, /* Interface */ {"separate_folder", "FALSE", &prefs_common.sep_folder, P_BOOL}, diff --git a/libsylph/prefs_common.h b/libsylph/prefs_common.h index bc1d2f3..92333aa 100644 --- a/libsylph/prefs_common.h +++ b/libsylph/prefs_common.h @@ -252,6 +252,7 @@ struct _PrefsCommon /* Master password */ gboolean use_master_password; gchar *master_password_hash; + guint encrypted_password_min_length; /* Interface */ gboolean sep_folder; -- cgit v1.3