summaryrefslogtreecommitdiff
path: root/nest/password.c
diff options
context:
space:
mode:
Diffstat (limited to 'nest/password.c')
-rw-r--r--nest/password.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/nest/password.c b/nest/password.c
index 21e42e0e..91aaa418 100644
--- a/nest/password.c
+++ b/nest/password.c
@@ -51,3 +51,18 @@ password_find_by_id(list *l, int id)
return NULL;
}
+struct password_item *
+password_find_by_value(list *l, char *pass, uint size)
+{
+ struct password_item *pi;
+
+ if (!l)
+ return NULL;
+
+ WALK_LIST(pi, *l)
+ if (password_verify(pi, pass, size) && (pi->accfrom <= now_real) && (now_real < pi->accto))
+ return pi;
+
+ return NULL;
+}
+