Fix salt encoding

This commit is contained in:
mhasbini
2019-01-27 23:09:54 +02:00
parent 86d7f0a95b
commit f142651f15
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -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;
}
+1 -2
View File
@@ -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;
}