0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-28 05:18:59 +02:00

libratbox/crypt: fix difference from glibc in sha256_crypt()

rb_crypt() was generating different SHA256 ($5$) hashes than glibc,
making hashes generated with charybdis unusable in ratbox and other
software, and vice versa.
This commit is contained in:
Mantas Mikulėnas 2013-10-23 14:39:51 +03:00
parent cba8bbc3fc
commit 320d34a606

View file

@ -1567,7 +1567,7 @@ static char *rb_sha256_crypt_r(const char *key, const char *salt, char *buffer,
rb_sha256_init_ctx(&alt_ctx);
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < (size_t)(16 + alt_result[0]); ++cnt)
for (cnt = 0; cnt < key_len; ++cnt)
rb_sha256_process_bytes(key, key_len, &alt_ctx);
/* Finish the digest. */