mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-11 08:10:59 +00:00
Fix invalid password truncation in -a 1 mode
This commit is contained in:
parent
e896d78b05
commit
e76c3de86a
@ -24,6 +24,7 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
|||||||
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
||||||
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
|
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
|
||||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||||
|
const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
|
||||||
|
|
||||||
const u64 gidvid = plain->gidvid;
|
const u64 gidvid = plain->gidvid;
|
||||||
const u32 il_pos = plain->il_pos;
|
const u32 il_pos = plain->il_pos;
|
||||||
@ -234,7 +235,28 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int pw_max = (const int) hashconfig->pw_max;
|
int pw_max = (const int) hashconfig->pw_max;
|
||||||
|
|
||||||
|
// pw_max is per pw_t element but in combinator we have two pw_t elements.
|
||||||
|
// therefore we can support up to 64 in combinator in optimized mode (but limited by general hash limit 55)
|
||||||
|
// or full 512 in pure mode (but limited by hashcat buffer size limit 256).
|
||||||
|
// some algorithms do not support general default pw_max = 31,
|
||||||
|
// therefore we need to use pw_max as a base and not hardcode it.
|
||||||
|
|
||||||
|
if (plain_len > pw_max)
|
||||||
|
{
|
||||||
|
if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
|
||||||
|
{
|
||||||
|
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||||
|
{
|
||||||
|
pw_max = MIN ((pw_max * 2), 55);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pw_max = MIN ((pw_max * 2), 256);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (plain_len > pw_max) plain_len = MIN (plain_len, pw_max);
|
if (plain_len > pw_max) plain_len = MIN (plain_len, pw_max);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user