aboutsummaryrefslogtreecommitdiff
path: root/src/auth.c
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2016-01-26 19:22:53 -0500
committerFranklin Wei <git@fwei.tk>2016-01-26 19:27:13 -0500
commit3b8df7146fe31518080f3a38eee98222d97ee5b2 (patch)
tree7fd7dffd98d0bfd3bdf20e24b184ec5440ca3909 /src/auth.c
parentcbe6bc14de8ad8fd035e0598a3fcc23fb38cfa1a (diff)
downloadnetcosm-3b8df7146fe31518080f3a38eee98222d97ee5b2.zip
netcosm-3b8df7146fe31518080f3a38eee98222d97ee5b2.tar.gz
netcosm-3b8df7146fe31518080f3a38eee98222d97ee5b2.tar.bz2
netcosm-3b8df7146fe31518080f3a38eee98222d97ee5b2.tar.xz
fix a memory leak, bumps version to 0.4.0-rc1
Diffstat (limited to 'src/auth.c')
-rw-r--r--src/auth.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/auth.c b/src/auth.c
index b7af56d..5fd8219 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -41,10 +41,10 @@ static char *hash_pass_hex(const char *pass, const char *salt)
SHA512(salted, pass_len + SALT_LEN, hash);
unsigned char tmp[AUTH_HASHLEN];
- /* now hash the hash half a million times to slow things down */
- for(int i = 0; i < HASH_ITERS - 1; ++i)
+ /* now hash the hash a million times to slow things down */
+ for(int i = 0; i < (HASH_ITERS / 2) - 1; ++i)
{
- memcpy(tmp, hash, AUTH_HASHLEN);
+ AUTH_HASHFUNC(hash, AUTH_HASHLEN, tmp);
AUTH_HASHFUNC(tmp, AUTH_HASHLEN, hash);
}
memset(tmp, 0, sizeof(tmp));