From b9d251b76e624d04f6a0640d9b466191c5faf69b Mon Sep 17 00:00:00 2001 From: s3inlc Date: Tue, 31 Mar 2020 20:40:09 +0200 Subject: [PATCH] fixing all inconsistent hash separators --- src/modules/module_00022.c | 2 +- src/modules/module_00023.c | 3 ++- src/modules/module_02410.c | 2 +- src/modules/module_11500.c | 2 +- src/modules/module_11750.c | 2 +- src/modules/module_11760.c | 2 +- src/modules/module_11850.c | 2 +- src/modules/module_11860.c | 2 +- src/modules/module_13500.c | 3 ++- src/modules/module_13800.c | 3 ++- src/modules/module_14900.c | 2 +- src/modules/module_18100.c | 2 +- 12 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/modules/module_00022.c b/src/modules/module_00022.c index c4eb1bb97..0349f5382 100644 --- a/src/modules/module_00022.c +++ b/src/modules/module_00022.c @@ -242,7 +242,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_salt[salt_len] = 0; - const int line_len = snprintf (line_buf, line_size, "%s:%s", tmp_buf, tmp_salt); + const int line_len = snprintf (line_buf, line_size, "%s%c%s", tmp_buf, hashconfig->separator, tmp_salt); return line_len; } diff --git a/src/modules/module_00023.c b/src/modules/module_00023.c index d849eff66..5ab25270f 100644 --- a/src/modules/module_00023.c +++ b/src/modules/module_00023.c @@ -138,11 +138,12 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_salt[salt_len] = 0; - const int out_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x:%s", + const int out_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x%c%s", byte_swap_32 (tmp[0]), byte_swap_32 (tmp[1]), byte_swap_32 (tmp[2]), byte_swap_32 (tmp[3]), + hashconfig->separator, tmp_salt); return out_len; diff --git a/src/modules/module_02410.c b/src/modules/module_02410.c index 030148ff1..7d01ccef3 100644 --- a/src/modules/module_02410.c +++ b/src/modules/module_02410.c @@ -51,7 +51,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 2; - token.sep[0] = ':'; + token.sep[0] = hashconfig->separator; token.len_min[0] = 16; token.len_max[0] = 16; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH diff --git a/src/modules/module_11500.c b/src/modules/module_11500.c index 5f6380539..7129de04d 100644 --- a/src/modules/module_11500.c +++ b/src/modules/module_11500.c @@ -97,7 +97,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_salt[salt_len] = 0; - const int line_len = snprintf (line_buf, line_size, "%08x:%s", digest[0], tmp_salt); + const int line_len = snprintf (line_buf, line_size, "%08x%c%s", digest[0], hashconfig->separator, tmp_salt); return line_len; } diff --git a/src/modules/module_11750.c b/src/modules/module_11750.c index 8be5c4dbd..a578616ec 100644 --- a/src/modules/module_11750.c +++ b/src/modules/module_11750.c @@ -49,7 +49,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 2; - token.sep[0] = ':'; + token.sep[0] = hashconfig->separator; token.len_min[0] = 64; token.len_max[0] = 64; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH diff --git a/src/modules/module_11760.c b/src/modules/module_11760.c index 6af85b12e..fd8b57d1e 100644 --- a/src/modules/module_11760.c +++ b/src/modules/module_11760.c @@ -49,7 +49,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 2; - token.sep[0] = ':'; + token.sep[0] = hashconfig->separator; token.len_min[0] = 64; token.len_max[0] = 64; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH diff --git a/src/modules/module_11850.c b/src/modules/module_11850.c index 5832b0bce..2ad65c6b2 100644 --- a/src/modules/module_11850.c +++ b/src/modules/module_11850.c @@ -49,7 +49,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 2; - token.sep[0] = ':'; + token.sep[0] = hashconfig->separator; token.len_min[0] = 128; token.len_max[0] = 128; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH diff --git a/src/modules/module_11860.c b/src/modules/module_11860.c index e906b095d..ac5b7b3c1 100644 --- a/src/modules/module_11860.c +++ b/src/modules/module_11860.c @@ -49,7 +49,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 2; - token.sep[0] = ':'; + token.sep[0] = hashconfig->separator; token.len_min[0] = 128; token.len_max[0] = 128; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH diff --git a/src/modules/module_13500.c b/src/modules/module_13500.c index 87482323f..a218ce960 100644 --- a/src/modules/module_13500.c +++ b/src/modules/module_13500.c @@ -185,12 +185,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE sprintf (pstoken_tmp + j, "%02x", ptr[i]); } - const int line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x%08x:%s", + const int line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x%08x%c%s", digest[0], digest[1], digest[2], digest[3], digest[4], + hashconfig->separator, pstoken_tmp); return line_len; diff --git a/src/modules/module_13800.c b/src/modules/module_13800.c index 824072b74..1d75ecb50 100644 --- a/src/modules/module_13800.c +++ b/src/modules/module_13800.c @@ -165,7 +165,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE sprintf (buf + j, "%08x", esalt->salt_buf[i]); } - const int line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x%08x%08x%08x%08x:%s", + const int line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x%08x%08x%08x%08x%c%s", digest[0], digest[1], digest[2], @@ -174,6 +174,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE digest[5], digest[6], digest[7], + hashconfig->separator, buf); return line_len; diff --git a/src/modules/module_14900.c b/src/modules/module_14900.c index 063e1204b..cb7c790d7 100644 --- a/src/modules/module_14900.c +++ b/src/modules/module_14900.c @@ -109,7 +109,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:%08x", byte_swap_32 (digest[0]), byte_swap_32 (salt->salt_buf[0])); + const int line_len = snprintf (line_buf, line_size, "%08x%c%08x", byte_swap_32 (digest[0]), hashconfig->separator, byte_swap_32 (salt->salt_buf[0])); return line_len; } diff --git a/src/modules/module_18100.c b/src/modules/module_18100.c index 3feb49fde..f77ef6d22 100644 --- a/src/modules/module_18100.c +++ b/src/modules/module_18100.c @@ -128,7 +128,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u64 tmp_salt_buf = (((u64) (salt->salt_buf[2])) << 32) | ((u64) (salt->salt_buf[3])); - const int line_len = snprintf (line_buf, line_size, "%06d:%" PRIu64, digest[0], tmp_salt_buf); + const int line_len = snprintf (line_buf, line_size, "%06d%c%" PRIu64, digest[0], hashconfig->separator, tmp_salt_buf); return line_len; }