aboutsummaryrefslogtreecommitdiff
path: root/src/auth.h
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2016-01-08 22:27:43 -0500
committerFranklin Wei <git@fwei.tk>2016-01-08 22:27:43 -0500
commit50134c46dc337c35b8ecf78b3c5b4308cf8fb791 (patch)
tree89d73bca1951129ec7e15b642e2fa6c85567f872 /src/auth.h
parent2819d11ceeb1ac739ed5f17ccb0abab63f494299 (diff)
downloadnetcosm-50134c46dc337c35b8ecf78b3c5b4308cf8fb791.zip
netcosm-50134c46dc337c35b8ecf78b3c5b4308cf8fb791.tar.gz
netcosm-50134c46dc337c35b8ecf78b3c5b4308cf8fb791.tar.bz2
netcosm-50134c46dc337c35b8ecf78b3c5b4308cf8fb791.tar.xz
some stuff
Diffstat (limited to 'src/auth.h')
-rw-r--r--src/auth.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/auth.h b/src/auth.h
index cd2fc1a..2717d30 100644
--- a/src/auth.h
+++ b/src/auth.h
@@ -1,6 +1,6 @@
/*
* NetCosm - a MUD server
- * Copyright (C) 2015 Franklin Wei
+ * Copyright (C) 2016 Franklin Wei
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,9 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef _AUTH_H_
+#define _AUTH_H_
+
#define SALT_LEN 12
#define ALGO GCRY_MD_SHA512
-#define AUTH_HASHLEN 64
+#define AUTH_HASHLEN (512/8)
//#define HASH_ITERS 500000
#define HASH_ITERS 1
@@ -31,10 +34,13 @@ struct authinfo_t {
/* makes admin account */
void first_run_setup(void);
-struct authinfo_t auth_check(const char *user, const char *pass);
+/* NULL on failure, user data struct on success */
+struct userdata_t *auth_check(const char *user, const char *pass);
bool auth_user_add(const char *user, const char *pass, int authlevel);
bool auth_user_del(const char *user);
/* lists users through out() */
void auth_user_list(void);
+
+#endif