Fix salt encoding

pull/1892/head
mhasbini 5 years ago
parent 86d7f0a95b
commit f142651f15

@ -94,7 +94,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const u32 *digest = (const u32 *) digest_buf;
const int line_len = snprintf (line_buf, line_size, "%08x:%s", digest[0], (char *) salt->salt_buf);
const int line_len = snprintf (line_buf, line_size, "%08x:%08x", digest[0], salt->salt_buf[0]);
return line_len;
}

@ -15,11 +15,10 @@ sub module_constraints { [[0, 255], [8, 8], [0, 31], [8, 8], [-1, -1]] }
sub module_generate_hash
{
my $word = shift;
my $salt = shift;
my $digest = crc32 ($word);
my $hash = sprintf ("%08x:$salt", $digest);
my $hash = sprintf ("%08x:00000000", $digest);
return $hash;
}

Loading…
Cancel
Save