diff --git a/src/modules/module_03910.c b/src/modules/module_03910.c index b8abcc4aa..c20894746 100644 --- a/src/modules/module_03910.c +++ b/src/modules/module_03910.c @@ -97,14 +97,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE digest[2] = hex_to_u32 (hash_pos + 16); digest[3] = hex_to_u32 (hash_pos + 24); - if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) - { - digest[0] -= MD5M_A; - digest[1] -= MD5M_B; - digest[2] -= MD5M_C; - digest[3] -= MD5M_D; - } - const u8 *salt_pos = token.buf[1]; const int salt_len = token.len[1]; @@ -131,14 +123,6 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp[2] = digest[2]; tmp[3] = digest[3]; - if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) - { - tmp[0] += MD5M_A; - tmp[1] += MD5M_B; - tmp[2] += MD5M_C; - tmp[3] += MD5M_D; - } - u8 *out_buf = (u8 *) line_buf; int out_len = 0; diff --git a/src/modules/module_07000.c b/src/modules/module_07000.c index ba09ed649..359224a48 100644 --- a/src/modules/module_07000.c +++ b/src/modules/module_07000.c @@ -145,11 +145,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 tmp[5]; - tmp[0] = byte_swap_32 (digest[0]); - tmp[1] = byte_swap_32 (digest[1]); - tmp[2] = byte_swap_32 (digest[2]); - tmp[3] = byte_swap_32 (digest[3]); - tmp[4] = byte_swap_32 (digest[4]); + tmp[0] = digest[0]; + tmp[1] = digest[1]; + tmp[2] = digest[2]; + tmp[3] = digest[3]; + tmp[4] = digest[4]; if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) { @@ -160,6 +160,12 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp[4] += SHA1M_E; } + tmp[0] = byte_swap_32 (tmp[0]); + tmp[1] = byte_swap_32 (tmp[1]); + tmp[2] = byte_swap_32 (tmp[2]); + tmp[3] = byte_swap_32 (tmp[3]); + tmp[4] = byte_swap_32 (tmp[4]); + memcpy (tmp_buf + 12, tmp, 20); // base64 encode (salt + SHA1)