]>
git.ipfire.org Git - thirdparty/bird.git/blob - nest/password.c
2 * BIRD -- Password handling
4 * (c) 1999 Pavel Machek <pavel@ucw.cz>
5 * (c) 2004 Ondrej Filip <feela@network.cz>
7 * Can be freely distributed and used under the terms of the GNU GPL.
10 #include "nest/bird.h"
11 #include "nest/password.h"
12 #include "lib/string.h"
15 struct password_item
*last_password_item
= NULL
;
17 struct password_item
*
18 password_find(list
*l
, int first_fit
)
20 struct password_item
*pi
;
21 struct password_item
*pf
= NULL
;
27 if ((pi
->genfrom
< now_real
) && (pi
->gento
> now_real
))
32 if (!pf
|| pf
->genfrom
< pi
->genfrom
)
40 struct password_item
*
41 password_find_by_id(list
*l
, uint id
)
43 struct password_item
*pi
;
49 if ((pi
->id
== id
) && (pi
->accfrom
<= now_real
) && (now_real
< pi
->accto
))
55 struct password_item
*
56 password_find_by_value(list
*l
, char *pass
, uint size
)
58 struct password_item
*pi
;
64 if (password_verify(pi
, pass
, size
) && (pi
->accfrom
<= now_real
) && (now_real
< pi
->accto
))
71 max_mac_length(list
*l
)
73 struct password_item
*pi
;
80 val
= MAX(val
, mac_type_length(pi
->alg
));