xref: /plan9/sys/src/cmd/auth/secstore/secstore.h (revision 252470cd51076298c1cb81e1aabee4494f47f284)
1 #define LOG		"secstore"
2 #define SECSTORE_DIR	"/adm/secstore"
3 
4 enum {
5 	MAXFILESIZE = 10*1024*1024,
6 };
7 
8 /* PW status bits */
9 enum {
10 	Enabled 	= 1<<0,
11 	STA 		= 1<<1,	/* extra SecurID step */
12 };
13 
14 typedef struct PW {
15 	char	*id;		/* user id */
16 	ulong	expire;		/* expiration time (epoch seconds) */
17 	ushort	status;		/* Enabled, STA, ... */
18 	ushort	failed;		/* number of failed login attempts */
19 	char	*other;		/* other information, e.g. sponsor */
20 	mpint	*Hi;  		/* H(passphrase)^-1 mod p */
21 } PW;
22 
23 void	freePW(PW*);
24 PW	*getPW(char*, int);
25 char	*getpassm(char*);
26 int	putPW(PW*);
27 char	*validatefile(char*f);
28 
29 /*
30  * *client: SConn, client name, passphrase
31  * *server: SConn, (partial) 1st msg, PW entry
32  * *setpass: Username, hashed passphrase, PW entry
33  */
34 int	PAKclient(SConn*, char*, char*, char**);
35 int	PAKserver(SConn*, char*, char*, PW**);
36 char*	PAK_Hi(char*, char*, mpint*, mpint*);
37