From 57944f6147f077ccf4d84b9d2659f4e8645e8858 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Thu, 8 Mar 2018 15:01:45 +0100 Subject: Reastructure master password functionality --- libsylph/utils.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'libsylph/utils.c') diff --git a/libsylph/utils.c b/libsylph/utils.c index 6ecf328..3bbcbcf 100644 --- a/libsylph/utils.c +++ b/libsylph/utils.c @@ -4598,6 +4598,36 @@ gchar *input_query_password(const gchar *server, const gchar *user) return NULL; } +static QueryMasterPasswordFunc query_master_password_func = NULL; + +void set_input_query_master_password_func(QueryMasterPasswordFunc func) +{ + query_master_password_func = func; +} + +gchar *input_query_master_password(void) +{ + if (query_master_password_func) + return query_master_password_func(); + else + return NULL; +} + +static SetNewPasswordFunc set_new_password_func = NULL; + +void set_input_set_new_password_func(SetNewPasswordFunc func) +{ + set_new_password_func = func; +} + +gchar *input_set_new_password(guint max_attempts) +{ + if (set_new_password_func) + return set_new_password_func(max_attempts); + else + return NULL; +} + /* logging */ static FILE *log_fp = NULL; -- cgit v1.3