Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150212150501.GA4187@openwall.com>
Date: Thu, 12 Feb 2015 18:05:01 +0300
From: Aleksey Cherepanov <aleksey.4erepanov@...il.com>
To: john-dev@...ts.openwall.com
Subject: wrong comment in sha512crypt_fmt_plug.c

It looks like there is a wrong comment in cryptsha512_fmt_plug.c :

		/* For every character in the password add the entire password.  */
		for (cnt = 0; cnt < 16 + ((unsigned char*)crypt_out[index])[0]; ++cnt)
			SHA512_Update(&alt_ctx, cur_salt->salt, cur_salt->len);

It is #18 according to
http://www.akkadia.org/drepper/SHA-crypt.txt
"
18. repeast the following 16+A[0] times, where A[0] represents the first
    byte in digest A interpreted as an 8-bit unsigned value

      add the salt to digest DS
"

The comment is from the original code:
  /* For every character in the password add the entire password.  */
  for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
    sha512_process_bytes (salt, salt_len, &alt_ctx);

Thanks!

-- 
Regards,
Aleksey Cherepanov

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.