From b1a2c4f0f61c36ab2b592758faa1a9832ad219ab Mon Sep 17 00:00:00 2001 From: philsmd Date: Sat, 21 Jan 2017 16:59:07 +0100 Subject: [PATCH] fixes #980: combinator attack needs special formula for max pass length --- docs/changes.txt | 6 ++++++ src/outfile.c | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index b9c002449..52ee1f167 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -18,6 +18,12 @@ - Workaround added for AMDGPU-Pro OpenCL runtime: AES encrypt and decrypt Invertkey function was calculated wrong in certain cases +## +## Bugs +## + +- Fixed a problem with maximal password length with the combinator attack + * changes v3.20 -> v3.30: ## diff --git a/src/outfile.c b/src/outfile.c index 9536c9dd6..52258de55 100644 --- a/src/outfile.c +++ b/src/outfile.c @@ -84,9 +84,20 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl memcpy (plain_ptr, comb_buf, comb_len); } + int pw_max_combi; + + if (hashconfig->pw_max < PW_DICTMAX) + { + pw_max_combi = hashconfig->pw_max; + } + else + { + pw_max_combi = PW_MAX; + } + plain_len += comb_len; - if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max; + if (plain_len > pw_max_combi) plain_len = pw_max_combi; } else if (user_options->attack_mode == ATTACK_MODE_BF) {