Fixed maximum password length limit which was announced as 256 but actually was 255
This commit is contained in:
+1
-1
@@ -205,7 +205,7 @@ bool need_hexify (const u8 *buf, const size_t len, const char separator, bool al
|
||||
|
||||
void exec_hexify (const u8 *buf, const size_t len, u8 *out)
|
||||
{
|
||||
const size_t max_len = (len >= PW_MAX) ? PW_MAX : len;
|
||||
const size_t max_len = (len > PW_MAX) ? PW_MAX : len;
|
||||
|
||||
for (int i = (int) max_len - 1, j = i * 2; i >= 0; i -= 1, j -= 2)
|
||||
{
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par
|
||||
line_len = (size_t) rule_len_out;
|
||||
}
|
||||
|
||||
if (line_len >= PW_MAX) continue;
|
||||
if (line_len > PW_MAX) continue;
|
||||
|
||||
// hmm that's always the case, or?
|
||||
|
||||
|
||||
+4
-4
@@ -2468,7 +2468,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
||||
|
||||
line_len = convert_from_hex (hashcat_ctx, line_buf, line_len);
|
||||
|
||||
if (line_len >= PW_MAX) continue;
|
||||
if (line_len > PW_MAX) continue;
|
||||
|
||||
char *line_buf_new = line_buf;
|
||||
|
||||
@@ -2509,7 +2509,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
||||
line_len = HCBUFSIZ_TINY - iconv_sz;
|
||||
}
|
||||
|
||||
line_len = MIN (line_len, PW_MAX - 1);
|
||||
line_len = MIN (line_len, PW_MAX);
|
||||
|
||||
u8 *ptr = (u8 *) device_param->combs_buf[i].i;
|
||||
|
||||
@@ -2605,7 +2605,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
||||
|
||||
line_len = convert_from_hex (hashcat_ctx, line_buf, line_len);
|
||||
|
||||
if (line_len >= PW_MAX) continue;
|
||||
if (line_len > PW_MAX) continue;
|
||||
|
||||
char *line_buf_new = line_buf;
|
||||
|
||||
@@ -2646,7 +2646,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
||||
line_len = HCBUFSIZ_TINY - iconv_sz;
|
||||
}
|
||||
|
||||
line_len = MIN (line_len, PW_MAX - 1);
|
||||
line_len = MIN (line_len, PW_MAX);
|
||||
|
||||
u8 *ptr = (u8 *) device_param->combs_buf[i].i;
|
||||
|
||||
|
||||
+2
-2
@@ -218,7 +218,7 @@ void get_next_word (hashcat_ctx_t *hashcat_ctx, FILE *fd, char **out_buf, u32 *o
|
||||
if (rule_len_out < 0) continue;
|
||||
}
|
||||
|
||||
if (len >= PW_MAX) continue;
|
||||
if (len > PW_MAX) continue;
|
||||
|
||||
*out_buf = ptr;
|
||||
*out_len = (u32) len;
|
||||
@@ -477,7 +477,7 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64
|
||||
|
||||
cnt2++;
|
||||
|
||||
if (len >= PW_MAX) continue;
|
||||
if (len > PW_MAX) continue;
|
||||
|
||||
d.cnt++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user