1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 14:48:12 +00:00

clang-tidy: remove useless casts

Now that const was fixed, pointless casts can be removed.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2023-08-18 16:37:00 -07:00
parent 795674c939
commit ae07d65f34
105 changed files with 572 additions and 572 deletions

View File

@ -69,8 +69,8 @@ DECLSPEC bool b58dec (PRIVATE_AS u8 *bin, PRIVATE_AS u32 *binszp, PRIVATE_AS con
{
u32 binsz = *binszp;
PRIVATE_AS const u8 *b58u = (PRIVATE_AS const u8*) b58;
PRIVATE_AS u8 *binu = (PRIVATE_AS u8*) bin;
PRIVATE_AS const u8 *b58u = b58;
PRIVATE_AS u8 *binu = bin;
u32 outisz = (binsz + sizeof (u32) - 1) / sizeof (u32);
@ -144,7 +144,7 @@ DECLSPEC bool b58dec (PRIVATE_AS u8 *bin, PRIVATE_AS u32 *binszp, PRIVATE_AS con
// Count canonical base58 byte count
binu = (PRIVATE_AS u8*) bin;
binu = bin;
for (u32 i = 0; i < binsz; i++)
{
@ -255,7 +255,7 @@ DECLSPEC bool b58check (PRIVATE_AS const u8 *bin, PRIVATE_AS const u32 binsz)
u32 data[64] = { 0 }; // 64 * 4 = 256 bytes (should be enough)
PRIVATE_AS u8 *datac = (PRIVATE_AS u8*) data;
PRIVATE_AS const u8 *binc = (PRIVATE_AS const u8*) bin;
PRIVATE_AS const u8 *binc = bin;
if (binsz < 4) return false;
if (binsz > 256) return false;
@ -288,7 +288,7 @@ DECLSPEC bool b58check (PRIVATE_AS const u8 *bin, PRIVATE_AS const u32 binsz)
ctx.h[0] = hc_swap32_S (ctx.h[0]);
PRIVATE_AS u8 *ph4 = (PRIVATE_AS u8*) ctx.h;
PRIVATE_AS const u8 *sum = (PRIVATE_AS const u8*) (binc + (binsz - 4)); // offset: binsz - 4, last 4 bytes
PRIVATE_AS const u8 *sum = (binc + (binsz - 4)); // offset: binsz - 4, last 4 bytes
if (ph4[0] != sum[0]) return false;
if (ph4[1] != sum[1]) return false;
@ -547,7 +547,7 @@ DECLSPEC bool b58check_38 (PRIVATE_AS const u32 *bin)
DECLSPEC bool b58enc (PRIVATE_AS u8 *b58, PRIVATE_AS u32 *b58sz, PRIVATE_AS const u8 *data, PRIVATE_AS const u32 binsz)
{
PRIVATE_AS const u8 *bin = (PRIVATE_AS const u8 *) data;
PRIVATE_AS const u8 *bin = data;
int carry;
u32 j = 0;
@ -609,7 +609,7 @@ DECLSPEC bool b58check_enc (PRIVATE_AS u8 *b58c, PRIVATE_AS u32 *b58c_sz, PRIVAT
u8 buf[128] = { 0 };
PRIVATE_AS u32 *buf32 = (PRIVATE_AS u32*) buf;
PRIVATE_AS const u8 *data8 = (PRIVATE_AS const u8 *) data;
PRIVATE_AS const u8 *data8 = data;
PRIVATE_AS u8 *hash = &buf[1 + datasz];
@ -641,7 +641,7 @@ DECLSPEC bool b58check_enc (PRIVATE_AS u8 *b58c, PRIVATE_AS u32 *b58c_sz, PRIVAT
for (u32 i = 0; i < 4; i++)
{
((PRIVATE_AS u8 *) hash)[i] = ((PRIVATE_AS u8 *) ctx.h)[i];
(hash)[i] = ((PRIVATE_AS u8 *) ctx.h)[i];
}
return b58enc (b58c, b58c_sz, buf, 1 + datasz + 4);

View File

@ -15083,7 +15083,7 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
// size_pws_idx
size_pws_idx = (u64) (kernel_power_max + 1) * sizeof (pw_idx_t);
size_pws_idx = (kernel_power_max + 1) * sizeof (pw_idx_t);
// size_tmps

View File

@ -247,12 +247,12 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par
char rule_buf_out[RP_PASSWORD_SIZE];
int rule_jk_len = (int) user_options_extra->rule_len_l;
const char *rule_jk_buf = (const char *) user_options->rule_buf_l;
const char *rule_jk_buf = user_options->rule_buf_l;
if (attack_mode == ATTACK_MODE_HYBRID2)
{
rule_jk_len = (int) user_options_extra->rule_len_r;
rule_jk_buf = (const char *) user_options->rule_buf_r;
rule_jk_buf = user_options->rule_buf_r;
}
if (run_rule_engine (rule_jk_len, rule_jk_buf))
@ -1426,12 +1426,12 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
// post-process rule engine
int rule_jk_len = (int) user_options_extra->rule_len_l;
const char *rule_jk_buf = (const char *) user_options->rule_buf_l;
const char *rule_jk_buf = user_options->rule_buf_l;
if (attack_mode == ATTACK_MODE_HYBRID2)
{
rule_jk_len = (int) user_options_extra->rule_len_r;
rule_jk_buf = (const char *) user_options->rule_buf_r;
rule_jk_buf = user_options->rule_buf_r;
}
if (run_rule_engine (rule_jk_len, rule_jk_buf))

View File

@ -477,7 +477,7 @@ size_t hc_fread (void *ptr, size_t size, size_t nmemb, HCFILE *fp)
if (inLeft == 0 && outLeft == 0)
{
/* partial read */
n = (size_t) (outPos / size);
n = (outPos / size);
break;
}
outPos += outLeft;

View File

@ -469,18 +469,18 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
{
const int hook_threads = (int) user_options->hook_threads;
module_ctx->hook_extra_params = (void *) hccalloc (hook_threads, sizeof (void *));
module_ctx->hook_extra_params = hccalloc (hook_threads, sizeof (void *));
for (int i = 0; i < hook_threads; i++)
{
module_ctx->hook_extra_params[i] = (void *) hcmalloc (hashconfig->hook_extra_param_size);
module_ctx->hook_extra_params[i] = hcmalloc (hashconfig->hook_extra_param_size);
}
}
else
{
module_ctx->hook_extra_params = (void *) hccalloc (1, sizeof (void *));
module_ctx->hook_extra_params = hccalloc (1, sizeof (void *));
module_ctx->hook_extra_params[0] = (void *) hcmalloc (1);
module_ctx->hook_extra_params[0] = hcmalloc (1);
}
if (module_ctx->module_hook_extra_param_init != MODULE_DEFAULT)

View File

@ -107,7 +107,7 @@ static void juniper_decrypt_hash (const u8 *in, const int in_len, u8 *out)
u8 base64_buf[100] = { 0 };
base64_decode (base64_to_int, (const u8 *) in, in_len, base64_buf);
base64_decode (base64_to_int, in, in_len, base64_buf);
// iv stuff

View File

@ -227,7 +227,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
base64_decode (bf64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
base64_decode (bf64_to_int, salt_pos, salt_len, tmp_buf);
memcpy (salt_buf_ptr, tmp_buf, 16);
@ -238,7 +238,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
base64_decode (bf64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
base64_decode (bf64_to_int, hash_pos, hash_len, tmp_buf);
memcpy (digest, tmp_buf, 24);

View File

@ -122,11 +122,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
digest[3] -= MD5M_D;
}
const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_double_salt->salt1_buf, (int *) &md5_double_salt->salt1_len);
const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_double_salt->salt1_buf, &md5_double_salt->salt1_len);
if (parse_rc1 == false) return (PARSER_SALT_LENGTH);
const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_double_salt->salt2_buf, (int *) &md5_double_salt->salt2_len);
const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_double_salt->salt2_buf, &md5_double_salt->salt2_len);
if (parse_rc2 == false) return (PARSER_SALT_LENGTH);
@ -186,13 +186,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt1_buf, (const int) md5_double_salt->salt1_len, out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt1_buf, md5_double_salt->salt1_len, out_buf + out_len);
out_buf[out_len] = hashconfig->separator;
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt2_buf, (const int) md5_double_salt->salt2_len, out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt2_buf, md5_double_salt->salt2_len, out_buf + out_len);
return out_len;
}

View File

@ -166,7 +166,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, out_buf + out_len);
return out_len;
}

View File

@ -166,7 +166,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, out_buf + out_len);
return out_len;
}

View File

@ -167,7 +167,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, out_buf + out_len);
return out_len;
}

View File

@ -133,7 +133,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
HCFILE fp;
if (hc_fopen (&fp, (const char *) line_buf, "rb") == false) return (PARSER_HASH_FILE);
if (hc_fopen (&fp, line_buf, "rb") == false) return (PARSER_HASH_FILE);
psafe3_t in;

View File

@ -71,7 +71,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 tmp_buf[100] = { 0 };
base64_decode (itoa64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
base64_decode (itoa64_to_int, hash_pos, hash_len, tmp_buf);
memcpy (digest, tmp_buf, 32);

View File

@ -175,7 +175,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
lastpass_t *lastpass = (lastpass_t *) esalt_buf;
const int iv_size = hex_decode ((const u8 *) token.buf[3], token.len[3], (u8 *) lastpass->iv);
const int iv_size = hex_decode (token.buf[3], token.len[3], (u8 *) lastpass->iv);
if (iv_size != sizeof (lastpass->iv)) return (PARSER_IV_LENGTH);

View File

@ -358,7 +358,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 tmp_dgst[100] = { 0 };
const int dgst_len = hex_decode ((const u8 *) hash_pos, hash_len, (u8 *) tmp_dgst);
const int dgst_len = hex_decode (hash_pos, hash_len, (u8 *) tmp_dgst);
if (dgst_len != 43) return (PARSER_HASH_ENCODING);

View File

@ -109,11 +109,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[1];
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]);
digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]);
digest[0] = hex_to_u32 (&hash_pos[ 0]);
digest[1] = hex_to_u32 (&hash_pos[ 8]);
digest[2] = hex_to_u32 (&hash_pos[16]);
digest[3] = hex_to_u32 (&hash_pos[24]);
digest[4] = hex_to_u32 (&hash_pos[32]);
digest[0] = byte_swap_32 (digest[0]);
digest[1] = byte_swap_32 (digest[1]);

View File

@ -109,11 +109,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[1];
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]);
digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]);
digest[0] = hex_to_u32 (&hash_pos[ 0]);
digest[1] = hex_to_u32 (&hash_pos[ 8]);
digest[2] = hex_to_u32 (&hash_pos[16]);
digest[3] = hex_to_u32 (&hash_pos[24]);
digest[4] = hex_to_u32 (&hash_pos[32]);
digest[0] = byte_swap_32 (digest[0]);
digest[1] = byte_swap_32 (digest[1]);

View File

@ -336,7 +336,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 tmp_buf[128] = { 0 };
const int tmp_len = base64_decode (base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
const int tmp_len = base64_decode (base64_to_int, salt_pos, salt_len, tmp_buf);
memcpy (salt->salt_buf, tmp_buf, tmp_len);
@ -349,7 +349,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
const int digest_len = base64_decode (base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
const int digest_len = base64_decode (base64_to_int, hash_pos, hash_len, tmp_buf);
// digest_len should be safe because of 88 limit

View File

@ -188,7 +188,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
HCFILE fp;
if (hc_fopen (&fp, (const char *) line_buf, "rb") == false) return (PARSER_HASH_FILE);
if (hc_fopen (&fp, line_buf, "rb") == false) return (PARSER_HASH_FILE);
psafe2_hdr buf;

View File

@ -164,7 +164,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 tmp_buf[100] = { 0 };
base64_decode (base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
base64_decode (base64_to_int, hash_pos, hash_len, tmp_buf);
memcpy (digest, tmp_buf, 32);

View File

@ -111,7 +111,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 tmp_buf[256] = { 0 };
const int tmp_len = base64_decode (base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
const int tmp_len = base64_decode (base64_to_int, hash_pos, hash_len, tmp_buf);
if (tmp_len < 32 + 1) return (PARSER_HASH_LENGTH);

View File

@ -117,7 +117,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 tmp_buf[100] = { 0 };
const u32 decoded_len = base64_decode (base64_to_int, (const u8 *) base64_pos, base64_len, tmp_buf);
const u32 decoded_len = base64_decode (base64_to_int, base64_pos, base64_len, tmp_buf);
if (decoded_len < 24) return (PARSER_SALT_LENGTH);

View File

@ -236,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; i < 8 + 2; i += 1, j += 8)
{
pdf->u_buf[i] = hex_to_u32 ((const u8 *) &u_buf_pos[j]);
pdf->u_buf[i] = hex_to_u32 (&u_buf_pos[j]);
}
salt->salt_buf[0] = pdf->u_buf[8];

View File

@ -315,7 +315,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; i < 8 + 2; i += 1, j += 8)
{
pdf->u_buf[i] = hex_to_u32 ((const u8 *) &u_buf_pos[j]);
pdf->u_buf[i] = hex_to_u32 (&u_buf_pos[j]);
}
salt->salt_buf[0] = pdf->u_buf[8];

View File

@ -236,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; j < cry_master_len; i += 1, j += 8)
{
bitcoin_wallet->cry_master_buf[i] = hex_to_u32 ((const u8 *) &cry_master_buf_pos[j]);
bitcoin_wallet->cry_master_buf[i] = hex_to_u32 (&cry_master_buf_pos[j]);
}
bitcoin_wallet->cry_master_len = cry_master_len / 2;

View File

@ -408,10 +408,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
* digest
*/
digest[0] = hex_to_u32 ((const u8 *) &digest_pos[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &digest_pos[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &digest_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &digest_pos[24]);
digest[0] = hex_to_u32 (&digest_pos[ 0]);
digest[1] = hex_to_u32 (&digest_pos[ 8]);
digest[2] = hex_to_u32 (&digest_pos[16]);
digest[3] = hex_to_u32 (&digest_pos[24]);
return (PARSER_OK);
}

View File

@ -657,7 +657,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0, j = 0; j < coder_attributes_len; i += 1, j += 2)
{
seven_zip->coder_attributes[i] = hex_to_u8 ((const u8 *) &coder_attributes_pos[j]);
seven_zip->coder_attributes[i] = hex_to_u8 (&coder_attributes_pos[j]);
seven_zip->coder_attributes_len++;
}

View File

@ -133,8 +133,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
if (line_buf[token.len[0] + 3] == '*')
{
const char *account_info_start = (const char *) line_buf + 12; // we want the * char included
char *account_info_stop = strchr ((const char *) account_info_start + 1, '*');
const char *account_info_start = line_buf + 12; // we want the * char included
char *account_info_stop = strchr (account_info_start + 1, '*');
if (account_info_stop == NULL) return (PARSER_SEPARATOR_UNMATCHED);

View File

@ -282,10 +282,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *final_random_seed_pos = token.buf[4];
keepass->final_random_seed[0] = hex_to_u32 ((const u8 *) &final_random_seed_pos[ 0]);
keepass->final_random_seed[1] = hex_to_u32 ((const u8 *) &final_random_seed_pos[ 8]);
keepass->final_random_seed[2] = hex_to_u32 ((const u8 *) &final_random_seed_pos[16]);
keepass->final_random_seed[3] = hex_to_u32 ((const u8 *) &final_random_seed_pos[24]);
keepass->final_random_seed[0] = hex_to_u32 (&final_random_seed_pos[ 0]);
keepass->final_random_seed[1] = hex_to_u32 (&final_random_seed_pos[ 8]);
keepass->final_random_seed[2] = hex_to_u32 (&final_random_seed_pos[16]);
keepass->final_random_seed[3] = hex_to_u32 (&final_random_seed_pos[24]);
keepass->final_random_seed[0] = byte_swap_32 (keepass->final_random_seed[0]);
keepass->final_random_seed[1] = byte_swap_32 (keepass->final_random_seed[1]);
@ -294,10 +294,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (keepass->version == 2)
{
keepass->final_random_seed[4] = hex_to_u32 ((const u8 *) &final_random_seed_pos[32]);
keepass->final_random_seed[5] = hex_to_u32 ((const u8 *) &final_random_seed_pos[40]);
keepass->final_random_seed[6] = hex_to_u32 ((const u8 *) &final_random_seed_pos[48]);
keepass->final_random_seed[7] = hex_to_u32 ((const u8 *) &final_random_seed_pos[56]);
keepass->final_random_seed[4] = hex_to_u32 (&final_random_seed_pos[32]);
keepass->final_random_seed[5] = hex_to_u32 (&final_random_seed_pos[40]);
keepass->final_random_seed[6] = hex_to_u32 (&final_random_seed_pos[48]);
keepass->final_random_seed[7] = hex_to_u32 (&final_random_seed_pos[56]);
keepass->final_random_seed[4] = byte_swap_32 (keepass->final_random_seed[4]);
keepass->final_random_seed[5] = byte_swap_32 (keepass->final_random_seed[5]);
@ -309,14 +309,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *transf_random_seed_pos = token.buf[5];
keepass->transf_random_seed[0] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[ 0]);
keepass->transf_random_seed[1] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[ 8]);
keepass->transf_random_seed[2] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[16]);
keepass->transf_random_seed[3] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[24]);
keepass->transf_random_seed[4] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[32]);
keepass->transf_random_seed[5] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[40]);
keepass->transf_random_seed[6] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[48]);
keepass->transf_random_seed[7] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[56]);
keepass->transf_random_seed[0] = hex_to_u32 (&transf_random_seed_pos[ 0]);
keepass->transf_random_seed[1] = hex_to_u32 (&transf_random_seed_pos[ 8]);
keepass->transf_random_seed[2] = hex_to_u32 (&transf_random_seed_pos[16]);
keepass->transf_random_seed[3] = hex_to_u32 (&transf_random_seed_pos[24]);
keepass->transf_random_seed[4] = hex_to_u32 (&transf_random_seed_pos[32]);
keepass->transf_random_seed[5] = hex_to_u32 (&transf_random_seed_pos[40]);
keepass->transf_random_seed[6] = hex_to_u32 (&transf_random_seed_pos[48]);
keepass->transf_random_seed[7] = hex_to_u32 (&transf_random_seed_pos[56]);
keepass->transf_random_seed[0] = byte_swap_32 (keepass->transf_random_seed[0]);
keepass->transf_random_seed[1] = byte_swap_32 (keepass->transf_random_seed[1]);
@ -331,10 +331,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *enc_iv_pos = token.buf[6];
keepass->enc_iv[0] = hex_to_u32 ((const u8 *) &enc_iv_pos[ 0]);
keepass->enc_iv[1] = hex_to_u32 ((const u8 *) &enc_iv_pos[ 8]);
keepass->enc_iv[2] = hex_to_u32 ((const u8 *) &enc_iv_pos[16]);
keepass->enc_iv[3] = hex_to_u32 ((const u8 *) &enc_iv_pos[24]);
keepass->enc_iv[0] = hex_to_u32 (&enc_iv_pos[ 0]);
keepass->enc_iv[1] = hex_to_u32 (&enc_iv_pos[ 8]);
keepass->enc_iv[2] = hex_to_u32 (&enc_iv_pos[16]);
keepass->enc_iv[3] = hex_to_u32 (&enc_iv_pos[24]);
keepass->enc_iv[0] = byte_swap_32 (keepass->enc_iv[0]);
keepass->enc_iv[1] = byte_swap_32 (keepass->enc_iv[1]);
@ -349,14 +349,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *contents_hash_pos = token.buf[7];
keepass->contents_hash[0] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 0]);
keepass->contents_hash[1] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 8]);
keepass->contents_hash[2] = hex_to_u32 ((const u8 *) &contents_hash_pos[16]);
keepass->contents_hash[3] = hex_to_u32 ((const u8 *) &contents_hash_pos[24]);
keepass->contents_hash[4] = hex_to_u32 ((const u8 *) &contents_hash_pos[32]);
keepass->contents_hash[5] = hex_to_u32 ((const u8 *) &contents_hash_pos[40]);
keepass->contents_hash[6] = hex_to_u32 ((const u8 *) &contents_hash_pos[48]);
keepass->contents_hash[7] = hex_to_u32 ((const u8 *) &contents_hash_pos[56]);
keepass->contents_hash[0] = hex_to_u32 (&contents_hash_pos[ 0]);
keepass->contents_hash[1] = hex_to_u32 (&contents_hash_pos[ 8]);
keepass->contents_hash[2] = hex_to_u32 (&contents_hash_pos[16]);
keepass->contents_hash[3] = hex_to_u32 (&contents_hash_pos[24]);
keepass->contents_hash[4] = hex_to_u32 (&contents_hash_pos[32]);
keepass->contents_hash[5] = hex_to_u32 (&contents_hash_pos[40]);
keepass->contents_hash[6] = hex_to_u32 (&contents_hash_pos[48]);
keepass->contents_hash[7] = hex_to_u32 (&contents_hash_pos[56]);
keepass->contents_hash[0] = byte_swap_32 (keepass->contents_hash[0]);
keepass->contents_hash[1] = byte_swap_32 (keepass->contents_hash[1]);
@ -376,7 +376,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; j < contents_len; i += 1, j += 8)
{
keepass->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[j]);
keepass->contents[i] = hex_to_u32 (&contents_pos[j]);
keepass->contents[i] = byte_swap_32 (keepass->contents[i]);
}
@ -392,14 +392,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *expected_bytes_pos = token.buf[7];
keepass->expected_bytes[0] = hex_to_u32 ((const u8 *) &expected_bytes_pos[ 0]);
keepass->expected_bytes[1] = hex_to_u32 ((const u8 *) &expected_bytes_pos[ 8]);
keepass->expected_bytes[2] = hex_to_u32 ((const u8 *) &expected_bytes_pos[16]);
keepass->expected_bytes[3] = hex_to_u32 ((const u8 *) &expected_bytes_pos[24]);
keepass->expected_bytes[4] = hex_to_u32 ((const u8 *) &expected_bytes_pos[32]);
keepass->expected_bytes[5] = hex_to_u32 ((const u8 *) &expected_bytes_pos[40]);
keepass->expected_bytes[6] = hex_to_u32 ((const u8 *) &expected_bytes_pos[48]);
keepass->expected_bytes[7] = hex_to_u32 ((const u8 *) &expected_bytes_pos[56]);
keepass->expected_bytes[0] = hex_to_u32 (&expected_bytes_pos[ 0]);
keepass->expected_bytes[1] = hex_to_u32 (&expected_bytes_pos[ 8]);
keepass->expected_bytes[2] = hex_to_u32 (&expected_bytes_pos[16]);
keepass->expected_bytes[3] = hex_to_u32 (&expected_bytes_pos[24]);
keepass->expected_bytes[4] = hex_to_u32 (&expected_bytes_pos[32]);
keepass->expected_bytes[5] = hex_to_u32 (&expected_bytes_pos[40]);
keepass->expected_bytes[6] = hex_to_u32 (&expected_bytes_pos[48]);
keepass->expected_bytes[7] = hex_to_u32 (&expected_bytes_pos[56]);
keepass->expected_bytes[0] = byte_swap_32 (keepass->expected_bytes[0]);
keepass->expected_bytes[1] = byte_swap_32 (keepass->expected_bytes[1]);
@ -414,14 +414,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *contents_hash_pos = token.buf[8];
keepass->contents_hash[0] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 0]);
keepass->contents_hash[1] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 8]);
keepass->contents_hash[2] = hex_to_u32 ((const u8 *) &contents_hash_pos[16]);
keepass->contents_hash[3] = hex_to_u32 ((const u8 *) &contents_hash_pos[24]);
keepass->contents_hash[4] = hex_to_u32 ((const u8 *) &contents_hash_pos[32]);
keepass->contents_hash[5] = hex_to_u32 ((const u8 *) &contents_hash_pos[40]);
keepass->contents_hash[6] = hex_to_u32 ((const u8 *) &contents_hash_pos[48]);
keepass->contents_hash[7] = hex_to_u32 ((const u8 *) &contents_hash_pos[56]);
keepass->contents_hash[0] = hex_to_u32 (&contents_hash_pos[ 0]);
keepass->contents_hash[1] = hex_to_u32 (&contents_hash_pos[ 8]);
keepass->contents_hash[2] = hex_to_u32 (&contents_hash_pos[16]);
keepass->contents_hash[3] = hex_to_u32 (&contents_hash_pos[24]);
keepass->contents_hash[4] = hex_to_u32 (&contents_hash_pos[32]);
keepass->contents_hash[5] = hex_to_u32 (&contents_hash_pos[40]);
keepass->contents_hash[6] = hex_to_u32 (&contents_hash_pos[48]);
keepass->contents_hash[7] = hex_to_u32 (&contents_hash_pos[56]);
keepass->contents_hash[0] = byte_swap_32 (keepass->contents_hash[0]);
keepass->contents_hash[1] = byte_swap_32 (keepass->contents_hash[1]);
@ -442,14 +442,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
keepass->keyfile_len = 32;
keepass->keyfile[0] = hex_to_u32 ((const u8 *) &keyfile_pos[ 0]);
keepass->keyfile[1] = hex_to_u32 ((const u8 *) &keyfile_pos[ 8]);
keepass->keyfile[2] = hex_to_u32 ((const u8 *) &keyfile_pos[16]);
keepass->keyfile[3] = hex_to_u32 ((const u8 *) &keyfile_pos[24]);
keepass->keyfile[4] = hex_to_u32 ((const u8 *) &keyfile_pos[32]);
keepass->keyfile[5] = hex_to_u32 ((const u8 *) &keyfile_pos[40]);
keepass->keyfile[6] = hex_to_u32 ((const u8 *) &keyfile_pos[48]);
keepass->keyfile[7] = hex_to_u32 ((const u8 *) &keyfile_pos[56]);
keepass->keyfile[0] = hex_to_u32 (&keyfile_pos[ 0]);
keepass->keyfile[1] = hex_to_u32 (&keyfile_pos[ 8]);
keepass->keyfile[2] = hex_to_u32 (&keyfile_pos[16]);
keepass->keyfile[3] = hex_to_u32 (&keyfile_pos[24]);
keepass->keyfile[4] = hex_to_u32 (&keyfile_pos[32]);
keepass->keyfile[5] = hex_to_u32 (&keyfile_pos[40]);
keepass->keyfile[6] = hex_to_u32 (&keyfile_pos[48]);
keepass->keyfile[7] = hex_to_u32 (&keyfile_pos[56]);
keepass->keyfile[0] = byte_swap_32 (keepass->keyfile[0]);
keepass->keyfile[1] = byte_swap_32 (keepass->keyfile[1]);

View File

@ -245,8 +245,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
if (salt_len != 16) return (PARSER_SALT_VALUE);
zip2->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[ 0]);
zip2->salt_buf[1] = hex_to_u32 ((const u8 *) &salt_pos[ 8]);
zip2->salt_buf[0] = hex_to_u32 (&salt_pos[ 0]);
zip2->salt_buf[1] = hex_to_u32 (&salt_pos[ 8]);
zip2->salt_buf[2] = 0;
zip2->salt_buf[3] = 0;
@ -256,9 +256,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
if (salt_len != 24) return (PARSER_SALT_VALUE);
zip2->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[ 0]);
zip2->salt_buf[1] = hex_to_u32 ((const u8 *) &salt_pos[ 8]);
zip2->salt_buf[2] = hex_to_u32 ((const u8 *) &salt_pos[16]);
zip2->salt_buf[0] = hex_to_u32 (&salt_pos[ 0]);
zip2->salt_buf[1] = hex_to_u32 (&salt_pos[ 8]);
zip2->salt_buf[2] = hex_to_u32 (&salt_pos[16]);
zip2->salt_buf[3] = 0;
zip2->salt_len = 12;
@ -267,10 +267,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
if (salt_len != 32) return (PARSER_SALT_VALUE);
zip2->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[ 0]);
zip2->salt_buf[1] = hex_to_u32 ((const u8 *) &salt_pos[ 8]);
zip2->salt_buf[2] = hex_to_u32 ((const u8 *) &salt_pos[16]);
zip2->salt_buf[3] = hex_to_u32 ((const u8 *) &salt_pos[24]);
zip2->salt_buf[0] = hex_to_u32 (&salt_pos[ 0]);
zip2->salt_buf[1] = hex_to_u32 (&salt_pos[ 8]);
zip2->salt_buf[2] = hex_to_u32 (&salt_pos[16]);
zip2->salt_buf[3] = hex_to_u32 (&salt_pos[24]);
zip2->salt_len = 16;
}

View File

@ -380,7 +380,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
HCFILE fp;
if (hc_fopen (&fp, (const char *) line_buf, "rb") == false) return (PARSER_HAVE_ERRNO);
if (hc_fopen (&fp, line_buf, "rb") == false) return (PARSER_HAVE_ERRNO);
struct luks_phdr hdr;

View File

@ -169,16 +169,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 *wpky_buf_ptr = (u32 *) itunes_backup->wpky;
wpky_buf_ptr[0] = hex_to_u32 ((const u8 *) &wpky_pos[ 0]);
wpky_buf_ptr[1] = hex_to_u32 ((const u8 *) &wpky_pos[ 8]);
wpky_buf_ptr[2] = hex_to_u32 ((const u8 *) &wpky_pos[16]);
wpky_buf_ptr[3] = hex_to_u32 ((const u8 *) &wpky_pos[24]);
wpky_buf_ptr[4] = hex_to_u32 ((const u8 *) &wpky_pos[32]);
wpky_buf_ptr[5] = hex_to_u32 ((const u8 *) &wpky_pos[40]);
wpky_buf_ptr[6] = hex_to_u32 ((const u8 *) &wpky_pos[48]);
wpky_buf_ptr[7] = hex_to_u32 ((const u8 *) &wpky_pos[56]);
wpky_buf_ptr[8] = hex_to_u32 ((const u8 *) &wpky_pos[64]);
wpky_buf_ptr[9] = hex_to_u32 ((const u8 *) &wpky_pos[72]);
wpky_buf_ptr[0] = hex_to_u32 (&wpky_pos[ 0]);
wpky_buf_ptr[1] = hex_to_u32 (&wpky_pos[ 8]);
wpky_buf_ptr[2] = hex_to_u32 (&wpky_pos[16]);
wpky_buf_ptr[3] = hex_to_u32 (&wpky_pos[24]);
wpky_buf_ptr[4] = hex_to_u32 (&wpky_pos[32]);
wpky_buf_ptr[5] = hex_to_u32 (&wpky_pos[40]);
wpky_buf_ptr[6] = hex_to_u32 (&wpky_pos[48]);
wpky_buf_ptr[7] = hex_to_u32 (&wpky_pos[56]);
wpky_buf_ptr[8] = hex_to_u32 (&wpky_pos[64]);
wpky_buf_ptr[9] = hex_to_u32 (&wpky_pos[72]);
wpky_buf_ptr[0] = byte_swap_32 (wpky_buf_ptr[0]);
wpky_buf_ptr[1] = byte_swap_32 (wpky_buf_ptr[1]);
@ -254,11 +254,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 *dpsl_buf_ptr = (u32 *) itunes_backup->dpsl;
dpsl_buf_ptr[0] = hex_to_u32 ((const u8 *) &dpsl_pos[ 0]);
dpsl_buf_ptr[1] = hex_to_u32 ((const u8 *) &dpsl_pos[ 8]);
dpsl_buf_ptr[2] = hex_to_u32 ((const u8 *) &dpsl_pos[16]);
dpsl_buf_ptr[3] = hex_to_u32 ((const u8 *) &dpsl_pos[24]);
dpsl_buf_ptr[4] = hex_to_u32 ((const u8 *) &dpsl_pos[32]);
dpsl_buf_ptr[0] = hex_to_u32 (&dpsl_pos[ 0]);
dpsl_buf_ptr[1] = hex_to_u32 (&dpsl_pos[ 8]);
dpsl_buf_ptr[2] = hex_to_u32 (&dpsl_pos[16]);
dpsl_buf_ptr[3] = hex_to_u32 (&dpsl_pos[24]);
dpsl_buf_ptr[4] = hex_to_u32 (&dpsl_pos[32]);
dpsl_buf_ptr[0] = byte_swap_32 (dpsl_buf_ptr[ 0]);
dpsl_buf_ptr[1] = byte_swap_32 (dpsl_buf_ptr[ 1]);

View File

@ -185,16 +185,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 *wpky_buf_ptr = (u32 *) itunes_backup->wpky;
wpky_buf_ptr[0] = hex_to_u32 ((const u8 *) &wpky_pos[ 0]);
wpky_buf_ptr[1] = hex_to_u32 ((const u8 *) &wpky_pos[ 8]);
wpky_buf_ptr[2] = hex_to_u32 ((const u8 *) &wpky_pos[16]);
wpky_buf_ptr[3] = hex_to_u32 ((const u8 *) &wpky_pos[24]);
wpky_buf_ptr[4] = hex_to_u32 ((const u8 *) &wpky_pos[32]);
wpky_buf_ptr[5] = hex_to_u32 ((const u8 *) &wpky_pos[40]);
wpky_buf_ptr[6] = hex_to_u32 ((const u8 *) &wpky_pos[48]);
wpky_buf_ptr[7] = hex_to_u32 ((const u8 *) &wpky_pos[56]);
wpky_buf_ptr[8] = hex_to_u32 ((const u8 *) &wpky_pos[64]);
wpky_buf_ptr[9] = hex_to_u32 ((const u8 *) &wpky_pos[72]);
wpky_buf_ptr[0] = hex_to_u32 (&wpky_pos[ 0]);
wpky_buf_ptr[1] = hex_to_u32 (&wpky_pos[ 8]);
wpky_buf_ptr[2] = hex_to_u32 (&wpky_pos[16]);
wpky_buf_ptr[3] = hex_to_u32 (&wpky_pos[24]);
wpky_buf_ptr[4] = hex_to_u32 (&wpky_pos[32]);
wpky_buf_ptr[5] = hex_to_u32 (&wpky_pos[40]);
wpky_buf_ptr[6] = hex_to_u32 (&wpky_pos[48]);
wpky_buf_ptr[7] = hex_to_u32 (&wpky_pos[56]);
wpky_buf_ptr[8] = hex_to_u32 (&wpky_pos[64]);
wpky_buf_ptr[9] = hex_to_u32 (&wpky_pos[72]);
wpky_buf_ptr[0] = byte_swap_32 (wpky_buf_ptr[0]);
wpky_buf_ptr[1] = byte_swap_32 (wpky_buf_ptr[1]);
@ -270,11 +270,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 *dpsl_buf_ptr = (u32 *) itunes_backup->dpsl;
dpsl_buf_ptr[0] = hex_to_u32 ((const u8 *) &dpsl_pos[ 0]);
dpsl_buf_ptr[1] = hex_to_u32 ((const u8 *) &dpsl_pos[ 8]);
dpsl_buf_ptr[2] = hex_to_u32 ((const u8 *) &dpsl_pos[16]);
dpsl_buf_ptr[3] = hex_to_u32 ((const u8 *) &dpsl_pos[24]);
dpsl_buf_ptr[4] = hex_to_u32 ((const u8 *) &dpsl_pos[32]);
dpsl_buf_ptr[0] = hex_to_u32 (&dpsl_pos[ 0]);
dpsl_buf_ptr[1] = hex_to_u32 (&dpsl_pos[ 8]);
dpsl_buf_ptr[2] = hex_to_u32 (&dpsl_pos[16]);
dpsl_buf_ptr[3] = hex_to_u32 (&dpsl_pos[24]);
dpsl_buf_ptr[4] = hex_to_u32 (&dpsl_pos[32]);
dpsl_buf_ptr[0] = byte_swap_32 (dpsl_buf_ptr[ 0]);
dpsl_buf_ptr[1] = byte_swap_32 (dpsl_buf_ptr[ 1]);

View File

@ -89,7 +89,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[0];
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[0]);
digest[0] = hex_to_u32 (&hash_pos[0]);
digest[1] = 0;
digest[2] = 0;
digest[3] = 0;
@ -99,7 +99,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1];
const int salt_len = token.len[1];
salt->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[0]);
salt->salt_buf[0] = hex_to_u32 (&salt_pos[0]);
salt->salt_len = salt_len / 2; // 4

View File

@ -215,7 +215,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0; i < dpapimk->contents_len / 8; i++)
{
dpapimk->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[i * 8]);
dpapimk->contents[i] = hex_to_u32 (&contents_pos[i * 8]);
dpapimk->contents[i] = byte_swap_32 (dpapimk->contents[i]);
}
@ -246,10 +246,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// iv
dpapimk->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]);
dpapimk->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]);
dpapimk->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]);
dpapimk->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]);
dpapimk->iv[0] = hex_to_u32 (&iv_pos[ 0]);
dpapimk->iv[1] = hex_to_u32 (&iv_pos[ 8]);
dpapimk->iv[2] = hex_to_u32 (&iv_pos[16]);
dpapimk->iv[3] = hex_to_u32 (&iv_pos[24]);
dpapimk->iv[0] = byte_swap_32 (dpapimk->iv[0]);
dpapimk->iv[1] = byte_swap_32 (dpapimk->iv[1]);

View File

@ -231,7 +231,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0; i < dpapimk->contents_len / 8; i++)
{
dpapimk->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[i * 8]);
dpapimk->contents[i] = hex_to_u32 (&contents_pos[i * 8]);
dpapimk->contents[i] = byte_swap_32 (dpapimk->contents[i]);
}
@ -258,10 +258,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// iv
dpapimk->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]);
dpapimk->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]);
dpapimk->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]);
dpapimk->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]);
dpapimk->iv[0] = hex_to_u32 (&iv_pos[ 0]);
dpapimk->iv[1] = hex_to_u32 (&iv_pos[ 8]);
dpapimk->iv[2] = hex_to_u32 (&iv_pos[16]);
dpapimk->iv[3] = hex_to_u32 (&iv_pos[24]);
dpapimk->iv[0] = byte_swap_32 (dpapimk->iv[0]);
dpapimk->iv[1] = byte_swap_32 (dpapimk->iv[1]);

View File

@ -145,22 +145,22 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *position_marker = token.buf[1];
chacha20->position[0] = hex_to_u32 ((const u8 *) position_marker + 0);
chacha20->position[1] = hex_to_u32 ((const u8 *) position_marker + 8);
chacha20->position[0] = hex_to_u32 (position_marker + 0);
chacha20->position[1] = hex_to_u32 (position_marker + 8);
// iv
const u8 *iv_marker = token.buf[3];
chacha20->iv[0] = hex_to_u32 ((const u8 *) iv_marker + 8);
chacha20->iv[1] = hex_to_u32 ((const u8 *) iv_marker + 0);
chacha20->iv[0] = hex_to_u32 (iv_marker + 8);
chacha20->iv[1] = hex_to_u32 (iv_marker + 0);
// plain
const u8 *plain_marker = token.buf[4];
chacha20->plain[0] = hex_to_u32 ((const u8 *) plain_marker + 0);
chacha20->plain[1] = hex_to_u32 ((const u8 *) plain_marker + 8);
chacha20->plain[0] = hex_to_u32 (plain_marker + 0);
chacha20->plain[1] = hex_to_u32 (plain_marker + 8);
/* some fake salt for the sorting mechanisms */
@ -178,8 +178,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *cipher_marker = token.buf[5];
digest[0] = hex_to_u32 ((const u8 *) cipher_marker + 8);
digest[1] = hex_to_u32 ((const u8 *) cipher_marker + 0);
digest[0] = hex_to_u32 (cipher_marker + 8);
digest[1] = hex_to_u32 (cipher_marker + 0);
return (PARSER_OK);
}

View File

@ -140,21 +140,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *checksum_pos = token.buf[1];
jks_sha1->checksum[0] = hex_to_u32 ((const u8 *) &checksum_pos[ 0]);
jks_sha1->checksum[1] = hex_to_u32 ((const u8 *) &checksum_pos[ 8]);
jks_sha1->checksum[2] = hex_to_u32 ((const u8 *) &checksum_pos[16]);
jks_sha1->checksum[3] = hex_to_u32 ((const u8 *) &checksum_pos[24]);
jks_sha1->checksum[4] = hex_to_u32 ((const u8 *) &checksum_pos[32]);
jks_sha1->checksum[0] = hex_to_u32 (&checksum_pos[ 0]);
jks_sha1->checksum[1] = hex_to_u32 (&checksum_pos[ 8]);
jks_sha1->checksum[2] = hex_to_u32 (&checksum_pos[16]);
jks_sha1->checksum[3] = hex_to_u32 (&checksum_pos[24]);
jks_sha1->checksum[4] = hex_to_u32 (&checksum_pos[32]);
// iv
const u8 *iv_pos = token.buf[2];
jks_sha1->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]);
jks_sha1->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]);
jks_sha1->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]);
jks_sha1->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]);
jks_sha1->iv[4] = hex_to_u32 ((const u8 *) &iv_pos[32]);
jks_sha1->iv[0] = hex_to_u32 (&iv_pos[ 0]);
jks_sha1->iv[1] = hex_to_u32 (&iv_pos[ 8]);
jks_sha1->iv[2] = hex_to_u32 (&iv_pos[16]);
jks_sha1->iv[3] = hex_to_u32 (&iv_pos[24]);
jks_sha1->iv[4] = hex_to_u32 (&iv_pos[32]);
// enc_key
@ -165,7 +165,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; j < enc_key_len; i += 1, j += 2)
{
enc_key_buf[i] = hex_to_u8 ((const u8 *) &enc_key_pos[j]);
enc_key_buf[i] = hex_to_u8 (&enc_key_pos[j]);
jks_sha1->enc_key_len++;
}
@ -176,7 +176,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 *der = (u8 *) jks_sha1->der;
der[0] = hex_to_u8 ((const u8 *) &der1_pos[0]);
der[0] = hex_to_u8 (&der1_pos[0]);
// der2
@ -184,7 +184,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 6, j = 0; j < 28; i += 1, j += 2)
{
der[i] = hex_to_u8 ((const u8 *) &der2_pos[j]);
der[i] = hex_to_u8 (&der2_pos[j]);
}
der[1] = 0;

View File

@ -198,27 +198,27 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *ciphertext_pos = token.buf[3];
ethereum_pbkdf2->ciphertext[0] = hex_to_u32 ((const u8 *) &ciphertext_pos[ 0]);
ethereum_pbkdf2->ciphertext[1] = hex_to_u32 ((const u8 *) &ciphertext_pos[ 8]);
ethereum_pbkdf2->ciphertext[2] = hex_to_u32 ((const u8 *) &ciphertext_pos[16]);
ethereum_pbkdf2->ciphertext[3] = hex_to_u32 ((const u8 *) &ciphertext_pos[24]);
ethereum_pbkdf2->ciphertext[4] = hex_to_u32 ((const u8 *) &ciphertext_pos[32]);
ethereum_pbkdf2->ciphertext[5] = hex_to_u32 ((const u8 *) &ciphertext_pos[40]);
ethereum_pbkdf2->ciphertext[6] = hex_to_u32 ((const u8 *) &ciphertext_pos[48]);
ethereum_pbkdf2->ciphertext[7] = hex_to_u32 ((const u8 *) &ciphertext_pos[56]);
ethereum_pbkdf2->ciphertext[0] = hex_to_u32 (&ciphertext_pos[ 0]);
ethereum_pbkdf2->ciphertext[1] = hex_to_u32 (&ciphertext_pos[ 8]);
ethereum_pbkdf2->ciphertext[2] = hex_to_u32 (&ciphertext_pos[16]);
ethereum_pbkdf2->ciphertext[3] = hex_to_u32 (&ciphertext_pos[24]);
ethereum_pbkdf2->ciphertext[4] = hex_to_u32 (&ciphertext_pos[32]);
ethereum_pbkdf2->ciphertext[5] = hex_to_u32 (&ciphertext_pos[40]);
ethereum_pbkdf2->ciphertext[6] = hex_to_u32 (&ciphertext_pos[48]);
ethereum_pbkdf2->ciphertext[7] = hex_to_u32 (&ciphertext_pos[56]);
// hash
const u8 *hash_pos = token.buf[4];
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]);
digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]);
digest[5] = hex_to_u32 ((const u8 *) &hash_pos[40]);
digest[6] = hex_to_u32 ((const u8 *) &hash_pos[48]);
digest[7] = hex_to_u32 ((const u8 *) &hash_pos[56]);
digest[0] = hex_to_u32 (&hash_pos[ 0]);
digest[1] = hex_to_u32 (&hash_pos[ 8]);
digest[2] = hex_to_u32 (&hash_pos[16]);
digest[3] = hex_to_u32 (&hash_pos[24]);
digest[4] = hex_to_u32 (&hash_pos[32]);
digest[5] = hex_to_u32 (&hash_pos[40]);
digest[6] = hex_to_u32 (&hash_pos[48]);
digest[7] = hex_to_u32 (&hash_pos[56]);
return (PARSER_OK);
}

View File

@ -377,27 +377,27 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *ciphertext_pos = token.buf[5];
ethereum_scrypt->ciphertext[0] = hex_to_u32 ((const u8 *) &ciphertext_pos[ 0]);
ethereum_scrypt->ciphertext[1] = hex_to_u32 ((const u8 *) &ciphertext_pos[ 8]);
ethereum_scrypt->ciphertext[2] = hex_to_u32 ((const u8 *) &ciphertext_pos[16]);
ethereum_scrypt->ciphertext[3] = hex_to_u32 ((const u8 *) &ciphertext_pos[24]);
ethereum_scrypt->ciphertext[4] = hex_to_u32 ((const u8 *) &ciphertext_pos[32]);
ethereum_scrypt->ciphertext[5] = hex_to_u32 ((const u8 *) &ciphertext_pos[40]);
ethereum_scrypt->ciphertext[6] = hex_to_u32 ((const u8 *) &ciphertext_pos[48]);
ethereum_scrypt->ciphertext[7] = hex_to_u32 ((const u8 *) &ciphertext_pos[56]);
ethereum_scrypt->ciphertext[0] = hex_to_u32 (&ciphertext_pos[ 0]);
ethereum_scrypt->ciphertext[1] = hex_to_u32 (&ciphertext_pos[ 8]);
ethereum_scrypt->ciphertext[2] = hex_to_u32 (&ciphertext_pos[16]);
ethereum_scrypt->ciphertext[3] = hex_to_u32 (&ciphertext_pos[24]);
ethereum_scrypt->ciphertext[4] = hex_to_u32 (&ciphertext_pos[32]);
ethereum_scrypt->ciphertext[5] = hex_to_u32 (&ciphertext_pos[40]);
ethereum_scrypt->ciphertext[6] = hex_to_u32 (&ciphertext_pos[48]);
ethereum_scrypt->ciphertext[7] = hex_to_u32 (&ciphertext_pos[56]);
// hash
const u8 *hash_pos = token.buf[6];
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]);
digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]);
digest[5] = hex_to_u32 ((const u8 *) &hash_pos[40]);
digest[6] = hex_to_u32 ((const u8 *) &hash_pos[48]);
digest[7] = hex_to_u32 ((const u8 *) &hash_pos[56]);
digest[0] = hex_to_u32 (&hash_pos[ 0]);
digest[1] = hex_to_u32 (&hash_pos[ 8]);
digest[2] = hex_to_u32 (&hash_pos[16]);
digest[3] = hex_to_u32 (&hash_pos[24]);
digest[4] = hex_to_u32 (&hash_pos[32]);
digest[5] = hex_to_u32 (&hash_pos[40]);
digest[6] = hex_to_u32 (&hash_pos[48]);
digest[7] = hex_to_u32 (&hash_pos[56]);
return (PARSER_OK);
}

View File

@ -228,7 +228,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0; i < dpapimk->contents_len / 8; i++)
{
dpapimk->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[i * 8]);
dpapimk->contents[i] = hex_to_u32 (&contents_pos[i * 8]);
dpapimk->contents[i] = byte_swap_32 (dpapimk->contents[i]);
}
@ -259,10 +259,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// iv
dpapimk->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]);
dpapimk->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]);
dpapimk->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]);
dpapimk->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]);
dpapimk->iv[0] = hex_to_u32 (&iv_pos[ 0]);
dpapimk->iv[1] = hex_to_u32 (&iv_pos[ 8]);
dpapimk->iv[2] = hex_to_u32 (&iv_pos[16]);
dpapimk->iv[3] = hex_to_u32 (&iv_pos[24]);
dpapimk->iv[0] = byte_swap_32 (dpapimk->iv[0]);
dpapimk->iv[1] = byte_swap_32 (dpapimk->iv[1]);

View File

@ -237,7 +237,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (u32 i = 0; i < dpapimk->contents_len / 8; i++)
{
dpapimk->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[i * 8]);
dpapimk->contents[i] = hex_to_u32 (&contents_pos[i * 8]);
dpapimk->contents[i] = byte_swap_32 (dpapimk->contents[i]);
}
@ -264,10 +264,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// iv
dpapimk->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]);
dpapimk->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]);
dpapimk->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]);
dpapimk->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]);
dpapimk->iv[0] = hex_to_u32 (&iv_pos[ 0]);
dpapimk->iv[1] = hex_to_u32 (&iv_pos[ 8]);
dpapimk->iv[2] = hex_to_u32 (&iv_pos[16]);
dpapimk->iv[3] = hex_to_u32 (&iv_pos[24]);
dpapimk->iv[0] = byte_swap_32 (dpapimk->iv[0]);
dpapimk->iv[1] = byte_swap_32 (dpapimk->iv[1]);

View File

@ -109,10 +109,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 *session_ptr = (u8 *) tacacs_plus->session_buf;
session_ptr[0] = hex_to_u8 ((const u8 *) session_pos + 0);
session_ptr[1] = hex_to_u8 ((const u8 *) session_pos + 2);
session_ptr[2] = hex_to_u8 ((const u8 *) session_pos + 4);
session_ptr[3] = hex_to_u8 ((const u8 *) session_pos + 6);
session_ptr[0] = hex_to_u8 (session_pos + 0);
session_ptr[1] = hex_to_u8 (session_pos + 2);
session_ptr[2] = hex_to_u8 (session_pos + 4);
session_ptr[3] = hex_to_u8 (session_pos + 6);
// ct_buf
@ -123,7 +123,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; j < ct_buf_len; i += 1, j += 2)
{
ct_data_ptr[i] = hex_to_u8 ((const u8 *) &ct_buf_pos[j]);
ct_data_ptr[i] = hex_to_u8 (&ct_buf_pos[j]);
tacacs_plus->ct_data_len++;
}
@ -134,8 +134,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 *sequence_ptr = (u8 *) tacacs_plus->sequence_buf;
sequence_ptr[0] = hex_to_u8 ((const u8 *) sequence_pos + 0);
sequence_ptr[1] = hex_to_u8 ((const u8 *) sequence_pos + 2);
sequence_ptr[0] = hex_to_u8 (sequence_pos + 0);
sequence_ptr[1] = hex_to_u8 (sequence_pos + 2);
// fake salt

View File

@ -178,10 +178,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *ZCRYPTOSALT_pos = token.buf[3];
apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 0]);
apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 8]);
apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[16]);
apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[24]);
apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 (&ZCRYPTOSALT_pos[ 0]);
apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 (&ZCRYPTOSALT_pos[ 8]);
apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 (&ZCRYPTOSALT_pos[16]);
apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 (&ZCRYPTOSALT_pos[24]);
apple_secure_notes->ZCRYPTOSALT[ 4] = 0;
apple_secure_notes->ZCRYPTOSALT[ 5] = 0;
apple_secure_notes->ZCRYPTOSALT[ 6] = 0;
@ -199,12 +199,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *ZCRYPTOWRAPPEDKEY_pos = token.buf[4];
apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 0]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 8]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[16]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[24]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[32]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[40]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 0]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 8]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[16]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[24]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[32]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[40]);
// fake salt

View File

@ -165,10 +165,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *encseed_pos = token.buf[1];
const int encseed_len = token.len[1];
ethereum_presale->iv[0] = hex_to_u32 ((const u8 *) &encseed_pos[ 0]);
ethereum_presale->iv[1] = hex_to_u32 ((const u8 *) &encseed_pos[ 8]);
ethereum_presale->iv[2] = hex_to_u32 ((const u8 *) &encseed_pos[16]);
ethereum_presale->iv[3] = hex_to_u32 ((const u8 *) &encseed_pos[24]);
ethereum_presale->iv[0] = hex_to_u32 (&encseed_pos[ 0]);
ethereum_presale->iv[1] = hex_to_u32 (&encseed_pos[ 8]);
ethereum_presale->iv[2] = hex_to_u32 (&encseed_pos[16]);
ethereum_presale->iv[3] = hex_to_u32 (&encseed_pos[24]);
ethereum_presale->iv[0] = byte_swap_32 (ethereum_presale->iv[0]);
ethereum_presale->iv[1] = byte_swap_32 (ethereum_presale->iv[1]);
@ -179,7 +179,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 32, j = 0; i < encseed_len; i += 8, j++)
{
esalt_buf_ptr[j] = hex_to_u32 ((const u8 *) &encseed_pos[i]);
esalt_buf_ptr[j] = hex_to_u32 (&encseed_pos[i]);
esalt_buf_ptr[j] = byte_swap_32 (esalt_buf_ptr[j]);
}
@ -201,10 +201,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *bkp_pos = token.buf[3];
digest[0] = hex_to_u32 ((const u8 *) &bkp_pos[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &bkp_pos[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &bkp_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &bkp_pos[24]);
digest[0] = hex_to_u32 (&bkp_pos[ 0]);
digest[1] = hex_to_u32 (&bkp_pos[ 8]);
digest[2] = hex_to_u32 (&bkp_pos[16]);
digest[3] = hex_to_u32 (&bkp_pos[24]);
return (PARSER_OK);
}

View File

@ -91,10 +91,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = (const u8 *) line_buf + 10;
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]);
digest[0] = hex_to_u32 (&hash_pos[ 0]);
digest[1] = hex_to_u32 (&hash_pos[ 8]);
digest[2] = hex_to_u32 (&hash_pos[16]);
digest[3] = hex_to_u32 (&hash_pos[24]);
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
{

View File

@ -121,19 +121,19 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *iv_pos = token.buf[2];
electrum_wallet->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]);
electrum_wallet->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]);
electrum_wallet->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]);
electrum_wallet->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]);
electrum_wallet->iv[0] = hex_to_u32 (&iv_pos[ 0]);
electrum_wallet->iv[1] = hex_to_u32 (&iv_pos[ 8]);
electrum_wallet->iv[2] = hex_to_u32 (&iv_pos[16]);
electrum_wallet->iv[3] = hex_to_u32 (&iv_pos[24]);
// encrypted
const u8 *encrypted_pos = token.buf[3];
electrum_wallet->encrypted[0] = hex_to_u32 ((const u8 *) &encrypted_pos[ 0]);
electrum_wallet->encrypted[1] = hex_to_u32 ((const u8 *) &encrypted_pos[ 8]);
electrum_wallet->encrypted[2] = hex_to_u32 ((const u8 *) &encrypted_pos[16]);
electrum_wallet->encrypted[3] = hex_to_u32 ((const u8 *) &encrypted_pos[24]);
electrum_wallet->encrypted[0] = hex_to_u32 (&encrypted_pos[ 0]);
electrum_wallet->encrypted[1] = hex_to_u32 (&encrypted_pos[ 8]);
electrum_wallet->encrypted[2] = hex_to_u32 (&encrypted_pos[16]);
electrum_wallet->encrypted[3] = hex_to_u32 (&encrypted_pos[24]);
// salt fake

View File

@ -142,10 +142,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *ZCRYPTOSALT_pos = token.buf[3];
apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 0]);
apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 8]);
apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[16]);
apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[24]);
apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 (&ZCRYPTOSALT_pos[ 0]);
apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 (&ZCRYPTOSALT_pos[ 8]);
apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 (&ZCRYPTOSALT_pos[16]);
apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 (&ZCRYPTOSALT_pos[24]);
apple_secure_notes->ZCRYPTOSALT[ 4] = 0;
apple_secure_notes->ZCRYPTOSALT[ 5] = 0;
apple_secure_notes->ZCRYPTOSALT[ 6] = 0;
@ -171,12 +171,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *ZCRYPTOWRAPPEDKEY_pos = token.buf[5];
apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 0]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 8]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[16]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[24]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[32]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[40]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 0]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 8]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[16]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[24]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[32]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[40]);
// fake salt

View File

@ -214,7 +214,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; j < ct_buf_len; i += 1, j += 2)
{
ct_data_ptr[i] = hex_to_u8 ((const u8 *) &ct_buf_pos[j]);
ct_data_ptr[i] = hex_to_u8 (&ct_buf_pos[j]);
ansible_vault->ct_data_len++;
}
@ -223,14 +223,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[5];
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]);
digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]);
digest[5] = hex_to_u32 ((const u8 *) &hash_pos[40]);
digest[6] = hex_to_u32 ((const u8 *) &hash_pos[48]);
digest[7] = hex_to_u32 ((const u8 *) &hash_pos[56]);
digest[0] = hex_to_u32 (&hash_pos[ 0]);
digest[1] = hex_to_u32 (&hash_pos[ 8]);
digest[2] = hex_to_u32 (&hash_pos[16]);
digest[3] = hex_to_u32 (&hash_pos[24]);
digest[4] = hex_to_u32 (&hash_pos[32]);
digest[5] = hex_to_u32 (&hash_pos[40]);
digest[6] = hex_to_u32 (&hash_pos[48]);
digest[7] = hex_to_u32 (&hash_pos[56]);
digest[0] = byte_swap_32 (digest[0]);
digest[1] = byte_swap_32 (digest[1]);

View File

@ -242,7 +242,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const int enc_data_size = hc_strtoul ((const char *) token.buf[2], NULL, 10);
const int encrypted_data_size = hex_decode ((const u8 *) token.buf[4], token.len[4], (u8 *) gpg->encrypted_data);
const int encrypted_data_size = hex_decode (token.buf[4], token.len[4], (u8 *) gpg->encrypted_data);
if (enc_data_size != encrypted_data_size) return (PARSER_CT_LENGTH);
@ -266,7 +266,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (hc_strtoul ((const char *) token.buf[9], NULL, 10) != sizeof (gpg->iv)) return (PARSER_IV_LENGTH);
const int iv_size = hex_decode ((const u8 *) token.buf[10], token.len[10], (u8 *) gpg->iv);
const int iv_size = hex_decode (token.buf[10], token.len[10], (u8 *) gpg->iv);
if (iv_size != sizeof (gpg->iv)) return (PARSER_IV_LENGTH);
@ -282,7 +282,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
salt->salt_repeats = gpg->cipher_algo == 7 ? 0 : 1; // "minus one"
salt->salt_len = hex_decode ((const u8 *) token.buf[12], token.len[12], (u8 *) salt->salt_buf);
salt->salt_len = hex_decode (token.buf[12], token.len[12], (u8 *) salt->salt_buf);
if (salt->salt_len != 8) return (PARSER_SALT_LENGTH);

View File

@ -246,7 +246,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const int enc_data_size = hc_strtoul ((const char *) token.buf[2], NULL, 10);
const int encrypted_data_size = hex_decode ((const u8 *) token.buf[4], token.len[4], (u8 *) gpg->encrypted_data);
const int encrypted_data_size = hex_decode (token.buf[4], token.len[4], (u8 *) gpg->encrypted_data);
if (enc_data_size != encrypted_data_size) return (PARSER_CT_LENGTH);
@ -270,7 +270,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (hc_strtoul ((const char *) token.buf[9], NULL, 10) != sizeof (gpg->iv)) return (PARSER_IV_LENGTH);
const int iv_size = hex_decode ((const u8 *) token.buf[10], token.len[10], (u8 *) gpg->iv);
const int iv_size = hex_decode (token.buf[10], token.len[10], (u8 *) gpg->iv);
if (iv_size != sizeof (gpg->iv)) return (PARSER_IV_LENGTH);
@ -284,7 +284,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// Salt Value
salt->salt_len = hex_decode ((const u8 *) token.buf[12], token.len[12], (u8 *) salt->salt_buf);
salt->salt_len = hex_decode (token.buf[12], token.len[12], (u8 *) salt->salt_buf);
if (salt->salt_len != 8) return (PARSER_SALT_LENGTH);

View File

@ -242,7 +242,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const int enc_data_size = hc_strtoul ((const char *) token.buf[2], NULL, 10);
const int encrypted_data_size = hex_decode ((const u8 *) token.buf[4], token.len[4], (u8 *) gpg->encrypted_data);
const int encrypted_data_size = hex_decode (token.buf[4], token.len[4], (u8 *) gpg->encrypted_data);
if (enc_data_size != encrypted_data_size) return (PARSER_CT_LENGTH);
@ -266,7 +266,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (hc_strtoul ((const char *) token.buf[9], NULL, 10) != sizeof (gpg->iv)) return (PARSER_IV_LENGTH);
const int iv_size = hex_decode ((const u8 *) token.buf[10], token.len[10], (u8 *) gpg->iv);
const int iv_size = hex_decode (token.buf[10], token.len[10], (u8 *) gpg->iv);
if (iv_size != sizeof (gpg->iv)) return (PARSER_IV_LENGTH);
@ -280,7 +280,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// Salt Value
salt->salt_len = hex_decode ((const u8 *) token.buf[12], token.len[12], (u8 *) salt->salt_buf);
salt->salt_len = hex_decode (token.buf[12], token.len[12], (u8 *) salt->salt_buf);
if (salt->salt_len != 8) return (PARSER_SALT_LENGTH);

View File

@ -257,7 +257,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const int enc_data_size = hc_strtoul ((const char *) token.buf[2], NULL, 10);
const int encrypted_data_size = hex_decode ((const u8 *) token.buf[4], token.len[4], (u8 *) gpg->encrypted_data);
const int encrypted_data_size = hex_decode (token.buf[4], token.len[4], (u8 *) gpg->encrypted_data);
if (enc_data_size != encrypted_data_size) return (PARSER_CT_LENGTH);
@ -312,7 +312,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
salt->salt_repeats = gpg->cipher_algo == 7 ? 0 : 1; // "minus one" // TODO check this?
salt->salt_len = hex_decode ((const u8 *) token.buf[12], token.len[12], (u8 *) salt->salt_buf);
salt->salt_len = hex_decode (token.buf[12], token.len[12], (u8 *) salt->salt_buf);
if (salt->salt_len != 8) return (PARSER_SALT_LENGTH);

View File

@ -83,7 +83,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (rc_tokenizer != PARSER_OK) return (rc_tokenizer);
// now we need to reduce our hash into a token
int otp_code = hc_strtoul ((const char *) line_buf, NULL, 10);
int otp_code = hc_strtoul (line_buf, NULL, 10);
digest[0] = otp_code;

View File

@ -142,7 +142,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
krb5asrep->format = 2;
}
const char *account_info_start = (const char *) line_buf + strlen (SIGNATURE_KRB5ASREP) + parse_off;
const char *account_info_start = line_buf + strlen (SIGNATURE_KRB5ASREP) + parse_off;
char *account_info_stop = strchr (account_info_start, ':');
if (account_info_stop == NULL) return (PARSER_SEPARATOR_UNMATCHED);

View File

@ -173,10 +173,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *ZCRYPTOSALT_pos = token.buf[3];
apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 0]);
apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 8]);
apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[16]);
apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[24]);
apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 (&ZCRYPTOSALT_pos[ 0]);
apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 (&ZCRYPTOSALT_pos[ 8]);
apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 (&ZCRYPTOSALT_pos[16]);
apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 (&ZCRYPTOSALT_pos[24]);
apple_secure_notes->ZCRYPTOSALT[ 4] = 0;
apple_secure_notes->ZCRYPTOSALT[ 5] = 0;
apple_secure_notes->ZCRYPTOSALT[ 6] = 0;
@ -202,16 +202,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *ZCRYPTOWRAPPEDKEY_pos = token.buf[5];
apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 0]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 8]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[16]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[24]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[32]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[40]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[6] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[48]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[7] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[56]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[8] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[64]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[9] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[72]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 0]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 8]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[16]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[24]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[32]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[40]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[6] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[48]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[7] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[56]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[8] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[64]);
apple_secure_notes->ZCRYPTOWRAPPEDKEY[9] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[72]);
// fake salt

View File

@ -185,28 +185,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; j < 128; i += 1, j += 8)
{
android_backup->user_salt[i] = hex_to_u32 ((const u8 *) user_salt_pos + j);
android_backup->user_salt[i] = hex_to_u32 (user_salt_pos + j);
}
// ck_salt
for (int i = 0, j = 0; j < 128; i += 1, j += 8)
{
android_backup->ck_salt[i] = hex_to_u32 ((const u8 *) ck_salt_pos + j);
android_backup->ck_salt[i] = hex_to_u32 (ck_salt_pos + j);
}
// user_iv
for (int i = 0, j = 0; j < 32; i += 1, j += 8)
{
android_backup->user_iv[i] = hex_to_u32 ((const u8 *) user_iv_pos + j);
android_backup->user_iv[i] = hex_to_u32 (user_iv_pos + j);
}
// masterkey_blob
for (int i = 0, j = 0; j < 192; i += 1, j += 8)
{
android_backup->masterkey_blob[i] = hex_to_u32 ((const u8 *) masterkey_blob_pos + j);
android_backup->masterkey_blob[i] = hex_to_u32 (masterkey_blob_pos + j);
}
// make the entry unique in our databases

View File

@ -123,10 +123,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (token.len[2] != 32) return (PARSER_HASH_LENGTH);
digest[0] = hex_to_u32 ((const u8 *) token.buf[2] + 0);
digest[1] = hex_to_u32 ((const u8 *) token.buf[2] + 8);
digest[2] = hex_to_u32 ((const u8 *) token.buf[2] + 16);
digest[3] = hex_to_u32 ((const u8 *) token.buf[2] + 24);
digest[0] = hex_to_u32 (token.buf[2] + 0);
digest[1] = hex_to_u32 (token.buf[2] + 8);
digest[2] = hex_to_u32 (token.buf[2] + 16);
digest[3] = hex_to_u32 (token.buf[2] + 24);
// salt

View File

@ -115,14 +115,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (token.len[2] != 64) return (PARSER_HASH_LENGTH);
digest[0] = hex_to_u32 ((const u8 *) token.buf[2] + 0);
digest[1] = hex_to_u32 ((const u8 *) token.buf[2] + 8);
digest[2] = hex_to_u32 ((const u8 *) token.buf[2] + 16);
digest[3] = hex_to_u32 ((const u8 *) token.buf[2] + 24);
digest[4] = hex_to_u32 ((const u8 *) token.buf[2] + 32);
digest[5] = hex_to_u32 ((const u8 *) token.buf[2] + 40);
digest[6] = hex_to_u32 ((const u8 *) token.buf[2] + 48);
digest[7] = hex_to_u32 ((const u8 *) token.buf[2] + 56);
digest[0] = hex_to_u32 (token.buf[2] + 0);
digest[1] = hex_to_u32 (token.buf[2] + 8);
digest[2] = hex_to_u32 (token.buf[2] + 16);
digest[3] = hex_to_u32 (token.buf[2] + 24);
digest[4] = hex_to_u32 (token.buf[2] + 32);
digest[5] = hex_to_u32 (token.buf[2] + 40);
digest[6] = hex_to_u32 (token.buf[2] + 48);
digest[7] = hex_to_u32 (token.buf[2] + 56);
// salt

View File

@ -118,14 +118,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (token.len[2] != 128) return (PARSER_HASH_LENGTH);
digest[0] = hex_to_u64 ((const u8 *) token.buf[2] + 0);
digest[1] = hex_to_u64 ((const u8 *) token.buf[2] + 16);
digest[2] = hex_to_u64 ((const u8 *) token.buf[2] + 32);
digest[3] = hex_to_u64 ((const u8 *) token.buf[2] + 48);
digest[4] = hex_to_u64 ((const u8 *) token.buf[2] + 64);
digest[5] = hex_to_u64 ((const u8 *) token.buf[2] + 80);
digest[6] = hex_to_u64 ((const u8 *) token.buf[2] + 96);
digest[7] = hex_to_u64 ((const u8 *) token.buf[2] + 112);
digest[0] = hex_to_u64 (token.buf[2] + 0);
digest[1] = hex_to_u64 (token.buf[2] + 16);
digest[2] = hex_to_u64 (token.buf[2] + 32);
digest[3] = hex_to_u64 (token.buf[2] + 48);
digest[4] = hex_to_u64 (token.buf[2] + 64);
digest[5] = hex_to_u64 (token.buf[2] + 80);
digest[6] = hex_to_u64 (token.buf[2] + 96);
digest[7] = hex_to_u64 (token.buf[2] + 112);
// salt

View File

@ -140,11 +140,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
digest[3] = byte_swap_32 (digest[3]);
digest[4] = byte_swap_32 (digest[4]);
const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) sha1_double_salt->salt1_buf, (int *) &sha1_double_salt->salt1_len);
const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) sha1_double_salt->salt1_buf, &sha1_double_salt->salt1_len);
if (parse_rc1 == false) return (PARSER_SALT_LENGTH);
const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) sha1_double_salt->salt2_buf, (int *) &sha1_double_salt->salt2_len);
const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) sha1_double_salt->salt2_buf, &sha1_double_salt->salt2_len);
if (parse_rc2 == false) return (PARSER_SALT_LENGTH);
@ -204,13 +204,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt1_buf, (const int) sha1_double_salt->salt1_len, out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt1_buf, sha1_double_salt->salt1_len, out_buf + out_len);
out_buf[out_len] = hashconfig->separator;
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt2_buf, (const int) sha1_double_salt->salt2_len, out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt2_buf, sha1_double_salt->salt2_len, out_buf + out_len);
return out_len;
}

View File

@ -132,11 +132,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
digest[3] = byte_swap_32 (digest[3]);
digest[4] = byte_swap_32 (digest[4]);
const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) devise_double_salt->salt_buf, (int *) &devise_double_salt->salt_len);
const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) devise_double_salt->salt_buf, &devise_double_salt->salt_len);
if (parse_rc1 == false) return (PARSER_SALT_LENGTH);
const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) devise_double_salt->site_key_buf, (int *) &devise_double_salt->site_key_len);
const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) devise_double_salt->site_key_buf, &devise_double_salt->site_key_len);
if (parse_rc2 == false) return (PARSER_SALT_LENGTH);
@ -196,13 +196,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) devise_double_salt->salt_buf, (const int) devise_double_salt->salt_len, out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) devise_double_salt->salt_buf, devise_double_salt->salt_len, out_buf + out_len);
out_buf[out_len] = hashconfig->separator;
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) devise_double_salt->site_key_buf, (const int) devise_double_salt->site_key_len, out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) devise_double_salt->site_key_buf, devise_double_salt->site_key_len, out_buf + out_len);
return out_len;
}

View File

@ -106,7 +106,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// assume no signature found
if (line_len < 12) return (PARSER_SALT_LENGTH);
char *spn_info_start = strchr ((const char *) line_buf + 12 + 1, '*');
char *spn_info_start = strchr (line_buf + 12 + 1, '*');
int is_spn_provided = 0;

View File

@ -106,7 +106,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// assume no signature found
if (line_len < 12) return (PARSER_SALT_LENGTH);
char *spn_info_start = strchr ((const char *) line_buf + 12 + 1, '*');
char *spn_info_start = strchr (line_buf + 12 + 1, '*');
int is_spn_provided = 0;

View File

@ -145,7 +145,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 tmp_buf[256] = { 0 };
const size_t salt_len_decoded = base64_decode (ab64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
const size_t salt_len_decoded = base64_decode (ab64_to_int, salt_pos, salt_len, tmp_buf);
u8 *salt_buf_ptr = (u8 *) pbkdf2_sha512->salt_buf;
memcpy (salt_buf_ptr, tmp_buf, salt_len_decoded);
@ -158,7 +158,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[4];
const int hash_len = token.len[4];
base64_decode (ab64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
base64_decode (ab64_to_int, hash_pos, hash_len, tmp_buf);
memcpy (digest, tmp_buf, HASH_LEN_RAW);
digest[0] = byte_swap_64 (digest[0]);

View File

@ -144,7 +144,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 tmp_buf[256] = { 0 };
const size_t salt_len_decoded = base64_decode (ab64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
const size_t salt_len_decoded = base64_decode (ab64_to_int, salt_pos, salt_len, tmp_buf);
u8 *salt_buf_ptr = (u8 *) pbkdf2_sha256->salt_buf;
memcpy (salt_buf_ptr, tmp_buf, salt_len_decoded);
@ -157,7 +157,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[4];
const int hash_len = token.len[4];
base64_decode (ab64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
base64_decode (ab64_to_int, hash_pos, hash_len, tmp_buf);
memcpy (digest, tmp_buf, HASH_LEN_RAW);
digest[0] = byte_swap_32 (digest[0]);

View File

@ -144,7 +144,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 tmp_buf[256] = { 0 };
const size_t salt_len_decoded = base64_decode (ab64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
const size_t salt_len_decoded = base64_decode (ab64_to_int, salt_pos, salt_len, tmp_buf);
u8 *salt_buf_ptr = (u8 *) pbkdf2_sha1->salt_buf;
memcpy (salt_buf_ptr, tmp_buf, salt_len_decoded);
@ -156,7 +156,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[4];
const int hash_len = token.len[4];
base64_decode (ab64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
base64_decode (ab64_to_int, hash_pos, hash_len, tmp_buf);
memcpy (digest, tmp_buf, HASH_LEN_RAW);
digest[0] = byte_swap_32 (digest[0]);

View File

@ -126,13 +126,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (md5_double_salt->salt1_buf, 0, sizeof (md5_double_salt->salt1_buf));
const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_double_salt->salt1_buf, (int *) &md5_double_salt->salt1_len);
const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_double_salt->salt1_buf, &md5_double_salt->salt1_len);
if (parse_rc1 == false) return (PARSER_SALT_LENGTH);
memset (md5_double_salt->salt2_buf, 0, sizeof (md5_double_salt->salt2_buf));
const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_double_salt->salt2_buf, (int *) &md5_double_salt->salt2_len);
const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_double_salt->salt2_buf, &md5_double_salt->salt2_len);
if (parse_rc2 == false) return (PARSER_SALT_LENGTH);
@ -197,7 +197,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt1_buf, (const int) md5_double_salt->salt1_len, out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt1_buf, md5_double_salt->salt1_len, out_buf + out_len);
out_buf[out_len] = hashconfig->separator;
@ -210,7 +210,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
salt2_buf[i] = byte_swap_32 (md5_double_salt->salt2_buf[i]);
}
out_len += generic_salt_encode (hashconfig, (const u8 *) salt2_buf, (const int) md5_double_salt->salt2_len, out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) salt2_buf, md5_double_salt->salt2_len, out_buf + out_len);
return out_len;
}

View File

@ -140,7 +140,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// hash
hex_decode ((const u8 *) token.buf[4], 40, (u8 *) digest);
hex_decode (token.buf[4], 40, (u8 *) digest);
return (PARSER_OK);
}
@ -159,7 +159,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += 1;
out_len += hex_encode ((const u8 *) digest, 20, (u8 *) out_buf + out_len);
out_len += hex_encode ((const u8 *) digest, 20, out_buf + out_len);
return out_len;
}

View File

@ -625,7 +625,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
wpa_t *wpa = (wpa_t *) esalt_buf;
const char *input_buf = (const char *) line_buf;
const char *input_buf = line_buf;
int input_len = line_len;
// start old pmkid/hccapx compatibility parsing
@ -683,7 +683,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tmp_len++;
tmp_len += hex_encode ((const u8 *) &hccapx->message_pair, 1, (u8 *) tmp_buf + tmp_len);
tmp_len += hex_encode (&hccapx->message_pair, 1, (u8 *) tmp_buf + tmp_len);
tmp_buf[tmp_len] = 0;
@ -942,7 +942,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 *eapol_ptr = (u8 *) wpa->eapol;
wpa->eapol_len = hex_decode ((const u8 *) eapol_pos, token.len[7], eapol_ptr);
wpa->eapol_len = hex_decode (eapol_pos, token.len[7], eapol_ptr);
memset (eapol_ptr + wpa->eapol_len, 0, (256 + 64) - wpa->eapol_len);

View File

@ -627,7 +627,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
wpa_t *wpa = (wpa_t *) esalt_buf;
const char *input_buf = (const char *) line_buf;
const char *input_buf = line_buf;
int input_len = line_len;
// start old pmkid/hccapx compatibility parsing
@ -685,7 +685,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tmp_len++;
tmp_len += hex_encode ((const u8 *) &hccapx->message_pair, 1, (u8 *) tmp_buf + tmp_len);
tmp_len += hex_encode (&hccapx->message_pair, 1, (u8 *) tmp_buf + tmp_len);
tmp_buf[tmp_len] = 0;
@ -943,7 +943,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 *eapol_ptr = (u8 *) wpa->eapol;
wpa->eapol_len = hex_decode ((const u8 *) eapol_pos, token.len[7], eapol_ptr);
wpa->eapol_len = hex_decode (eapol_pos, token.len[7], eapol_ptr);
memset (eapol_ptr + wpa->eapol_len, 0, (256 + 64) - wpa->eapol_len);

View File

@ -184,7 +184,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
byte_swap_32 (salt->salt_buf[1]),
pem->data_len);
out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, (u8 *) out_buf + out_len);
out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, out_buf + out_len);
return out_len;
}

View File

@ -185,7 +185,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
byte_swap_32 (salt->salt_buf[1]),
pem->data_len);
out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, (u8 *) out_buf + out_len);
out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, out_buf + out_len);
return out_len;
}

View File

@ -188,7 +188,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
byte_swap_32 (salt->salt_buf[3]),
pem->data_len);
out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, (u8 *) out_buf + out_len);
out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, out_buf + out_len);
return out_len;
}

View File

@ -188,7 +188,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
byte_swap_32 (salt->salt_buf[3]),
pem->data_len);
out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, (u8 *) out_buf + out_len);
out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, out_buf + out_len);
return out_len;
}

View File

@ -188,7 +188,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
byte_swap_32 (salt->salt_buf[3]),
pem->data_len);
out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, (u8 *) out_buf + out_len);
out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, out_buf + out_len);
return out_len;
}

View File

@ -142,7 +142,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[5];
const int salt_len = token.len[5];
salt->salt_len = hex_decode ((const u8 *) salt_pos, salt_len, (u8 *) salt->salt_buf);
salt->salt_len = hex_decode (salt_pos, salt_len, (u8 *) salt->salt_buf);
// salt length
@ -179,7 +179,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += 1;
out_len += hex_encode ((const u8 *) digest, 20, (u8 *) out_buf + out_len);
out_len += hex_encode ((const u8 *) digest, 20, out_buf + out_len);
return out_len;
}

View File

@ -295,7 +295,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
iv,
pkcs->data_len);
out_len += hex_encode ((const u8 *) pkcs->data_buf, pkcs->data_len, (u8 *) out_buf + out_len);
out_len += hex_encode ((const u8 *) pkcs->data_buf, pkcs->data_len, out_buf + out_len);
return out_len;
}

View File

@ -295,7 +295,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
iv,
pkcs->data_len);
out_len += hex_encode ((const u8 *) pkcs->data_buf, pkcs->data_len, (u8 *) out_buf + out_len);
out_len += hex_encode ((const u8 *) pkcs->data_buf, pkcs->data_len, out_buf + out_len);
return out_len;
}

View File

@ -155,7 +155,7 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len)
{
const char *input_buf = (const char *) line_buf;
const char *input_buf = line_buf;
int input_len = line_len;
// based on m22000 module_hash_decode() we detect both the hashformat with and without user-password

View File

@ -220,7 +220,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
base64_decode (bf64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
base64_decode (bf64_to_int, salt_pos, salt_len, tmp_buf);
memcpy (salt_buf_ptr, tmp_buf, 16);
@ -231,7 +231,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
base64_decode (bf64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
base64_decode (bf64_to_int, hash_pos, hash_len, tmp_buf);
memcpy (digest, tmp_buf, 24);

View File

@ -84,7 +84,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[0];
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[0]);
digest[0] = hex_to_u32 (&hash_pos[0]);
digest[1] = 0;
digest[2] = 0;
digest[3] = 0;
@ -96,7 +96,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1];
const int salt_len = token.len[1];
salt->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[0]);
salt->salt_buf[0] = hex_to_u32 (&salt_pos[0]);
salt->salt_buf[0] = byte_swap_32 (salt->salt_buf[0]);

View File

@ -220,7 +220,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
base64_decode (bf64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
base64_decode (bf64_to_int, salt_pos, salt_len, tmp_buf);
memcpy (salt_buf_ptr, tmp_buf, 16);
@ -231,7 +231,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
base64_decode (bf64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
base64_decode (bf64_to_int, hash_pos, hash_len, tmp_buf);
memcpy (digest, tmp_buf, 24);

View File

@ -179,13 +179,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u8 secure_session_identifier[2];
u8 public_value_xor[32];
hex_decode (secure_session_identifier_pos, secure_session_identifier_len, (u8 *) &secure_session_identifier);
hex_decode (public_value_xor_pos, public_value_xor_len, (u8 *) &public_value_xor);
hex_decode (secure_session_identifier_pos, secure_session_identifier_len, secure_session_identifier);
hex_decode (public_value_xor_pos, public_value_xor_len, public_value_xor);
digest[0] = hex_to_u32 ((const u8 *) &mac_pos[0]);
digest[1] = hex_to_u32 ((const u8 *) &mac_pos[8]);
digest[2] = hex_to_u32 ((const u8 *) &mac_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &mac_pos[24]);
digest[0] = hex_to_u32 (&mac_pos[0]);
digest[1] = hex_to_u32 (&mac_pos[8]);
digest[2] = hex_to_u32 (&mac_pos[16]);
digest[3] = hex_to_u32 (&mac_pos[24]);
u8 b1[16] = { 0x00, //-x Length of the associated data
0x28, //_|

View File

@ -92,7 +92,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (rc_tokenizer != PARSER_OK) return (rc_tokenizer);
const u8 *hash_pos = (const u8 *) token.buf[0];
const u8 *hash_pos = token.buf[0];
const u32 hash_len = token.len[0];
/*

View File

@ -136,7 +136,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt
const u8 *salt_pos = (const u8 *) token.buf[2];
const u8 *salt_pos = token.buf[2];
int salt_len = token.len[2];
salt->salt_buf[0] = hex_to_u32 (salt_pos + 0);

View File

@ -184,14 +184,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 *salt1_buf_ptr = (u32 *) vbox->salt1_buf;
salt1_buf_ptr[0] = hex_to_u32 ((const u8 *) &salt1_pos[ 0]);
salt1_buf_ptr[1] = hex_to_u32 ((const u8 *) &salt1_pos[ 8]);
salt1_buf_ptr[2] = hex_to_u32 ((const u8 *) &salt1_pos[16]);
salt1_buf_ptr[3] = hex_to_u32 ((const u8 *) &salt1_pos[24]);
salt1_buf_ptr[4] = hex_to_u32 ((const u8 *) &salt1_pos[32]);
salt1_buf_ptr[5] = hex_to_u32 ((const u8 *) &salt1_pos[40]);
salt1_buf_ptr[6] = hex_to_u32 ((const u8 *) &salt1_pos[48]);
salt1_buf_ptr[7] = hex_to_u32 ((const u8 *) &salt1_pos[56]);
salt1_buf_ptr[0] = hex_to_u32 (&salt1_pos[ 0]);
salt1_buf_ptr[1] = hex_to_u32 (&salt1_pos[ 8]);
salt1_buf_ptr[2] = hex_to_u32 (&salt1_pos[16]);
salt1_buf_ptr[3] = hex_to_u32 (&salt1_pos[24]);
salt1_buf_ptr[4] = hex_to_u32 (&salt1_pos[32]);
salt1_buf_ptr[5] = hex_to_u32 (&salt1_pos[40]);
salt1_buf_ptr[6] = hex_to_u32 (&salt1_pos[48]);
salt1_buf_ptr[7] = hex_to_u32 (&salt1_pos[56]);
vbox->salt1_len = salt1_len / 2;
@ -228,14 +228,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 *enc_pass_buf_ptr = (u32 *) vbox->enc_pass_buf;
enc_pass_buf_ptr[ 0] = hex_to_u32 ((const u8 *) &enc_pass_pos[ 0]);
enc_pass_buf_ptr[ 1] = hex_to_u32 ((const u8 *) &enc_pass_pos[ 8]);
enc_pass_buf_ptr[ 2] = hex_to_u32 ((const u8 *) &enc_pass_pos[16]);
enc_pass_buf_ptr[ 3] = hex_to_u32 ((const u8 *) &enc_pass_pos[24]);
enc_pass_buf_ptr[ 4] = hex_to_u32 ((const u8 *) &enc_pass_pos[32]);
enc_pass_buf_ptr[ 5] = hex_to_u32 ((const u8 *) &enc_pass_pos[40]);
enc_pass_buf_ptr[ 6] = hex_to_u32 ((const u8 *) &enc_pass_pos[48]);
enc_pass_buf_ptr[ 7] = hex_to_u32 ((const u8 *) &enc_pass_pos[56]);
enc_pass_buf_ptr[ 0] = hex_to_u32 (&enc_pass_pos[ 0]);
enc_pass_buf_ptr[ 1] = hex_to_u32 (&enc_pass_pos[ 8]);
enc_pass_buf_ptr[ 2] = hex_to_u32 (&enc_pass_pos[16]);
enc_pass_buf_ptr[ 3] = hex_to_u32 (&enc_pass_pos[24]);
enc_pass_buf_ptr[ 4] = hex_to_u32 (&enc_pass_pos[32]);
enc_pass_buf_ptr[ 5] = hex_to_u32 (&enc_pass_pos[40]);
enc_pass_buf_ptr[ 6] = hex_to_u32 (&enc_pass_pos[48]);
enc_pass_buf_ptr[ 7] = hex_to_u32 (&enc_pass_pos[56]);
// iter 2
@ -254,14 +254,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 *salt2_buf_ptr = (u32 *) vbox->salt2_buf;
salt2_buf_ptr[0] = hex_to_u32 ((const u8 *) &salt2_pos[ 0]);
salt2_buf_ptr[1] = hex_to_u32 ((const u8 *) &salt2_pos[ 8]);
salt2_buf_ptr[2] = hex_to_u32 ((const u8 *) &salt2_pos[16]);
salt2_buf_ptr[3] = hex_to_u32 ((const u8 *) &salt2_pos[24]);
salt2_buf_ptr[4] = hex_to_u32 ((const u8 *) &salt2_pos[32]);
salt2_buf_ptr[5] = hex_to_u32 ((const u8 *) &salt2_pos[40]);
salt2_buf_ptr[6] = hex_to_u32 ((const u8 *) &salt2_pos[48]);
salt2_buf_ptr[7] = hex_to_u32 ((const u8 *) &salt2_pos[56]);
salt2_buf_ptr[0] = hex_to_u32 (&salt2_pos[ 0]);
salt2_buf_ptr[1] = hex_to_u32 (&salt2_pos[ 8]);
salt2_buf_ptr[2] = hex_to_u32 (&salt2_pos[16]);
salt2_buf_ptr[3] = hex_to_u32 (&salt2_pos[24]);
salt2_buf_ptr[4] = hex_to_u32 (&salt2_pos[32]);
salt2_buf_ptr[5] = hex_to_u32 (&salt2_pos[40]);
salt2_buf_ptr[6] = hex_to_u32 (&salt2_pos[48]);
salt2_buf_ptr[7] = hex_to_u32 (&salt2_pos[56]);
vbox->salt2_len = salt2_len / 2;
@ -269,14 +269,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[7];
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]);
digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]);
digest[5] = hex_to_u32 ((const u8 *) &hash_pos[40]);
digest[6] = hex_to_u32 ((const u8 *) &hash_pos[48]);
digest[7] = hex_to_u32 ((const u8 *) &hash_pos[56]);
digest[0] = hex_to_u32 (&hash_pos[ 0]);
digest[1] = hex_to_u32 (&hash_pos[ 8]);
digest[2] = hex_to_u32 (&hash_pos[16]);
digest[3] = hex_to_u32 (&hash_pos[24]);
digest[4] = hex_to_u32 (&hash_pos[32]);
digest[5] = hex_to_u32 (&hash_pos[40]);
digest[6] = hex_to_u32 (&hash_pos[48]);
digest[7] = hex_to_u32 (&hash_pos[56]);
digest[0] = byte_swap_32 (digest[0]);
digest[1] = byte_swap_32 (digest[1]);

View File

@ -184,14 +184,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 *salt1_buf_ptr = (u32 *) vbox->salt1_buf;
salt1_buf_ptr[0] = hex_to_u32 ((const u8 *) &salt1_pos[ 0]);
salt1_buf_ptr[1] = hex_to_u32 ((const u8 *) &salt1_pos[ 8]);
salt1_buf_ptr[2] = hex_to_u32 ((const u8 *) &salt1_pos[16]);
salt1_buf_ptr[3] = hex_to_u32 ((const u8 *) &salt1_pos[24]);
salt1_buf_ptr[4] = hex_to_u32 ((const u8 *) &salt1_pos[32]);
salt1_buf_ptr[5] = hex_to_u32 ((const u8 *) &salt1_pos[40]);
salt1_buf_ptr[6] = hex_to_u32 ((const u8 *) &salt1_pos[48]);
salt1_buf_ptr[7] = hex_to_u32 ((const u8 *) &salt1_pos[56]);
salt1_buf_ptr[0] = hex_to_u32 (&salt1_pos[ 0]);
salt1_buf_ptr[1] = hex_to_u32 (&salt1_pos[ 8]);
salt1_buf_ptr[2] = hex_to_u32 (&salt1_pos[16]);
salt1_buf_ptr[3] = hex_to_u32 (&salt1_pos[24]);
salt1_buf_ptr[4] = hex_to_u32 (&salt1_pos[32]);
salt1_buf_ptr[5] = hex_to_u32 (&salt1_pos[40]);
salt1_buf_ptr[6] = hex_to_u32 (&salt1_pos[48]);
salt1_buf_ptr[7] = hex_to_u32 (&salt1_pos[56]);
vbox->salt1_len = salt1_len / 2;
@ -228,22 +228,22 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 *enc_pass_buf_ptr = (u32 *) vbox->enc_pass_buf;
enc_pass_buf_ptr[ 0] = hex_to_u32 ((const u8 *) &enc_pass_pos[ 0]);
enc_pass_buf_ptr[ 1] = hex_to_u32 ((const u8 *) &enc_pass_pos[ 8]);
enc_pass_buf_ptr[ 2] = hex_to_u32 ((const u8 *) &enc_pass_pos[16]);
enc_pass_buf_ptr[ 3] = hex_to_u32 ((const u8 *) &enc_pass_pos[24]);
enc_pass_buf_ptr[ 4] = hex_to_u32 ((const u8 *) &enc_pass_pos[32]);
enc_pass_buf_ptr[ 5] = hex_to_u32 ((const u8 *) &enc_pass_pos[40]);
enc_pass_buf_ptr[ 6] = hex_to_u32 ((const u8 *) &enc_pass_pos[48]);
enc_pass_buf_ptr[ 7] = hex_to_u32 ((const u8 *) &enc_pass_pos[56]);
enc_pass_buf_ptr[ 8] = hex_to_u32 ((const u8 *) &enc_pass_pos[64]);
enc_pass_buf_ptr[ 9] = hex_to_u32 ((const u8 *) &enc_pass_pos[72]);
enc_pass_buf_ptr[10] = hex_to_u32 ((const u8 *) &enc_pass_pos[80]);
enc_pass_buf_ptr[11] = hex_to_u32 ((const u8 *) &enc_pass_pos[88]);
enc_pass_buf_ptr[12] = hex_to_u32 ((const u8 *) &enc_pass_pos[96]);
enc_pass_buf_ptr[13] = hex_to_u32 ((const u8 *) &enc_pass_pos[104]);
enc_pass_buf_ptr[14] = hex_to_u32 ((const u8 *) &enc_pass_pos[112]);
enc_pass_buf_ptr[15] = hex_to_u32 ((const u8 *) &enc_pass_pos[120]);
enc_pass_buf_ptr[ 0] = hex_to_u32 (&enc_pass_pos[ 0]);
enc_pass_buf_ptr[ 1] = hex_to_u32 (&enc_pass_pos[ 8]);
enc_pass_buf_ptr[ 2] = hex_to_u32 (&enc_pass_pos[16]);
enc_pass_buf_ptr[ 3] = hex_to_u32 (&enc_pass_pos[24]);
enc_pass_buf_ptr[ 4] = hex_to_u32 (&enc_pass_pos[32]);
enc_pass_buf_ptr[ 5] = hex_to_u32 (&enc_pass_pos[40]);
enc_pass_buf_ptr[ 6] = hex_to_u32 (&enc_pass_pos[48]);
enc_pass_buf_ptr[ 7] = hex_to_u32 (&enc_pass_pos[56]);
enc_pass_buf_ptr[ 8] = hex_to_u32 (&enc_pass_pos[64]);
enc_pass_buf_ptr[ 9] = hex_to_u32 (&enc_pass_pos[72]);
enc_pass_buf_ptr[10] = hex_to_u32 (&enc_pass_pos[80]);
enc_pass_buf_ptr[11] = hex_to_u32 (&enc_pass_pos[88]);
enc_pass_buf_ptr[12] = hex_to_u32 (&enc_pass_pos[96]);
enc_pass_buf_ptr[13] = hex_to_u32 (&enc_pass_pos[104]);
enc_pass_buf_ptr[14] = hex_to_u32 (&enc_pass_pos[112]);
enc_pass_buf_ptr[15] = hex_to_u32 (&enc_pass_pos[120]);
// iter 2
@ -262,14 +262,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
u32 *salt2_buf_ptr = (u32 *) vbox->salt2_buf;
salt2_buf_ptr[0] = hex_to_u32 ((const u8 *) &salt2_pos[ 0]);
salt2_buf_ptr[1] = hex_to_u32 ((const u8 *) &salt2_pos[ 8]);
salt2_buf_ptr[2] = hex_to_u32 ((const u8 *) &salt2_pos[16]);
salt2_buf_ptr[3] = hex_to_u32 ((const u8 *) &salt2_pos[24]);
salt2_buf_ptr[4] = hex_to_u32 ((const u8 *) &salt2_pos[32]);
salt2_buf_ptr[5] = hex_to_u32 ((const u8 *) &salt2_pos[40]);
salt2_buf_ptr[6] = hex_to_u32 ((const u8 *) &salt2_pos[48]);
salt2_buf_ptr[7] = hex_to_u32 ((const u8 *) &salt2_pos[56]);
salt2_buf_ptr[0] = hex_to_u32 (&salt2_pos[ 0]);
salt2_buf_ptr[1] = hex_to_u32 (&salt2_pos[ 8]);
salt2_buf_ptr[2] = hex_to_u32 (&salt2_pos[16]);
salt2_buf_ptr[3] = hex_to_u32 (&salt2_pos[24]);
salt2_buf_ptr[4] = hex_to_u32 (&salt2_pos[32]);
salt2_buf_ptr[5] = hex_to_u32 (&salt2_pos[40]);
salt2_buf_ptr[6] = hex_to_u32 (&salt2_pos[48]);
salt2_buf_ptr[7] = hex_to_u32 (&salt2_pos[56]);
vbox->salt2_len = salt2_len / 2;
@ -277,14 +277,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[7];
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]);
digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]);
digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]);
digest[5] = hex_to_u32 ((const u8 *) &hash_pos[40]);
digest[6] = hex_to_u32 ((const u8 *) &hash_pos[48]);
digest[7] = hex_to_u32 ((const u8 *) &hash_pos[56]);
digest[0] = hex_to_u32 (&hash_pos[ 0]);
digest[1] = hex_to_u32 (&hash_pos[ 8]);
digest[2] = hex_to_u32 (&hash_pos[16]);
digest[3] = hex_to_u32 (&hash_pos[24]);
digest[4] = hex_to_u32 (&hash_pos[32]);
digest[5] = hex_to_u32 (&hash_pos[40]);
digest[6] = hex_to_u32 (&hash_pos[48]);
digest[7] = hex_to_u32 (&hash_pos[56]);
digest[0] = byte_swap_32 (digest[0]);
digest[1] = byte_swap_32 (digest[1]);

View File

@ -84,7 +84,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[0];
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[0]);
digest[0] = hex_to_u32 (&hash_pos[0]);
digest[1] = 0;
digest[2] = 0;
digest[3] = 0;
@ -96,7 +96,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1];
const int salt_len = token.len[1];
salt->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[0]);
salt->salt_buf[0] = hex_to_u32 (&salt_pos[0]);
salt->salt_buf[0] = byte_swap_32 (salt->salt_buf[0]);

View File

@ -362,7 +362,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
tmp_len = base64_decode (base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
tmp_len = base64_decode (base64_to_int, salt_pos, salt_len, tmp_buf);
memcpy (salt->salt_buf, tmp_buf, tmp_len);
@ -377,7 +377,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
tmp_len = base64_decode (base64_to_int, (const u8 *) iv_pos, iv_len, tmp_buf);
tmp_len = base64_decode (base64_to_int, iv_pos, iv_len, tmp_buf);
memcpy (exodus->iv, tmp_buf, tmp_len);
@ -390,7 +390,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
tmp_len = base64_decode (base64_to_int, (const u8 *) data_pos, data_len, tmp_buf);
tmp_len = base64_decode (base64_to_int, data_pos, data_len, tmp_buf);
memcpy (exodus->data, tmp_buf, tmp_len);
@ -403,7 +403,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
tmp_len = base64_decode (base64_to_int, (const u8 *) tag_pos, tag_len, tmp_buf);
tmp_len = base64_decode (base64_to_int, tag_pos, tag_len, tmp_buf);
memcpy (exodus->tag, tmp_buf, tmp_len);

View File

@ -220,7 +220,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
base64_decode (bf64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf);
base64_decode (bf64_to_int, salt_pos, salt_len, tmp_buf);
memcpy (salt_buf_ptr, tmp_buf, 16);
@ -231,7 +231,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
memset (tmp_buf, 0, sizeof (tmp_buf));
base64_decode (bf64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf);
base64_decode (bf64_to_int, hash_pos, hash_len, tmp_buf);
memcpy (digest, tmp_buf, 24);

View File

@ -155,7 +155,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// date
parse_rc = generic_salt_decode (hashconfig, (const u8 *) longdate_pos, 8, (u8 *) esalt->date, (int *) &esalt->date_len);
parse_rc = generic_salt_decode (hashconfig, longdate_pos, 8, (u8 *) esalt->date, (int *) &esalt->date_len);
if (parse_rc == false) return (PARSER_SALT_LENGTH);

View File

@ -116,7 +116,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// assume no signature found
if (line_len < 11) return (PARSER_SALT_LENGTH);
char *spn_info_start = strchr ((const char *) line_buf + 11 + 1, '*');
char *spn_info_start = strchr (line_buf + 11 + 1, '*');
int is_spn_provided = 0;

View File

@ -116,7 +116,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// assume no signature found
if (line_len < 11) return (PARSER_SALT_LENGTH);
char *spn_info_start = strchr ((const char *) line_buf + 11 + 1, '*');
char *spn_info_start = strchr (line_buf + 11 + 1, '*');
int is_spn_provided = 0;

View File

@ -122,11 +122,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
digest[4] -= SHA1M_E;
}
const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) sha1_double_salt->salt1_buf, (int *) &sha1_double_salt->salt1_len);
const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) sha1_double_salt->salt1_buf, &sha1_double_salt->salt1_len);
if (parse_rc1 == false) return (PARSER_SALT_LENGTH);
const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) sha1_double_salt->salt2_buf, (int *) &sha1_double_salt->salt2_len);
const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) sha1_double_salt->salt2_buf, &sha1_double_salt->salt2_len);
if (parse_rc2 == false) return (PARSER_SALT_LENGTH);
@ -195,13 +195,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt1_buf, (const int) sha1_double_salt->salt1_len, out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt1_buf, sha1_double_salt->salt1_len, out_buf + out_len);
out_buf[out_len] = hashconfig->separator;
out_len += 1;
out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt2_buf, (const int) sha1_double_salt->salt2_len, out_buf + out_len);
out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt2_buf, sha1_double_salt->salt2_len, out_buf + out_len);
return out_len;
}

View File

@ -292,10 +292,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *final_random_seed_pos = token.buf[4];
keepass->final_random_seed[0] = hex_to_u32 ((const u8 *) &final_random_seed_pos[ 0]);
keepass->final_random_seed[1] = hex_to_u32 ((const u8 *) &final_random_seed_pos[ 8]);
keepass->final_random_seed[2] = hex_to_u32 ((const u8 *) &final_random_seed_pos[16]);
keepass->final_random_seed[3] = hex_to_u32 ((const u8 *) &final_random_seed_pos[24]);
keepass->final_random_seed[0] = hex_to_u32 (&final_random_seed_pos[ 0]);
keepass->final_random_seed[1] = hex_to_u32 (&final_random_seed_pos[ 8]);
keepass->final_random_seed[2] = hex_to_u32 (&final_random_seed_pos[16]);
keepass->final_random_seed[3] = hex_to_u32 (&final_random_seed_pos[24]);
keepass->final_random_seed[0] = byte_swap_32 (keepass->final_random_seed[0]);
keepass->final_random_seed[1] = byte_swap_32 (keepass->final_random_seed[1]);
@ -304,10 +304,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (keepass->version == 2)
{
keepass->final_random_seed[4] = hex_to_u32 ((const u8 *) &final_random_seed_pos[32]);
keepass->final_random_seed[5] = hex_to_u32 ((const u8 *) &final_random_seed_pos[40]);
keepass->final_random_seed[6] = hex_to_u32 ((const u8 *) &final_random_seed_pos[48]);
keepass->final_random_seed[7] = hex_to_u32 ((const u8 *) &final_random_seed_pos[56]);
keepass->final_random_seed[4] = hex_to_u32 (&final_random_seed_pos[32]);
keepass->final_random_seed[5] = hex_to_u32 (&final_random_seed_pos[40]);
keepass->final_random_seed[6] = hex_to_u32 (&final_random_seed_pos[48]);
keepass->final_random_seed[7] = hex_to_u32 (&final_random_seed_pos[56]);
keepass->final_random_seed[4] = byte_swap_32 (keepass->final_random_seed[4]);
keepass->final_random_seed[5] = byte_swap_32 (keepass->final_random_seed[5]);
@ -319,14 +319,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *transf_random_seed_pos = token.buf[5];
keepass->transf_random_seed[0] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[ 0]);
keepass->transf_random_seed[1] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[ 8]);
keepass->transf_random_seed[2] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[16]);
keepass->transf_random_seed[3] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[24]);
keepass->transf_random_seed[4] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[32]);
keepass->transf_random_seed[5] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[40]);
keepass->transf_random_seed[6] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[48]);
keepass->transf_random_seed[7] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[56]);
keepass->transf_random_seed[0] = hex_to_u32 (&transf_random_seed_pos[ 0]);
keepass->transf_random_seed[1] = hex_to_u32 (&transf_random_seed_pos[ 8]);
keepass->transf_random_seed[2] = hex_to_u32 (&transf_random_seed_pos[16]);
keepass->transf_random_seed[3] = hex_to_u32 (&transf_random_seed_pos[24]);
keepass->transf_random_seed[4] = hex_to_u32 (&transf_random_seed_pos[32]);
keepass->transf_random_seed[5] = hex_to_u32 (&transf_random_seed_pos[40]);
keepass->transf_random_seed[6] = hex_to_u32 (&transf_random_seed_pos[48]);
keepass->transf_random_seed[7] = hex_to_u32 (&transf_random_seed_pos[56]);
keepass->transf_random_seed[0] = byte_swap_32 (keepass->transf_random_seed[0]);
keepass->transf_random_seed[1] = byte_swap_32 (keepass->transf_random_seed[1]);
@ -341,10 +341,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *enc_iv_pos = token.buf[6];
keepass->enc_iv[0] = hex_to_u32 ((const u8 *) &enc_iv_pos[ 0]);
keepass->enc_iv[1] = hex_to_u32 ((const u8 *) &enc_iv_pos[ 8]);
keepass->enc_iv[2] = hex_to_u32 ((const u8 *) &enc_iv_pos[16]);
keepass->enc_iv[3] = hex_to_u32 ((const u8 *) &enc_iv_pos[24]);
keepass->enc_iv[0] = hex_to_u32 (&enc_iv_pos[ 0]);
keepass->enc_iv[1] = hex_to_u32 (&enc_iv_pos[ 8]);
keepass->enc_iv[2] = hex_to_u32 (&enc_iv_pos[16]);
keepass->enc_iv[3] = hex_to_u32 (&enc_iv_pos[24]);
keepass->enc_iv[0] = byte_swap_32 (keepass->enc_iv[0]);
keepass->enc_iv[1] = byte_swap_32 (keepass->enc_iv[1]);
@ -359,14 +359,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *contents_hash_pos = token.buf[7];
keepass->contents_hash[0] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 0]);
keepass->contents_hash[1] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 8]);
keepass->contents_hash[2] = hex_to_u32 ((const u8 *) &contents_hash_pos[16]);
keepass->contents_hash[3] = hex_to_u32 ((const u8 *) &contents_hash_pos[24]);
keepass->contents_hash[4] = hex_to_u32 ((const u8 *) &contents_hash_pos[32]);
keepass->contents_hash[5] = hex_to_u32 ((const u8 *) &contents_hash_pos[40]);
keepass->contents_hash[6] = hex_to_u32 ((const u8 *) &contents_hash_pos[48]);
keepass->contents_hash[7] = hex_to_u32 ((const u8 *) &contents_hash_pos[56]);
keepass->contents_hash[0] = hex_to_u32 (&contents_hash_pos[ 0]);
keepass->contents_hash[1] = hex_to_u32 (&contents_hash_pos[ 8]);
keepass->contents_hash[2] = hex_to_u32 (&contents_hash_pos[16]);
keepass->contents_hash[3] = hex_to_u32 (&contents_hash_pos[24]);
keepass->contents_hash[4] = hex_to_u32 (&contents_hash_pos[32]);
keepass->contents_hash[5] = hex_to_u32 (&contents_hash_pos[40]);
keepass->contents_hash[6] = hex_to_u32 (&contents_hash_pos[48]);
keepass->contents_hash[7] = hex_to_u32 (&contents_hash_pos[56]);
keepass->contents_hash[0] = byte_swap_32 (keepass->contents_hash[0]);
keepass->contents_hash[1] = byte_swap_32 (keepass->contents_hash[1]);
@ -386,7 +386,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; j < contents_len; i += 1, j += 8)
{
keepass->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[j]);
keepass->contents[i] = hex_to_u32 (&contents_pos[j]);
keepass->contents[i] = byte_swap_32 (keepass->contents[i]);
}
@ -402,14 +402,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *expected_bytes_pos = token.buf[7];
keepass->expected_bytes[0] = hex_to_u32 ((const u8 *) &expected_bytes_pos[ 0]);
keepass->expected_bytes[1] = hex_to_u32 ((const u8 *) &expected_bytes_pos[ 8]);
keepass->expected_bytes[2] = hex_to_u32 ((const u8 *) &expected_bytes_pos[16]);
keepass->expected_bytes[3] = hex_to_u32 ((const u8 *) &expected_bytes_pos[24]);
keepass->expected_bytes[4] = hex_to_u32 ((const u8 *) &expected_bytes_pos[32]);
keepass->expected_bytes[5] = hex_to_u32 ((const u8 *) &expected_bytes_pos[40]);
keepass->expected_bytes[6] = hex_to_u32 ((const u8 *) &expected_bytes_pos[48]);
keepass->expected_bytes[7] = hex_to_u32 ((const u8 *) &expected_bytes_pos[56]);
keepass->expected_bytes[0] = hex_to_u32 (&expected_bytes_pos[ 0]);
keepass->expected_bytes[1] = hex_to_u32 (&expected_bytes_pos[ 8]);
keepass->expected_bytes[2] = hex_to_u32 (&expected_bytes_pos[16]);
keepass->expected_bytes[3] = hex_to_u32 (&expected_bytes_pos[24]);
keepass->expected_bytes[4] = hex_to_u32 (&expected_bytes_pos[32]);
keepass->expected_bytes[5] = hex_to_u32 (&expected_bytes_pos[40]);
keepass->expected_bytes[6] = hex_to_u32 (&expected_bytes_pos[48]);
keepass->expected_bytes[7] = hex_to_u32 (&expected_bytes_pos[56]);
keepass->expected_bytes[0] = byte_swap_32 (keepass->expected_bytes[0]);
keepass->expected_bytes[1] = byte_swap_32 (keepass->expected_bytes[1]);
@ -424,14 +424,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *contents_hash_pos = token.buf[8];
keepass->contents_hash[0] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 0]);
keepass->contents_hash[1] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 8]);
keepass->contents_hash[2] = hex_to_u32 ((const u8 *) &contents_hash_pos[16]);
keepass->contents_hash[3] = hex_to_u32 ((const u8 *) &contents_hash_pos[24]);
keepass->contents_hash[4] = hex_to_u32 ((const u8 *) &contents_hash_pos[32]);
keepass->contents_hash[5] = hex_to_u32 ((const u8 *) &contents_hash_pos[40]);
keepass->contents_hash[6] = hex_to_u32 ((const u8 *) &contents_hash_pos[48]);
keepass->contents_hash[7] = hex_to_u32 ((const u8 *) &contents_hash_pos[56]);
keepass->contents_hash[0] = hex_to_u32 (&contents_hash_pos[ 0]);
keepass->contents_hash[1] = hex_to_u32 (&contents_hash_pos[ 8]);
keepass->contents_hash[2] = hex_to_u32 (&contents_hash_pos[16]);
keepass->contents_hash[3] = hex_to_u32 (&contents_hash_pos[24]);
keepass->contents_hash[4] = hex_to_u32 (&contents_hash_pos[32]);
keepass->contents_hash[5] = hex_to_u32 (&contents_hash_pos[40]);
keepass->contents_hash[6] = hex_to_u32 (&contents_hash_pos[48]);
keepass->contents_hash[7] = hex_to_u32 (&contents_hash_pos[56]);
keepass->contents_hash[0] = byte_swap_32 (keepass->contents_hash[0]);
keepass->contents_hash[1] = byte_swap_32 (keepass->contents_hash[1]);
@ -452,14 +452,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
keepass->keyfile_len = 32;
keepass->keyfile[0] = hex_to_u32 ((const u8 *) &keyfile_pos[ 0]);
keepass->keyfile[1] = hex_to_u32 ((const u8 *) &keyfile_pos[ 8]);
keepass->keyfile[2] = hex_to_u32 ((const u8 *) &keyfile_pos[16]);
keepass->keyfile[3] = hex_to_u32 ((const u8 *) &keyfile_pos[24]);
keepass->keyfile[4] = hex_to_u32 ((const u8 *) &keyfile_pos[32]);
keepass->keyfile[5] = hex_to_u32 ((const u8 *) &keyfile_pos[40]);
keepass->keyfile[6] = hex_to_u32 ((const u8 *) &keyfile_pos[48]);
keepass->keyfile[7] = hex_to_u32 ((const u8 *) &keyfile_pos[56]);
keepass->keyfile[0] = hex_to_u32 (&keyfile_pos[ 0]);
keepass->keyfile[1] = hex_to_u32 (&keyfile_pos[ 8]);
keepass->keyfile[2] = hex_to_u32 (&keyfile_pos[16]);
keepass->keyfile[3] = hex_to_u32 (&keyfile_pos[24]);
keepass->keyfile[4] = hex_to_u32 (&keyfile_pos[32]);
keepass->keyfile[5] = hex_to_u32 (&keyfile_pos[40]);
keepass->keyfile[6] = hex_to_u32 (&keyfile_pos[48]);
keepass->keyfile[7] = hex_to_u32 (&keyfile_pos[56]);
keepass->keyfile[0] = byte_swap_32 (keepass->keyfile[0]);
keepass->keyfile[1] = byte_swap_32 (keepass->keyfile[1]);

View File

@ -170,15 +170,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *iv_pos = token.buf[3];
encdatavault->iv[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[0]));
encdatavault->iv[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[8]));
encdatavault->iv[0] = byte_swap_32 (hex_to_u32 (&iv_pos[0]));
encdatavault->iv[1] = byte_swap_32 (hex_to_u32 (&iv_pos[8]));
// ct
const u8 *ct_pos = token.buf[4];
encdatavault->ct[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[0]));
encdatavault->ct[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[8]));
encdatavault->ct[0] = byte_swap_32 (hex_to_u32 (&ct_pos[0]));
encdatavault->ct[1] = byte_swap_32 (hex_to_u32 (&ct_pos[8]));
// salt length
@ -192,14 +192,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[6];
salt->salt_buf[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[ 0]));
salt->salt_buf[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[ 8]));
salt->salt_buf[2] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[16]));
salt->salt_buf[3] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[24]));
salt->salt_buf[4] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[32]));
salt->salt_buf[5] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[40]));
salt->salt_buf[6] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[48]));
salt->salt_buf[7] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[56]));
salt->salt_buf[0] = byte_swap_32 (hex_to_u32 (&salt_pos[ 0]));
salt->salt_buf[1] = byte_swap_32 (hex_to_u32 (&salt_pos[ 8]));
salt->salt_buf[2] = byte_swap_32 (hex_to_u32 (&salt_pos[16]));
salt->salt_buf[3] = byte_swap_32 (hex_to_u32 (&salt_pos[24]));
salt->salt_buf[4] = byte_swap_32 (hex_to_u32 (&salt_pos[32]));
salt->salt_buf[5] = byte_swap_32 (hex_to_u32 (&salt_pos[40]));
salt->salt_buf[6] = byte_swap_32 (hex_to_u32 (&salt_pos[48]));
salt->salt_buf[7] = byte_swap_32 (hex_to_u32 (&salt_pos[56]));
salt->salt_len = 32;

View File

@ -176,15 +176,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *iv_pos = token.buf[3];
encdatavault->iv[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[0]));
encdatavault->iv[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[8]));
encdatavault->iv[0] = byte_swap_32 (hex_to_u32 (&iv_pos[0]));
encdatavault->iv[1] = byte_swap_32 (hex_to_u32 (&iv_pos[8]));
// ct
const u8 *ct_pos = token.buf[4];
encdatavault->ct[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[0]));
encdatavault->ct[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[8]));
encdatavault->ct[0] = byte_swap_32 (hex_to_u32 (&ct_pos[0]));
encdatavault->ct[1] = byte_swap_32 (hex_to_u32 (&ct_pos[8]));
// salt length
@ -198,14 +198,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[6];
salt->salt_buf[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[ 0]));
salt->salt_buf[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[ 8]));
salt->salt_buf[2] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[16]));
salt->salt_buf[3] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[24]));
salt->salt_buf[4] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[32]));
salt->salt_buf[5] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[40]));
salt->salt_buf[6] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[48]));
salt->salt_buf[7] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[56]));
salt->salt_buf[0] = byte_swap_32 (hex_to_u32 (&salt_pos[ 0]));
salt->salt_buf[1] = byte_swap_32 (hex_to_u32 (&salt_pos[ 8]));
salt->salt_buf[2] = byte_swap_32 (hex_to_u32 (&salt_pos[16]));
salt->salt_buf[3] = byte_swap_32 (hex_to_u32 (&salt_pos[24]));
salt->salt_buf[4] = byte_swap_32 (hex_to_u32 (&salt_pos[32]));
salt->salt_buf[5] = byte_swap_32 (hex_to_u32 (&salt_pos[40]));
salt->salt_buf[6] = byte_swap_32 (hex_to_u32 (&salt_pos[48]));
salt->salt_buf[7] = byte_swap_32 (hex_to_u32 (&salt_pos[56]));
salt->salt_len = 32;
@ -221,7 +221,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; i < 32; i += 1, j+= 8)
{
encdatavault->keychain[i] = byte_swap_32 (hex_to_u32 ((const u8 *) &keychain_pos[j]));
encdatavault->keychain[i] = byte_swap_32 (hex_to_u32 (&keychain_pos[j]));
}
// hash

View File

@ -149,15 +149,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *iv_pos = token.buf[3];
encdatavault->iv[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[0]));
encdatavault->iv[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[8]));
encdatavault->iv[0] = byte_swap_32 (hex_to_u32 (&iv_pos[0]));
encdatavault->iv[1] = byte_swap_32 (hex_to_u32 (&iv_pos[8]));
// ct
const u8 *ct_pos = token.buf[4];
encdatavault->ct[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[0]));
encdatavault->ct[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[8]));
encdatavault->ct[0] = byte_swap_32 (hex_to_u32 (&ct_pos[0]));
encdatavault->ct[1] = byte_swap_32 (hex_to_u32 (&ct_pos[8]));
// salt fixed

View File

@ -154,15 +154,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *iv_pos = token.buf[3];
encdatavault->iv[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[0]));
encdatavault->iv[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[8]));
encdatavault->iv[0] = byte_swap_32 (hex_to_u32 (&iv_pos[0]));
encdatavault->iv[1] = byte_swap_32 (hex_to_u32 (&iv_pos[8]));
// ct
const u8 *ct_pos = token.buf[4];
encdatavault->ct[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[0]));
encdatavault->ct[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[8]));
encdatavault->ct[0] = byte_swap_32 (hex_to_u32 (&ct_pos[0]));
encdatavault->ct[1] = byte_swap_32 (hex_to_u32 (&ct_pos[8]));
// keychain
@ -170,7 +170,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int i = 0, j = 0; i < 32; i += 1, j+= 8)
{
encdatavault->keychain[i] = byte_swap_32 (hex_to_u32 ((const u8 *) &keychain_pos[j]));
encdatavault->keychain[i] = byte_swap_32 (hex_to_u32 (&keychain_pos[j]));
}
// salt fixed

Some files were not shown because too many files have changed in this diff Show More