From a2708e106375920d90311a81b225aaf472dc23c3 Mon Sep 17 00:00:00 2001 From: philsmd Date: Sun, 5 Mar 2017 17:14:55 +0100 Subject: [PATCH] fixes #1160: parsing/displaying -m 7000 = Fortigate hashes --- docs/changes.txt | 1 + src/interface.c | 4 ++-- tools/test.pl | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index f333ed1ba..031682e40 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -6,6 +6,7 @@ - Fixed a problem where --keyspace combined with custom charsets incorrectly displayed an error message - Fixed a typo that resulted in the minimum password length not being correctly initialized +- Fixed a problem with parsing and displaying -m 7000 = Fortigate (FortiOS) hashes * changes v3.30 -> v3.40: diff --git a/src/interface.c b/src/interface.c index a0e48d179..916438da8 100644 --- a/src/interface.c +++ b/src/interface.c @@ -14054,7 +14054,7 @@ int fortigate_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ int decoded_len = base64_decode (base64_to_int, (const u8 *) hash_pos, DISPLAY_LEN_MAX_7000 - 3, tmp_buf); - if (decoded_len != 32 + 1) return (PARSER_HASH_LENGTH); + if (decoded_len != 32) return (PARSER_HASH_LENGTH); /** * store data @@ -16219,7 +16219,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le // base64 encode (salt + SHA1) - base64_encode (int_to_base64, (const u8 *) tmp_buf, 12 + 20 + 1, (u8 *) ptr_plain); + base64_encode (int_to_base64, (const u8 *) tmp_buf, 12 + 20, (u8 *) ptr_plain); ptr_plain[44] = 0; diff --git a/tools/test.pl b/tools/test.pl index c73dfbeae..e7cc1c342 100755 --- a/tools/test.pl +++ b/tools/test.pl @@ -5492,7 +5492,7 @@ sub gen_hash my $hash = sha1 ($salt_bin . $word_buf . $FORTIGATE_MAGIC); - $hash = encode_base64 ($salt_bin . $hash . "\x00"); + $hash = encode_base64 ($salt_bin . $hash); $hash =~ s/[\r\n]//g; $tmp_hash = sprintf ("%s%s", $FORTIGATE_SIGNATURE, $hash);