mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-15 12:29:35 +00:00
Make sure to zero scratch buffer for WPA/WPA2 and LUKS
This commit is contained in:
parent
5f58a25dcc
commit
2dd027af65
35
src/hashes.c
35
src/hashes.c
@ -721,6 +721,16 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
|
||||
memset (hashes_buf[0].salt, 0, sizeof (salt_t));
|
||||
}
|
||||
|
||||
if (hashconfig->esalt_size)
|
||||
{
|
||||
memset (hashes_buf[0].esalt, 0, hashconfig->esalt_size);
|
||||
}
|
||||
|
||||
if (hashconfig->hook_salt_size)
|
||||
{
|
||||
memset (hashes_buf[0].hook_salt, 0, hashconfig->hook_salt_size);
|
||||
}
|
||||
|
||||
int parser_status = PARSER_OK;
|
||||
|
||||
if (hashconfig->hash_mode == 2500)
|
||||
@ -753,6 +763,21 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
|
||||
break;
|
||||
}
|
||||
|
||||
if (hashconfig->is_salted)
|
||||
{
|
||||
memset (hashes_buf[hashes_cnt].salt, 0, sizeof (salt_t));
|
||||
}
|
||||
|
||||
if (hashconfig->esalt_size)
|
||||
{
|
||||
memset (hashes_buf[hashes_cnt].esalt, 0, hashconfig->esalt_size);
|
||||
}
|
||||
|
||||
if (hashconfig->hook_salt_size)
|
||||
{
|
||||
memset (hashes_buf[hashes_cnt].hook_salt, 0, hashconfig->hook_salt_size);
|
||||
}
|
||||
|
||||
parser_status = hashconfig->parse_func ((u8 *) in, sizeof (hccapx_t), &hashes_buf[hashes_cnt], hashconfig);
|
||||
|
||||
if (parser_status != PARSER_OK)
|
||||
@ -961,6 +986,16 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
|
||||
memset (hashes_buf[hashes_cnt].salt, 0, sizeof (salt_t));
|
||||
}
|
||||
|
||||
if (hashconfig->esalt_size)
|
||||
{
|
||||
memset (hashes_buf[hashes_cnt].esalt, 0, hashconfig->esalt_size);
|
||||
}
|
||||
|
||||
if (hashconfig->hook_salt_size)
|
||||
{
|
||||
memset (hashes_buf[hashes_cnt].hook_salt, 0, hashconfig->hook_salt_size);
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 3000)
|
||||
{
|
||||
if (hash_len == 32)
|
||||
|
@ -2826,6 +2826,8 @@ int wpa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED
|
||||
|
||||
u32 block[16];
|
||||
|
||||
memset (block, 0, sizeof (block));
|
||||
|
||||
u8 *block_ptr = (u8 *) block;
|
||||
|
||||
for (int i = 0; i < 16; i++) block[i] = salt->salt_buf[i];
|
||||
|
Loading…
Reference in New Issue
Block a user