From f142651f15a256ea460570f4807eaf7c1d1e108d Mon Sep 17 00:00:00 2001
From: mhasbini <mohammad.hasbini@gmail.com>
Date: Sun, 27 Jan 2019 23:09:54 +0200
Subject: [PATCH] Fix salt encoding

---
 src/modules/module_11500.c   | 2 +-
 tools/test_modules/m11500.pm | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/modules/module_11500.c b/src/modules/module_11500.c
index 0567bfe82..5efc0206a 100644
--- a/src/modules/module_11500.c
+++ b/src/modules/module_11500.c
@@ -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;
 }
diff --git a/tools/test_modules/m11500.pm b/tools/test_modules/m11500.pm
index 4fccf24ce..b25124f26 100644
--- a/tools/test_modules/m11500.pm
+++ b/tools/test_modules/m11500.pm
@@ -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;
 }