From 3b8df7146fe31518080f3a38eee98222d97ee5b2 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Tue, 26 Jan 2016 19:22:53 -0500 Subject: fix a memory leak, bumps version to 0.4.0-rc1 --- src/auth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/auth.c') 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)); -- cgit v1.1