mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-05 06:58:56 +00:00
Fixed a buffer overflow in module_hash_decode() of -m 15500
This commit is contained in:
parent
1e469a96a4
commit
09b2bb0ad7
@ -197,9 +197,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
// alias
|
||||
|
||||
const u8 *alias_pos = token.buf[6];
|
||||
|
||||
strncpy ((char *) jks_sha1->alias, (const char *) alias_pos, 64);
|
||||
memcpy ((char *) jks_sha1->alias, (const char *) token.buf[6], token.len[6]);
|
||||
|
||||
// fake salt
|
||||
|
||||
@ -237,6 +235,10 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
u8 *der = (u8 *) jks_sha1->der;
|
||||
|
||||
char alias[65] = { 0 };
|
||||
|
||||
memcpy (alias, (char *) jks_sha1->alias, 64);
|
||||
|
||||
const int line_len = snprintf (line_buf, line_size, "%s*%08X%08X%08X%08X%08X*%08X%08X%08X%08X%08X*%s*%02X*%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X*%s",
|
||||
SIGNATURE_JKS_SHA1,
|
||||
byte_swap_32 (jks_sha1->checksum[0]),
|
||||
@ -265,7 +267,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
der[17],
|
||||
der[18],
|
||||
der[19],
|
||||
(char *) jks_sha1->alias
|
||||
alias
|
||||
);
|
||||
|
||||
return line_len;
|
||||
|
Loading…
Reference in New Issue
Block a user