From 01470d941a53a322b3a148bd5cedc222e87f2074 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:09:53 +0000 Subject: [PATCH] Fix hex conversion and formatting Co-Authored-By: SQL master --- src/modules/module_33000.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/module_33000.c b/src/modules/module_33000.c index 36facd878..8fb36231a 100644 --- a/src/modules/module_33000.c +++ b/src/modules/module_33000.c @@ -118,8 +118,16 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_buf[out_len] = hashconfig->separator; out_len += 1; - u8_to_hex ((const u8 *) salt->salt_buf, 4, out_buf + out_len); - out_len += 8; + // Convert salt to hex (4 bytes) + const u8 *salt_ptr = (const u8 *) salt->salt_buf; + u8 hex[2]; + + for (int i = 0; i < 4; i++) + { + u8_to_hex (salt_ptr[i], hex); + out_buf[out_len++] = hex[0]; + out_buf[out_len++] = hex[1]; + } return out_len; }