1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-15 20:39:17 +00:00

Merge pull request #2217 from philsmd/master

fixes #2200: new WinZip tokenizer hex  data length problem
This commit is contained in:
Jens Steube 2019-11-11 10:15:54 +01:00 committed by GitHub
commit b005c7de2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -162,7 +162,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
token.len_max[6] = 6;
token.sep[6] = '*';
token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH
| TOKEN_ATTR_VERIFY_DIGIT;
| TOKEN_ATTR_VERIFY_HEX;
token.len_min[7] = 0;
token.len_max[7] = 16384;
@ -233,7 +233,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *compress_length_pos = token.buf[6];
const u32 compress_length = hc_strtoul ((const char *) compress_length_pos, NULL, 10);
const u32 compress_length = hc_strtoul ((const char *) compress_length_pos, NULL, 16);
zip2->compress_length = compress_length;
@ -384,7 +384,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
sprintf (auth_tmp + j, "%02x", ptr[i]);
}
const int line_len = snprintf (line_buf, line_size, "%s*%u*%u*%u*%s*%x*%u*%s*%s*%s",
const int line_len = snprintf (line_buf, line_size, "%s*%u*%u*%u*%s*%x*%x*%s*%s*%s",
SIGNATURE_ZIP2_START,
zip2->type,
zip2->mode,

View File

@ -94,7 +94,7 @@ sub module_generate_hash
my $auth = hmac_hex ($data, $key_bin, \&sha1, 64);
my $hash = sprintf ('$zip2$*%u*%u*%u*%s*%s*%u*%s*%s*$/zip2$', $type, $mode, $magic, $salt, $verify_bytes, $compress_length, $data, substr ($auth, 0, 20));
my $hash = sprintf ('$zip2$*%u*%u*%u*%s*%s*%x*%s*%s*$/zip2$', $type, $mode, $magic, $salt, $verify_bytes, $compress_length, $data, substr ($auth, 0, 20));
return $hash;
}