7 #include "crypto_hash_sha512.h"
10 USERNAMES_OK
= 0, /* Usernames match, valid 'token' */
11 USERNAMES_NE
, /* Usernames do not match */
12 USERNAMES_TS
, /* Usernames match, but 'token' invalid,
13 Drop connection here */
17 struct username_struct
{
19 uint8_t hash
[crypto_hash_sha512_BYTES
];
22 extern int username_msg(char *username
, size_t len
, char *dst
, size_t dlen
);
23 extern enum is_user_enum
username_msg_is_user(char *src
, size_t slen
,
24 char *username
, size_t len
);
25 extern void parse_userfile_and_generate_user_store_or_die(char *homedir
);
26 extern void dump_user_store(void);
27 extern void destroy_user_store(void);
29 extern int get_user_by_socket(int sock
, struct curve25519_proto
**proto
);
30 extern int get_user_by_sockaddr(struct sockaddr_storage
*sa
, size_t sa_len
,
31 struct curve25519_proto
**proto
);
32 extern int try_register_user_by_socket(struct curve25519_struct
*c
,
33 char *src
, size_t slen
, int sock
,
35 extern int try_register_user_by_sockaddr(struct curve25519_struct
*c
,
36 char *src
, size_t slen
,
37 struct sockaddr_storage
*sa
,
38 size_t sa_len
, int log
);
39 extern void remove_user_by_socket(int sock
);
40 extern void remove_user_by_sockaddr(struct sockaddr_storage
*sa
,
43 #endif /* CT_USERMGMT_H */