mirror of
https://github.com/hashcat/hashcat.git
synced 2025-03-24 11:25:41 +00:00
Allocate always MAX_SALT * 2 bytes for temporary buffers going into generic_salt_encode()
This commit is contained in:
parent
ba803a79ae
commit
a5336ceb72
@ -239,7 +239,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
tmp_buf[29] = sig[5];
|
||||
tmp_buf[30] = 0;
|
||||
|
||||
char tmp_salt[SALT_MAX];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len - strlen (adm), (u8 *) tmp_salt);
|
||||
|
||||
|
@ -133,7 +133,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
tmp[3] += MD5M_D;
|
||||
}
|
||||
|
||||
char tmp_salt[SALT_MAX];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len - strlen (skyper), (u8 *) tmp_salt);
|
||||
|
||||
|
@ -123,7 +123,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
tmp[4] += SHA1M_E;
|
||||
}
|
||||
|
||||
char tmp_salt[48];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -141,7 +141,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
tmp[3] = byte_swap_32 (tmp[3]);
|
||||
tmp[4] = byte_swap_32 (tmp[4]);
|
||||
|
||||
char tmp_salt[SALT_MAX];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -125,7 +125,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
tmp[4] += SHA1M_E;
|
||||
}
|
||||
|
||||
char tmp_salt[48];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -138,7 +138,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
tmp[4] += SHA1M_E;
|
||||
}
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -133,7 +133,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
tmp[4] += SHA1M_E;
|
||||
}
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -128,7 +128,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
char tmp_salt[128] = { 0 };
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -222,7 +222,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
md5crypt_encode (digest_buf, tmp);
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -137,7 +137,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
tmp[7] += SHA256M_H;
|
||||
}
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -134,7 +134,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
char tmp_salt[128];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -222,7 +222,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
md5crypt_encode (digest_buf, tmp);
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -141,7 +141,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
u32 *ptr = (u32 *) tmp;
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -151,7 +151,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
const u32 *ptr = (const u32 *) tmp;
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -487,7 +487,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
sha512crypt_encode (digest_buf, tmp);
|
||||
|
||||
char tmp_salt[64];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -126,7 +126,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
tmp[3] += MD5M_D;
|
||||
}
|
||||
|
||||
char tmp_salt[SALT_MAX];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len - 1, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -222,7 +222,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
md5crypt_encode (digest_buf, tmp);
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -345,7 +345,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
sha256aix_encode ((unsigned char *) tmp, (unsigned char *) ptr_plain);
|
||||
|
||||
char tmp_salt[64];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -519,7 +519,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
sha512aix_encode ((unsigned char *) tmp, (unsigned char *) ptr_plain);
|
||||
|
||||
char tmp_salt[64];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -272,7 +272,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
sha1aix_encode ((unsigned char *) tmp, (unsigned char *) ptr_plain);
|
||||
|
||||
char tmp_salt[64];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -126,7 +126,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
char tmp_salt[48];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -311,7 +311,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
sha256crypt_encode ((unsigned char *) digest_buf, (unsigned char *) ptr_plain);
|
||||
|
||||
char tmp_salt[32];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -117,7 +117,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -110,7 +110,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -124,7 +124,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -117,7 +117,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -121,7 +121,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -185,7 +185,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
// final
|
||||
|
||||
char tmp_salt[128];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -164,7 +164,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
FP (tmp[1], tmp[0], tt);
|
||||
|
||||
char tmp_salt[32];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -110,7 +110,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
char tmp_salt[64];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -269,7 +269,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
sprintf (public_key_buf + j, "%02x", ptr[i]);
|
||||
}
|
||||
|
||||
char tmp_salt[48];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -91,7 +91,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
char tmp_salt[16];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -315,7 +315,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
salt_in[4] = byte_swap_32 (salt->salt_buf[4]);
|
||||
salt_in[5] = 0;
|
||||
|
||||
char tmp_salt[48];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt_in, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -317,7 +317,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
salt_in[4] = byte_swap_32 (salt->salt_buf[4]);
|
||||
salt_in[5] = 0;
|
||||
|
||||
char tmp_salt[48];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt_in, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -293,7 +293,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
// salt
|
||||
|
||||
char tmp_salt[128];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
memcpy (tmp_salt, salt->salt_buf, salt->salt_len);
|
||||
|
||||
|
@ -410,7 +410,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
char *salt_ptr = (char *) salt->salt_buf;
|
||||
|
||||
char tmp_salt[128];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
@ -210,7 +210,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
// salt:
|
||||
|
||||
char tmp_salt[48];
|
||||
char tmp_salt[SALT_MAX * 2];
|
||||
|
||||
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user