From 831075b532afeb7bd8abd9f12e7002b06aa5ea00 Mon Sep 17 00:00:00 2001 From: "R. Yushaev" <44146334+Naufragous@users.noreply.github.com> Date: Wed, 24 Oct 2018 17:11:18 +0200 Subject: [PATCH] Fixed the byte order of digest output for hash-mode 11800 (Streebog-512) --- docs/changes.txt | 1 + src/interface.c | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index fa1d2d635..1a4271426 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -55,6 +55,7 @@ - Fixed speed/delay problem when quitting while the outfile folder is being scanned - Fixed the ciphertext max length in Ansible Vault parser - Fixed the tokenizer configuration in Postgres hash parser +- Fixed the byte order of digest output for hash-mode 11800 (Streebog-512) * changes v4.2.0 -> v4.2.1 diff --git a/src/interface.c b/src/interface.c index 240fd6dad..485f5eca1 100644 --- a/src/interface.c +++ b/src/interface.c @@ -21047,22 +21047,22 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le else if (hash_mode == 11800) { snprintf (out_buf, out_len - 1, "%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x", - digest_buf[ 0], - digest_buf[ 1], - digest_buf[ 2], - digest_buf[ 3], - digest_buf[ 4], - digest_buf[ 5], - digest_buf[ 6], - digest_buf[ 7], - digest_buf[ 8], - digest_buf[ 9], - digest_buf[10], - digest_buf[11], - digest_buf[12], - digest_buf[13], - digest_buf[14], - digest_buf[15]); + byte_swap_32 (digest_buf[ 0]), + byte_swap_32 (digest_buf[ 1]), + byte_swap_32 (digest_buf[ 2]), + byte_swap_32 (digest_buf[ 3]), + byte_swap_32 (digest_buf[ 4]), + byte_swap_32 (digest_buf[ 5]), + byte_swap_32 (digest_buf[ 6]), + byte_swap_32 (digest_buf[ 7]), + byte_swap_32 (digest_buf[ 8]), + byte_swap_32 (digest_buf[ 9]), + byte_swap_32 (digest_buf[10]), + byte_swap_32 (digest_buf[11]), + byte_swap_32 (digest_buf[12]), + byte_swap_32 (digest_buf[13]), + byte_swap_32 (digest_buf[14]), + byte_swap_32 (digest_buf[15])); } else if (hash_mode == 11900) {