1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 15:18:16 +00:00

Fixed: buffer overflows

temporary buffer was too small for MAX_SALT
This commit is contained in:
vlo 2019-05-09 19:27:11 +02:00
parent 23c3e723f7
commit ee500bec02
3 changed files with 6 additions and 6 deletions

View File

@ -151,7 +151,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[3];
const int salt_len = token.len[3];
u8 tmp_buf[100] = { 0 };
u8 tmp_buf[256] = { 0 };
const size_t salt_len_decoded = base64_decode (alternate_base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
@ -200,7 +200,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tmp[7] = byte_swap_64 (digest[7]);
tmp[8] = 0;
char salt_enc[128] = { 0 };
char salt_enc[256] = { 0 };
char hash_enc[128] = { 0 };
const size_t salt_len_enc = base64_encode (int_to_alternate_base64, (const u8 *) pbkdf2_sha512->salt_buf, salt->salt_len, (u8 *) salt_enc);

View File

@ -150,7 +150,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[3];
const int salt_len = token.len[3];
u8 tmp_buf[100] = { 0 };
u8 tmp_buf[256] = { 0 };
const size_t salt_len_decoded = base64_decode (alternate_base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
@ -199,7 +199,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tmp[7] = byte_swap_32 (digest[7]);
tmp[8] = 0;
char salt_enc[128] = { 0 };
char salt_enc[256] = { 0 };
char hash_enc[128] = { 0 };
const size_t salt_len_enc = base64_encode (int_to_alternate_base64, (const u8 *) pbkdf2_sha256->salt_buf, salt->salt_len, (u8 *) salt_enc);

View File

@ -150,7 +150,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[3];
const int salt_len = token.len[3];
u8 tmp_buf[100] = { 0 };
u8 tmp_buf[256] = { 0 };
const size_t salt_len_decoded = base64_decode (alternate_base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
@ -192,7 +192,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tmp[4] = byte_swap_32 (digest[4]);
tmp[5] = 0;
char salt_enc[128] = { 0 };
char salt_enc[256] = { 0 };
char hash_enc[128] = { 0 };
const size_t salt_len_enc = base64_encode (int_to_alternate_base64, (const u8 *) pbkdf2_sha1->salt_buf, salt->salt_len, (u8 *) salt_enc);