From 795674c939058653373790d9db15f4a349121fa7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 18 Aug 2023 12:22:13 -0700 Subject: [PATCH 1/2] fix some const-qual warnings Signed-off-by: Rosen Penev --- OpenCL/inc_hash_base58.cl | 10 +++++----- src/backend.c | 4 ++-- src/debugfile.c | 4 ++-- src/dispatch.c | 8 ++++---- src/loopback.c | 2 +- src/modules/module_00022.c | 2 +- src/modules/module_00400.c | 2 +- src/modules/module_01500.c | 2 +- src/modules/module_02500.c | 8 ++++---- src/modules/module_02501.c | 8 ++++---- src/modules/module_03200.c | 2 +- src/modules/module_05500.c | 6 ++---- src/modules/module_05600.c | 6 ++---- src/modules/module_07200.c | 2 +- src/modules/module_07300.c | 2 +- src/modules/module_07400.c | 2 +- src/modules/module_07401.c | 2 +- src/modules/module_07500.c | 10 +++++----- src/modules/module_07900.c | 4 ++-- src/modules/module_08300.c | 2 +- src/modules/module_09200.c | 4 ++-- src/modules/module_09300.c | 2 +- src/modules/module_09600.c | 2 +- src/modules/module_09800.c | 2 +- src/modules/module_09810.c | 2 +- src/modules/module_09820.c | 2 +- src/modules/module_10200.c | 2 +- src/modules/module_10400.c | 2 +- src/modules/module_10410.c | 2 +- src/modules/module_10420.c | 2 +- src/modules/module_10500.c | 4 ++-- src/modules/module_10901.c | 2 +- src/modules/module_11600.c | 14 +++++++------- src/modules/module_13100.c | 8 ++++---- src/modules/module_13400.c | 16 ++++++++-------- src/modules/module_13711.c | 4 ++-- src/modules/module_13712.c | 4 ++-- src/modules/module_13713.c | 4 ++-- src/modules/module_13721.c | 4 ++-- src/modules/module_13722.c | 4 ++-- src/modules/module_13723.c | 4 ++-- src/modules/module_13731.c | 4 ++-- src/modules/module_13732.c | 4 ++-- src/modules/module_13733.c | 4 ++-- src/modules/module_13751.c | 4 ++-- src/modules/module_13752.c | 4 ++-- src/modules/module_13753.c | 4 ++-- src/modules/module_13771.c | 4 ++-- src/modules/module_13772.c | 4 ++-- src/modules/module_13773.c | 4 ++-- src/modules/module_14500.c | 4 ++-- src/modules/module_15300.c | 6 +++--- src/modules/module_15310.c | 6 +++--- src/modules/module_15500.c | 6 +++--- src/modules/module_15700.c | 2 +- src/modules/module_15900.c | 6 +++--- src/modules/module_15910.c | 6 +++--- src/modules/module_16500.c | 2 +- src/modules/module_18200.c | 10 +++++----- src/modules/module_18300.c | 2 +- src/modules/module_19600.c | 6 +++--- src/modules/module_19700.c | 6 +++--- src/modules/module_19800.c | 6 +++--- src/modules/module_19900.c | 6 +++--- src/modules/module_20510.c | 4 ++-- src/modules/module_20600.c | 2 +- src/modules/module_21310.c | 2 +- src/modules/module_21500.c | 4 ++-- src/modules/module_21501.c | 6 +++--- src/modules/module_21700.c | 4 ++-- src/modules/module_21800.c | 4 ++-- src/modules/module_22000.c | 4 ++-- src/modules/module_22001.c | 4 ++-- src/modules/module_22100.c | 2 +- src/modules/module_22400.c | 2 +- src/modules/module_22911.c | 2 +- src/modules/module_22921.c | 2 +- src/modules/module_22931.c | 2 +- src/modules/module_22941.c | 2 +- src/modules/module_22951.c | 2 +- src/modules/module_23001.c | 4 ++-- src/modules/module_23002.c | 4 ++-- src/modules/module_23003.c | 4 ++-- src/modules/module_23100.c | 6 +++--- src/modules/module_23300.c | 4 ++-- src/modules/module_23500.c | 2 +- src/modules/module_23600.c | 2 +- src/modules/module_23800.c | 10 +++++----- src/modules/module_23900.c | 2 +- src/modules/module_24100.c | 6 +++--- src/modules/module_24200.c | 6 +++--- src/modules/module_24410.c | 2 +- src/modules/module_24420.c | 2 +- src/modules/module_24600.c | 2 +- src/modules/module_25000.c | 10 +++++----- src/modules/module_25100.c | 10 +++++----- src/modules/module_25200.c | 10 +++++----- src/modules/module_25400.c | 22 +++++++++++----------- src/modules/module_25500.c | 2 +- src/modules/module_25600.c | 2 +- src/modules/module_25800.c | 2 +- src/modules/module_25900.c | 4 ++-- src/modules/module_26200.c | 4 ++-- src/modules/module_26600.c | 2 +- src/modules/module_26700.c | 10 +++++----- src/modules/module_26800.c | 10 +++++----- src/modules/module_26900.c | 12 ++++++------ src/modules/module_27000.c | 6 ++---- src/modules/module_27100.c | 6 +++--- src/modules/module_27300.c | 10 +++++----- src/modules/module_27400.c | 4 ++-- src/modules/module_28000.c | 2 +- src/modules/module_28400.c | 2 +- src/modules/module_28501.c | 4 ++-- src/modules/module_28502.c | 4 ++-- src/modules/module_28503.c | 2 +- src/modules/module_28504.c | 2 +- src/modules/module_28505.c | 4 ++-- src/modules/module_28506.c | 4 ++-- src/modules/module_28600.c | 6 +++--- src/modules/module_28700.c | 8 ++++---- src/modules/module_28800.c | 4 ++-- src/modules/module_28900.c | 4 ++-- src/modules/module_29100.c | 2 +- src/modules/module_29200.c | 2 +- src/modules/module_29311.c | 2 +- src/modules/module_29312.c | 2 +- src/modules/module_29313.c | 2 +- src/modules/module_29321.c | 2 +- src/modules/module_29322.c | 2 +- src/modules/module_29323.c | 2 +- src/modules/module_29331.c | 2 +- src/modules/module_29332.c | 2 +- src/modules/module_29333.c | 2 +- src/modules/module_29341.c | 2 +- src/modules/module_29342.c | 2 +- src/modules/module_29343.c | 2 +- src/modules/module_29411.c | 6 +++--- src/modules/module_29412.c | 6 +++--- src/modules/module_29413.c | 6 +++--- src/modules/module_29421.c | 6 +++--- src/modules/module_29422.c | 6 +++--- src/modules/module_29423.c | 6 +++--- src/modules/module_29431.c | 6 +++--- src/modules/module_29432.c | 6 +++--- src/modules/module_29433.c | 6 +++--- src/modules/module_29441.c | 2 +- src/modules/module_29442.c | 2 +- src/modules/module_29443.c | 2 +- src/modules/module_29451.c | 6 +++--- src/modules/module_29452.c | 6 +++--- src/modules/module_29453.c | 6 +++--- src/modules/module_29461.c | 2 +- src/modules/module_29462.c | 2 +- src/modules/module_29463.c | 2 +- src/modules/module_29471.c | 6 +++--- src/modules/module_29472.c | 6 +++--- src/modules/module_29473.c | 6 +++--- src/modules/module_29481.c | 2 +- src/modules/module_29482.c | 2 +- src/modules/module_29483.c | 2 +- src/modules/module_29511.c | 4 ++-- src/modules/module_29512.c | 4 ++-- src/modules/module_29513.c | 4 ++-- src/modules/module_29521.c | 4 ++-- src/modules/module_29522.c | 4 ++-- src/modules/module_29523.c | 4 ++-- src/modules/module_29531.c | 4 ++-- src/modules/module_29532.c | 4 ++-- src/modules/module_29533.c | 4 ++-- src/modules/module_29541.c | 4 ++-- src/modules/module_29542.c | 4 ++-- src/modules/module_29543.c | 4 ++-- src/modules/module_29600.c | 6 +++--- src/modules/module_29700.c | 16 ++++++++-------- src/modules/module_30600.c | 2 +- src/modules/module_30901.c | 4 ++-- src/modules/module_30902.c | 4 ++-- src/modules/module_30903.c | 2 +- src/modules/module_30904.c | 2 +- src/modules/module_30905.c | 4 ++-- src/modules/module_30906.c | 4 ++-- src/modules/module_31400.c | 2 +- src/modules/module_31800.c | 8 ++++---- src/modules/module_31900.c | 4 ++-- src/modules/module_32020.c | 2 +- src/modules/module_32030.c | 2 +- src/modules/module_32040.c | 2 +- src/modules/module_32050.c | 4 ++-- src/modules/module_32060.c | 4 ++-- src/modules/module_32070.c | 6 +++--- src/modules/module_32100.c | 8 ++++---- src/modules/module_32200.c | 8 ++++---- src/modules/module_32300.c | 4 ++-- src/modules/module_99999.c | 2 +- 195 files changed, 421 insertions(+), 427 deletions(-) diff --git a/OpenCL/inc_hash_base58.cl b/OpenCL/inc_hash_base58.cl index 1396c6e07..a6733ed68 100644 --- a/OpenCL/inc_hash_base58.cl +++ b/OpenCL/inc_hash_base58.cl @@ -69,7 +69,7 @@ DECLSPEC bool b58dec (PRIVATE_AS u8 *bin, PRIVATE_AS u32 *binszp, PRIVATE_AS con { u32 binsz = *binszp; - PRIVATE_AS const u8 *b58u = (PRIVATE_AS u8*) b58; + PRIVATE_AS const u8 *b58u = (PRIVATE_AS const u8*) b58; PRIVATE_AS u8 *binu = (PRIVATE_AS u8*) bin; u32 outisz = (binsz + sizeof (u32) - 1) / sizeof (u32); @@ -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 u8 *binc = (PRIVATE_AS u8*) bin; + PRIVATE_AS const u8 *binc = (PRIVATE_AS const u8*) 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 u8 *sum = (PRIVATE_AS u8*) (binc + (binsz - 4)); // offset: binsz - 4, last 4 bytes + PRIVATE_AS const u8 *sum = (PRIVATE_AS const u8*) (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 u8 *) data; + PRIVATE_AS const u8 *bin = (PRIVATE_AS const u8 *) 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 u8 *data8 = (PRIVATE_AS u8 *) data; + PRIVATE_AS const u8 *data8 = (PRIVATE_AS const u8 *) data; PRIVATE_AS u8 *hash = &buf[1 + datasz]; diff --git a/src/backend.c b/src/backend.c index f6cda270c..91f425fcb 100644 --- a/src/backend.c +++ b/src/backend.c @@ -2031,8 +2031,8 @@ int run_opencl_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *devi cl_kernel kernel = device_param->opencl_kernel_bzero; - if (hc_clSetKernelArg (hashcat_ctx, kernel, 0, sizeof (cl_mem), (void *) &buf) == -1) return -1; - if (hc_clSetKernelArg (hashcat_ctx, kernel, 1, sizeof (cl_ulong), (void *) &num16d) == -1) return -1; + if (hc_clSetKernelArg (hashcat_ctx, kernel, 0, sizeof (cl_mem), &buf) == -1) return -1; + if (hc_clSetKernelArg (hashcat_ctx, kernel, 1, sizeof (cl_ulong), &num16d) == -1) return -1; const size_t global_work_size[3] = { num_elements, 1, 1 }; const size_t local_work_size[3] = { kernel_threads, 1, 1 }; diff --git a/src/debugfile.c b/src/debugfile.c index cf943f3aa..20ee3ad1f 100644 --- a/src/debugfile.c +++ b/src/debugfile.c @@ -55,7 +55,7 @@ static void debugfile_format_plain (hashcat_ctx_t *hashcat_ctx, const u8 *plain_ } else { - hc_fwrite ((void *)plain_ptr, plain_len, 1, &debugfile_ctx->fp); + hc_fwrite (plain_ptr, plain_len, 1, &debugfile_ctx->fp); } } @@ -76,7 +76,7 @@ void debugfile_write_append (hashcat_ctx_t *hashcat_ctx, const u8 *rule_buf, con if ((debug_mode == 3) || (debug_mode == 4) || (debug_mode == 5)) hc_fputc (':', &debugfile_ctx->fp); } - hc_fwrite ((void *) rule_buf, rule_len, 1, &debugfile_ctx->fp); + hc_fwrite (rule_buf, rule_len, 1, &debugfile_ctx->fp); if ((debug_mode == 4) || (debug_mode == 5)) { diff --git a/src/dispatch.c b/src/dispatch.c index c38006dee..db830e015 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -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; - char *rule_jk_buf = (char *) user_options->rule_buf_l; + const char *rule_jk_buf = (const char *) user_options->rule_buf_l; if (attack_mode == ATTACK_MODE_HYBRID2) { rule_jk_len = (int) user_options_extra->rule_len_r; - rule_jk_buf = (char *) user_options->rule_buf_r; + rule_jk_buf = (const char *) 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; - char *rule_jk_buf = (char *) user_options->rule_buf_l; + const char *rule_jk_buf = (const char *) user_options->rule_buf_l; if (attack_mode == ATTACK_MODE_HYBRID2) { rule_jk_len = (int) user_options_extra->rule_len_r; - rule_jk_buf = (char *) user_options->rule_buf_r; + rule_jk_buf = (const char *) user_options->rule_buf_r; } if (run_rule_engine (rule_jk_len, rule_jk_buf)) diff --git a/src/loopback.c b/src/loopback.c index c20c88ea5..28dcff0d0 100644 --- a/src/loopback.c +++ b/src/loopback.c @@ -49,7 +49,7 @@ static void loopback_format_plain (hashcat_ctx_t *hashcat_ctx, const u8 *plain_p } else { - hc_fwrite ((void *)plain_ptr, plain_len, 1, &loopback_ctx->fp); + hc_fwrite (plain_ptr, plain_len, 1, &loopback_ctx->fp); } } diff --git a/src/modules/module_00022.c b/src/modules/module_00022.c index 986ddc37e..6e974b024 100644 --- a/src/modules/module_00022.c +++ b/src/modules/module_00022.c @@ -180,7 +180,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u32 *digest = (u32 *) digest_buf; + const u32 *digest = (const u32 *) digest_buf; char sig[6] = { 'n', 'r', 'c', 's', 't', 'n' }; diff --git a/src/modules/module_00400.c b/src/modules/module_00400.c index 3105bc546..23dc5c4c4 100644 --- a/src/modules/module_00400.c +++ b/src/modules/module_00400.c @@ -228,7 +228,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE phpass_encode (digest_buf, tmp); - return snprintf (line_buf, line_size, "%s%s%s", (char *) salt->salt_sign, (char *) salt->salt_buf, tmp); + return snprintf (line_buf, line_size, "%s%s%s", (const char *) salt->salt_sign, (const char *) salt->salt_buf, tmp); } void module_init (module_ctx_t *module_ctx) diff --git a/src/modules/module_01500.c b/src/modules/module_01500.c index 1956999dd..c6bb1e995 100644 --- a/src/modules/module_01500.c +++ b/src/modules/module_01500.c @@ -57,7 +57,7 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const void *tmps, const u32 *src_buf, MAYBE_UNUSED const size_t src_sz, MAYBE_UNUSED const int src_len, u32 *dst_buf, MAYBE_UNUSED const size_t dst_sz) { - u8 *ptr_src = (u8 *) src_buf; + const u8 *ptr_src = (const u8 *) src_buf; u8 *ptr_dst = (u8 *) dst_buf; for (int i = 0; i < src_len; i++) diff --git a/src/modules/module_02500.c b/src/modules/module_02500.c index a49559ff5..95e0c8713 100644 --- a/src/modules/module_02500.c +++ b/src/modules/module_02500.c @@ -138,8 +138,8 @@ static void to_hccapx_t (const hashes_t *hashes, hccapx_t *hccapx, const u32 sal memcpy (hccapx->essid, salt->salt_buf, hccapx->essid_len); - wpa_eapol_t *wpa_eapols = (wpa_eapol_t *) esalts_buf; - wpa_eapol_t *wpa_eapol = &wpa_eapols[digest_cur]; + const wpa_eapol_t *wpa_eapols = (const wpa_eapol_t *) esalts_buf; + const wpa_eapol_t *wpa_eapol = &wpa_eapols[digest_cur]; hccapx->message_pair = wpa_eapol->message_pair; hccapx->keyver = wpa_eapol->keyver; @@ -309,10 +309,10 @@ int module_hash_encode_potfile (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY int module_hash_encode_status (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - wpa_eapol_t *wpa_eapol = (wpa_eapol_t *) esalt_buf; + const wpa_eapol_t *wpa_eapol = (const wpa_eapol_t *) esalt_buf; const int line_len = snprintf (line_buf, line_size, "%s (AP:%02x:%02x:%02x:%02x:%02x:%02x STA:%02x:%02x:%02x:%02x:%02x:%02x)", - (char *) salt->salt_buf, + (const char *) salt->salt_buf, wpa_eapol->orig_mac_ap[0], wpa_eapol->orig_mac_ap[1], wpa_eapol->orig_mac_ap[2], diff --git a/src/modules/module_02501.c b/src/modules/module_02501.c index 2e97a32fc..3b987cee8 100644 --- a/src/modules/module_02501.c +++ b/src/modules/module_02501.c @@ -136,8 +136,8 @@ static void to_hccapx_t (const hashes_t *hashes, hccapx_t *hccapx, const u32 sal memcpy (hccapx->essid, salt->salt_buf, hccapx->essid_len); - wpa_eapol_t *wpa_eapols = (wpa_eapol_t *) esalts_buf; - wpa_eapol_t *wpa_eapol = &wpa_eapols[digest_cur]; + const wpa_eapol_t *wpa_eapols = (const wpa_eapol_t *) esalts_buf; + const wpa_eapol_t *wpa_eapol = &wpa_eapols[digest_cur]; hccapx->message_pair = wpa_eapol->message_pair; hccapx->keyver = wpa_eapol->keyver; @@ -572,10 +572,10 @@ bool module_potfile_custom_check (MAYBE_UNUSED const hashconfig_t *hashconfig, M int module_hash_encode_status (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - wpa_eapol_t *wpa_eapol = (wpa_eapol_t *) esalt_buf; + const wpa_eapol_t *wpa_eapol = (const wpa_eapol_t *) esalt_buf; const int line_len = snprintf (line_buf, line_size, "%s (AP:%02x:%02x:%02x:%02x:%02x:%02x STA:%02x:%02x:%02x:%02x:%02x:%02x)", - (char *) salt->salt_buf, + (const char *) salt->salt_buf, wpa_eapol->orig_mac_ap[0], wpa_eapol->orig_mac_ap[1], wpa_eapol->orig_mac_ap[2], diff --git a/src/modules/module_03200.c b/src/modules/module_03200.c index 8f0ad91aa..c3706ffa8 100644 --- a/src/modules/module_03200.c +++ b/src/modules/module_03200.c @@ -281,7 +281,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_buf[22 + 31] = 0; // base64_encode wants to pad - return snprintf (line_buf, line_size, "%s$%s", (char *) salt->salt_sign, tmp_buf); + return snprintf (line_buf, line_size, "%s$%s", (const char *) salt->salt_sign, tmp_buf); } void module_init (module_ctx_t *module_ctx) diff --git a/src/modules/module_05500.c b/src/modules/module_05500.c index ec6771bd9..9fc1de726 100644 --- a/src/modules/module_05500.c +++ b/src/modules/module_05500.c @@ -351,9 +351,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int out_len = 0; - u8 *ptr; - - ptr = (u8 *) netntlm->userdomain_buf; + const u8 *ptr = (const u8 *) netntlm->userdomain_buf; for (int i = 0; i < netntlm->user_len; i += 2) { @@ -372,7 +370,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_buf[out_len++] = ':'; - ptr = (u8 *) netntlm->chall_buf; + ptr = (const u8 *) netntlm->chall_buf; for (int i = 0; i < netntlm->srvchall_len; i++) { diff --git a/src/modules/module_05600.c b/src/modules/module_05600.c index 78955456d..a40ec4e64 100644 --- a/src/modules/module_05600.c +++ b/src/modules/module_05600.c @@ -249,9 +249,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int out_len = 0; - u8 *ptr; - - ptr = (u8 *) netntlm->userdomain_buf; + const u8 *ptr = (const u8 *) netntlm->userdomain_buf; for (int i = 0; i < netntlm->user_len; i += 2) { @@ -270,7 +268,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_buf[out_len++] = ':'; - ptr = (u8 *) netntlm->chall_buf; + ptr = (const u8 *) netntlm->chall_buf; for (int i = 0; i < netntlm->srvchall_len; i++) { diff --git a/src/modules/module_07200.c b/src/modules/module_07200.c index 7f2852234..7387334b8 100644 --- a/src/modules/module_07200.c +++ b/src/modules/module_07200.c @@ -195,7 +195,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE line_len += snprintf (line_buf + line_len, line_size - line_len, "%s%u.", SIGNATURE_SHA512GRUB, salt->salt_iter + 1); - unsigned char *salt_buf_ptr = (unsigned char *) pbkdf2_sha512->salt_buf; + const unsigned char *salt_buf_ptr = (const unsigned char *) pbkdf2_sha512->salt_buf; for (u32 i = 0; i < salt->salt_len; i++) { diff --git a/src/modules/module_07300.c b/src/modules/module_07300.c index 77a07db2d..00bff337a 100644 --- a/src/modules/module_07300.c +++ b/src/modules/module_07300.c @@ -140,7 +140,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const rakp_t *rakp = (const rakp_t *) esalt_buf; - u8 *ptr = (u8 *) rakp->salt_buf; + const u8 *ptr = (const u8 *) rakp->salt_buf; int line_len = 0; diff --git a/src/modules/module_07400.c b/src/modules/module_07400.c index f1961c3c4..251aec4f8 100644 --- a/src/modules/module_07400.c +++ b/src/modules/module_07400.c @@ -343,7 +343,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { char ptr_plain[48] = { 0 }; - sha256crypt_encode ((unsigned char *) digest_buf, (unsigned char *) ptr_plain); + sha256crypt_encode ((const unsigned char *) digest_buf, (unsigned char *) ptr_plain); char tmp_salt[SALT_MAX * 2]; diff --git a/src/modules/module_07401.c b/src/modules/module_07401.c index 9584781a4..b19aefaaa 100644 --- a/src/modules/module_07401.c +++ b/src/modules/module_07401.c @@ -373,7 +373,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 dgst[100] = { 0 }; - sha256crypt_encode ((u8 *) digest_buf, dgst); + sha256crypt_encode ((const u8 *) digest_buf, dgst); // yeah, this is weird: we use hex-encoding for base64-encoded salt // this has to do with missing MySQL function to decode/encode this variant of base64 diff --git a/src/modules/module_07500.c b/src/modules/module_07500.c index 30bdb71dc..e8434e5f6 100644 --- a/src/modules/module_07500.c +++ b/src/modules/module_07500.c @@ -216,8 +216,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const krb5pa_t *krb5pa = (const krb5pa_t *) esalt_buf; - u8 *ptr_timestamp = (u8 *) krb5pa->timestamp; - u8 *ptr_checksum = (u8 *) krb5pa->checksum; + const u8 *ptr_timestamp = (const u8 *) krb5pa->timestamp; + const u8 *ptr_checksum = (const u8 *) krb5pa->checksum; char data[128] = { 0 }; @@ -237,9 +237,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%s$%s", SIGNATURE_KRB5PA, - (char *) krb5pa->user, - (char *) krb5pa->realm, - (char *) krb5pa->salt, + (const char *) krb5pa->user, + (const char *) krb5pa->realm, + (const char *) krb5pa->salt, data); return line_len; diff --git a/src/modules/module_07900.c b/src/modules/module_07900.c index bebfb6aab..7afbe2221 100644 --- a/src/modules/module_07900.c +++ b/src/modules/module_07900.c @@ -428,7 +428,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ugly hack start - char *tmpx = (char *) salt->salt_buf_pc; + const char *tmpx = (const char *) salt->salt_buf_pc; ptr_plain[42] = tmpx[0]; @@ -436,7 +436,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE ptr_plain[43] = 0; - const int line_len = snprintf (line_buf, line_size, "%s%s%s", (char *) salt->salt_sign, (char *) salt->salt_buf, ptr_plain); + const int line_len = snprintf (line_buf, line_size, "%s%s%s", (const char *) salt->salt_sign, (const char *) salt->salt_buf, ptr_plain); return line_len; } diff --git a/src/modules/module_08300.c b/src/modules/module_08300.c index 88975f396..74bb19823 100644 --- a/src/modules/module_08300.c +++ b/src/modules/module_08300.c @@ -175,7 +175,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char domain_buf_c[33] = { 0 }; - memcpy (domain_buf_c, (char *) salt->salt_buf_pc, salt_pc_len); + memcpy (domain_buf_c, (const char *) salt->salt_buf_pc, salt_pc_len); for (u32 i = 0; i < salt_pc_len; i++) { diff --git a/src/modules/module_09200.c b/src/modules/module_09200.c index bfc3aac69..495dea9fd 100644 --- a/src/modules/module_09200.c +++ b/src/modules/module_09200.c @@ -171,9 +171,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt - const pbkdf2_sha256_t *pbkdf2_sha256 = (pbkdf2_sha256_t *) esalt_buf; + const pbkdf2_sha256_t *pbkdf2_sha256 = (const pbkdf2_sha256_t *) esalt_buf; - unsigned char *salt_buf_ptr = (unsigned char *) pbkdf2_sha256->salt_buf; + const unsigned char *salt_buf_ptr = (const unsigned char *) pbkdf2_sha256->salt_buf; // hash diff --git a/src/modules/module_09300.c b/src/modules/module_09300.c index e60d47b36..b4e06bef9 100644 --- a/src/modules/module_09300.c +++ b/src/modules/module_09300.c @@ -337,7 +337,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_buf[43] = 0; // cut it here - const int line_len = snprintf (line_buf, line_size, "%s%s$%s", SIGNATURE_CISCO9, (unsigned char *) salt->salt_buf, tmp_buf); + const int line_len = snprintf (line_buf, line_size, "%s%s$%s", SIGNATURE_CISCO9, (const unsigned char *) salt->salt_buf, tmp_buf); return line_len; } diff --git a/src/modules/module_09600.c b/src/modules/module_09600.c index 10b55cd3e..9232e543f 100644 --- a/src/modules/module_09600.c +++ b/src/modules/module_09600.c @@ -261,7 +261,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const office2013_t *office2013 = (office2013_t *) esalt_buf; + const office2013_t *office2013 = (const office2013_t *) esalt_buf; const int line_len = snprintf (line_buf, line_size, "%s*%d*%d*%d*%d*%08x%08x%08x%08x*%08x%08x%08x%08x*%08x%08x%08x%08x%08x%08x%08x%08x", SIGNATURE_OFFICE2013, diff --git a/src/modules/module_09800.c b/src/modules/module_09800.c index 899b852e7..7c3036d5c 100644 --- a/src/modules/module_09800.c +++ b/src/modules/module_09800.c @@ -259,7 +259,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { secondBlockData[0] = '*'; - u8 *ptr = (u8 *) oldoffice34->secondBlockData; + const u8 *ptr = (const u8 *) oldoffice34->secondBlockData; for (int i = 0, j = 1; i < 32; i += 1, j += 2) { diff --git a/src/modules/module_09810.c b/src/modules/module_09810.c index b689304ea..d0c838e01 100644 --- a/src/modules/module_09810.c +++ b/src/modules/module_09810.c @@ -278,7 +278,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { secondBlockData[0] = '*'; - u8 *ptr = (u8 *) oldoffice34->secondBlockData; + const u8 *ptr = (const u8 *) oldoffice34->secondBlockData; for (int i = 0, j = 1; i < 32; i += 1, j += 2) { diff --git a/src/modules/module_09820.c b/src/modules/module_09820.c index 7508f8fff..f356fcbcb 100644 --- a/src/modules/module_09820.c +++ b/src/modules/module_09820.c @@ -293,7 +293,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { secondBlockData[0] = '*'; - u8 *ptr = (u8 *) oldoffice34->secondBlockData; + const u8 *ptr = (const u8 *) oldoffice34->secondBlockData; for (int i = 0, j = 1; i < 32; i += 1, j += 2) { diff --git a/src/modules/module_10200.c b/src/modules/module_10200.c index b236e573a..cad5a4888 100644 --- a/src/modules/module_10200.c +++ b/src/modules/module_10200.c @@ -155,7 +155,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char tmp_buf[SALT_MAX * 2]; const int tmp_len = snprintf (tmp_buf, sizeof (tmp_buf), "%s %08x%08x%08x%08x", - (char *) cram_md5->user, + (const char *) cram_md5->user, byte_swap_32 (digest[0]), byte_swap_32 (digest[1]), byte_swap_32 (digest[2]), diff --git a/src/modules/module_10400.c b/src/modules/module_10400.c index 65a76701e..079325392 100644 --- a/src/modules/module_10400.c +++ b/src/modules/module_10400.c @@ -289,7 +289,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const pdf_t *pdf = (const pdf_t *) esalt_buf; - char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; + const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; diff --git a/src/modules/module_10410.c b/src/modules/module_10410.c index 1e0914738..265a15662 100644 --- a/src/modules/module_10410.c +++ b/src/modules/module_10410.c @@ -310,7 +310,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const pdf_t *pdf = (const pdf_t *) esalt_buf; - char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; + const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; diff --git a/src/modules/module_10420.c b/src/modules/module_10420.c index 23e8cb663..14054efc7 100644 --- a/src/modules/module_10420.c +++ b/src/modules/module_10420.c @@ -319,7 +319,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *rc4key = (const u8 *) pdf->rc4key; - char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x"; + const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x"; if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x"; diff --git a/src/modules/module_10500.c b/src/modules/module_10500.c index b9d932bc0..0e9026ef1 100644 --- a/src/modules/module_10500.c +++ b/src/modules/module_10500.c @@ -378,7 +378,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (pdf->id_len == 32) { - char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; + const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; @@ -419,7 +419,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE } else { - char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; + const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x"; diff --git a/src/modules/module_10901.c b/src/modules/module_10901.c index ed95f467d..b0444bb8d 100644 --- a/src/modules/module_10901.c +++ b/src/modules/module_10901.c @@ -165,7 +165,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - const pbkdf2_sha256_t *pbkdf2_sha256 = (pbkdf2_sha256_t *) esalt_buf; + const pbkdf2_sha256_t *pbkdf2_sha256 = (const pbkdf2_sha256_t *) esalt_buf; u32 tmp_digest[64]; diff --git a/src/modules/module_11600.c b/src/modules/module_11600.c index 9f1d37992..43f5b3c3f 100644 --- a/src/modules/module_11600.c +++ b/src/modules/module_11600.c @@ -185,13 +185,13 @@ void module_hook23 (hc_device_param_t *device_param, MAYBE_UNUSED const void *ho { seven_zip_hook_t *hook_items = (seven_zip_hook_t *) device_param->hooks_buf; - seven_zip_hook_salt_t *seven_zips = (seven_zip_hook_salt_t *) hook_salts_buf; - seven_zip_hook_salt_t *seven_zip = &seven_zips[salt_pos]; + const seven_zip_hook_salt_t *seven_zips = (const seven_zip_hook_salt_t *) hook_salts_buf; + const seven_zip_hook_salt_t *seven_zip = &seven_zips[salt_pos]; - seven_zip_hook_extra_t *seven_zip_hook_extra = (seven_zip_hook_extra_t *) hook_extra_param; + const seven_zip_hook_extra_t *seven_zip_hook_extra = (const seven_zip_hook_extra_t *) hook_extra_param; u8 data_type = seven_zip->data_type; - u32 *data_buf = seven_zip->data_buf; + const u32 *data_buf = seven_zip->data_buf; u32 unpack_size = seven_zip->unpack_size; // this hook data needs to be updated (the "hook_success" variable): @@ -286,7 +286,7 @@ void module_hook23 (hc_device_param_t *device_param, MAYBE_UNUSED const void *ho { u32 crc_len = seven_zip->crc_len; - char *coder_attributes = seven_zip->coder_attributes; + const char *coder_attributes = seven_zip->coder_attributes; // input buffers and length @@ -716,7 +716,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - seven_zip_hook_salt_t *seven_zip = (seven_zip_hook_salt_t *) hook_salt_buf; + const seven_zip_hook_salt_t *seven_zip = (const seven_zip_hook_salt_t *) hook_salt_buf; const u32 data_len = seven_zip->data_len; @@ -752,7 +752,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE salt->salt_sign[0], cost, seven_zip->salt_len, - (char *) seven_zip->salt_buf, + (const char *) seven_zip->salt_buf, iv_len, iv[0], iv[1], diff --git a/src/modules/module_13100.c b/src/modules/module_13100.c index d3949ae75..536f16aa1 100644 --- a/src/modules/module_13100.c +++ b/src/modules/module_13100.c @@ -133,7 +133,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { if (line_buf[token.len[0] + 3] == '*') { - char *account_info_start = (char *) line_buf + 12; // we want the * char included + 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, '*'); if (account_info_stop == NULL) return (PARSER_SEPARATOR_UNMATCHED); @@ -311,7 +311,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0, j = 0; i < krb5tgs->edata2_len; i += 1, j += 2) { - u8 *ptr_edata2 = (u8 *) krb5tgs->edata2; + const u8 *ptr_edata2 = (const u8 *) krb5tgs->edata2; snprintf (data + j, 3, "%02x", ptr_edata2[i]); } @@ -324,7 +324,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { line_len = snprintf (line_buf, line_size, "%s23$%s%08x%08x%08x%08x$%s", SIGNATURE_KRB5TGS, - (char *) krb5tgs->account_info, + (const char *) krb5tgs->account_info, byte_swap_32 (krb5tgs->checksum[0]), byte_swap_32 (krb5tgs->checksum[1]), byte_swap_32 (krb5tgs->checksum[2]), @@ -335,7 +335,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { line_len = snprintf (line_buf, line_size, "%s%s:%08x%08x%08x%08x$%s", SIGNATURE_KRB5TGS, - (char *) krb5tgs->account_info, + (const char *) krb5tgs->account_info, byte_swap_32 (krb5tgs->checksum[0]), byte_swap_32 (krb5tgs->checksum[1]), byte_swap_32 (krb5tgs->checksum[2]), diff --git a/src/modules/module_13400.c b/src/modules/module_13400.c index 0c7b2c995..6186e4632 100644 --- a/src/modules/module_13400.c +++ b/src/modules/module_13400.c @@ -507,15 +507,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 algorithm = keepass->algorithm; u32 keyfile_len = keepass->keyfile_len; - u32 *ptr_final_random_seed = (u32 *) keepass->final_random_seed; - u32 *ptr_transf_random_seed = (u32 *) keepass->transf_random_seed; - u32 *ptr_enc_iv = (u32 *) keepass->enc_iv; - u32 *ptr_contents_hash = (u32 *) keepass->contents_hash; - u32 *ptr_keyfile = (u32 *) keepass->keyfile; + const u32 *ptr_final_random_seed = (const u32 *) keepass->final_random_seed; + const u32 *ptr_transf_random_seed = (const u32 *) keepass->transf_random_seed; + const u32 *ptr_enc_iv = (const u32 *) keepass->enc_iv; + const u32 *ptr_contents_hash = (const u32 *) keepass->contents_hash; + const u32 *ptr_keyfile = (const u32 *) keepass->keyfile; // specific to version 2 u32 expected_bytes_len; - u32 *ptr_expected_bytes; + const u32 *ptr_expected_bytes; u32 final_random_seed_len; u32 transf_random_seed_len; @@ -561,7 +561,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (version == 1) { u32 contents_len = keepass->contents_len; - u32 *ptr_contents = (u32 *) keepass->contents; + const u32 *ptr_contents = (const u32 *) keepass->contents; for (u32 i = 0; i < contents_hash_len; i++, ptr_data += 8) snprintf (ptr_data, 9, "%08x", ptr_contents_hash[i]); @@ -591,7 +591,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE else if (version == 2) { expected_bytes_len = 8; - ptr_expected_bytes = (u32 *) keepass->expected_bytes; + ptr_expected_bytes = (const u32 *) keepass->expected_bytes; for (u32 i = 0; i < expected_bytes_len; i++, ptr_data += 8) snprintf (ptr_data, 9, "%08x", ptr_expected_bytes[i]); diff --git a/src/modules/module_13711.c b/src/modules/module_13711.c index f442901d2..05ab89ecc 100644 --- a/src/modules/module_13711.c +++ b/src/modules/module_13711.c @@ -93,11 +93,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } diff --git a/src/modules/module_13712.c b/src/modules/module_13712.c index 9c05ead68..6f62b2b33 100644 --- a/src/modules/module_13712.c +++ b/src/modules/module_13712.c @@ -93,11 +93,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } diff --git a/src/modules/module_13713.c b/src/modules/module_13713.c index cd5e41ab6..ba414a5a0 100644 --- a/src/modules/module_13713.c +++ b/src/modules/module_13713.c @@ -93,11 +93,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } diff --git a/src/modules/module_13721.c b/src/modules/module_13721.c index 4042664a0..75e7271b1 100644 --- a/src/modules/module_13721.c +++ b/src/modules/module_13721.c @@ -105,11 +105,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_tmp->pim - 15); } } diff --git a/src/modules/module_13722.c b/src/modules/module_13722.c index 980df5d2b..ff1ad6472 100644 --- a/src/modules/module_13722.c +++ b/src/modules/module_13722.c @@ -105,11 +105,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_tmp->pim - 15); } } diff --git a/src/modules/module_13723.c b/src/modules/module_13723.c index 8bea36ed7..c94c2ab14 100644 --- a/src/modules/module_13723.c +++ b/src/modules/module_13723.c @@ -105,11 +105,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_tmp->pim - 15); } } diff --git a/src/modules/module_13731.c b/src/modules/module_13731.c index 15927541d..428c33ffa 100644 --- a/src/modules/module_13731.c +++ b/src/modules/module_13731.c @@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } diff --git a/src/modules/module_13732.c b/src/modules/module_13732.c index d577c819f..742b68d39 100644 --- a/src/modules/module_13732.c +++ b/src/modules/module_13732.c @@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } diff --git a/src/modules/module_13733.c b/src/modules/module_13733.c index 35f6020f3..1e9007315 100644 --- a/src/modules/module_13733.c +++ b/src/modules/module_13733.c @@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } diff --git a/src/modules/module_13751.c b/src/modules/module_13751.c index 71a051217..5530305f0 100644 --- a/src/modules/module_13751.c +++ b/src/modules/module_13751.c @@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } diff --git a/src/modules/module_13752.c b/src/modules/module_13752.c index 7ac105149..d5485047f 100644 --- a/src/modules/module_13752.c +++ b/src/modules/module_13752.c @@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } diff --git a/src/modules/module_13753.c b/src/modules/module_13753.c index 76a78d62a..5b6d7297d 100644 --- a/src/modules/module_13753.c +++ b/src/modules/module_13753.c @@ -112,11 +112,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } diff --git a/src/modules/module_13771.c b/src/modules/module_13771.c index 592c5f2d6..e6283a499 100644 --- a/src/modules/module_13771.c +++ b/src/modules/module_13771.c @@ -98,11 +98,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_sbog_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_sbog_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_sbog_tmp->pim - 15); } } diff --git a/src/modules/module_13772.c b/src/modules/module_13772.c index e232bada5..7ae4bed75 100644 --- a/src/modules/module_13772.c +++ b/src/modules/module_13772.c @@ -98,11 +98,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_sbog_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_sbog_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_sbog_tmp->pim - 15); } } diff --git a/src/modules/module_13773.c b/src/modules/module_13773.c index d87d27eee..df1e35ba0 100644 --- a/src/modules/module_13773.c +++ b/src/modules/module_13773.c @@ -98,11 +98,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_sbog_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_sbog_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_sbog_tmp->pim - 15); } } diff --git a/src/modules/module_14500.c b/src/modules/module_14500.c index 8033ed481..c940dc953 100644 --- a/src/modules/module_14500.c +++ b/src/modules/module_14500.c @@ -185,7 +185,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - const u32 type = atoi ((char *)token.buf[1]); + const u32 type = atoi ((const char *)token.buf[1]); if (type > 14) return (PARSER_CRYPTOAPI_KERNELTYPE); @@ -208,7 +208,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE case 14: cryptoapi->kern_type = KERN_TYPE_CRYPTOAPI_WHIRLPOOL_TWOFISH; break; } - const u32 key_size = atoi ((char *)token.buf[2]); + const u32 key_size = atoi ((const char *)token.buf[2]); if (key_size > 2) return (PARSER_CRYPTOAPI_KEYSIZE); diff --git a/src/modules/module_15300.c b/src/modules/module_15300.c index 0469b19d2..8bd81f94a 100644 --- a/src/modules/module_15300.c +++ b/src/modules/module_15300.c @@ -292,9 +292,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8* SID_tmp; - u32 *ptr_SID = (u32 *) dpapimk->SID; - u32 *ptr_iv = (u32 *) dpapimk->iv; - u32 *ptr_contents = (u32 *) dpapimk->contents; + const u32 *ptr_SID = (const u32 *) dpapimk->SID; + const u32 *ptr_iv = (const u32 *) dpapimk->iv; + const u32 *ptr_contents = (const u32 *) dpapimk->contents; u32 u32_iv[4]; diff --git a/src/modules/module_15310.c b/src/modules/module_15310.c index c58dba69b..aec1b4539 100644 --- a/src/modules/module_15310.c +++ b/src/modules/module_15310.c @@ -304,9 +304,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 SID[512] = { 0 }; u8 *SID_tmp = NULL; - u32 *ptr_SID = (u32 *) dpapimk->SID; - u32 *ptr_iv = (u32 *) dpapimk->iv; - u32 *ptr_contents = (u32 *) dpapimk->contents; + const u32 *ptr_SID = (const u32 *) dpapimk->SID; + const u32 *ptr_iv = (const u32 *) dpapimk->iv; + const u32 *ptr_contents = (const u32 *) dpapimk->contents; u32 u32_iv[4]; u8 iv[32 + 1]; diff --git a/src/modules/module_15500.c b/src/modules/module_15500.c index dd10ed9cf..19750aac3 100644 --- a/src/modules/module_15500.c +++ b/src/modules/module_15500.c @@ -224,18 +224,18 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char enc_key[16384 + 1] = { 0 }; - u8 *ptr = (u8 *) jks_sha1->enc_key_buf; + const u8 *ptr = (const u8 *) jks_sha1->enc_key_buf; for (u32 i = 0, j = 0; i < jks_sha1->enc_key_len; i += 1, j += 2) { snprintf (enc_key + j, 3, "%02X", ptr[i]); } - u8 *der = (u8 *) jks_sha1->der; + const u8 *der = (const u8 *) jks_sha1->der; char alias[65] = { 0 }; - memcpy (alias, (char *) jks_sha1->alias, 64); + memcpy (alias, (const char *) jks_sha1->alias, 64); const int line_len = snprintf (line_buf, line_size, "%s*%08X%08X%08X%08X%08X*%08X%08X%08X%08X%08X*%s*%02X*%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X*%s", SIGNATURE_JKS_SHA1, diff --git a/src/modules/module_15700.c b/src/modules/module_15700.c index baf0c72c1..02f55b653 100644 --- a/src/modules/module_15700.c +++ b/src/modules/module_15700.c @@ -412,7 +412,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_salt[salt_len] = 0; - ethereum_scrypt_t *ethereum_scrypt = (ethereum_scrypt_t *) esalt_buf; + const ethereum_scrypt_t *ethereum_scrypt = (const ethereum_scrypt_t *) esalt_buf; const int line_len = snprintf (line_buf, line_size, "%s*%u*%u*%u*%s*%08x%08x%08x%08x%08x%08x%08x%08x*%08x%08x%08x%08x%08x%08x%08x%08x", SIGNATURE_ETHEREUM_SCRYPT, diff --git a/src/modules/module_15900.c b/src/modules/module_15900.c index 0614b1157..573f2c84a 100644 --- a/src/modules/module_15900.c +++ b/src/modules/module_15900.c @@ -304,9 +304,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 SID[512] = { 0 }; u8* SID_tmp; - u32 *ptr_SID = (u32 *) dpapimk->SID; - u32 *ptr_iv = (u32 *) dpapimk->iv; - u32 *ptr_contents = (u32 *) dpapimk->contents; + const u32 *ptr_SID = (const u32 *) dpapimk->SID; + const u32 *ptr_iv = (const u32 *) dpapimk->iv; + const u32 *ptr_contents = (const u32 *) dpapimk->contents; u32 u32_iv[4]; u8 iv[32 + 1]; diff --git a/src/modules/module_15910.c b/src/modules/module_15910.c index 5e8be508f..dcc98f9fb 100644 --- a/src/modules/module_15910.c +++ b/src/modules/module_15910.c @@ -310,9 +310,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 SID[512] = { 0 }; u8 *SID_tmp = NULL; - u32 *ptr_SID = (u32 *) dpapimk->SID; - u32 *ptr_iv = (u32 *) dpapimk->iv; - u32 *ptr_contents = (u32 *) dpapimk->contents; + const u32 *ptr_SID = (const u32 *) dpapimk->SID; + const u32 *ptr_iv = (const u32 *) dpapimk->iv; + const u32 *ptr_contents = (const u32 *) dpapimk->contents; u32 u32_iv[4]; u8 iv[32 + 1]; diff --git a/src/modules/module_16500.c b/src/modules/module_16500.c index d4add2cf9..cea9e0a24 100644 --- a/src/modules/module_16500.c +++ b/src/modules/module_16500.c @@ -327,7 +327,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE ptr_plain[86] = 0; } - const int line_len = snprintf (line_buf, line_size, "%s.%s", (char *) jwt->salt_buf, (char *) ptr_plain); + const int line_len = snprintf (line_buf, line_size, "%s.%s", (const char *) jwt->salt_buf, (const char *) ptr_plain); return line_len; } diff --git a/src/modules/module_18200.c b/src/modules/module_18200.c index 87120b443..85ec16d91 100644 --- a/src/modules/module_18200.c +++ b/src/modules/module_18200.c @@ -142,8 +142,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE krb5asrep->format = 2; } - char *account_info_start = (char *) line_buf + strlen (SIGNATURE_KRB5ASREP) + parse_off; - char *account_info_stop = strchr ((const char *) account_info_start, ':'); + const char *account_info_start = (const char *) line_buf + strlen (SIGNATURE_KRB5ASREP) + parse_off; + char *account_info_stop = strchr (account_info_start, ':'); if (account_info_stop == NULL) return (PARSER_SEPARATOR_UNMATCHED); @@ -281,7 +281,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0, j = 0; i < krb5asrep->edata2_len; i += 1, j += 2) { - u8 *ptr_edata2 = (u8 *) krb5asrep->edata2; + const u8 *ptr_edata2 = (const u8 *) krb5asrep->edata2; snprintf (data + j, 3, "%02x", ptr_edata2[i]); } @@ -292,7 +292,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { line_len = snprintf (line_buf, line_size, "%s23$%s:%08x%08x%08x%08x$%s", SIGNATURE_KRB5ASREP, - (char *) krb5asrep->account_info, + (const char *) krb5asrep->account_info, byte_swap_32 (krb5asrep->checksum[0]), byte_swap_32 (krb5asrep->checksum[1]), byte_swap_32 (krb5asrep->checksum[2]), @@ -303,7 +303,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { line_len = snprintf (line_buf, line_size, "%s%s:%08x%08x%08x%08x$%s", SIGNATURE_KRB5ASREP, - (char *) krb5asrep->account_info, + (const char *) krb5asrep->account_info, byte_swap_32 (krb5asrep->checksum[0]), byte_swap_32 (krb5asrep->checksum[1]), byte_swap_32 (krb5asrep->checksum[2]), diff --git a/src/modules/module_18300.c b/src/modules/module_18300.c index 6a3750718..fa0c66199 100644 --- a/src/modules/module_18300.c +++ b/src/modules/module_18300.c @@ -236,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - apple_secure_notes_t *apple_secure_notes = (apple_secure_notes_t *) esalt_buf; + const apple_secure_notes_t *apple_secure_notes = (const apple_secure_notes_t *) esalt_buf; const int out_len = snprintf (line_buf, line_size, "%s%u$16$%08x%08x%08x%08x$%u$%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x", SIGNATURE_APFS, diff --git a/src/modules/module_19600.c b/src/modules/module_19600.c index af5e04a82..5a4d85796 100644 --- a/src/modules/module_19600.c +++ b/src/modules/module_19600.c @@ -265,15 +265,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0, j = 0; i < krb5tgs->edata2_len; i += 1, j += 2) { - u8 *ptr_edata2 = (u8 *) krb5tgs->edata2; + const u8 *ptr_edata2 = (const u8 *) krb5tgs->edata2; snprintf (data + j, 3, "%02x", ptr_edata2[i]); } const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%08x%08x%08x$%s", SIGNATURE_KRB5TGS, - (char *) krb5tgs->user, - (char *) krb5tgs->domain, + (const char *) krb5tgs->user, + (const char *) krb5tgs->domain, krb5tgs->checksum[0], krb5tgs->checksum[1], krb5tgs->checksum[2], diff --git a/src/modules/module_19700.c b/src/modules/module_19700.c index d7eba1d4a..9c449308e 100644 --- a/src/modules/module_19700.c +++ b/src/modules/module_19700.c @@ -265,15 +265,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0, j = 0; i < krb5tgs->edata2_len; i += 1, j += 2) { - u8 *ptr_edata2 = (u8 *) krb5tgs->edata2; + const u8 *ptr_edata2 = (const u8 *) krb5tgs->edata2; snprintf (data + j, 3, "%02x", ptr_edata2[i]); } const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%08x%08x%08x$%s", SIGNATURE_KRB5TGS, - (char *) krb5tgs->user, - (char *) krb5tgs->domain, + (const char *) krb5tgs->user, + (const char *) krb5tgs->domain, krb5tgs->checksum[0], krb5tgs->checksum[1], krb5tgs->checksum[2], diff --git a/src/modules/module_19800.c b/src/modules/module_19800.c index 28560777f..93d746dd2 100644 --- a/src/modules/module_19800.c +++ b/src/modules/module_19800.c @@ -213,15 +213,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0, j = 0; i < krb5pa->enc_timestamp_len; i += 1, j += 2) { - u8 *ptr_enc_timestamp = (u8 *) krb5pa->enc_timestamp; + const u8 *ptr_enc_timestamp = (const u8 *) krb5pa->enc_timestamp; snprintf (data + j, 3, "%02x", ptr_enc_timestamp[i]); } const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%s%08x%08x%08x", SIGNATURE_KRB5PA, - (char *) krb5pa->user, - (char *) krb5pa->domain, + (const char *) krb5pa->user, + (const char *) krb5pa->domain, data, krb5pa->checksum[0], krb5pa->checksum[1], diff --git a/src/modules/module_19900.c b/src/modules/module_19900.c index 329b4902e..facce5cca 100644 --- a/src/modules/module_19900.c +++ b/src/modules/module_19900.c @@ -213,15 +213,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0, j = 0; i < krb5pa->enc_timestamp_len; i += 1, j += 2) { - u8 *ptr_enc_timestamp = (u8 *) krb5pa->enc_timestamp; + const u8 *ptr_enc_timestamp = (const u8 *) krb5pa->enc_timestamp; snprintf (data + j, 3, "%02x", ptr_enc_timestamp[i]); } const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%s%08x%08x%08x", SIGNATURE_KRB5PA, - (char *) krb5pa->user, - (char *) krb5pa->domain, + (const char *) krb5pa->user, + (const char *) krb5pa->domain, data, krb5pa->checksum[0], krb5pa->checksum[1], diff --git a/src/modules/module_20510.c b/src/modules/module_20510.c index e89e8dfc2..d96f57b6e 100644 --- a/src/modules/module_20510.c +++ b/src/modules/module_20510.c @@ -128,7 +128,7 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (pkzip_extra->len == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { @@ -136,7 +136,7 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, memcpy (dst_ptr, pkzip_extra->buf, pkzip_extra->len); - return pkzip_extra->len + snprintf (dst_ptr + pkzip_extra->len, dst_sz - pkzip_extra->len, "%s", (char *) src_buf); + return pkzip_extra->len + snprintf (dst_ptr + pkzip_extra->len, dst_sz - pkzip_extra->len, "%s", (const char *) src_buf); } } diff --git a/src/modules/module_20600.c b/src/modules/module_20600.c index dc35c6081..e6a17c5af 100644 --- a/src/modules/module_20600.c +++ b/src/modules/module_20600.c @@ -177,7 +177,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE base64_encode (int_to_base64, (const u8 *) digest_buf, 32, (u8 *) ptr_plain); - const int out_len = snprintf (line_buf, line_size, "otm_sha256:%d:%s:%s", salt->salt_iter + 1, (char *) salt->salt_buf, (char *) ptr_plain); + const int out_len = snprintf (line_buf, line_size, "otm_sha256:%d:%s:%s", salt->salt_iter + 1, (const char *) salt->salt_buf, (const char *) ptr_plain); return out_len; } diff --git a/src/modules/module_21310.c b/src/modules/module_21310.c index 106424fb0..5210ff325 100644 --- a/src/modules/module_21310.c +++ b/src/modules/module_21310.c @@ -164,7 +164,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - md5_double_salt_t *md5_double_salt = (md5_double_salt_t *) esalt_buf; + const md5_double_salt_t *md5_double_salt = (const md5_double_salt_t *) esalt_buf; // we can not change anything in the original buffer, otherwise destroying sorting // therefore create some local buffer diff --git a/src/modules/module_21500.c b/src/modules/module_21500.c index 837c942bb..ba52c09f0 100644 --- a/src/modules/module_21500.c +++ b/src/modules/module_21500.c @@ -127,7 +127,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // save original salt for encode function // this is the only reason why we have an esalt in this hash-mode - const char *salt_pos = (char *) token.buf[1]; + const char *salt_pos = (const char *) token.buf[1]; const int salt_len = token.len[1]; memcpy (solarwinds->salt_buf, salt_pos, salt_len); @@ -182,7 +182,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u64 *digest = (u64 *) digest_buf; + const u64 *digest = (const u64 *) digest_buf; const solarwinds_t *solarwinds = (const solarwinds_t *) esalt_buf; diff --git a/src/modules/module_21501.c b/src/modules/module_21501.c index a36517053..0c7d25abf 100644 --- a/src/modules/module_21501.c +++ b/src/modules/module_21501.c @@ -141,7 +141,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // save original salt for encode function // this is the only reason why we have an esalt in this hash-mode - const char *salt_pos = (char *) token.buf[1]; + const char *salt_pos = (const char *) token.buf[1]; const int salt_len = token.len[1]; memcpy (solarwinds->salt_buf, salt_pos, salt_len); @@ -154,7 +154,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - int tmp_len = base64_decode (base64_to_int, (u8 *)salt_pos, salt_len, tmp_buf); + int tmp_len = base64_decode (base64_to_int, (const u8 *)salt_pos, salt_len, tmp_buf); if (tmp_len != 16) return (PARSER_SALT_LENGTH); @@ -189,7 +189,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u64 *digest = (u64 *) digest_buf; + const u64 *digest = (const u64 *) digest_buf; const solarwinds_t *solarwinds = (const solarwinds_t *) esalt_buf; diff --git a/src/modules/module_21700.c b/src/modules/module_21700.c index 68d4f60eb..7f138f5b9 100644 --- a/src/modules/module_21700.c +++ b/src/modules/module_21700.c @@ -228,9 +228,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u32 *digest = (u32 *) digest_buf; + const u32 *digest = (const u32 *) digest_buf; - electrum_t *esalt = (electrum_t *) esalt_buf; + const electrum_t *esalt = (const electrum_t *) esalt_buf; // ephemeral pubkey: diff --git a/src/modules/module_21800.c b/src/modules/module_21800.c index 752f3451c..da26f0efa 100644 --- a/src/modules/module_21800.c +++ b/src/modules/module_21800.c @@ -205,9 +205,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u32 *digest = (u32 *) digest_buf; + const u32 *digest = (const u32 *) digest_buf; - electrum_t *esalt = (electrum_t *) esalt_buf; + const electrum_t *esalt = (const electrum_t *) esalt_buf; // ephemeral pubkey: diff --git a/src/modules/module_22000.c b/src/modules/module_22000.c index bc0b76917..dcd91d926 100644 --- a/src/modules/module_22000.c +++ b/src/modules/module_22000.c @@ -625,7 +625,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE wpa_t *wpa = (wpa_t *) esalt_buf; - char *input_buf = (char *) line_buf; + const char *input_buf = (const char *) line_buf; int input_len = line_len; // start old pmkid/hccapx compatibility parsing @@ -639,7 +639,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (line_len == sizeof (hccapx_t)) { - hccapx_t *hccapx = (hccapx_t *) line_buf; + const hccapx_t *hccapx = (const hccapx_t *) line_buf; if ((hccapx->signature == HCCAPX_SIGNATURE) && (hccapx->version == HCCAPX_VERSION)) { diff --git a/src/modules/module_22001.c b/src/modules/module_22001.c index ee152d7c3..beed898ed 100644 --- a/src/modules/module_22001.c +++ b/src/modules/module_22001.c @@ -627,7 +627,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE wpa_t *wpa = (wpa_t *) esalt_buf; - char *input_buf = (char *) line_buf; + const char *input_buf = (const char *) line_buf; int input_len = line_len; // start old pmkid/hccapx compatibility parsing @@ -641,7 +641,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (line_len == sizeof (hccapx_t)) { - hccapx_t *hccapx = (hccapx_t *) line_buf; + const hccapx_t *hccapx = (const hccapx_t *) line_buf; if ((hccapx->signature == HCCAPX_SIGNATURE) && (hccapx->version == HCCAPX_VERSION)) { diff --git a/src/modules/module_22100.c b/src/modules/module_22100.c index 833eb4a63..f5b21082a 100644 --- a/src/modules/module_22100.c +++ b/src/modules/module_22100.c @@ -350,7 +350,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - bitlocker_t *bitlocker = (bitlocker_t *) esalt_buf; + const bitlocker_t *bitlocker = (const bitlocker_t *) esalt_buf; // type diff --git a/src/modules/module_22400.c b/src/modules/module_22400.c index cd373a75d..476911d5d 100644 --- a/src/modules/module_22400.c +++ b/src/modules/module_22400.c @@ -243,7 +243,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - aescrypt_t *aescrypt = (aescrypt_t *) esalt_buf; + const aescrypt_t *aescrypt = (const aescrypt_t *) esalt_buf; // salt diff --git a/src/modules/module_22911.c b/src/modules/module_22911.c index 8beeca76b..8715d6992 100644 --- a/src/modules/module_22911.c +++ b/src/modules/module_22911.c @@ -171,7 +171,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - pem_t *pem = (pem_t *) esalt_buf; + const pem_t *pem = (const pem_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; diff --git a/src/modules/module_22921.c b/src/modules/module_22921.c index 182c1c6f3..3b68fe18f 100644 --- a/src/modules/module_22921.c +++ b/src/modules/module_22921.c @@ -172,7 +172,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - pem_t *pem = (pem_t *) esalt_buf; + const pem_t *pem = (const pem_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; diff --git a/src/modules/module_22931.c b/src/modules/module_22931.c index 5296c58fc..e61e4f72a 100644 --- a/src/modules/module_22931.c +++ b/src/modules/module_22931.c @@ -173,7 +173,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - pem_t *pem = (pem_t *) esalt_buf; + const pem_t *pem = (const pem_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; diff --git a/src/modules/module_22941.c b/src/modules/module_22941.c index e2b2e8116..b1c9261e0 100644 --- a/src/modules/module_22941.c +++ b/src/modules/module_22941.c @@ -173,7 +173,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - pem_t *pem = (pem_t *) esalt_buf; + const pem_t *pem = (const pem_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; diff --git a/src/modules/module_22951.c b/src/modules/module_22951.c index ad0d95659..83094ea86 100644 --- a/src/modules/module_22951.c +++ b/src/modules/module_22951.c @@ -173,7 +173,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - pem_t *pem = (pem_t *) esalt_buf; + const pem_t *pem = (const pem_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; diff --git a/src/modules/module_23001.c b/src/modules/module_23001.c index 02e4bd62b..db6fb556a 100644 --- a/src/modules/module_23001.c +++ b/src/modules/module_23001.c @@ -209,13 +209,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 iv[33] = { 0 }; - hex_encode ((u8 *) securezip->iv, securezip->iv_len, iv); + hex_encode ((const u8 *) securezip->iv, securezip->iv_len, iv); // data: u8 data[289] = { 0 }; - hex_encode ((u8 *) securezip->data, 144, data); + hex_encode ((const u8 *) securezip->data, 144, data); // file: diff --git a/src/modules/module_23002.c b/src/modules/module_23002.c index 223096535..189a78a54 100644 --- a/src/modules/module_23002.c +++ b/src/modules/module_23002.c @@ -209,13 +209,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 iv[33] = { 0 }; - hex_encode ((u8 *) securezip->iv, securezip->iv_len, iv); + hex_encode ((const u8 *) securezip->iv, securezip->iv_len, iv); // data: u8 data[289] = { 0 }; - hex_encode ((u8 *) securezip->data, 144, data); + hex_encode ((const u8 *) securezip->data, 144, data); // file: diff --git a/src/modules/module_23003.c b/src/modules/module_23003.c index 3e1dd0428..c3a44d944 100644 --- a/src/modules/module_23003.c +++ b/src/modules/module_23003.c @@ -210,13 +210,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 iv[33] = { 0 }; - hex_encode ((u8 *) securezip->iv, securezip->iv_len, iv); + hex_encode ((const u8 *) securezip->iv, securezip->iv_len, iv); // data: u8 data[289] = { 0 }; - hex_encode ((u8 *) securezip->data, 144, data); + hex_encode ((const u8 *) securezip->data, 144, data); // file: diff --git a/src/modules/module_23100.c b/src/modules/module_23100.c index f3057c803..22b524e9f 100644 --- a/src/modules/module_23100.c +++ b/src/modules/module_23100.c @@ -163,19 +163,19 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - keychain_t *keychain = (keychain_t *) esalt_buf; + const keychain_t *keychain = (const keychain_t *) esalt_buf; // iv u8 iv[17] = { 0 }; - hex_encode ((u8 *) keychain->iv, 8, iv); + hex_encode ((const u8 *) keychain->iv, 8, iv); // data u8 data[97] = { 0 }; - hex_encode ((u8 *) keychain->data, 48, data); + hex_encode ((const u8 *) keychain->data, 48, data); return snprintf (line_buf, line_size, "%s*%08x%08x%08x%08x%08x*%s*%s", SIGNATURE_KEYCHAIN, diff --git a/src/modules/module_23300.c b/src/modules/module_23300.c index 21d03e82c..decc32913 100644 --- a/src/modules/module_23300.c +++ b/src/modules/module_23300.c @@ -230,13 +230,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 iv_hex[33] = { 0 }; - hex_encode ((u8 *) iwork->iv, 16, iv_hex); + hex_encode ((const u8 *) iwork->iv, 16, iv_hex); // data u8 data_hex[129] = { 0 }; - hex_encode ((u8 *) iwork->data, 64, data_hex); + hex_encode ((const u8 *) iwork->data, 64, data_hex); int out_len = snprintf (line_buf, line_size, "%s%u$%u$%u$%u$%s$%s$%s", SIGNATURE_IWORK, diff --git a/src/modules/module_23500.c b/src/modules/module_23500.c index 4e4220296..5c8bd4367 100644 --- a/src/modules/module_23500.c +++ b/src/modules/module_23500.c @@ -236,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - axcrypt2_t *axcrypt2 = (axcrypt2_t *) esalt_buf; + const axcrypt2_t *axcrypt2 = (const axcrypt2_t *) esalt_buf; // salt wrap buffer diff --git a/src/modules/module_23600.c b/src/modules/module_23600.c index b94c2530a..2df2d3479 100644 --- a/src/modules/module_23600.c +++ b/src/modules/module_23600.c @@ -236,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - axcrypt2_t *axcrypt2 = (axcrypt2_t *) esalt_buf; + const axcrypt2_t *axcrypt2 = (const axcrypt2_t *) esalt_buf; // salt wrap buffer diff --git a/src/modules/module_23800.c b/src/modules/module_23800.c index 5f164b084..e197ec8b9 100644 --- a/src/modules/module_23800.c +++ b/src/modules/module_23800.c @@ -293,10 +293,10 @@ void module_hook23 (hc_device_param_t *device_param, const void *hook_extra_para rar3_hook_t *hook_items = (rar3_hook_t *) device_param->hooks_buf; rar3_hook_t *hook_item = &hook_items[pw_pos]; - rar3_hook_salt_t *rar3s = (rar3_hook_salt_t *) hook_salts_buf; - rar3_hook_salt_t *rar3 = &rar3s[salt_pos]; + const rar3_hook_salt_t *rar3s = (const rar3_hook_salt_t *) hook_salts_buf; + const rar3_hook_salt_t *rar3 = &rar3s[salt_pos]; - rar3_hook_extra_t *rar3_hook_extra = (rar3_hook_extra_t *) hook_extra_param; + const rar3_hook_extra_t *rar3_hook_extra = (const rar3_hook_extra_t *) hook_extra_param; const unsigned int pack_size = (const unsigned int) rar3->pack_size; const unsigned int unpack_size = (const unsigned int) rar3->unpack_size; @@ -323,7 +323,7 @@ void module_hook23 (hc_device_param_t *device_param, const void *hook_extra_para } } - const u8 *data = (u8 *) rar3->data; + const u8 *data = (const u8 *) rar3->data; const u8 *key = (u8 *) hook_item->key; const u8 *iv = (u8 *) hook_item->iv; @@ -567,7 +567,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - rar3_hook_salt_t *rar3_hook_salt = (rar3_hook_salt_t *) hook_salt_buf; + const rar3_hook_salt_t *rar3_hook_salt = (const rar3_hook_salt_t *) hook_salt_buf; const u32 data_len = rar3_hook_salt->pack_size; diff --git a/src/modules/module_23900.c b/src/modules/module_23900.c index 56febb803..7fe378938 100644 --- a/src/modules/module_23900.c +++ b/src/modules/module_23900.c @@ -182,7 +182,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 data_hex[193] = { 0 }; - hex_encode ((u8 *) bestcrypt->data, 96, data_hex); + hex_encode ((const u8 *) bestcrypt->data, 96, data_hex); int out_len = snprintf (line_buf, line_size, "%s3$08$%s$%s", SIGNATURE_BESTCRYPT, diff --git a/src/modules/module_24100.c b/src/modules/module_24100.c index 699fbf7b5..a871090f0 100644 --- a/src/modules/module_24100.c +++ b/src/modules/module_24100.c @@ -220,9 +220,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u32 *digest = (u32 *) digest_buf; + const u32 *digest = (const u32 *) digest_buf; - mongodb_sha1_t *mongodb_sha1 = (mongodb_sha1_t *) esalt_buf; + const mongodb_sha1_t *mongodb_sha1 = (const mongodb_sha1_t *) esalt_buf; // salt @@ -257,7 +257,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 user[100] = { 0 }; // actually: 64 - 7 (:mongo:) - memcpy (user, (char *) mongodb_sha1->user, user_len); + memcpy (user, (const char *) mongodb_sha1->user, user_len); u8 user_base64[100] = { 0 }; diff --git a/src/modules/module_24200.c b/src/modules/module_24200.c index 9457eb4a7..4ab9c2a09 100644 --- a/src/modules/module_24200.c +++ b/src/modules/module_24200.c @@ -256,9 +256,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u32 *digest = (u32 *) digest_buf; + const u32 *digest = (const u32 *) digest_buf; - mongodb_sha256_t *mongodb_sha256 = (mongodb_sha256_t *) esalt_buf; + const mongodb_sha256_t *mongodb_sha256 = (const mongodb_sha256_t *) esalt_buf; // salt @@ -297,7 +297,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 user[100] = { 0 }; - memcpy (user, (char *) mongodb_sha256->user, 64); + memcpy (user, (const char *) mongodb_sha256->user, 64); u8 user_base64[100] = { 0 }; diff --git a/src/modules/module_24410.c b/src/modules/module_24410.c index 6e59fd160..75cf634ee 100644 --- a/src/modules/module_24410.c +++ b/src/modules/module_24410.c @@ -258,7 +258,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - pkcs_t *pkcs = (pkcs_t *) esalt_buf; + const pkcs_t *pkcs = (const pkcs_t *) esalt_buf; // salt diff --git a/src/modules/module_24420.c b/src/modules/module_24420.c index 90f00ffa0..edb657d89 100644 --- a/src/modules/module_24420.c +++ b/src/modules/module_24420.c @@ -258,7 +258,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - pkcs_t *pkcs = (pkcs_t *) esalt_buf; + const pkcs_t *pkcs = (const pkcs_t *) esalt_buf; // salt diff --git a/src/modules/module_24600.c b/src/modules/module_24600.c index 0194cb05e..838d61245 100644 --- a/src/modules/module_24600.c +++ b/src/modules/module_24600.c @@ -252,7 +252,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - sqlcipher_t *sqlcipher = (sqlcipher_t *) esalt_buf; + const sqlcipher_t *sqlcipher = (const sqlcipher_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; diff --git a/src/modules/module_25000.c b/src/modules/module_25000.c index 71461a8f0..c3249420d 100644 --- a/src/modules/module_25000.c +++ b/src/modules/module_25000.c @@ -177,7 +177,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (snmpv3->packet_number, 0, sizeof (snmpv3->packet_number)); - strncpy ((char *) snmpv3->packet_number, (char *) packet_number_pos, packet_number_len); + strncpy ((char *) snmpv3->packet_number, (const char *) packet_number_pos, packet_number_len); // salt @@ -236,19 +236,19 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - snmpv3_t *snmpv3 = (snmpv3_t *) esalt_buf; + const snmpv3_t *snmpv3 = (const snmpv3_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; - int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (char *) snmpv3->packet_number); + int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (const char *) snmpv3->packet_number); - out_len += hex_encode ((u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); out_buf[out_len] = '$'; out_len++; - out_len += hex_encode ((u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); out_buf[out_len] = '$'; diff --git a/src/modules/module_25100.c b/src/modules/module_25100.c index d157c8143..eaa7ba048 100644 --- a/src/modules/module_25100.c +++ b/src/modules/module_25100.c @@ -173,7 +173,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (snmpv3->packet_number, 0, sizeof (snmpv3->packet_number)); - strncpy ((char *) snmpv3->packet_number, (char *) packet_number_pos, packet_number_len); + strncpy ((char *) snmpv3->packet_number, (const char *) packet_number_pos, packet_number_len); // salt @@ -225,19 +225,19 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - snmpv3_t *snmpv3 = (snmpv3_t *) esalt_buf; + const snmpv3_t *snmpv3 = (const snmpv3_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; - int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (char *) snmpv3->packet_number); + int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (const char *) snmpv3->packet_number); - out_len += hex_encode ((u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); out_buf[out_len] = '$'; out_len++; - out_len += hex_encode ((u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); out_buf[out_len] = '$'; diff --git a/src/modules/module_25200.c b/src/modules/module_25200.c index 0865bc2c1..41131767d 100644 --- a/src/modules/module_25200.c +++ b/src/modules/module_25200.c @@ -173,7 +173,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (snmpv3->packet_number, 0, sizeof (snmpv3->packet_number)); - strncpy ((char *) snmpv3->packet_number, (char *) packet_number_pos, packet_number_len); + strncpy ((char *) snmpv3->packet_number, (const char *) packet_number_pos, packet_number_len); // salt @@ -230,19 +230,19 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - snmpv3_t *snmpv3 = (snmpv3_t *) esalt_buf; + const snmpv3_t *snmpv3 = (const snmpv3_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; - int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (char *) snmpv3->packet_number); + int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (const char *) snmpv3->packet_number); - out_len += hex_encode ((u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); out_buf[out_len] = '$'; out_len++; - out_len += hex_encode ((u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); out_buf[out_len] = '$'; diff --git a/src/modules/module_25400.c b/src/modules/module_25400.c index 7b2402267..ccfcaa547 100644 --- a/src/modules/module_25400.c +++ b/src/modules/module_25400.c @@ -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) { - char *input_buf = (char *) line_buf; + const char *input_buf = (const char *) line_buf; int input_len = line_len; // based on m22000 module_hash_decode() we detect both the hashformat with and without user-password @@ -483,7 +483,7 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, 0x7a695364 }; - pdf14_tmp_t *pdf_tmp = (pdf14_tmp_t *) tmps; + const pdf14_tmp_t *pdf_tmp = (const pdf14_tmp_t *) tmps; pdf_t *pdf = (pdf_t *) hashes->esalts_buf; // if the password in tmp->out is equal to the padding, then we recovered just the owner-password @@ -497,11 +497,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, pdf_tmp->out[6] == padding[6] && pdf_tmp->out[7] == padding[7]) { - return snprintf ((char *) dst_buf, dst_sz, "%s (user password not set)", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s (user password not set)", (const char *) src_buf); } // cast out buffer to byte such that we can do a byte per byte comparison - u32 *u32OutBufPtr = pdf_tmp->out; + const u32 *u32OutBufPtr = pdf_tmp->out; u8 *u8OutBufPtr; u8OutBufPtr = (u8*) u32OutBufPtr; @@ -540,11 +540,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (pdf->u_pass_len == 0) { // we seem to only have recovered the user-password as we don't have one yet - return snprintf ((char *) dst_buf, dst_sz, "(user password=%s)", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "(user password=%s)", (const char *) src_buf); } } // we recovered both the user-password and the owner-password - return snprintf ((char *) dst_buf, dst_sz, "%s (user password=%s)", (char *) src_buf, (char *) pdf_tmp->out); + return snprintf ((char *) dst_buf, dst_sz, "%s (user password=%s)", (const char *) src_buf, (const char *) pdf_tmp->out); } @@ -557,11 +557,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { int line_len = 0; - pdf_t *pdf = (pdf_t *) esalt_buf; + const pdf_t *pdf = (const pdf_t *) esalt_buf; if (pdf->id_len == 32) { - char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s"; + const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s"; if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s"; @@ -598,12 +598,12 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE byte_swap_32 (pdf->o_buf[5]), byte_swap_32 (pdf->o_buf[6]), byte_swap_32 (pdf->o_buf[7]), - (char *) pdf->u_pass_buf // TODO just prints the old hash now, we don't edit the hash to add a recovered user-password to it (yet) + (const char *) pdf->u_pass_buf // TODO just prints the old hash now, we don't edit the hash to add a recovered user-password to it (yet) ); } else { - char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s"; + const char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s"; if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s"; @@ -636,7 +636,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE byte_swap_32 (pdf->o_buf[5]), byte_swap_32 (pdf->o_buf[6]), byte_swap_32 (pdf->o_buf[7]), - (char *) pdf->u_pass_buf // TODO just prints the old hash now, we don't edit the hash to add a recovered user-password to it (yet) + (const char *) pdf->u_pass_buf // TODO just prints the old hash now, we don't edit the hash to add a recovered user-password to it (yet) ); } diff --git a/src/modules/module_25500.c b/src/modules/module_25500.c index 7d68a8648..9e2305f84 100644 --- a/src/modules/module_25500.c +++ b/src/modules/module_25500.c @@ -243,7 +243,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - pbkdf2_sha256_aes_gcm_t *stellar = (pbkdf2_sha256_aes_gcm_t *) esalt_buf; + const pbkdf2_sha256_aes_gcm_t *stellar = (const pbkdf2_sha256_aes_gcm_t *) esalt_buf; // salt diff --git a/src/modules/module_25600.c b/src/modules/module_25600.c index e39224b54..d673b29ee 100644 --- a/src/modules/module_25600.c +++ b/src/modules/module_25600.c @@ -274,7 +274,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_buf[22 + 31] = 0; // base64_encode wants to pad - return snprintf (line_buf, line_size, "%s$%s", (char *) salt->salt_sign, tmp_buf); + return snprintf (line_buf, line_size, "%s$%s", (const char *) salt->salt_sign, tmp_buf); } void module_init (module_ctx_t *module_ctx) diff --git a/src/modules/module_25800.c b/src/modules/module_25800.c index 9c3189f21..116af2fa5 100644 --- a/src/modules/module_25800.c +++ b/src/modules/module_25800.c @@ -274,7 +274,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_buf[22 + 31] = 0; // base64_encode wants to pad - return snprintf (line_buf, line_size, "%s$%s", (char *) salt->salt_sign, tmp_buf); + return snprintf (line_buf, line_size, "%s$%s", (const char *) salt->salt_sign, tmp_buf); } void module_init (module_ctx_t *module_ctx) diff --git a/src/modules/module_25900.c b/src/modules/module_25900.c index b8ce7a24a..ba5e8423b 100644 --- a/src/modules/module_25900.c +++ b/src/modules/module_25900.c @@ -224,7 +224,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - blocks_t *blocks = (blocks_t *) esalt_buf; + const blocks_t *blocks = (const blocks_t *) esalt_buf; u8 secure_session_identifier[2]; u8 secure_session_identifier_hex[5] = { 0 }; @@ -233,7 +233,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memcpy (secure_session_identifier, &(blocks->b1[2]), 2); - memcpy (&public_value_xor[ 0], ((u8 *) &blocks->b1[2]) + 2, 6); + memcpy (&public_value_xor[ 0], ((const u8 *) &blocks->b1[2]) + 2, 6); memcpy (&public_value_xor[ 6], &(blocks->b2[0]), 16); memcpy (&public_value_xor[22], &(blocks->b3[0]), 10); diff --git a/src/modules/module_26200.c b/src/modules/module_26200.c index c3696d5fc..90223e1bf 100644 --- a/src/modules/module_26200.c +++ b/src/modules/module_26200.c @@ -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 = (u8 *) token.buf[0]; + const u8 *hash_pos = (const u8 *) token.buf[0]; const u32 hash_len = token.len[0]; /* @@ -122,7 +122,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - char *digest = (char *) digest_buf; + const char *digest = (const char *) digest_buf; char buf[16 + 1] = { 0 }; diff --git a/src/modules/module_26600.c b/src/modules/module_26600.c index a60917cc9..4f6d0de3b 100644 --- a/src/modules/module_26600.c +++ b/src/modules/module_26600.c @@ -258,7 +258,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - pbkdf2_sha256_aes_gcm_t *metamask = (pbkdf2_sha256_aes_gcm_t *) esalt_buf; + const pbkdf2_sha256_aes_gcm_t *metamask = (const pbkdf2_sha256_aes_gcm_t *) esalt_buf; // salt diff --git a/src/modules/module_26700.c b/src/modules/module_26700.c index 050eb196a..a568da5f4 100644 --- a/src/modules/module_26700.c +++ b/src/modules/module_26700.c @@ -170,7 +170,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (snmpv3->packet_number, 0, sizeof (snmpv3->packet_number)); - strncpy ((char *) snmpv3->packet_number, (char *) packet_number_pos, packet_number_len); + strncpy ((char *) snmpv3->packet_number, (const char *) packet_number_pos, packet_number_len); // salt @@ -227,19 +227,19 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - snmpv3_t *snmpv3 = (snmpv3_t *) esalt_buf; + const snmpv3_t *snmpv3 = (const snmpv3_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; - int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (char *) snmpv3->packet_number); + int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (const char *) snmpv3->packet_number); - out_len += hex_encode ((u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); out_buf[out_len] = '$'; out_len++; - out_len += hex_encode ((u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); out_buf[out_len] = '$'; diff --git a/src/modules/module_26800.c b/src/modules/module_26800.c index fc43bf17a..152cfc723 100644 --- a/src/modules/module_26800.c +++ b/src/modules/module_26800.c @@ -170,7 +170,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (snmpv3->packet_number, 0, sizeof (snmpv3->packet_number)); - strncpy ((char *) snmpv3->packet_number, (char *) packet_number_pos, packet_number_len); + strncpy ((char *) snmpv3->packet_number, (const char *) packet_number_pos, packet_number_len); // salt @@ -231,19 +231,19 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - snmpv3_t *snmpv3 = (snmpv3_t *) esalt_buf; + const snmpv3_t *snmpv3 = (const snmpv3_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; - int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (char *) snmpv3->packet_number); + int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (const char *) snmpv3->packet_number); - out_len += hex_encode ((u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); out_buf[out_len] = '$'; out_len++; - out_len += hex_encode ((u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); out_buf[out_len] = '$'; diff --git a/src/modules/module_26900.c b/src/modules/module_26900.c index 633e9e512..321bcca47 100644 --- a/src/modules/module_26900.c +++ b/src/modules/module_26900.c @@ -210,7 +210,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (snmpv3->packet_number, 0, sizeof (snmpv3->packet_number)); - strncpy ((char *) snmpv3->packet_number, (char *) packet_number_pos, packet_number_len); + strncpy ((char *) snmpv3->packet_number, (const char *) packet_number_pos, packet_number_len); // salt @@ -272,13 +272,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u64 *digest = (const u64 *) digest_buf; - snmpv3_t *snmpv3 = (snmpv3_t *) esalt_buf; + const snmpv3_t *snmpv3 = (const snmpv3_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; - int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (char *) snmpv3->packet_number); + int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (const char *) snmpv3->packet_number); - out_len += hex_encode ((u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); out_buf[out_len] = '$'; @@ -286,7 +286,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // remove zero padding from snmpv3->engineID_buf - u8 *engineID_buf_tmp = (u8 *) snmpv3->engineID_buf; + const u8 *engineID_buf_tmp = (const u8 *) snmpv3->engineID_buf; u32 engineID_len = snmpv3->engineID_len; @@ -296,7 +296,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // append to output - out_len += hex_encode ((u8 *) snmpv3->engineID_buf, engineID_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->engineID_buf, engineID_len, out_buf + out_len); out_buf[out_len] = '$'; diff --git a/src/modules/module_27000.c b/src/modules/module_27000.c index c9cca63b4..bf5a190bb 100644 --- a/src/modules/module_27000.c +++ b/src/modules/module_27000.c @@ -366,9 +366,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int out_len = 0; - u8 *ptr; - - ptr = (u8 *) netntlm->userdomain_buf; + const u8 *ptr = (const u8 *) netntlm->userdomain_buf; for (int i = 0; i < netntlm->user_len; i += 2) { @@ -387,7 +385,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_buf[out_len++] = ':'; - ptr = (u8 *) netntlm->chall_buf; + ptr = (const u8 *) netntlm->chall_buf; for (int i = 0; i < netntlm->srvchall_len; i++) { diff --git a/src/modules/module_27100.c b/src/modules/module_27100.c index 06dac32dd..b11a961d1 100644 --- a/src/modules/module_27100.c +++ b/src/modules/module_27100.c @@ -265,9 +265,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int out_len = 0; - u8 *ptr; + const u8 *ptr; - ptr = (u8 *) netntlm->userdomain_buf; + ptr = (const u8 *) netntlm->userdomain_buf; for (int i = 0; i < netntlm->user_len; i += 2) { @@ -286,7 +286,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_buf[out_len++] = ':'; - ptr = (u8 *) netntlm->chall_buf; + ptr = (const u8 *) netntlm->chall_buf; for (int i = 0; i < netntlm->srvchall_len; i++) { diff --git a/src/modules/module_27300.c b/src/modules/module_27300.c index 1512bbbb4..277be0c1a 100644 --- a/src/modules/module_27300.c +++ b/src/modules/module_27300.c @@ -210,7 +210,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (snmpv3->packet_number, 0, sizeof (snmpv3->packet_number)); - strncpy ((char *) snmpv3->packet_number, (char *) packet_number_pos, packet_number_len); + strncpy ((char *) snmpv3->packet_number, (const char *) packet_number_pos, packet_number_len); // salt @@ -276,19 +276,19 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u64 *digest = (const u64 *) digest_buf; - snmpv3_t *snmpv3 = (snmpv3_t *) esalt_buf; + const snmpv3_t *snmpv3 = (const snmpv3_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; - int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (char *) snmpv3->packet_number); + int out_len = snprintf (line_buf, line_size, "%s%s$", SIGNATURE_SNMPV3, (const char *) snmpv3->packet_number); - out_len += hex_encode ((u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->salt_buf, snmpv3->salt_len, out_buf + out_len); out_buf[out_len] = '$'; out_len++; - out_len += hex_encode ((u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) snmpv3->engineID_buf, snmpv3->engineID_len, out_buf + out_len); out_buf[out_len] = '$'; diff --git a/src/modules/module_27400.c b/src/modules/module_27400.c index 3bd35cff5..72ba72cdb 100644 --- a/src/modules/module_27400.c +++ b/src/modules/module_27400.c @@ -136,7 +136,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt - u8 *salt_pos = (u8 *) token.buf[2]; + const u8 *salt_pos = (const u8 *) token.buf[2]; int salt_len = token.len[2]; salt->salt_buf[0] = hex_to_u32 (salt_pos + 0); @@ -189,7 +189,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vmware_vmx_t *vmware_vmx = (vmware_vmx_t *) esalt_buf; + const vmware_vmx_t *vmware_vmx = (const vmware_vmx_t *) esalt_buf; // salt diff --git a/src/modules/module_28000.c b/src/modules/module_28000.c index 653e6dddf..90cf643ce 100644 --- a/src/modules/module_28000.c +++ b/src/modules/module_28000.c @@ -108,7 +108,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u64 *digest = (const u64 *) digest_buf; - crc64_t *crc64 = (crc64_t *) esalt_buf; + const crc64_t *crc64 = (const crc64_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; diff --git a/src/modules/module_28400.c b/src/modules/module_28400.c index dbeba6126..d2bc7e2bc 100644 --- a/src/modules/module_28400.c +++ b/src/modules/module_28400.c @@ -274,7 +274,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_buf[22 + 31] = 0; // base64_encode wants to pad - return snprintf (line_buf, line_size, "%s$%s", (char *) salt->salt_sign, tmp_buf); + return snprintf (line_buf, line_size, "%s$%s", (const char *) salt->salt_sign, tmp_buf); } void module_init (module_ctx_t *module_ctx) diff --git a/src/modules/module_28501.c b/src/modules/module_28501.c index 8692e05e6..954590b15 100644 --- a/src/modules/module_28501.c +++ b/src/modules/module_28501.c @@ -84,7 +84,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 pubkey_len = PUBKEY_MAXLEN; - bool res = b58dec (pubkey, &pubkey_len, (u8 *) line_buf, line_len); + bool res = b58dec (pubkey, &pubkey_len, (const u8 *) line_buf, line_len); if (res == false) return (PARSER_HASH_LENGTH); @@ -123,7 +123,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 buf[64] = { 0 }; diff --git a/src/modules/module_28502.c b/src/modules/module_28502.c index daafa9be3..3b910d9bf 100644 --- a/src/modules/module_28502.c +++ b/src/modules/module_28502.c @@ -84,7 +84,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 pubkey_len = PUBKEY_MAXLEN; - bool res = b58dec (pubkey, &pubkey_len, (u8 *) line_buf, line_len); + bool res = b58dec (pubkey, &pubkey_len, (const u8 *) line_buf, line_len); if (res == false) return (PARSER_HASH_LENGTH); @@ -123,7 +123,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 buf[64] = { 0 }; diff --git a/src/modules/module_28503.c b/src/modules/module_28503.c index 696bbf2d8..53838e7e5 100644 --- a/src/modules/module_28503.c +++ b/src/modules/module_28503.c @@ -212,7 +212,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // note: here we work mostly with char/u8 type because it's easier to base32 encode // (at least conceptually), but this could be easily extended to u32 variable types: - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 b[20] = { 0 }; diff --git a/src/modules/module_28504.c b/src/modules/module_28504.c index 93e35784c..35539c49f 100644 --- a/src/modules/module_28504.c +++ b/src/modules/module_28504.c @@ -212,7 +212,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // note: here we work mostly with char/u8 type because it's easier to base32 encode // (at least conceptually), but this could be easily extended to u32 variable types: - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 b[20] = { 0 }; diff --git a/src/modules/module_28505.c b/src/modules/module_28505.c index 133bf1e43..7c9ae9090 100644 --- a/src/modules/module_28505.c +++ b/src/modules/module_28505.c @@ -83,7 +83,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 pubkey_len = PUBKEY_MAXLEN; - bool res = b58dec (pubkey, &pubkey_len, (u8 *) line_buf, line_len); + bool res = b58dec (pubkey, &pubkey_len, (const u8 *) line_buf, line_len); if (res == false) return (PARSER_HASH_LENGTH); @@ -122,7 +122,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 buf[64] = { 0 }; diff --git a/src/modules/module_28506.c b/src/modules/module_28506.c index 296122758..7aac998d4 100644 --- a/src/modules/module_28506.c +++ b/src/modules/module_28506.c @@ -83,7 +83,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 pubkey_len = PUBKEY_MAXLEN; - bool res = b58dec (pubkey, &pubkey_len, (u8 *) line_buf, line_len); + bool res = b58dec (pubkey, &pubkey_len, (const u8 *) line_buf, line_len); if (res == false) return (PARSER_HASH_LENGTH); @@ -122,7 +122,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 buf[64] = { 0 }; diff --git a/src/modules/module_28600.c b/src/modules/module_28600.c index e152e8dc8..b77869507 100644 --- a/src/modules/module_28600.c +++ b/src/modules/module_28600.c @@ -268,9 +268,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u32 *digest = (u32 *) digest_buf; + const u32 *digest = (const u32 *) digest_buf; - postgres_sha256_t *postgres_sha256 = (postgres_sha256_t *) esalt_buf; + const postgres_sha256_t *postgres_sha256 = (const postgres_sha256_t *) esalt_buf; // salt @@ -310,7 +310,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 stored_key_bin[100] = { 0 }; - memcpy (stored_key_bin, (char *) postgres_sha256->storedKey, postgres_sha256->storedKey_len); + memcpy (stored_key_bin, (const char *) postgres_sha256->storedKey, postgres_sha256->storedKey_len); u8 stored_key_base64[64] = { 0 }; diff --git a/src/modules/module_28700.c b/src/modules/module_28700.c index e86ccb448..cd35d2ccf 100644 --- a/src/modules/module_28700.c +++ b/src/modules/module_28700.c @@ -155,7 +155,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // date - parse_rc = generic_salt_decode (hashconfig, (u8 *) longdate_pos, 8, (u8 *) esalt->date, (int *) &esalt->date_len); + parse_rc = generic_salt_decode (hashconfig, (const u8 *) longdate_pos, 8, (u8 *) esalt->date, (int *) &esalt->date_len); if (parse_rc == false) return (PARSER_SALT_LENGTH); @@ -242,7 +242,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE stringtosign_ptr[off] = 0x0a; off += 1; - memcpy (stringtosign_ptr + off, (char *) canonical_pos, canonical_len); + memcpy (stringtosign_ptr + off, (const char *) canonical_pos, canonical_len); off += canonical_len; esalt->stringtosign_len = off; @@ -276,7 +276,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - aws4_sig_v4_t *esalt = (aws4_sig_v4_t *) esalt_buf; + const aws4_sig_v4_t *esalt = (const aws4_sig_v4_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; @@ -310,7 +310,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // canonical - out_len += hex_encode ((u8 *) esalt->canonical, esalt->canonical_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) esalt->canonical, esalt->canonical_len, out_buf + out_len); out_buf[out_len] = '$'; diff --git a/src/modules/module_28800.c b/src/modules/module_28800.c index d34c860e5..d5a972765 100644 --- a/src/modules/module_28800.c +++ b/src/modules/module_28800.c @@ -244,8 +244,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%08x%08x%08x%08x", SIGNATURE_KRB5DB, - (char *) krb5db->user, - (char *) krb5db->domain, + (const char *) krb5db->user, + (const char *) krb5db->domain, digest[0], digest[1], digest[2], diff --git a/src/modules/module_28900.c b/src/modules/module_28900.c index 929e09a04..d706e5a3e 100644 --- a/src/modules/module_28900.c +++ b/src/modules/module_28900.c @@ -249,8 +249,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const int line_len = snprintf (line_buf, line_size, "%s%s$%s$%08x%08x%08x%08x%08x%08x%08x%08x", SIGNATURE_KRB5DB, - (char *) krb5db->user, - (char *) krb5db->domain, + (const char *) krb5db->user, + (const char *) krb5db->domain, digest[0], digest[1], digest[2], diff --git a/src/modules/module_29100.c b/src/modules/module_29100.c index b0db0f42f..38f136e00 100644 --- a/src/modules/module_29100.c +++ b/src/modules/module_29100.c @@ -138,7 +138,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE ptr_plain[27] = 0; - const int line_len = snprintf (line_buf, line_size, "%s.%s", (char *) salt->salt_buf, (char *) ptr_plain); + const int line_len = snprintf (line_buf, line_size, "%s.%s", (const char *) salt->salt_buf, (const char *) ptr_plain); return line_len; } diff --git a/src/modules/module_29200.c b/src/modules/module_29200.c index 9a9d95c03..5c57ca970 100644 --- a/src/modules/module_29200.c +++ b/src/modules/module_29200.c @@ -192,7 +192,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - radmin3_t *esalt = (radmin3_t *) esalt_buf; + const radmin3_t *esalt = (const radmin3_t *) esalt_buf; u8 *out_buf = (u8 *) line_buf; diff --git a/src/modules/module_29311.c b/src/modules/module_29311.c index b6603ad73..0f976ee8d 100644 --- a/src/modules/module_29311.c +++ b/src/modules/module_29311.c @@ -228,7 +228,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29312.c b/src/modules/module_29312.c index 6d8bfe643..31e5dba33 100644 --- a/src/modules/module_29312.c +++ b/src/modules/module_29312.c @@ -228,7 +228,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29313.c b/src/modules/module_29313.c index 064ef2c46..eadca3d08 100644 --- a/src/modules/module_29313.c +++ b/src/modules/module_29313.c @@ -228,7 +228,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29321.c b/src/modules/module_29321.c index c443ce2a3..ac5e1bf4f 100644 --- a/src/modules/module_29321.c +++ b/src/modules/module_29321.c @@ -229,7 +229,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29322.c b/src/modules/module_29322.c index 0dad95126..4322666c9 100644 --- a/src/modules/module_29322.c +++ b/src/modules/module_29322.c @@ -229,7 +229,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29323.c b/src/modules/module_29323.c index 1186809af..63c016358 100644 --- a/src/modules/module_29323.c +++ b/src/modules/module_29323.c @@ -229,7 +229,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29331.c b/src/modules/module_29331.c index 00f89b10c..52eefad8f 100644 --- a/src/modules/module_29331.c +++ b/src/modules/module_29331.c @@ -214,7 +214,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29332.c b/src/modules/module_29332.c index aea7fb0a5..2bb2c57ae 100644 --- a/src/modules/module_29332.c +++ b/src/modules/module_29332.c @@ -214,7 +214,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29333.c b/src/modules/module_29333.c index cd3c4ac05..427dda7c4 100644 --- a/src/modules/module_29333.c +++ b/src/modules/module_29333.c @@ -214,7 +214,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29341.c b/src/modules/module_29341.c index 01e0947aa..9b2a472ef 100644 --- a/src/modules/module_29341.c +++ b/src/modules/module_29341.c @@ -241,7 +241,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29342.c b/src/modules/module_29342.c index cf6f6abf2..56ec1bc84 100644 --- a/src/modules/module_29342.c +++ b/src/modules/module_29342.c @@ -241,7 +241,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29343.c b/src/modules/module_29343.c index 6ed61b839..5bd5f6823 100644 --- a/src/modules/module_29343.c +++ b/src/modules/module_29343.c @@ -241,7 +241,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - tc_t *tc = (tc_t *) esalt_buf; + const tc_t *tc = (const tc_t *) esalt_buf; // salt diff --git a/src/modules/module_29411.c b/src/modules/module_29411.c index e0695a5a0..434ebd06d 100644 --- a/src/modules/module_29411.c +++ b/src/modules/module_29411.c @@ -106,11 +106,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } @@ -280,7 +280,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29412.c b/src/modules/module_29412.c index cf5e403b8..ecb9e4706 100644 --- a/src/modules/module_29412.c +++ b/src/modules/module_29412.c @@ -106,11 +106,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } @@ -280,7 +280,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29413.c b/src/modules/module_29413.c index f8ea19758..295807e18 100644 --- a/src/modules/module_29413.c +++ b/src/modules/module_29413.c @@ -106,11 +106,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } @@ -280,7 +280,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29421.c b/src/modules/module_29421.c index 69d86b307..82ccd29dc 100644 --- a/src/modules/module_29421.c +++ b/src/modules/module_29421.c @@ -116,11 +116,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_tmp->pim - 15); } } @@ -290,7 +290,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29422.c b/src/modules/module_29422.c index 8099b8998..0e1b9f628 100644 --- a/src/modules/module_29422.c +++ b/src/modules/module_29422.c @@ -116,11 +116,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_tmp->pim - 15); } } @@ -290,7 +290,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29423.c b/src/modules/module_29423.c index afaa1b147..ab441d433 100644 --- a/src/modules/module_29423.c +++ b/src/modules/module_29423.c @@ -116,11 +116,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_tmp->pim - 15); } } @@ -290,7 +290,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29431.c b/src/modules/module_29431.c index a48035fc5..d98fce4dd 100644 --- a/src/modules/module_29431.c +++ b/src/modules/module_29431.c @@ -93,11 +93,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } @@ -267,7 +267,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29432.c b/src/modules/module_29432.c index a3ace917a..8bdb26a99 100644 --- a/src/modules/module_29432.c +++ b/src/modules/module_29432.c @@ -93,11 +93,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } @@ -267,7 +267,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29433.c b/src/modules/module_29433.c index 9ea966525..16d39fa1c 100644 --- a/src/modules/module_29433.c +++ b/src/modules/module_29433.c @@ -107,11 +107,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } @@ -281,7 +281,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29441.c b/src/modules/module_29441.c index 65a34b8c3..44db4ff81 100644 --- a/src/modules/module_29441.c +++ b/src/modules/module_29441.c @@ -282,7 +282,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29442.c b/src/modules/module_29442.c index 2e688d499..d47c16b3f 100644 --- a/src/modules/module_29442.c +++ b/src/modules/module_29442.c @@ -282,7 +282,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29443.c b/src/modules/module_29443.c index 124bac2e6..bc09e12f0 100644 --- a/src/modules/module_29443.c +++ b/src/modules/module_29443.c @@ -282,7 +282,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29451.c b/src/modules/module_29451.c index e2cfc368c..01a955fa4 100644 --- a/src/modules/module_29451.c +++ b/src/modules/module_29451.c @@ -125,11 +125,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } @@ -299,7 +299,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29452.c b/src/modules/module_29452.c index 39c826da1..b77ff6145 100644 --- a/src/modules/module_29452.c +++ b/src/modules/module_29452.c @@ -125,11 +125,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } @@ -299,7 +299,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29453.c b/src/modules/module_29453.c index e5bbe5d9e..171c61373 100644 --- a/src/modules/module_29453.c +++ b/src/modules/module_29453.c @@ -125,11 +125,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc_tmp->pim - 15); } } @@ -299,7 +299,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29461.c b/src/modules/module_29461.c index 0489a8e6b..301d2dada 100644 --- a/src/modules/module_29461.c +++ b/src/modules/module_29461.c @@ -301,7 +301,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29462.c b/src/modules/module_29462.c index 329eee24b..409384d8e 100644 --- a/src/modules/module_29462.c +++ b/src/modules/module_29462.c @@ -301,7 +301,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29463.c b/src/modules/module_29463.c index 2b61a3e43..d1dcd3d80 100644 --- a/src/modules/module_29463.c +++ b/src/modules/module_29463.c @@ -301,7 +301,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29471.c b/src/modules/module_29471.c index 2fa8e247d..4b1852559 100644 --- a/src/modules/module_29471.c +++ b/src/modules/module_29471.c @@ -116,11 +116,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_sbog_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_sbog_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_sbog_tmp->pim - 15); } } @@ -290,7 +290,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29472.c b/src/modules/module_29472.c index 7fc95a2d9..8a7a20d15 100644 --- a/src/modules/module_29472.c +++ b/src/modules/module_29472.c @@ -116,11 +116,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_sbog_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_sbog_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_sbog_tmp->pim - 15); } } @@ -290,7 +290,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29473.c b/src/modules/module_29473.c index 1b8a7d6e4..4e2345011 100644 --- a/src/modules/module_29473.c +++ b/src/modules/module_29473.c @@ -122,11 +122,11 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, if (vc64_sbog_tmp->pim == 0) { - return snprintf ((char *) dst_buf, dst_sz, "%s", (char *) src_buf); + return snprintf ((char *) dst_buf, dst_sz, "%s", (const char *) src_buf); } else { - return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (char *) src_buf, vc64_sbog_tmp->pim - 15); + return snprintf ((char *) dst_buf, dst_sz, "%s (PIM=%d)", (const char *) src_buf, vc64_sbog_tmp->pim - 15); } } @@ -296,7 +296,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29481.c b/src/modules/module_29481.c index 3cf55a275..55d0b84c6 100644 --- a/src/modules/module_29481.c +++ b/src/modules/module_29481.c @@ -292,7 +292,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29482.c b/src/modules/module_29482.c index aece087db..6e784d9a6 100644 --- a/src/modules/module_29482.c +++ b/src/modules/module_29482.c @@ -292,7 +292,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29483.c b/src/modules/module_29483.c index d958e5424..c6162d306 100644 --- a/src/modules/module_29483.c +++ b/src/modules/module_29483.c @@ -292,7 +292,7 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - vc_t *vc = (vc_t *) esalt_buf; + const vc_t *vc = (const vc_t *) esalt_buf; // salt diff --git a/src/modules/module_29511.c b/src/modules/module_29511.c index 673f1833c..0f1d38566 100644 --- a/src/modules/module_29511.c +++ b/src/modules/module_29511.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29512.c b/src/modules/module_29512.c index 0079abd74..09f04ccca 100644 --- a/src/modules/module_29512.c +++ b/src/modules/module_29512.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29513.c b/src/modules/module_29513.c index 20fb7620b..8680d3665 100644 --- a/src/modules/module_29513.c +++ b/src/modules/module_29513.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29521.c b/src/modules/module_29521.c index 43ba8a537..ce1978bfd 100644 --- a/src/modules/module_29521.c +++ b/src/modules/module_29521.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29522.c b/src/modules/module_29522.c index cc940ef1b..0466cfca4 100644 --- a/src/modules/module_29522.c +++ b/src/modules/module_29522.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29523.c b/src/modules/module_29523.c index 7d7c17ae9..a88e54de4 100644 --- a/src/modules/module_29523.c +++ b/src/modules/module_29523.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29531.c b/src/modules/module_29531.c index bc175f9b0..1a604a96e 100644 --- a/src/modules/module_29531.c +++ b/src/modules/module_29531.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29532.c b/src/modules/module_29532.c index fc864498b..7650b9457 100644 --- a/src/modules/module_29532.c +++ b/src/modules/module_29532.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29533.c b/src/modules/module_29533.c index a21a581ea..0c76f085f 100644 --- a/src/modules/module_29533.c +++ b/src/modules/module_29533.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29541.c b/src/modules/module_29541.c index 4f9d02309..1006486b4 100644 --- a/src/modules/module_29541.c +++ b/src/modules/module_29541.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29542.c b/src/modules/module_29542.c index 397e70c92..69d561d4f 100644 --- a/src/modules/module_29542.c +++ b/src/modules/module_29542.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29543.c b/src/modules/module_29543.c index 4dd2e82f8..8cca348ff 100644 --- a/src/modules/module_29543.c +++ b/src/modules/module_29543.c @@ -305,11 +305,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - luks_t *luks = (luks_t *) esalt_buf; + const luks_t *luks = (const luks_t *) esalt_buf; // cipher mode - char *cipher_mode = ""; + const char *cipher_mode = ""; switch (luks->cipher_mode) { diff --git a/src/modules/module_29600.c b/src/modules/module_29600.c index e05e75eab..29c026a29 100644 --- a/src/modules/module_29600.c +++ b/src/modules/module_29600.c @@ -197,7 +197,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u32 *digest = (u32 *) digest_buf; + const u32 *digest = (const u32 *) digest_buf; const terra_t *terra = (const terra_t *) esalt_buf; @@ -205,7 +205,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char salt_hex[32 + 1] = { 0 }; - hex_encode ((u8 *) terra->salt_buf, 16, (u8 *) salt_hex); // or use: generic_salt_encode () + hex_encode ((const u8 *) terra->salt_buf, 16, (u8 *) salt_hex); // or use: generic_salt_encode () salt_hex[32] = 0; @@ -213,7 +213,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char iv_hex[32 + 1] = { 0 }; - hex_encode ((u8 *) terra->iv, 16, (u8 *) iv_hex); + hex_encode ((const u8 *) terra->iv, 16, (u8 *) iv_hex); iv_hex[32] = 0; diff --git a/src/modules/module_29700.c b/src/modules/module_29700.c index 872051c1f..2337f0e29 100644 --- a/src/modules/module_29700.c +++ b/src/modules/module_29700.c @@ -517,15 +517,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 algorithm = keepass->algorithm; u32 keyfile_len = keepass->keyfile_len; - u32 *ptr_final_random_seed = (u32 *) keepass->final_random_seed; - u32 *ptr_transf_random_seed = (u32 *) keepass->transf_random_seed; - u32 *ptr_enc_iv = (u32 *) keepass->enc_iv; - u32 *ptr_contents_hash = (u32 *) keepass->contents_hash; - u32 *ptr_keyfile = (u32 *) keepass->keyfile; + const u32 *ptr_final_random_seed = (const u32 *) keepass->final_random_seed; + const u32 *ptr_transf_random_seed = (const u32 *) keepass->transf_random_seed; + const u32 *ptr_enc_iv = (const u32 *) keepass->enc_iv; + const u32 *ptr_contents_hash = (const u32 *) keepass->contents_hash; + const u32 *ptr_keyfile = (const u32 *) keepass->keyfile; // specific to version 2 u32 expected_bytes_len; - u32 *ptr_expected_bytes; + const u32 *ptr_expected_bytes; u32 final_random_seed_len; u32 transf_random_seed_len; @@ -571,7 +571,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (version == 1) { u32 contents_len = keepass->contents_len; - u32 *ptr_contents = (u32 *) keepass->contents; + const u32 *ptr_contents = (const u32 *) keepass->contents; for (u32 i = 0; i < contents_hash_len; i++, ptr_data += 8) snprintf (ptr_data, 9, "%08x", ptr_contents_hash[i]); @@ -601,7 +601,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE else if (version == 2) { expected_bytes_len = 8; - ptr_expected_bytes = (u32 *) keepass->expected_bytes; + ptr_expected_bytes = (const u32 *) keepass->expected_bytes; for (u32 i = 0; i < expected_bytes_len; i++, ptr_data += 8) snprintf (ptr_data, 9, "%08x", ptr_expected_bytes[i]); diff --git a/src/modules/module_30600.c b/src/modules/module_30600.c index 713fa6f64..6ce51b72d 100644 --- a/src/modules/module_30600.c +++ b/src/modules/module_30600.c @@ -274,7 +274,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_buf[22 + 31] = 0; // base64_encode wants to pad - return snprintf (line_buf, line_size, "%s$%s", (char *) salt->salt_sign, tmp_buf); + return snprintf (line_buf, line_size, "%s$%s", (const char *) salt->salt_sign, tmp_buf); } void module_init (module_ctx_t *module_ctx) diff --git a/src/modules/module_30901.c b/src/modules/module_30901.c index 3d60c3d90..e3af30325 100644 --- a/src/modules/module_30901.c +++ b/src/modules/module_30901.c @@ -89,7 +89,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 pubkey_len = PUBKEY_MAXLEN; - bool res = b58dec (pubkey, &pubkey_len, (u8 *) line_buf, line_len); + bool res = b58dec (pubkey, &pubkey_len, (const u8 *) line_buf, line_len); if (res == false) return (PARSER_HASH_LENGTH); @@ -128,7 +128,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 buf[64] = { 0 }; diff --git a/src/modules/module_30902.c b/src/modules/module_30902.c index 984496707..ae7f1b030 100644 --- a/src/modules/module_30902.c +++ b/src/modules/module_30902.c @@ -90,7 +90,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 pubkey_len = PUBKEY_MAXLEN; - bool res = b58dec (pubkey, &pubkey_len, (u8 *) line_buf, line_len); + bool res = b58dec (pubkey, &pubkey_len, (const u8 *) line_buf, line_len); if (res == false) return (PARSER_HASH_LENGTH); @@ -129,7 +129,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 buf[64] = { 0 }; diff --git a/src/modules/module_30903.c b/src/modules/module_30903.c index 3bcdad5af..0b4eaba73 100644 --- a/src/modules/module_30903.c +++ b/src/modules/module_30903.c @@ -218,7 +218,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // note: here we work mostly with char/u8 type because it's easier to base32 encode // (at least conceptually), but this could be easily extended to u32 variable types: - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 b[20] = { 0 }; diff --git a/src/modules/module_30904.c b/src/modules/module_30904.c index a3c9f2abe..58f0b2696 100644 --- a/src/modules/module_30904.c +++ b/src/modules/module_30904.c @@ -218,7 +218,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // note: here we work mostly with char/u8 type because it's easier to base32 encode // (at least conceptually), but this could be easily extended to u32 variable types: - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 b[20] = { 0 }; diff --git a/src/modules/module_30905.c b/src/modules/module_30905.c index e3e9b7d55..763fd550d 100644 --- a/src/modules/module_30905.c +++ b/src/modules/module_30905.c @@ -89,7 +89,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 pubkey_len = PUBKEY_MAXLEN; - bool res = b58dec (pubkey, &pubkey_len, (u8 *) line_buf, line_len); + bool res = b58dec (pubkey, &pubkey_len, (const u8 *) line_buf, line_len); if (res == false) return (PARSER_HASH_LENGTH); @@ -128,7 +128,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 buf[64] = { 0 }; diff --git a/src/modules/module_30906.c b/src/modules/module_30906.c index 1be061fad..22553013b 100644 --- a/src/modules/module_30906.c +++ b/src/modules/module_30906.c @@ -89,7 +89,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 pubkey_len = PUBKEY_MAXLEN; - bool res = b58dec (pubkey, &pubkey_len, (u8 *) line_buf, line_len); + bool res = b58dec (pubkey, &pubkey_len, (const u8 *) line_buf, line_len); if (res == false) return (PARSER_HASH_LENGTH); @@ -128,7 +128,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u8 *digest = (u8 *) digest_buf; + const u8 *digest = (const u8 *) digest_buf; u8 buf[64] = { 0 }; diff --git a/src/modules/module_31400.c b/src/modules/module_31400.c index dc9a94582..46bcef397 100644 --- a/src/modules/module_31400.c +++ b/src/modules/module_31400.c @@ -126,7 +126,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int out_len = snprintf (line_buf, line_size, "%s", CONFIGPASSPHRASEV2_SIGNATURE); - out_len += hex_encode ((u8 *) scrtv2->ct_buf, scrtv2->ct_len, out_buf + out_len); + out_len += hex_encode ((const u8 *) scrtv2->ct_buf, scrtv2->ct_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_31800.c b/src/modules/module_31800.c index e1dfa3b04..459b0d9b2 100644 --- a/src/modules/module_31800.c +++ b/src/modules/module_31800.c @@ -313,7 +313,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { // const u32 *digest = (const u32 *) digest_buf; - onepassword8_t *onepassword8 = (onepassword8_t *) esalt_buf; + const onepassword8_t *onepassword8 = (const onepassword8_t *) esalt_buf; // iv @@ -343,7 +343,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int out_len = snprintf ((char *) line_buf, line_size, "%s%s$%08x%08x%08x%08x%08x%08x%08x%08x$%08x%08x%08x%08x%08x%08x%08x%08x$%u$%s$%s$%08x%08x%08x%08x", SIGNATURE_1PASSWORD8, - (char *) onepassword8->email_buf, + (const char *) onepassword8->email_buf, onepassword8->hkdf_salt_buf[0], onepassword8->hkdf_salt_buf[1], onepassword8->hkdf_salt_buf[2], @@ -361,8 +361,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE onepassword8->hkdf_key_buf[6], onepassword8->hkdf_key_buf[7], salt->salt_iter + 1, - (char *) iv_buf8, - (char *) ct_buf8, + (const char *) iv_buf8, + (const char *) ct_buf8, onepassword8->tag_buf[0], onepassword8->tag_buf[1], onepassword8->tag_buf[2], diff --git a/src/modules/module_31900.c b/src/modules/module_31900.c index 291c3d213..3f7002148 100644 --- a/src/modules/module_31900.c +++ b/src/modules/module_31900.c @@ -231,11 +231,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - pbkdf2_sha512_aes_cbc_t *metamask = (pbkdf2_sha512_aes_cbc_t *) esalt_buf; + const pbkdf2_sha512_aes_cbc_t *metamask = (const pbkdf2_sha512_aes_cbc_t *) esalt_buf; // salt - u8 *salt_buf = (u8 *) salt->salt_buf; + const u8 *salt_buf = (const u8 *) salt->salt_buf; // iv diff --git a/src/modules/module_32020.c b/src/modules/module_32020.c index 6b35439b2..98c525586 100644 --- a/src/modules/module_32020.c +++ b/src/modules/module_32020.c @@ -143,7 +143,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt - u8 *salt_buf = (u8 *) salt->salt_buf; + const u8 *salt_buf = (const u8 *) salt->salt_buf; // digest diff --git a/src/modules/module_32030.c b/src/modules/module_32030.c index d2a28f172..11ac43ead 100644 --- a/src/modules/module_32030.c +++ b/src/modules/module_32030.c @@ -149,7 +149,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt - u8 *salt_buf = (u8 *) salt->salt_buf; + const u8 *salt_buf = (const u8 *) salt->salt_buf; // digest diff --git a/src/modules/module_32040.c b/src/modules/module_32040.c index 2a8f248af..a9afe56f7 100644 --- a/src/modules/module_32040.c +++ b/src/modules/module_32040.c @@ -150,7 +150,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt - u8 *salt_buf = (u8 *) salt->salt_buf; + const u8 *salt_buf = (const u8 *) salt->salt_buf; // digest diff --git a/src/modules/module_32050.c b/src/modules/module_32050.c index 47e0b2c6d..131651dce 100644 --- a/src/modules/module_32050.c +++ b/src/modules/module_32050.c @@ -177,7 +177,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - pbkdf2_sha1_t *pbkdf2_sha1 = (pbkdf2_sha1_t *) esalt_buf; + const pbkdf2_sha1_t *pbkdf2_sha1 = (const pbkdf2_sha1_t *) esalt_buf; // salt @@ -185,7 +185,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (salt_buf, 0, sizeof (salt_buf)); - hex_encode ((u8 *) pbkdf2_sha1->salt_buf, salt->salt_len, salt_buf); + hex_encode ((const u8 *) pbkdf2_sha1->salt_buf, salt->salt_len, salt_buf); // digest diff --git a/src/modules/module_32060.c b/src/modules/module_32060.c index ba7029dfa..eade07596 100644 --- a/src/modules/module_32060.c +++ b/src/modules/module_32060.c @@ -218,9 +218,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u32 *digest = (u32 *) digest_buf; + const u32 *digest = (const u32 *) digest_buf; - pbkdf2_sha256_t *pbkdf2_sha256 = (pbkdf2_sha256_t *) esalt_buf; + const pbkdf2_sha256_t *pbkdf2_sha256 = (const pbkdf2_sha256_t *) esalt_buf; // salt diff --git a/src/modules/module_32070.c b/src/modules/module_32070.c index 391f993c4..a2a785628 100644 --- a/src/modules/module_32070.c +++ b/src/modules/module_32070.c @@ -182,9 +182,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - u64 *digest = (u64 *) digest_buf; + const u64 *digest = (const u64 *) digest_buf; - pbkdf2_sha512_t *pbkdf2_sha512 = (pbkdf2_sha512_t *) esalt_buf; + const pbkdf2_sha512_t *pbkdf2_sha512 = (const pbkdf2_sha512_t *) esalt_buf; // salt @@ -192,7 +192,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (salt_buf, 0, sizeof (salt_buf)); - hex_encode ((u8 *) pbkdf2_sha512->salt_buf, salt->salt_len, salt_buf); + hex_encode ((const u8 *) pbkdf2_sha512->salt_buf, salt->salt_len, salt_buf); // digest diff --git a/src/modules/module_32100.c b/src/modules/module_32100.c index 1460bed62..cbcee0c86 100644 --- a/src/modules/module_32100.c +++ b/src/modules/module_32100.c @@ -307,7 +307,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0, j = 0; i < krb5asrep->edata2_len; i += 1, j += 2) { - u8 *ptr_edata2 = (u8 *) krb5asrep->edata2; + const u8 *ptr_edata2 = (const u8 *) krb5asrep->edata2; snprintf (data + j, 3, "%02x", ptr_edata2[i]); } @@ -318,8 +318,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { line_len = snprintf (line_buf, line_size, "%s%s$%s$%08x%08x%08x$%s", SIGNATURE_KRB5ASREP, - (char *) krb5asrep->user, - (char *) krb5asrep->domain, + (const char *) krb5asrep->user, + (const char *) krb5asrep->domain, krb5asrep->checksum[0], krb5asrep->checksum[1], krb5asrep->checksum[2], @@ -329,7 +329,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { line_len = snprintf (line_buf, line_size, "%s%s$%s$%08x%08x%08x", SIGNATURE_KRB5ASREP, - (char *) krb5asrep->account_info, + (const char *) krb5asrep->account_info, data, krb5asrep->checksum[0], krb5asrep->checksum[1], diff --git a/src/modules/module_32200.c b/src/modules/module_32200.c index f87f9fe2a..57f43019b 100644 --- a/src/modules/module_32200.c +++ b/src/modules/module_32200.c @@ -306,7 +306,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0, j = 0; i < krb5asrep->edata2_len; i += 1, j += 2) { - u8 *ptr_edata2 = (u8 *) krb5asrep->edata2; + const u8 *ptr_edata2 = (const u8 *) krb5asrep->edata2; snprintf (data + j, 3, "%02x", ptr_edata2[i]); } @@ -317,8 +317,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { line_len = snprintf (line_buf, line_size, "%s%s$%s$%08x%08x%08x$%s", SIGNATURE_KRB5ASREP, - (char *) krb5asrep->user, - (char *) krb5asrep->domain, + (const char *) krb5asrep->user, + (const char *) krb5asrep->domain, krb5asrep->checksum[0], krb5asrep->checksum[1], krb5asrep->checksum[2], @@ -328,7 +328,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { line_len = snprintf (line_buf, line_size, "%s%s$%s$%08x%08x%08x", SIGNATURE_KRB5ASREP, - (char *) krb5asrep->account_info, + (const char *) krb5asrep->account_info, data, krb5asrep->checksum[0], krb5asrep->checksum[1], diff --git a/src/modules/module_32300.c b/src/modules/module_32300.c index c97bbd007..b78ce31bf 100644 --- a/src/modules/module_32300.c +++ b/src/modules/module_32300.c @@ -138,10 +138,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (parse_rc2 == false) return (PARSER_SALT_LENGTH); const u8 *empire_salt1 = (const u8 *) "E!m^p-i(r#e.C:M?S"; - const u32 empire_salt1_len = strlen ((char *) empire_salt1); + const u32 empire_salt1_len = strlen ((const char *) empire_salt1); const u8 *empire_salt2 = (const u8 *) "d)i.g^o-d"; - const u32 empire_salt2_len = strlen ((char *) empire_salt2); + const u32 empire_salt2_len = strlen ((const char *) empire_salt2); memcpy ((u8 *) md5_triple_salt->salt2_buf + md5_triple_salt->salt2_len, empire_salt1, empire_salt1_len); diff --git a/src/modules/module_99999.c b/src/modules/module_99999.c index 6189d4aea..b1dd810bd 100644 --- a/src/modules/module_99999.c +++ b/src/modules/module_99999.c @@ -128,7 +128,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - char *ptr = (char *) digest_buf; + const char *ptr = (const char *) digest_buf; const char *line_ptr = ptr + 64; size_t line_len = strnlen (line_ptr, 55); From ae07d65f34d3e5d3fdecc2019a57ceab74fcfdbd Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 18 Aug 2023 16:37:00 -0700 Subject: [PATCH 2/2] clang-tidy: remove useless casts Now that const was fixed, pointless casts can be removed. Signed-off-by: Rosen Penev --- OpenCL/inc_hash_base58.cl | 16 +++--- src/backend.c | 2 +- src/dispatch.c | 8 +-- src/filehandling.c | 2 +- src/interface.c | 8 +-- src/modules/module_00501.c | 2 +- src/modules/module_03200.c | 4 +- src/modules/module_03730.c | 8 +-- src/modules/module_04510.c | 2 +- src/modules/module_04710.c | 2 +- src/modules/module_04711.c | 2 +- src/modules/module_05200.c | 2 +- src/modules/module_05700.c | 2 +- src/modules/module_06800.c | 2 +- src/modules/module_07401.c | 2 +- src/modules/module_07800.c | 10 ++-- src/modules/module_07801.c | 10 ++-- src/modules/module_08900.c | 4 +- src/modules/module_09000.c | 2 +- src/modules/module_10000.c | 2 +- src/modules/module_10200.c | 2 +- src/modules/module_10300.c | 2 +- src/modules/module_10600.c | 2 +- src/modules/module_10700.c | 2 +- src/modules/module_11300.c | 2 +- src/modules/module_11400.c | 8 +-- src/modules/module_11600.c | 2 +- src/modules/module_13100.c | 4 +- src/modules/module_13400.c | 106 ++++++++++++++++++------------------- src/modules/module_13600.c | 18 +++---- src/modules/module_14600.c | 2 +- src/modules/module_14700.c | 30 +++++------ src/modules/module_14800.c | 30 +++++------ src/modules/module_14900.c | 4 +- src/modules/module_15300.c | 10 ++-- src/modules/module_15310.c | 10 ++-- src/modules/module_15400.c | 16 +++--- src/modules/module_15500.c | 26 ++++----- src/modules/module_15600.c | 32 +++++------ src/modules/module_15700.c | 32 +++++------ src/modules/module_15900.c | 10 ++-- src/modules/module_15910.c | 10 ++-- src/modules/module_16100.c | 14 ++--- src/modules/module_16200.c | 20 +++---- src/modules/module_16300.c | 18 +++---- src/modules/module_16400.c | 8 +-- src/modules/module_16600.c | 16 +++--- src/modules/module_16700.c | 20 +++---- src/modules/module_16900.c | 18 +++---- src/modules/module_17010.c | 6 +-- src/modules/module_17020.c | 6 +-- src/modules/module_17030.c | 6 +-- src/modules/module_17040.c | 4 +- src/modules/module_18100.c | 2 +- src/modules/module_18200.c | 2 +- src/modules/module_18300.c | 28 +++++----- src/modules/module_18900.c | 8 +-- src/modules/module_19000.c | 8 +-- src/modules/module_19100.c | 16 +++--- src/modules/module_19200.c | 16 +++--- src/modules/module_19300.c | 8 +-- src/modules/module_19500.c | 8 +-- src/modules/module_19600.c | 2 +- src/modules/module_19700.c | 2 +- src/modules/module_20200.c | 4 +- src/modules/module_20300.c | 4 +- src/modules/module_20400.c | 4 +- src/modules/module_21310.c | 8 +-- src/modules/module_21600.c | 4 +- src/modules/module_22000.c | 6 +-- src/modules/module_22001.c | 6 +-- src/modules/module_22911.c | 2 +- src/modules/module_22921.c | 2 +- src/modules/module_22931.c | 2 +- src/modules/module_22941.c | 2 +- src/modules/module_22951.c | 2 +- src/modules/module_23200.c | 4 +- src/modules/module_24410.c | 2 +- src/modules/module_24420.c | 2 +- src/modules/module_25400.c | 2 +- src/modules/module_25600.c | 4 +- src/modules/module_25700.c | 4 +- src/modules/module_25800.c | 4 +- src/modules/module_25900.c | 12 ++--- src/modules/module_26200.c | 2 +- src/modules/module_27400.c | 2 +- src/modules/module_27500.c | 64 +++++++++++----------- src/modules/module_27600.c | 80 ++++++++++++++-------------- src/modules/module_27800.c | 4 +- src/modules/module_28200.c | 8 +-- src/modules/module_28400.c | 4 +- src/modules/module_28700.c | 2 +- src/modules/module_28800.c | 2 +- src/modules/module_28900.c | 2 +- src/modules/module_29000.c | 8 +-- src/modules/module_29700.c | 106 ++++++++++++++++++------------------- src/modules/module_29910.c | 24 ++++----- src/modules/module_29920.c | 26 ++++----- src/modules/module_29930.c | 8 +-- src/modules/module_29940.c | 10 ++-- src/modules/module_30600.c | 4 +- src/modules/module_31700.c | 8 +-- src/modules/module_31800.c | 2 +- src/modules/module_32300.c | 8 +-- src/modules/module_32500.c | 2 +- 105 files changed, 572 insertions(+), 572 deletions(-) diff --git a/OpenCL/inc_hash_base58.cl b/OpenCL/inc_hash_base58.cl index a6733ed68..f47f48d25 100644 --- a/OpenCL/inc_hash_base58.cl +++ b/OpenCL/inc_hash_base58.cl @@ -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); diff --git a/src/backend.c b/src/backend.c index 91f425fcb..384bb0d17 100644 --- a/src/backend.c +++ b/src/backend.c @@ -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 diff --git a/src/dispatch.c b/src/dispatch.c index db830e015..fdb0b441d 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -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)) diff --git a/src/filehandling.c b/src/filehandling.c index 4d56a2f2c..9a2d0ea39 100644 --- a/src/filehandling.c +++ b/src/filehandling.c @@ -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; diff --git a/src/interface.c b/src/interface.c index a4a13fd03..14faddd89 100644 --- a/src/interface.c +++ b/src/interface.c @@ -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) diff --git a/src/modules/module_00501.c b/src/modules/module_00501.c index 76980adaa..f31985406 100644 --- a/src/modules/module_00501.c +++ b/src/modules/module_00501.c @@ -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 diff --git a/src/modules/module_03200.c b/src/modules/module_03200.c index c3706ffa8..bd38d8aec 100644 --- a/src/modules/module_03200.c +++ b/src/modules/module_03200.c @@ -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); diff --git a/src/modules/module_03730.c b/src/modules/module_03730.c index eb37c234f..c5959ad06 100644 --- a/src/modules/module_03730.c +++ b/src/modules/module_03730.c @@ -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; } diff --git a/src/modules/module_04510.c b/src/modules/module_04510.c index 51d0a686a..6659b478d 100644 --- a/src/modules/module_04510.c +++ b/src/modules/module_04510.c @@ -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; } diff --git a/src/modules/module_04710.c b/src/modules/module_04710.c index 48d0e0a9b..6a04380c0 100644 --- a/src/modules/module_04710.c +++ b/src/modules/module_04710.c @@ -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; } diff --git a/src/modules/module_04711.c b/src/modules/module_04711.c index 5020a5d18..1e1bfdcc0 100644 --- a/src/modules/module_04711.c +++ b/src/modules/module_04711.c @@ -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; } diff --git a/src/modules/module_05200.c b/src/modules/module_05200.c index 66eb5fd8d..47fb863cb 100644 --- a/src/modules/module_05200.c +++ b/src/modules/module_05200.c @@ -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; diff --git a/src/modules/module_05700.c b/src/modules/module_05700.c index dab3dc8c5..e981eeea1 100644 --- a/src/modules/module_05700.c +++ b/src/modules/module_05700.c @@ -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); diff --git a/src/modules/module_06800.c b/src/modules/module_06800.c index 35eebf6b4..6439f98f3 100644 --- a/src/modules/module_06800.c +++ b/src/modules/module_06800.c @@ -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); diff --git a/src/modules/module_07401.c b/src/modules/module_07401.c index b19aefaaa..ae5fdd434 100644 --- a/src/modules/module_07401.c +++ b/src/modules/module_07401.c @@ -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); diff --git a/src/modules/module_07800.c b/src/modules/module_07800.c index 080a26252..8aa784460 100644 --- a/src/modules/module_07800.c +++ b/src/modules/module_07800.c @@ -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]); diff --git a/src/modules/module_07801.c b/src/modules/module_07801.c index 0e390d259..4caf03e84 100644 --- a/src/modules/module_07801.c +++ b/src/modules/module_07801.c @@ -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]); diff --git a/src/modules/module_08900.c b/src/modules/module_08900.c index d7b7a9a62..6f996a3b0 100644 --- a/src/modules/module_08900.c +++ b/src/modules/module_08900.c @@ -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 diff --git a/src/modules/module_09000.c b/src/modules/module_09000.c index 8ea86ae32..4ed3b41ff 100644 --- a/src/modules/module_09000.c +++ b/src/modules/module_09000.c @@ -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; diff --git a/src/modules/module_10000.c b/src/modules/module_10000.c index ce6518d3d..47901e03c 100644 --- a/src/modules/module_10000.c +++ b/src/modules/module_10000.c @@ -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); diff --git a/src/modules/module_10200.c b/src/modules/module_10200.c index cad5a4888..8c743a518 100644 --- a/src/modules/module_10200.c +++ b/src/modules/module_10200.c @@ -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); diff --git a/src/modules/module_10300.c b/src/modules/module_10300.c index 0768b6029..85937d115 100644 --- a/src/modules/module_10300.c +++ b/src/modules/module_10300.c @@ -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); diff --git a/src/modules/module_10600.c b/src/modules/module_10600.c index dc5422137..6cd76cbbd 100644 --- a/src/modules/module_10600.c +++ b/src/modules/module_10600.c @@ -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]; diff --git a/src/modules/module_10700.c b/src/modules/module_10700.c index 9b6fa97a3..05be37b65 100644 --- a/src/modules/module_10700.c +++ b/src/modules/module_10700.c @@ -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]; diff --git a/src/modules/module_11300.c b/src/modules/module_11300.c index 7b81b3d26..6ece4048a 100644 --- a/src/modules/module_11300.c +++ b/src/modules/module_11300.c @@ -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; diff --git a/src/modules/module_11400.c b/src/modules/module_11400.c index f6f656629..e5264d053 100644 --- a/src/modules/module_11400.c +++ b/src/modules/module_11400.c @@ -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); } diff --git a/src/modules/module_11600.c b/src/modules/module_11600.c index 43f5b3c3f..7205f6b7e 100644 --- a/src/modules/module_11600.c +++ b/src/modules/module_11600.c @@ -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++; } diff --git a/src/modules/module_13100.c b/src/modules/module_13100.c index 536f16aa1..eb6288fb6 100644 --- a/src/modules/module_13100.c +++ b/src/modules/module_13100.c @@ -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); diff --git a/src/modules/module_13400.c b/src/modules/module_13400.c index 6186e4632..8f019d859 100644 --- a/src/modules/module_13400.c +++ b/src/modules/module_13400.c @@ -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]); diff --git a/src/modules/module_13600.c b/src/modules/module_13600.c index c6dd15498..f927d5761 100644 --- a/src/modules/module_13600.c +++ b/src/modules/module_13600.c @@ -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; } diff --git a/src/modules/module_14600.c b/src/modules/module_14600.c index 19421eabc..6848ca06a 100644 --- a/src/modules/module_14600.c +++ b/src/modules/module_14600.c @@ -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; diff --git a/src/modules/module_14700.c b/src/modules/module_14700.c index 601e07063..f71fd99a9 100644 --- a/src/modules/module_14700.c +++ b/src/modules/module_14700.c @@ -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]); diff --git a/src/modules/module_14800.c b/src/modules/module_14800.c index 2825b93ce..2a5f6b33c 100644 --- a/src/modules/module_14800.c +++ b/src/modules/module_14800.c @@ -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]); diff --git a/src/modules/module_14900.c b/src/modules/module_14900.c index 2bedb5553..62499126f 100644 --- a/src/modules/module_14900.c +++ b/src/modules/module_14900.c @@ -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 diff --git a/src/modules/module_15300.c b/src/modules/module_15300.c index 8bd81f94a..701e5d695 100644 --- a/src/modules/module_15300.c +++ b/src/modules/module_15300.c @@ -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]); diff --git a/src/modules/module_15310.c b/src/modules/module_15310.c index aec1b4539..b10b93792 100644 --- a/src/modules/module_15310.c +++ b/src/modules/module_15310.c @@ -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]); diff --git a/src/modules/module_15400.c b/src/modules/module_15400.c index a42b7ba67..ffcbc1b5a 100644 --- a/src/modules/module_15400.c +++ b/src/modules/module_15400.c @@ -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); } diff --git a/src/modules/module_15500.c b/src/modules/module_15500.c index 19750aac3..b87390fb7 100644 --- a/src/modules/module_15500.c +++ b/src/modules/module_15500.c @@ -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; diff --git a/src/modules/module_15600.c b/src/modules/module_15600.c index a9605061f..c06af7f29 100644 --- a/src/modules/module_15600.c +++ b/src/modules/module_15600.c @@ -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); } diff --git a/src/modules/module_15700.c b/src/modules/module_15700.c index 02f55b653..6b8550095 100644 --- a/src/modules/module_15700.c +++ b/src/modules/module_15700.c @@ -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); } diff --git a/src/modules/module_15900.c b/src/modules/module_15900.c index 573f2c84a..d3d2df0b7 100644 --- a/src/modules/module_15900.c +++ b/src/modules/module_15900.c @@ -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]); diff --git a/src/modules/module_15910.c b/src/modules/module_15910.c index dcc98f9fb..8ca85a5fd 100644 --- a/src/modules/module_15910.c +++ b/src/modules/module_15910.c @@ -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]); diff --git a/src/modules/module_16100.c b/src/modules/module_16100.c index 9e470f079..57b0d5a33 100644 --- a/src/modules/module_16100.c +++ b/src/modules/module_16100.c @@ -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 diff --git a/src/modules/module_16200.c b/src/modules/module_16200.c index 36e14358e..f3d65d007 100644 --- a/src/modules/module_16200.c +++ b/src/modules/module_16200.c @@ -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 diff --git a/src/modules/module_16300.c b/src/modules/module_16300.c index 1efe11c73..9c2fa883d 100644 --- a/src/modules/module_16300.c +++ b/src/modules/module_16300.c @@ -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); } diff --git a/src/modules/module_16400.c b/src/modules/module_16400.c index 009d82ad2..eecd9fe3d 100644 --- a/src/modules/module_16400.c +++ b/src/modules/module_16400.c @@ -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) { diff --git a/src/modules/module_16600.c b/src/modules/module_16600.c index 0571028f7..47ed037d7 100644 --- a/src/modules/module_16600.c +++ b/src/modules/module_16600.c @@ -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 diff --git a/src/modules/module_16700.c b/src/modules/module_16700.c index 50314c20d..3066b8f0b 100644 --- a/src/modules/module_16700.c +++ b/src/modules/module_16700.c @@ -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 diff --git a/src/modules/module_16900.c b/src/modules/module_16900.c index 213b5940e..3fd5a3d40 100644 --- a/src/modules/module_16900.c +++ b/src/modules/module_16900.c @@ -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]); diff --git a/src/modules/module_17010.c b/src/modules/module_17010.c index 865a6f8eb..c5b4280b0 100644 --- a/src/modules/module_17010.c +++ b/src/modules/module_17010.c @@ -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); diff --git a/src/modules/module_17020.c b/src/modules/module_17020.c index c4c9c7bef..a877ab82d 100644 --- a/src/modules/module_17020.c +++ b/src/modules/module_17020.c @@ -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); diff --git a/src/modules/module_17030.c b/src/modules/module_17030.c index 05867755c..52fa74c92 100644 --- a/src/modules/module_17030.c +++ b/src/modules/module_17030.c @@ -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); diff --git a/src/modules/module_17040.c b/src/modules/module_17040.c index 36c94c897..dd3661136 100644 --- a/src/modules/module_17040.c +++ b/src/modules/module_17040.c @@ -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); diff --git a/src/modules/module_18100.c b/src/modules/module_18100.c index d7b1f62a9..37a8ef2e7 100644 --- a/src/modules/module_18100.c +++ b/src/modules/module_18100.c @@ -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; diff --git a/src/modules/module_18200.c b/src/modules/module_18200.c index 85ec16d91..b99d4978d 100644 --- a/src/modules/module_18200.c +++ b/src/modules/module_18200.c @@ -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); diff --git a/src/modules/module_18300.c b/src/modules/module_18300.c index fa0c66199..adc98432a 100644 --- a/src/modules/module_18300.c +++ b/src/modules/module_18300.c @@ -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 diff --git a/src/modules/module_18900.c b/src/modules/module_18900.c index 2141796f2..0d07400f8 100644 --- a/src/modules/module_18900.c +++ b/src/modules/module_18900.c @@ -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 diff --git a/src/modules/module_19000.c b/src/modules/module_19000.c index b9875463e..286635726 100644 --- a/src/modules/module_19000.c +++ b/src/modules/module_19000.c @@ -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 diff --git a/src/modules/module_19100.c b/src/modules/module_19100.c index 74222b883..50b89ecec 100644 --- a/src/modules/module_19100.c +++ b/src/modules/module_19100.c @@ -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 diff --git a/src/modules/module_19200.c b/src/modules/module_19200.c index 4fa1c8daa..9e4467b40 100644 --- a/src/modules/module_19200.c +++ b/src/modules/module_19200.c @@ -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 diff --git a/src/modules/module_19300.c b/src/modules/module_19300.c index 2e9bb17d9..ad1d7cefc 100644 --- a/src/modules/module_19300.c +++ b/src/modules/module_19300.c @@ -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; } diff --git a/src/modules/module_19500.c b/src/modules/module_19500.c index 3e6748efa..afaa3c7cd 100644 --- a/src/modules/module_19500.c +++ b/src/modules/module_19500.c @@ -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; } diff --git a/src/modules/module_19600.c b/src/modules/module_19600.c index 5a4d85796..296a1dca1 100644 --- a/src/modules/module_19600.c +++ b/src/modules/module_19600.c @@ -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; diff --git a/src/modules/module_19700.c b/src/modules/module_19700.c index 9c449308e..8a09915b0 100644 --- a/src/modules/module_19700.c +++ b/src/modules/module_19700.c @@ -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; diff --git a/src/modules/module_20200.c b/src/modules/module_20200.c index 351810ae1..ff63ea7c6 100644 --- a/src/modules/module_20200.c +++ b/src/modules/module_20200.c @@ -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]); diff --git a/src/modules/module_20300.c b/src/modules/module_20300.c index 1a65498e2..2d6ac1fd6 100644 --- a/src/modules/module_20300.c +++ b/src/modules/module_20300.c @@ -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]); diff --git a/src/modules/module_20400.c b/src/modules/module_20400.c index d099fb360..2fd8a7dcd 100644 --- a/src/modules/module_20400.c +++ b/src/modules/module_20400.c @@ -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]); diff --git a/src/modules/module_21310.c b/src/modules/module_21310.c index 5210ff325..9bd5e991c 100644 --- a/src/modules/module_21310.c +++ b/src/modules/module_21310.c @@ -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; } diff --git a/src/modules/module_21600.c b/src/modules/module_21600.c index 1342e697c..47cf4ce40 100644 --- a/src/modules/module_21600.c +++ b/src/modules/module_21600.c @@ -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; } diff --git a/src/modules/module_22000.c b/src/modules/module_22000.c index dcd91d926..ebacaab95 100644 --- a/src/modules/module_22000.c +++ b/src/modules/module_22000.c @@ -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); diff --git a/src/modules/module_22001.c b/src/modules/module_22001.c index beed898ed..b0fb51dd9 100644 --- a/src/modules/module_22001.c +++ b/src/modules/module_22001.c @@ -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); diff --git a/src/modules/module_22911.c b/src/modules/module_22911.c index 8715d6992..25b90e94a 100644 --- a/src/modules/module_22911.c +++ b/src/modules/module_22911.c @@ -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; } diff --git a/src/modules/module_22921.c b/src/modules/module_22921.c index 3b68fe18f..c71aad254 100644 --- a/src/modules/module_22921.c +++ b/src/modules/module_22921.c @@ -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; } diff --git a/src/modules/module_22931.c b/src/modules/module_22931.c index e61e4f72a..ea673b633 100644 --- a/src/modules/module_22931.c +++ b/src/modules/module_22931.c @@ -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; } diff --git a/src/modules/module_22941.c b/src/modules/module_22941.c index b1c9261e0..05f0d57e5 100644 --- a/src/modules/module_22941.c +++ b/src/modules/module_22941.c @@ -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; } diff --git a/src/modules/module_22951.c b/src/modules/module_22951.c index 83094ea86..abf2fb6dd 100644 --- a/src/modules/module_22951.c +++ b/src/modules/module_22951.c @@ -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; } diff --git a/src/modules/module_23200.c b/src/modules/module_23200.c index bcea54bce..5ec94c72d 100644 --- a/src/modules/module_23200.c +++ b/src/modules/module_23200.c @@ -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; } diff --git a/src/modules/module_24410.c b/src/modules/module_24410.c index 75cf634ee..44e3202f9 100644 --- a/src/modules/module_24410.c +++ b/src/modules/module_24410.c @@ -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; } diff --git a/src/modules/module_24420.c b/src/modules/module_24420.c index edb657d89..7bd0e1e05 100644 --- a/src/modules/module_24420.c +++ b/src/modules/module_24420.c @@ -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; } diff --git a/src/modules/module_25400.c b/src/modules/module_25400.c index ccfcaa547..8dc70b479 100644 --- a/src/modules/module_25400.c +++ b/src/modules/module_25400.c @@ -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 diff --git a/src/modules/module_25600.c b/src/modules/module_25600.c index d673b29ee..dc6ec869c 100644 --- a/src/modules/module_25600.c +++ b/src/modules/module_25600.c @@ -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); diff --git a/src/modules/module_25700.c b/src/modules/module_25700.c index c6a805dcc..30b0df8d5 100644 --- a/src/modules/module_25700.c +++ b/src/modules/module_25700.c @@ -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]); diff --git a/src/modules/module_25800.c b/src/modules/module_25800.c index 116af2fa5..89c4251b6 100644 --- a/src/modules/module_25800.c +++ b/src/modules/module_25800.c @@ -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); diff --git a/src/modules/module_25900.c b/src/modules/module_25900.c index ba5e8423b..898fc5b52 100644 --- a/src/modules/module_25900.c +++ b/src/modules/module_25900.c @@ -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, //_| diff --git a/src/modules/module_26200.c b/src/modules/module_26200.c index 90223e1bf..bed7b39c5 100644 --- a/src/modules/module_26200.c +++ b/src/modules/module_26200.c @@ -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]; /* diff --git a/src/modules/module_27400.c b/src/modules/module_27400.c index 72ba72cdb..f0368c6b5 100644 --- a/src/modules/module_27400.c +++ b/src/modules/module_27400.c @@ -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); diff --git a/src/modules/module_27500.c b/src/modules/module_27500.c index 12d576bff..24ea388fd 100644 --- a/src/modules/module_27500.c +++ b/src/modules/module_27500.c @@ -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]); diff --git a/src/modules/module_27600.c b/src/modules/module_27600.c index d458cbd8a..4f2feccd7 100644 --- a/src/modules/module_27600.c +++ b/src/modules/module_27600.c @@ -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]); diff --git a/src/modules/module_27800.c b/src/modules/module_27800.c index 4aefff85a..f5bf82a46 100644 --- a/src/modules/module_27800.c +++ b/src/modules/module_27800.c @@ -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]); diff --git a/src/modules/module_28200.c b/src/modules/module_28200.c index 4eaf61bc6..dd3ce7998 100644 --- a/src/modules/module_28200.c +++ b/src/modules/module_28200.c @@ -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); diff --git a/src/modules/module_28400.c b/src/modules/module_28400.c index d2bc7e2bc..fdb164cee 100644 --- a/src/modules/module_28400.c +++ b/src/modules/module_28400.c @@ -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); diff --git a/src/modules/module_28700.c b/src/modules/module_28700.c index cd35d2ccf..7e053b6ee 100644 --- a/src/modules/module_28700.c +++ b/src/modules/module_28700.c @@ -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); diff --git a/src/modules/module_28800.c b/src/modules/module_28800.c index d5a972765..a1fe7825d 100644 --- a/src/modules/module_28800.c +++ b/src/modules/module_28800.c @@ -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; diff --git a/src/modules/module_28900.c b/src/modules/module_28900.c index d706e5a3e..d0805d085 100644 --- a/src/modules/module_28900.c +++ b/src/modules/module_28900.c @@ -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; diff --git a/src/modules/module_29000.c b/src/modules/module_29000.c index 4204020d8..7e9682cf4 100644 --- a/src/modules/module_29000.c +++ b/src/modules/module_29000.c @@ -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; } diff --git a/src/modules/module_29700.c b/src/modules/module_29700.c index 2337f0e29..4a2ca92ac 100644 --- a/src/modules/module_29700.c +++ b/src/modules/module_29700.c @@ -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]); diff --git a/src/modules/module_29910.c b/src/modules/module_29910.c index 23ed260c7..bb76e8da4 100644 --- a/src/modules/module_29910.c +++ b/src/modules/module_29910.c @@ -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; diff --git a/src/modules/module_29920.c b/src/modules/module_29920.c index bb433b090..259e0f620 100644 --- a/src/modules/module_29920.c +++ b/src/modules/module_29920.c @@ -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 diff --git a/src/modules/module_29930.c b/src/modules/module_29930.c index bf467b029..d29e9bcfe 100644 --- a/src/modules/module_29930.c +++ b/src/modules/module_29930.c @@ -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 diff --git a/src/modules/module_29940.c b/src/modules/module_29940.c index 5cdca974e..be5522352 100644 --- a/src/modules/module_29940.c +++ b/src/modules/module_29940.c @@ -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 diff --git a/src/modules/module_30600.c b/src/modules/module_30600.c index 6ce51b72d..2af2eecd4 100644 --- a/src/modules/module_30600.c +++ b/src/modules/module_30600.c @@ -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); diff --git a/src/modules/module_31700.c b/src/modules/module_31700.c index a99bdc663..1bdb6161a 100644 --- a/src/modules/module_31700.c +++ b/src/modules/module_31700.c @@ -120,11 +120,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); @@ -184,13 +184,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; } diff --git a/src/modules/module_31800.c b/src/modules/module_31800.c index 459b0d9b2..8a91a90e7 100644 --- a/src/modules/module_31800.c +++ b/src/modules/module_31800.c @@ -341,7 +341,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // final - int out_len = snprintf ((char *) line_buf, line_size, "%s%s$%08x%08x%08x%08x%08x%08x%08x%08x$%08x%08x%08x%08x%08x%08x%08x%08x$%u$%s$%s$%08x%08x%08x%08x", + int out_len = snprintf (line_buf, line_size, "%s%s$%08x%08x%08x%08x%08x%08x%08x%08x$%08x%08x%08x%08x%08x%08x%08x%08x$%u$%s$%s$%08x%08x%08x%08x", SIGNATURE_1PASSWORD8, (const char *) onepassword8->email_buf, onepassword8->hkdf_salt_buf[0], diff --git a/src/modules/module_32300.c b/src/modules/module_32300.c index b78ce31bf..3c0462e72 100644 --- a/src/modules/module_32300.c +++ b/src/modules/module_32300.c @@ -129,11 +129,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (md5_triple_salt, 0, sizeof (md5_triple_salt_t)); - const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_triple_salt->salt1_buf, (int *) &md5_triple_salt->salt1_len); + const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_triple_salt->salt1_buf, &md5_triple_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_triple_salt->salt2_buf, (int *) &md5_triple_salt->salt2_len); + const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_triple_salt->salt2_buf, &md5_triple_salt->salt2_len); if (parse_rc2 == false) return (PARSER_SALT_LENGTH); @@ -206,13 +206,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_triple_salt->salt1_buf, (const int) md5_triple_salt->salt1_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) md5_triple_salt->salt1_buf, md5_triple_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_triple_salt->salt2_buf, (const int) md5_triple_salt->salt2_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) md5_triple_salt->salt2_buf, md5_triple_salt->salt2_len, out_buf + out_len); out_len -= 17; // remove empire_salt1 diff --git a/src/modules/module_32500.c b/src/modules/module_32500.c index f99791b28..74ae3b144 100644 --- a/src/modules/module_32500.c +++ b/src/modules/module_32500.c @@ -131,7 +131,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[256] = { 0 }; - int tmp_len = base64_decode (base64_to_int, (const u8 *) data_pos, data_len, tmp_buf); + int tmp_len = base64_decode (base64_to_int, data_pos, data_len, tmp_buf); memcpy (payload->pl_buf, tmp_buf, tmp_len);