diff --git a/OpenCL/m26610-pure.cl b/OpenCL/m26610-pure.cl index 9c51ea572..5408c5cdf 100644 --- a/OpenCL/m26610-pure.cl +++ b/OpenCL/m26610-pure.cl @@ -21,11 +21,11 @@ typedef struct pbkdf2_sha256_tmp { - u32 ipad[8]; - u32 opad[8]; + u32 ipad[8]; + u32 opad[8]; - u32 dgst[32]; - u32 out[32]; + u32 dgst[32]; + u32 out[32]; } pbkdf2_sha256_tmp_t; @@ -34,7 +34,7 @@ typedef struct pbkdf2_sha256_aes_gcm u32 salt_buf[64]; u32 iv_buf[4]; u32 iv_len; - u32 ct_buf[784]; // TODO this can be smaller and would speedup the attack, only 64 bytes of ciphertext are allowed + u32 ct_buf[16]; u32 ct_len; } pbkdf2_sha256_aes_gcm_t; @@ -368,7 +368,6 @@ KERNEL_FQ void m26610_comp (KERN_ATTR_TMPS_ESALT (pbkdf2_sha256_tmp_t, pbkdf2_sh AES_GCM_decrypt (key, J0, ct, 32, pt, s_te0, s_te1, s_te2, s_te3, s_te4); - const int correct = is_valid_printable_32 (pt[0]) + is_valid_printable_32 (pt[1]) + is_valid_printable_32 (pt[2]) diff --git a/OpenCL/m31900-pure.cl b/OpenCL/m31900-pure.cl new file mode 100644 index 000000000..24ffb1232 --- /dev/null +++ b/OpenCL/m31900-pure.cl @@ -0,0 +1,451 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#define NEW_SIMD_CODE + +#ifdef KERNEL_STATIC +#include M2S(INCLUDE_PATH/inc_vendor.h) +#include M2S(INCLUDE_PATH/inc_types.h) +#include M2S(INCLUDE_PATH/inc_platform.cl) +#include M2S(INCLUDE_PATH/inc_common.cl) +#include M2S(INCLUDE_PATH/inc_simd.cl) +#include M2S(INCLUDE_PATH/inc_hash_sha512.cl) +#include M2S(INCLUDE_PATH/inc_cipher_aes.cl) +#endif + +#define COMPARE_S M2S(INCLUDE_PATH/inc_comp_single.cl) +#define COMPARE_M M2S(INCLUDE_PATH/inc_comp_multi.cl) + +typedef struct pbkdf2_sha512_tmp +{ + u64 ipad[8]; + u64 opad[8]; + + u64 dgst[32]; + u64 out[32]; + +} pbkdf2_sha512_tmp_t; + +typedef struct pbkdf2_sha512_aes_cbc +{ + u32 salt_buf[64]; + u32 iv_buf[4]; + u32 iv_len; + u32 ct_buf[4]; + u32 ct_len; + +} pbkdf2_sha512_aes_cbc_t; + +DECLSPEC void hmac_sha512_run_V (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, PRIVATE_AS u64x *ipad, PRIVATE_AS u64x *opad, PRIVATE_AS u64x *digest) +{ + digest[0] = ipad[0]; + digest[1] = ipad[1]; + digest[2] = ipad[2]; + digest[3] = ipad[3]; + digest[4] = ipad[4]; + digest[5] = ipad[5]; + digest[6] = ipad[6]; + digest[7] = ipad[7]; + + sha512_transform_vector (w0, w1, w2, w3, w4, w5, w6, w7, digest); + + w0[0] = h32_from_64 (digest[0]); + w0[1] = l32_from_64 (digest[0]); + w0[2] = h32_from_64 (digest[1]); + w0[3] = l32_from_64 (digest[1]); + w1[0] = h32_from_64 (digest[2]); + w1[1] = l32_from_64 (digest[2]); + w1[2] = h32_from_64 (digest[3]); + w1[3] = l32_from_64 (digest[3]); + w2[0] = h32_from_64 (digest[4]); + w2[1] = l32_from_64 (digest[4]); + w2[2] = h32_from_64 (digest[5]); + w2[3] = l32_from_64 (digest[5]); + w3[0] = h32_from_64 (digest[6]); + w3[1] = l32_from_64 (digest[6]); + w3[2] = h32_from_64 (digest[7]); + w3[3] = l32_from_64 (digest[7]); + w4[0] = 0x80000000; + w4[1] = 0; + w4[2] = 0; + w4[3] = 0; + w5[0] = 0; + w5[1] = 0; + w5[2] = 0; + w5[3] = 0; + w6[0] = 0; + w6[1] = 0; + w6[2] = 0; + w6[3] = 0; + w7[0] = 0; + w7[1] = 0; + w7[2] = 0; + w7[3] = (128 + 64) * 8; + + digest[0] = opad[0]; + digest[1] = opad[1]; + digest[2] = opad[2]; + digest[3] = opad[3]; + digest[4] = opad[4]; + digest[5] = opad[5]; + digest[6] = opad[6]; + digest[7] = opad[7]; + + sha512_transform_vector (w0, w1, w2, w3, w4, w5, w6, w7, digest); +} + +KERNEL_FQ void m31900_init (KERN_ATTR_TMPS_ESALT (pbkdf2_sha512_tmp_t, pbkdf2_sha512_aes_cbc_t)) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= GID_CNT) return; + + sha512_hmac_ctx_t sha512_hmac_ctx; + + sha512_hmac_init_global_swap (&sha512_hmac_ctx, pws[gid].i, pws[gid].pw_len); + + tmps[gid].ipad[0] = sha512_hmac_ctx.ipad.h[0]; + tmps[gid].ipad[1] = sha512_hmac_ctx.ipad.h[1]; + tmps[gid].ipad[2] = sha512_hmac_ctx.ipad.h[2]; + tmps[gid].ipad[3] = sha512_hmac_ctx.ipad.h[3]; + tmps[gid].ipad[4] = sha512_hmac_ctx.ipad.h[4]; + tmps[gid].ipad[5] = sha512_hmac_ctx.ipad.h[5]; + tmps[gid].ipad[6] = sha512_hmac_ctx.ipad.h[6]; + tmps[gid].ipad[7] = sha512_hmac_ctx.ipad.h[7]; + + tmps[gid].opad[0] = sha512_hmac_ctx.opad.h[0]; + tmps[gid].opad[1] = sha512_hmac_ctx.opad.h[1]; + tmps[gid].opad[2] = sha512_hmac_ctx.opad.h[2]; + tmps[gid].opad[3] = sha512_hmac_ctx.opad.h[3]; + tmps[gid].opad[4] = sha512_hmac_ctx.opad.h[4]; + tmps[gid].opad[5] = sha512_hmac_ctx.opad.h[5]; + tmps[gid].opad[6] = sha512_hmac_ctx.opad.h[6]; + tmps[gid].opad[7] = sha512_hmac_ctx.opad.h[7]; + + sha512_hmac_update_global_swap (&sha512_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, salt_bufs[SALT_POS_HOST].salt_len); + + for (u32 i = 0, j = 1; i < 8; i += 8, j += 1) + { + sha512_hmac_ctx_t sha512_hmac_ctx2 = sha512_hmac_ctx; + + u32 w0[4]; + u32 w1[4]; + u32 w2[4]; + u32 w3[4]; + u32 w4[4]; + u32 w5[4]; + u32 w6[4]; + u32 w7[4]; + + w0[0] = j; + w0[1] = 0; + w0[2] = 0; + w0[3] = 0; + w1[0] = 0; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = 0; + w4[0] = 0; + w4[1] = 0; + w4[2] = 0; + w4[3] = 0; + w5[0] = 0; + w5[1] = 0; + w5[2] = 0; + w5[3] = 0; + w6[0] = 0; + w6[1] = 0; + w6[2] = 0; + w6[3] = 0; + w7[0] = 0; + w7[1] = 0; + w7[2] = 0; + w7[3] = 0; + + sha512_hmac_update_128 (&sha512_hmac_ctx2, w0, w1, w2, w3, w4, w5, w6, w7, 4); + + sha512_hmac_final (&sha512_hmac_ctx2); + + tmps[gid].dgst[i + 0] = sha512_hmac_ctx2.opad.h[0]; + tmps[gid].dgst[i + 1] = sha512_hmac_ctx2.opad.h[1]; + tmps[gid].dgst[i + 2] = sha512_hmac_ctx2.opad.h[2]; + tmps[gid].dgst[i + 3] = sha512_hmac_ctx2.opad.h[3]; + tmps[gid].dgst[i + 4] = sha512_hmac_ctx2.opad.h[4]; + tmps[gid].dgst[i + 5] = sha512_hmac_ctx2.opad.h[5]; + tmps[gid].dgst[i + 6] = sha512_hmac_ctx2.opad.h[6]; + tmps[gid].dgst[i + 7] = sha512_hmac_ctx2.opad.h[7]; + + tmps[gid].out[i + 0] = tmps[gid].dgst[i + 0]; + tmps[gid].out[i + 1] = tmps[gid].dgst[i + 1]; + tmps[gid].out[i + 2] = tmps[gid].dgst[i + 2]; + tmps[gid].out[i + 3] = tmps[gid].dgst[i + 3]; + tmps[gid].out[i + 4] = tmps[gid].dgst[i + 4]; + tmps[gid].out[i + 5] = tmps[gid].dgst[i + 5]; + tmps[gid].out[i + 6] = tmps[gid].dgst[i + 6]; + tmps[gid].out[i + 7] = tmps[gid].dgst[i + 7]; + } +} + +KERNEL_FQ void m31900_loop (KERN_ATTR_TMPS_ESALT (pbkdf2_sha512_tmp_t, pbkdf2_sha512_aes_cbc_t)) +{ + const u64 gid = get_global_id (0); + + if ((gid * VECT_SIZE) >= GID_CNT) return; + + u64x ipad[8]; + u64x opad[8]; + + ipad[0] = pack64v (tmps, ipad, gid, 0); + ipad[1] = pack64v (tmps, ipad, gid, 1); + ipad[2] = pack64v (tmps, ipad, gid, 2); + ipad[3] = pack64v (tmps, ipad, gid, 3); + ipad[4] = pack64v (tmps, ipad, gid, 4); + ipad[5] = pack64v (tmps, ipad, gid, 5); + ipad[6] = pack64v (tmps, ipad, gid, 6); + ipad[7] = pack64v (tmps, ipad, gid, 7); + + opad[0] = pack64v (tmps, opad, gid, 0); + opad[1] = pack64v (tmps, opad, gid, 1); + opad[2] = pack64v (tmps, opad, gid, 2); + opad[3] = pack64v (tmps, opad, gid, 3); + opad[4] = pack64v (tmps, opad, gid, 4); + opad[5] = pack64v (tmps, opad, gid, 5); + opad[6] = pack64v (tmps, opad, gid, 6); + opad[7] = pack64v (tmps, opad, gid, 7); + + for (u32 i = 0; i < 8; i += 8) + { + u64x dgst[8]; + u64x out[8]; + + dgst[0] = pack64v (tmps, dgst, gid, i + 0); + dgst[1] = pack64v (tmps, dgst, gid, i + 1); + dgst[2] = pack64v (tmps, dgst, gid, i + 2); + dgst[3] = pack64v (tmps, dgst, gid, i + 3); + dgst[4] = pack64v (tmps, dgst, gid, i + 4); + dgst[5] = pack64v (tmps, dgst, gid, i + 5); + dgst[6] = pack64v (tmps, dgst, gid, i + 6); + dgst[7] = pack64v (tmps, dgst, gid, i + 7); + + out[0] = pack64v (tmps, out, gid, i + 0); + out[1] = pack64v (tmps, out, gid, i + 1); + out[2] = pack64v (tmps, out, gid, i + 2); + out[3] = pack64v (tmps, out, gid, i + 3); + out[4] = pack64v (tmps, out, gid, i + 4); + out[5] = pack64v (tmps, out, gid, i + 5); + out[6] = pack64v (tmps, out, gid, i + 6); + out[7] = pack64v (tmps, out, gid, i + 7); + + for (u32 j = 0; j < LOOP_CNT; j++) + { + u32x w0[4]; + u32x w1[4]; + u32x w2[4]; + u32x w3[4]; + u32x w4[4]; + u32x w5[4]; + u32x w6[4]; + u32x w7[4]; + + w0[0] = h32_from_64 (dgst[0]); + w0[1] = l32_from_64 (dgst[0]); + w0[2] = h32_from_64 (dgst[1]); + w0[3] = l32_from_64 (dgst[1]); + w1[0] = h32_from_64 (dgst[2]); + w1[1] = l32_from_64 (dgst[2]); + w1[2] = h32_from_64 (dgst[3]); + w1[3] = l32_from_64 (dgst[3]); + w2[0] = h32_from_64 (dgst[4]); + w2[1] = l32_from_64 (dgst[4]); + w2[2] = h32_from_64 (dgst[5]); + w2[3] = l32_from_64 (dgst[5]); + w3[0] = h32_from_64 (dgst[6]); + w3[1] = l32_from_64 (dgst[6]); + w3[2] = h32_from_64 (dgst[7]); + w3[3] = l32_from_64 (dgst[7]); + w4[0] = 0x80000000; + w4[1] = 0; + w4[2] = 0; + w4[3] = 0; + w5[0] = 0; + w5[1] = 0; + w5[2] = 0; + w5[3] = 0; + w6[0] = 0; + w6[1] = 0; + w6[2] = 0; + w6[3] = 0; + w7[0] = 0; + w7[1] = 0; + w7[2] = 0; + w7[3] = (128 + 64) * 8; + + hmac_sha512_run_V (w0, w1, w2, w3, w4, w5, w6, w7, ipad, opad, dgst); + + out[0] ^= dgst[0]; + out[1] ^= dgst[1]; + out[2] ^= dgst[2]; + out[3] ^= dgst[3]; + out[4] ^= dgst[4]; + out[5] ^= dgst[5]; + out[6] ^= dgst[6]; + out[7] ^= dgst[7]; + } + + unpack64v (tmps, dgst, gid, i + 0, dgst[0]); + unpack64v (tmps, dgst, gid, i + 1, dgst[1]); + unpack64v (tmps, dgst, gid, i + 2, dgst[2]); + unpack64v (tmps, dgst, gid, i + 3, dgst[3]); + unpack64v (tmps, dgst, gid, i + 4, dgst[4]); + unpack64v (tmps, dgst, gid, i + 5, dgst[5]); + unpack64v (tmps, dgst, gid, i + 6, dgst[6]); + unpack64v (tmps, dgst, gid, i + 7, dgst[7]); + + unpack64v (tmps, out, gid, i + 0, out[0]); + unpack64v (tmps, out, gid, i + 1, out[1]); + unpack64v (tmps, out, gid, i + 2, out[2]); + unpack64v (tmps, out, gid, i + 3, out[3]); + unpack64v (tmps, out, gid, i + 4, out[4]); + unpack64v (tmps, out, gid, i + 5, out[5]); + unpack64v (tmps, out, gid, i + 6, out[6]); + unpack64v (tmps, out, gid, i + 7, out[7]); + } +} + +KERNEL_FQ void m31900_comp (KERN_ATTR_TMPS_ESALT (pbkdf2_sha512_tmp_t, pbkdf2_sha512_aes_cbc_t)) +{ + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + LOCAL_VK u32 s_td0[256]; + LOCAL_VK u32 s_td1[256]; + LOCAL_VK u32 s_td2[256]; + LOCAL_VK u32 s_td3[256]; + LOCAL_VK u32 s_td4[256]; + + LOCAL_VK u32 s_te0[256]; + LOCAL_VK u32 s_te1[256]; + LOCAL_VK u32 s_te2[256]; + LOCAL_VK u32 s_te3[256]; + LOCAL_VK u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + SYNC_THREADS (); + + #else + + CONSTANT_AS u32a *s_td0 = td0; + CONSTANT_AS u32a *s_td1 = td1; + CONSTANT_AS u32a *s_td2 = td2; + CONSTANT_AS u32a *s_td3 = td3; + CONSTANT_AS u32a *s_td4 = td4; + + CONSTANT_AS u32a *s_te0 = te0; + CONSTANT_AS u32a *s_te1 = te1; + CONSTANT_AS u32a *s_te2 = te2; + CONSTANT_AS u32a *s_te3 = te3; + CONSTANT_AS u32a *s_te4 = te4; + + #endif + + if (gid >= GID_CNT) return; + + // keys + + u32 ukey[8]; + + ukey[0] = h32_from_64_S (tmps[gid].out[0]); + ukey[1] = l32_from_64_S (tmps[gid].out[0]); + ukey[2] = h32_from_64_S (tmps[gid].out[1]); + ukey[3] = l32_from_64_S (tmps[gid].out[1]); + ukey[4] = h32_from_64_S (tmps[gid].out[2]); + ukey[5] = l32_from_64_S (tmps[gid].out[2]); + ukey[6] = h32_from_64_S (tmps[gid].out[3]); + ukey[7] = l32_from_64_S (tmps[gid].out[3]); + + u32 ks[60]; + + AES256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_td0, s_td1, s_td2, s_td3); + + // iv + + u32 iv_buf[4]; + + iv_buf[0] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[0]; + iv_buf[1] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[1]; + iv_buf[2] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[2]; + iv_buf[3] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[3]; + + // ct + + u32 ct_buf[4]; + + ct_buf[0] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[0]; + ct_buf[1] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[1]; + ct_buf[2] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[2]; + ct_buf[3] = esalt_bufs[DIGESTS_OFFSET_HOST].ct_buf[3]; + + // decrypt first block + + u32 pt_buf[4] = { 0 }; + + AES256_decrypt (ks, ct_buf, pt_buf, s_td0, s_td1, s_td2, s_td3, s_td4); + + pt_buf[0] ^= iv_buf[0]; + pt_buf[1] ^= iv_buf[1]; + pt_buf[2] ^= iv_buf[2]; + pt_buf[3] ^= iv_buf[3]; + + const int correct = is_valid_printable_32 (pt_buf[0]) + + is_valid_printable_32 (pt_buf[1]) + + is_valid_printable_32 (pt_buf[2]) + + is_valid_printable_32 (pt_buf[3]); + + if (correct != 4) return; + + const u32 r0 = ct_buf[0]; + const u32 r1 = ct_buf[1]; + const u32 r2 = ct_buf[2]; + const u32 r3 = ct_buf[3]; + + #define il_pos 0 + + #ifdef KERNEL_STATIC + #include COMPARE_M + #endif +} diff --git a/docs/changes.txt b/docs/changes.txt index 8da7f3d7c..a10eae2d2 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -20,6 +20,7 @@ - Added hash-mode: GPG (AES-128/AES-256 (SHA-1($pass))) - Added hash-mode: GPG (AES-128/AES-256 (SHA-256($pass))) - Added hash-mode: GPG (AES-128/AES-256 (SHA-512($pass))) +- Added hash-mode: MetaMask Mobile Wallet - Added hash-mode: MetaMask Wallet (short hash, plaintext check) - Added hash-mode: SecureCRT MasterPassphrase v2 - Added hash-mode: Veeam VB @@ -51,13 +52,18 @@ - Skip chained generated rules that exceed the maximum number of function calls - Fixed incorrect plaintext check for 25400 and 26610. Increased plaintext check to 32 bytes to prevent false positives. - Fixed bug in --stdout that caused certain rules to malfunction +- Fixed bug in 18400 module_hash_encode - Fixed bug in 26900 module_hash_encode +- Fixed bug in grep out-of-memory workaround on Unit Test +- Fixed bug in input_tokenizer when TOKEN_ATTR_FIXED_LENGTH is used and refactor modules - Fixed build failed for 18400 with Apple Metal - Fixed build failed for 18600 with Apple Metal - Fixed display problem of the "Optimizers applied" list for algorithms using OPTI_TYPE_SLOW_HASH_SIMD_INIT2 and/or OPTI_TYPE_SLOW_HASH_SIMD_LOOP2 - Fixed incompatible pointer types (salt1 and salt2 buf) in 31700 a3 kernel - Fixed incompatible pointer types (salt1 and salt2 buf) in 3730 a3 kernel - Handle signed/unsigned PDF permission P value for all PDF hash-modes +- Fixed minimum password length in module of hash-mode 29800 +- Fixed buffer overflow on module_26600.c / module_hash_encode() ## ## Technical @@ -74,6 +80,7 @@ - Scrypt: Increase buffer sizes in module for hash mode 8900 to allow longer scrypt digests - Unicode: Update UTF-8 to UTF-16 conversion to match RFC 3629 - User Options: Added error message when mixing --username and --show to warn users of exponential delay +- MetaMask: update extraction tool to support MetaMask Mobile wallets * changes v6.2.5 -> v6.2.6 diff --git a/docs/readme.txt b/docs/readme.txt index c2f64a2c0..574055698 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -420,6 +420,7 @@ NVIDIA GPUs require "NVIDIA Driver" (440.64 or later) and "CUDA Toolkit" (9.0 or - Skype - Anope IRC Services (enc_sha256) - Terra Station Wallet (AES256-CBC(PBKDF2($pass))) +- MetaMask Mobile Wallet - MetaMask Wallet (needs all data, checks AES-GCM tag) - MetaMask Wallet (short hash, plaintext check) - Bisq .wallet (scrypt) diff --git a/src/modules/module_00000.c b/src/modules/module_00000.c index 8c4190264..127d95c16 100644 --- a/src/modules/module_00000.c +++ b/src/modules/module_00000.c @@ -55,11 +55,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_00010.c b/src/modules/module_00010.c index 4fadfe1d5..57197205e 100644 --- a/src/modules/module_00010.c +++ b/src/modules/module_00010.c @@ -55,12 +55,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00011.c b/src/modules/module_00011.c index 6d30965e1..e762f70d7 100644 --- a/src/modules/module_00011.c +++ b/src/modules/module_00011.c @@ -55,17 +55,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 32; - token.len_max[1] = 32; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 32; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { diff --git a/src/modules/module_00012.c b/src/modules/module_00012.c index d9fa59a78..f0236e151 100644 --- a/src/modules/module_00012.c +++ b/src/modules/module_00012.c @@ -55,12 +55,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = 0; diff --git a/src/modules/module_00020.c b/src/modules/module_00020.c index 134e22708..505f648e4 100644 --- a/src/modules/module_00020.c +++ b/src/modules/module_00020.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00021.c b/src/modules/module_00021.c index 7223cad97..7ad9d9acf 100644 --- a/src/modules/module_00021.c +++ b/src/modules/module_00021.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[1] = 2; diff --git a/src/modules/module_00022.c b/src/modules/module_00022.c index 83ea25c18..986ddc37e 100644 --- a/src/modules/module_00022.c +++ b/src/modules/module_00022.c @@ -56,12 +56,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 30; - token.len_max[0] = 30; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 30; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00023.c b/src/modules/module_00023.c index 81c35d48e..1cbce89a2 100644 --- a/src/modules/module_00023.c +++ b/src/modules/module_00023.c @@ -56,12 +56,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00024.c b/src/modules/module_00024.c index 3f0652298..fedd77c37 100644 --- a/src/modules/module_00024.c +++ b/src/modules/module_00024.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[1] = 2; diff --git a/src/modules/module_00030.c b/src/modules/module_00030.c index e1306c98e..50c5ca511 100644 --- a/src/modules/module_00030.c +++ b/src/modules/module_00030.c @@ -56,12 +56,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00040.c b/src/modules/module_00040.c index 1bdf420bc..2d0186982 100644 --- a/src/modules/module_00040.c +++ b/src/modules/module_00040.c @@ -55,12 +55,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00050.c b/src/modules/module_00050.c index 7b7ad4c68..7e4eeaa4d 100644 --- a/src/modules/module_00050.c +++ b/src/modules/module_00050.c @@ -50,12 +50,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00060.c b/src/modules/module_00060.c index a91a7e38f..7a3e0757d 100644 --- a/src/modules/module_00060.c +++ b/src/modules/module_00060.c @@ -50,12 +50,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00070.c b/src/modules/module_00070.c index 04cb1a020..d503dd5fe 100644 --- a/src/modules/module_00070.c +++ b/src/modules/module_00070.c @@ -56,11 +56,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_00100.c b/src/modules/module_00100.c index ea725c5b2..3d6bb223d 100644 --- a/src/modules/module_00100.c +++ b/src/modules/module_00100.c @@ -54,11 +54,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_00101.c b/src/modules/module_00101.c index fd7a1181c..7482896e2 100644 --- a/src/modules/module_00101.c +++ b/src/modules/module_00101.c @@ -54,6 +54,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; @@ -63,9 +65,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 28; - token.len_max[1] = 28; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 28; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_00110.c b/src/modules/module_00110.c index f9b384301..30ce167af 100644 --- a/src/modules/module_00110.c +++ b/src/modules/module_00110.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00111.c b/src/modules/module_00111.c index 10e8c9c23..499c9a67c 100644 --- a/src/modules/module_00111.c +++ b/src/modules/module_00111.c @@ -57,6 +57,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 2; diff --git a/src/modules/module_00112.c b/src/modules/module_00112.c index 370adaf82..152f2314a 100644 --- a/src/modules/module_00112.c +++ b/src/modules/module_00112.c @@ -62,17 +62,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 20; - token.len_max[1] = 20; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 20; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_00120.c b/src/modules/module_00120.c index 6a1f0f089..2ecb1aa79 100644 --- a/src/modules/module_00120.c +++ b/src/modules/module_00120.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00121.c b/src/modules/module_00121.c index 497fa2167..e988a45a6 100644 --- a/src/modules/module_00121.c +++ b/src/modules/module_00121.c @@ -55,12 +55,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00122.c b/src/modules/module_00122.c index 5ab58b391..c806a2055 100644 --- a/src/modules/module_00122.c +++ b/src/modules/module_00122.c @@ -55,6 +55,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.len[0] = 8; diff --git a/src/modules/module_00124.c b/src/modules/module_00124.c index 1c08c6f87..ccdfe4e63 100644 --- a/src/modules/module_00124.c +++ b/src/modules/module_00124.c @@ -56,6 +56,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; diff --git a/src/modules/module_00125.c b/src/modules/module_00125.c index 396194aed..b865e087a 100644 --- a/src/modules/module_00125.c +++ b/src/modules/module_00125.c @@ -55,6 +55,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.len[0] = 10; diff --git a/src/modules/module_00130.c b/src/modules/module_00130.c index 713ff747f..d071fdc94 100644 --- a/src/modules/module_00130.c +++ b/src/modules/module_00130.c @@ -55,12 +55,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00131.c b/src/modules/module_00131.c index 3b3bbcffe..26eae96f9 100644 --- a/src/modules/module_00131.c +++ b/src/modules/module_00131.c @@ -59,6 +59,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; diff --git a/src/modules/module_00132.c b/src/modules/module_00132.c index 33257e486..ab05701cb 100644 --- a/src/modules/module_00132.c +++ b/src/modules/module_00132.c @@ -58,6 +58,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; diff --git a/src/modules/module_00133.c b/src/modules/module_00133.c index f10d1966b..ecef6b61f 100644 --- a/src/modules/module_00133.c +++ b/src/modules/module_00133.c @@ -55,11 +55,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 28; - token.len_max[0] = 28; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 28; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_00140.c b/src/modules/module_00140.c index 42227e7b7..bfded211a 100644 --- a/src/modules/module_00140.c +++ b/src/modules/module_00140.c @@ -55,12 +55,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00141.c b/src/modules/module_00141.c index 2bed1ea03..6a356562f 100644 --- a/src/modules/module_00141.c +++ b/src/modules/module_00141.c @@ -58,32 +58,32 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_EPISERVER; - token.len_min[0] = 11; - token.len_max[0] = 11; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 11; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '*'; token.len_min[1] = 1; token.len_max[1] = 6; - token.sep[1] = '*'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[2] = '*'; token.len_min[2] = ((SALT_MIN * 8) / 6) + 0; token.len_max[2] = ((SALT_MAX * 8) / 6) + 3; - token.sep[2] = '*'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; - token.len_min[3] = 27; - token.len_max[3] = 27; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 27; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_00150.c b/src/modules/module_00150.c index d770c6898..9df2e605c 100644 --- a/src/modules/module_00150.c +++ b/src/modules/module_00150.c @@ -50,12 +50,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00160.c b/src/modules/module_00160.c index 35249b7e4..ab82bed03 100644 --- a/src/modules/module_00160.c +++ b/src/modules/module_00160.c @@ -50,12 +50,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_00170.c b/src/modules/module_00170.c index 4856f3379..ae08beca6 100644 --- a/src/modules/module_00170.c +++ b/src/modules/module_00170.c @@ -55,11 +55,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_00200.c b/src/modules/module_00200.c index eb4905525..e2bd7c8f4 100644 --- a/src/modules/module_00200.c +++ b/src/modules/module_00200.c @@ -47,11 +47,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_00300.c b/src/modules/module_00300.c index 1a318dc20..db4731a85 100644 --- a/src/modules/module_00300.c +++ b/src/modules/module_00300.c @@ -53,11 +53,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_00400.c b/src/modules/module_00400.c index 9fff7051d..3105bc546 100644 --- a/src/modules/module_00400.c +++ b/src/modules/module_00400.c @@ -172,6 +172,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 2; diff --git a/src/modules/module_00500.c b/src/modules/module_00500.c index e86de7a19..e2e6bba93 100644 --- a/src/modules/module_00500.c +++ b/src/modules/module_00500.c @@ -172,6 +172,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -181,9 +183,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '$'; token.len_min[1] = 0; token.len_max[1] = 8; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_OPTIONAL_ROUNDS; diff --git a/src/modules/module_00501.c b/src/modules/module_00501.c index b22c8f80d..885951b59 100644 --- a/src/modules/module_00501.c +++ b/src/modules/module_00501.c @@ -251,11 +251,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 104; - token.len_max[0] = 104; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 104; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); @@ -281,10 +282,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token2.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token2.len_min[1] = 8; - token2.len_max[1] = 8; token2.sep[1] = '$'; - token2.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token2.len[1] = 8; + token2.attr[1] = TOKEN_ATTR_FIXED_LENGTH; token2.len[2] = 22; token2.attr[2] = TOKEN_ATTR_FIXED_LENGTH diff --git a/src/modules/module_00600.c b/src/modules/module_00600.c index ec36cb376..9165bb744 100644 --- a/src/modules/module_00600.c +++ b/src/modules/module_00600.c @@ -51,6 +51,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_00610.c b/src/modules/module_00610.c index 8242494d1..05f5074dc 100644 --- a/src/modules/module_00610.c +++ b/src/modules/module_00610.c @@ -52,6 +52,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; // signature @@ -64,9 +66,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // hash token.sep[1] = hashconfig->separator; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // salt diff --git a/src/modules/module_00620.c b/src/modules/module_00620.c index fab49c066..fc56fadb6 100644 --- a/src/modules/module_00620.c +++ b/src/modules/module_00620.c @@ -52,6 +52,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; // signature @@ -64,9 +66,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // hash token.sep[1] = hashconfig->separator; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // salt diff --git a/src/modules/module_00900.c b/src/modules/module_00900.c index 4200b54aa..8e007962a 100644 --- a/src/modules/module_00900.c +++ b/src/modules/module_00900.c @@ -55,11 +55,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_01000.c b/src/modules/module_01000.c index 8a1a35536..7662af81b 100644 --- a/src/modules/module_01000.c +++ b/src/modules/module_01000.c @@ -58,11 +58,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_01100.c b/src/modules/module_01100.c index 1e1c9b9f8..d514c311e 100644 --- a/src/modules/module_01100.c +++ b/src/modules/module_01100.c @@ -56,12 +56,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01300.c b/src/modules/module_01300.c index d4f3b5f21..149fd39ad 100644 --- a/src/modules/module_01300.c +++ b/src/modules/module_01300.c @@ -54,11 +54,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 56; - token.len_max[0] = 56; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 56; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_01400.c b/src/modules/module_01400.c index dfa7c0136..ab002efbe 100644 --- a/src/modules/module_01400.c +++ b/src/modules/module_01400.c @@ -54,11 +54,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_01410.c b/src/modules/module_01410.c index a54104a02..f2f763bfe 100644 --- a/src/modules/module_01410.c +++ b/src/modules/module_01410.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01411.c b/src/modules/module_01411.c index 6584decc0..63d8bde69 100644 --- a/src/modules/module_01411.c +++ b/src/modules/module_01411.c @@ -56,6 +56,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_01420.c b/src/modules/module_01420.c index a0e9c6764..795bd254f 100644 --- a/src/modules/module_01420.c +++ b/src/modules/module_01420.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01421.c b/src/modules/module_01421.c index 6bfe2dd75..22cda42c1 100644 --- a/src/modules/module_01421.c +++ b/src/modules/module_01421.c @@ -54,14 +54,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.len[0] = 6; token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; - token.len_min[1] = 64; - token.len_max[1] = 64; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 64; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_01430.c b/src/modules/module_01430.c index c3931e087..650a7ec92 100644 --- a/src/modules/module_01430.c +++ b/src/modules/module_01430.c @@ -55,12 +55,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01440.c b/src/modules/module_01440.c index 9aca7a0de..4dd8fb3c6 100644 --- a/src/modules/module_01440.c +++ b/src/modules/module_01440.c @@ -55,12 +55,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01441.c b/src/modules/module_01441.c index 63c7d2c96..89ff454d6 100644 --- a/src/modules/module_01441.c +++ b/src/modules/module_01441.c @@ -58,32 +58,32 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_EPISERVER; - token.len_min[0] = 11; - token.len_max[0] = 11; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 11; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '*'; token.len_min[1] = 1; token.len_max[1] = 6; - token.sep[1] = '*'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[2] = '*'; token.len_min[2] = ((SALT_MIN * 8) / 6) + 0; token.len_max[2] = ((SALT_MAX * 8) / 6) + 3; - token.sep[2] = '*'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; - token.len_min[3] = 43; - token.len_max[3] = 43; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 43; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_01450.c b/src/modules/module_01450.c index bbf13ff02..b909b0b70 100644 --- a/src/modules/module_01450.c +++ b/src/modules/module_01450.c @@ -49,12 +49,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01460.c b/src/modules/module_01460.c index f04ff77c2..08937aeb2 100644 --- a/src/modules/module_01460.c +++ b/src/modules/module_01460.c @@ -81,12 +81,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01470.c b/src/modules/module_01470.c index 735351a67..07d3b5bee 100644 --- a/src/modules/module_01470.c +++ b/src/modules/module_01470.c @@ -55,11 +55,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_01500.c b/src/modules/module_01500.c index b939b0a10..1956999dd 100644 --- a/src/modules/module_01500.c +++ b/src/modules/module_01500.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.len[0] = 2; diff --git a/src/modules/module_01600.c b/src/modules/module_01600.c index 5c62252b1..fd2698d9d 100644 --- a/src/modules/module_01600.c +++ b/src/modules/module_01600.c @@ -172,6 +172,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -181,9 +183,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '$'; token.len_min[1] = 0; token.len_max[1] = 8; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_OPTIONAL_ROUNDS; diff --git a/src/modules/module_01700.c b/src/modules/module_01700.c index f6c8b839f..66398ad54 100644 --- a/src/modules/module_01700.c +++ b/src/modules/module_01700.c @@ -86,11 +86,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_01710.c b/src/modules/module_01710.c index a302a1957..870bc22ef 100644 --- a/src/modules/module_01710.c +++ b/src/modules/module_01710.c @@ -86,12 +86,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01711.c b/src/modules/module_01711.c index 8c92539d4..7d5f1b112 100644 --- a/src/modules/module_01711.c +++ b/src/modules/module_01711.c @@ -88,6 +88,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_01720.c b/src/modules/module_01720.c index 7c1c0aaaa..01b2571ee 100644 --- a/src/modules/module_01720.c +++ b/src/modules/module_01720.c @@ -86,12 +86,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01722.c b/src/modules/module_01722.c index 69c2aac70..9da97c101 100644 --- a/src/modules/module_01722.c +++ b/src/modules/module_01722.c @@ -87,6 +87,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.len[0] = 8; diff --git a/src/modules/module_01730.c b/src/modules/module_01730.c index bb1280a97..0f9d1632b 100644 --- a/src/modules/module_01730.c +++ b/src/modules/module_01730.c @@ -87,12 +87,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01731.c b/src/modules/module_01731.c index 26dc8b9fd..a150b407d 100644 --- a/src/modules/module_01731.c +++ b/src/modules/module_01731.c @@ -90,6 +90,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; diff --git a/src/modules/module_01740.c b/src/modules/module_01740.c index 19289d9ad..c45cb2cdf 100644 --- a/src/modules/module_01740.c +++ b/src/modules/module_01740.c @@ -87,12 +87,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01750.c b/src/modules/module_01750.c index 93f162be1..e2eaa5382 100644 --- a/src/modules/module_01750.c +++ b/src/modules/module_01750.c @@ -50,12 +50,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01760.c b/src/modules/module_01760.c index 1311f89be..b2bff2f12 100644 --- a/src/modules/module_01760.c +++ b/src/modules/module_01760.c @@ -51,12 +51,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_01770.c b/src/modules/module_01770.c index a0e0cac4f..799f0d71f 100644 --- a/src/modules/module_01770.c +++ b/src/modules/module_01770.c @@ -70,11 +70,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_01800.c b/src/modules/module_01800.c index a983cda0a..eeea0a484 100644 --- a/src/modules/module_01800.c +++ b/src/modules/module_01800.c @@ -494,6 +494,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -503,9 +505,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '$'; token.len_min[1] = 0; token.len_max[1] = 16; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_OPTIONAL_ROUNDS; diff --git a/src/modules/module_02100.c b/src/modules/module_02100.c index 154b9d789..a304c003f 100644 --- a/src/modules/module_02100.c +++ b/src/modules/module_02100.c @@ -78,6 +78,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -87,21 +89,20 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '#'; token.len_min[1] = 1; token.len_max[1] = 6; - token.sep[1] = '#'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[2] = '#'; token.len_min[2] = SALT_MIN; token.len_max[2] = SALT_MAX; - token.sep[2] = '#'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_SEPARATOR_FARTHEST; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_02400.c b/src/modules/module_02400.c index 09e8f3396..064a0986d 100644 --- a/src/modules/module_02400.c +++ b/src/modules/module_02400.c @@ -51,12 +51,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.sep[0] = ':'; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64B; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_02410.c b/src/modules/module_02410.c index 47e4f46d4..a12eb50c8 100644 --- a/src/modules/module_02410.c +++ b/src/modules/module_02410.c @@ -50,12 +50,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64B; token.len_min[1] = 1; diff --git a/src/modules/module_02600.c b/src/modules/module_02600.c index 02bbeeb03..a784dcb79 100644 --- a/src/modules/module_02600.c +++ b/src/modules/module_02600.c @@ -52,11 +52,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_02611.c b/src/modules/module_02611.c index cb3902db9..096fb3cd8 100644 --- a/src/modules/module_02611.c +++ b/src/modules/module_02611.c @@ -52,12 +52,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_02612.c b/src/modules/module_02612.c index 8ca360b7d..56edc1de8 100644 --- a/src/modules/module_02612.c +++ b/src/modules/module_02612.c @@ -55,6 +55,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -70,9 +72,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_02711.c b/src/modules/module_02711.c index 242d95c76..e9943538f 100644 --- a/src/modules/module_02711.c +++ b/src/modules/module_02711.c @@ -52,12 +52,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_02811.c b/src/modules/module_02811.c index eb587a4c6..7f9c5fb3a 100644 --- a/src/modules/module_02811.c +++ b/src/modules/module_02811.c @@ -80,12 +80,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_03000.c b/src/modules/module_03000.c index 741ef1f91..2fe4cf17b 100644 --- a/src/modules/module_03000.c +++ b/src/modules/module_03000.c @@ -162,12 +162,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.sep[0] = hashconfig->separator; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_03100.c b/src/modules/module_03100.c index b42bb584a..af0f98840 100644 --- a/src/modules/module_03100.c +++ b/src/modules/module_03100.c @@ -75,12 +75,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = 0; diff --git a/src/modules/module_03200.c b/src/modules/module_03200.c index 98ff740e1..8f0ad91aa 100644 --- a/src/modules/module_03200.c +++ b/src/modules/module_03200.c @@ -178,6 +178,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 4; @@ -190,10 +192,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 2; - token.len_max[1] = 2; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.len[2] = 22; diff --git a/src/modules/module_03500.c b/src/modules/module_03500.c index b4f2fec4e..cdca0d157 100644 --- a/src/modules/module_03500.c +++ b/src/modules/module_03500.c @@ -52,11 +52,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_03710.c b/src/modules/module_03710.c index a92e7c405..787473468 100644 --- a/src/modules/module_03710.c +++ b/src/modules/module_03710.c @@ -51,12 +51,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_03711.c b/src/modules/module_03711.c index 85d5e4bdf..ad7fd3a9a 100644 --- a/src/modules/module_03711.c +++ b/src/modules/module_03711.c @@ -53,6 +53,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -67,9 +69,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.len_max[1] = SALT_MAX; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_03730.c b/src/modules/module_03730.c index 336fa32d4..eb37c234f 100644 --- a/src/modules/module_03730.c +++ b/src/modules/module_03730.c @@ -71,12 +71,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = hashconfig->separator; diff --git a/src/modules/module_03800.c b/src/modules/module_03800.c index 860ea5e85..a863b7ec0 100644 --- a/src/modules/module_03800.c +++ b/src/modules/module_03800.c @@ -52,12 +52,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_03910.c b/src/modules/module_03910.c index 8f643fc1a..4aebe37c3 100644 --- a/src/modules/module_03910.c +++ b/src/modules/module_03910.c @@ -82,12 +82,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_04010.c b/src/modules/module_04010.c index 49198d6ee..0e7e2063e 100644 --- a/src/modules/module_04010.c +++ b/src/modules/module_04010.c @@ -51,12 +51,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_04110.c b/src/modules/module_04110.c index 1d81ed647..396238751 100644 --- a/src/modules/module_04110.c +++ b/src/modules/module_04110.c @@ -49,12 +49,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_04300.c b/src/modules/module_04300.c index f8bd08a39..85d999530 100644 --- a/src/modules/module_04300.c +++ b/src/modules/module_04300.c @@ -52,11 +52,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_04400.c b/src/modules/module_04400.c index 0ec255375..6c86306d1 100644 --- a/src/modules/module_04400.c +++ b/src/modules/module_04400.c @@ -54,11 +54,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_04410.c b/src/modules/module_04410.c index 8c824bb15..4a763340a 100644 --- a/src/modules/module_04410.c +++ b/src/modules/module_04410.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_04500.c b/src/modules/module_04500.c index 22596eeb6..ad98eb05d 100644 --- a/src/modules/module_04500.c +++ b/src/modules/module_04500.c @@ -52,11 +52,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_04510.c b/src/modules/module_04510.c index fad21b425..51d0a686a 100644 --- a/src/modules/module_04510.c +++ b/src/modules/module_04510.c @@ -64,12 +64,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_04520.c b/src/modules/module_04520.c index 723e78990..3c0ff2eb5 100644 --- a/src/modules/module_04520.c +++ b/src/modules/module_04520.c @@ -52,12 +52,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_04521.c b/src/modules/module_04521.c index 5fb91e8e6..3e0f8abe8 100644 --- a/src/modules/module_04521.c +++ b/src/modules/module_04521.c @@ -52,17 +52,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 32; - token.len_max[1] = 32; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 32; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_04522.c b/src/modules/module_04522.c index 06c1681cf..5423f86cc 100644 --- a/src/modules/module_04522.c +++ b/src/modules/module_04522.c @@ -52,17 +52,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 12; - token.len_max[1] = 12; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 12; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_04700.c b/src/modules/module_04700.c index 58d7c969f..90b1f0f18 100644 --- a/src/modules/module_04700.c +++ b/src/modules/module_04700.c @@ -54,11 +54,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_04710.c b/src/modules/module_04710.c index 91794b21c..48d0e0a9b 100644 --- a/src/modules/module_04710.c +++ b/src/modules/module_04710.c @@ -64,12 +64,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_04711.c b/src/modules/module_04711.c index 956d517a3..5020a5d18 100644 --- a/src/modules/module_04711.c +++ b/src/modules/module_04711.c @@ -67,22 +67,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 8; - token.len_max[1] = 8; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 8; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { - token.len_min[1] *= 2; - token.len_max[1] *= 2; + token.len[1] *= 2; token.attr[1] |= TOKEN_ATTR_VERIFY_HEX; } diff --git a/src/modules/module_04800.c b/src/modules/module_04800.c index f856c8ce6..d65124938 100644 --- a/src/modules/module_04800.c +++ b/src/modules/module_04800.c @@ -53,23 +53,22 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.sep[0] = ':'; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = ':'; - token.len_min[1] = 32; - token.len_max[1] = 32; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 32; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[2] = 2; - token.len_max[2] = 2; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 2; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_04900.c b/src/modules/module_04900.c index ad661e4c1..02c7a2ca7 100644 --- a/src/modules/module_04900.c +++ b/src/modules/module_04900.c @@ -49,12 +49,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_05000.c b/src/modules/module_05000.c index 72ce7de91..85c5c9e87 100644 --- a/src/modules/module_05000.c +++ b/src/modules/module_05000.c @@ -49,12 +49,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_05100.c b/src/modules/module_05100.c index 3753fbb50..d16ae19d6 100644 --- a/src/modules/module_05100.c +++ b/src/modules/module_05100.c @@ -50,11 +50,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_05300.c b/src/modules/module_05300.c index 16895447c..ea10850b2 100644 --- a/src/modules/module_05300.c +++ b/src/modules/module_05300.c @@ -74,6 +74,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 9; token.sep[0] = ':'; @@ -125,9 +127,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[8] = ':'; - token.len_min[8] = 32; - token.len_max[8] = 32; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 32; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_05400.c b/src/modules/module_05400.c index 276422103..f6470f0c0 100644 --- a/src/modules/module_05400.c +++ b/src/modules/module_05400.c @@ -74,6 +74,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 9; token.sep[0] = ':'; @@ -125,9 +127,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[8] = ':'; - token.len_min[8] = 40; - token.len_max[8] = 40; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 40; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_05500.c b/src/modules/module_05500.c index e02b828a3..ec6771bd9 100644 --- a/src/modules/module_05500.c +++ b/src/modules/module_05500.c @@ -114,45 +114,44 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; // username + token.sep[0] = ':'; token.len_min[0] = 0; token.len_max[0] = 60; - token.sep[0] = ':'; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; // unused - token.len_min[1] = 0; - token.len_max[1] = 0; token.sep[1] = ':'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 0; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; // domain + token.sep[2] = ':'; token.len_min[2] = 0; token.len_max[2] = 45; - token.sep[2] = ':'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; // lm response + token.sep[3] = ':'; token.len_min[3] = 0; token.len_max[3] = 48; - token.sep[3] = ':'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // ntlm response - token.len_min[4] = 48; - token.len_max[4] = 48; token.sep[4] = ':'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 48; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // challenge - token.len_min[5] = 16; - token.len_max[5] = 16; token.sep[5] = ':'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 16; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_05600.c b/src/modules/module_05600.c index 9ce22c4b3..9870369fe 100644 --- a/src/modules/module_05600.c +++ b/src/modules/module_05600.c @@ -73,19 +73,20 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; // username + token.sep[0] = ':'; token.len_min[0] = 0; token.len_max[0] = 60; - token.sep[0] = ':'; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; // unused - token.len_min[1] = 0; - token.len_max[1] = 0; token.sep[1] = ':'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 0; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; // domain token.len_min[2] = 0; @@ -94,23 +95,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; // lm response - token.len_min[3] = 16; - token.len_max[3] = 16; token.sep[3] = ':'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // ntlm response - token.len_min[4] = 32; - token.len_max[4] = 32; token.sep[4] = ':'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // challenge + token.sep[5] = ':'; token.len_min[5] = 2; token.len_max[5] = 1024; - token.sep[5] = ':'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_05700.c b/src/modules/module_05700.c index 396f7ce3f..dab3dc8c5 100644 --- a/src/modules/module_05700.c +++ b/src/modules/module_05700.c @@ -54,6 +54,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 43; diff --git a/src/modules/module_05800.c b/src/modules/module_05800.c index 23c97f03b..b646d0f89 100644 --- a/src/modules/module_05800.c +++ b/src/modules/module_05800.c @@ -77,12 +77,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = 1; diff --git a/src/modules/module_06000.c b/src/modules/module_06000.c index 204617b2f..6c7b5ffec 100644 --- a/src/modules/module_06000.c +++ b/src/modules/module_06000.c @@ -48,11 +48,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_06050.c b/src/modules/module_06050.c index 7d1fec6c0..7cb55504c 100644 --- a/src/modules/module_06050.c +++ b/src/modules/module_06050.c @@ -50,12 +50,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_06060.c b/src/modules/module_06060.c index 0d0e59e8a..5407e642e 100644 --- a/src/modules/module_06060.c +++ b/src/modules/module_06060.c @@ -50,12 +50,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_06100.c b/src/modules/module_06100.c index a5243cd96..c583db693 100644 --- a/src/modules/module_06100.c +++ b/src/modules/module_06100.c @@ -48,11 +48,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_06300.c b/src/modules/module_06300.c index 02fc4d051..0f6ed5bc0 100644 --- a/src/modules/module_06300.c +++ b/src/modules/module_06300.c @@ -172,6 +172,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -181,9 +183,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '$'; token.len_min[1] = 0; token.len_max[1] = 8; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_OPTIONAL_ROUNDS; diff --git a/src/modules/module_06400.c b/src/modules/module_06400.c index 39d6c8628..79e825509 100644 --- a/src/modules/module_06400.c +++ b/src/modules/module_06400.c @@ -261,6 +261,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -270,14 +272,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 2; - token.len_max[1] = 2; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; + token.sep[2] = '$'; token.len_min[2] = 16; token.len_max[2] = 48; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; token.len[3] = 43; diff --git a/src/modules/module_06500.c b/src/modules/module_06500.c index 05cc564d5..bfaa5e243 100644 --- a/src/modules/module_06500.c +++ b/src/modules/module_06500.c @@ -445,6 +445,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -454,14 +456,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 2; - token.len_max[1] = 2; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; + token.sep[2] = '$'; token.len_min[2] = 16; token.len_max[2] = 48; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; token.len[3] = 86; diff --git a/src/modules/module_06600.c b/src/modules/module_06600.c index 58972c082..f7bea8cdd 100644 --- a/src/modules/module_06600.c +++ b/src/modules/module_06600.c @@ -90,23 +90,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; + token.sep[0] = ':'; token.len_min[0] = 1; token.len_max[0] = 6; - token.sep[0] = ':'; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[1] = 16; - token.len_max[1] = 16; token.sep[1] = ':'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 16; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[2] = 2080; - token.len_max[2] = 2080; token.sep[2] = ':'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 2080; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_06700.c b/src/modules/module_06700.c index bbc36fe8d..3305f1502 100644 --- a/src/modules/module_06700.c +++ b/src/modules/module_06700.c @@ -196,6 +196,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -205,14 +207,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 2; - token.len_max[1] = 2; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; + token.sep[2] = '$'; token.len_min[2] = 16; token.len_max[2] = 48; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; token.len[3] = 27; diff --git a/src/modules/module_06800.c b/src/modules/module_06800.c index 8f189fc45..35eebf6b4 100644 --- a/src/modules/module_06800.c +++ b/src/modules/module_06800.c @@ -118,28 +118,29 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; + token.sep[0] = ':'; token.len_min[0] = 32; token.len_max[0] = 64; - token.sep[0] = ':'; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[1] = ':'; token.len_min[1] = 1; token.len_max[1] = 6; - token.sep[1] = ':'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.sep[2] = ':'; token.len_min[2] = 0; token.len_max[2] = 32; - token.sep[2] = ':'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[3] = 32; - token.len_max[3] = 32; token.sep[3] = ':'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_06900.c b/src/modules/module_06900.c index 3e659d629..eff993986 100644 --- a/src/modules/module_06900.c +++ b/src/modules/module_06900.c @@ -64,11 +64,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_07000.c b/src/modules/module_07000.c index f97d8a4d8..99fb188cc 100644 --- a/src/modules/module_07000.c +++ b/src/modules/module_07000.c @@ -65,6 +65,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_07100.c b/src/modules/module_07100.c index 1d7b764ef..22adc6a98 100644 --- a/src/modules/module_07100.c +++ b/src/modules/module_07100.c @@ -119,6 +119,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -128,16 +130,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '$'; token.len_min[1] = 1; token.len_max[1] = 6; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 64; - token.len_max[2] = 64; token.sep[2] = '$'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 64; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[3] = 128; @@ -206,6 +207,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; diff --git a/src/modules/module_07200.c b/src/modules/module_07200.c index 785c2538e..7f2852234 100644 --- a/src/modules/module_07200.c +++ b/src/modules/module_07200.c @@ -104,6 +104,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -113,21 +115,20 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '.'; token.len_min[1] = 1; token.len_max[1] = 6; - token.sep[1] = '.'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[2] = '.'; token.len_min[2] = SALT_MIN; token.len_max[2] = SALT_MAX; - token.sep[2] = '.'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[3] = 128; - token.len_max[3] = 128; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 128; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_07300.c b/src/modules/module_07300.c index 905be677d..77a07db2d 100644 --- a/src/modules/module_07300.c +++ b/src/modules/module_07300.c @@ -66,17 +66,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; + token.sep[0] = hashconfig->separator; token.len_min[0] = 64; token.len_max[0] = 512; - token.sep[0] = hashconfig->separator; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 40; - token.len_max[1] = 40; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 40; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_07350.c b/src/modules/module_07350.c index 7c9dcb67c..fd79d31d1 100644 --- a/src/modules/module_07350.c +++ b/src/modules/module_07350.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = RAKP_HEX_SALT_MIN; diff --git a/src/modules/module_07400.c b/src/modules/module_07400.c index c1b57fdef..b4f82ed16 100644 --- a/src/modules/module_07400.c +++ b/src/modules/module_07400.c @@ -287,6 +287,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -296,9 +298,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '$'; token.len_min[1] = 0; token.len_max[1] = 20; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_OPTIONAL_ROUNDS; diff --git a/src/modules/module_07401.c b/src/modules/module_07401.c index eb5143e97..9584781a4 100644 --- a/src/modules/module_07401.c +++ b/src/modules/module_07401.c @@ -288,6 +288,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; @@ -297,27 +299,24 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; + token.sep[2] = '*'; token.len_min[2] = 3; token.len_max[2] = 4; - token.sep[2] = '*'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 40; - token.len_max[3] = 40; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 40; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[4] = 86; - token.len_max[4] = 86; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 86; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_07500.c b/src/modules/module_07500.c index 96a358ba0..f119402cd 100644 --- a/src/modules/module_07500.c +++ b/src/modules/module_07500.c @@ -104,6 +104,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -113,19 +115,19 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '$'; token.len_min[1] = 0; token.len_max[1] = 64; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.sep[2] = '$'; token.len_min[2] = 0; token.len_max[2] = 64; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + token.sep[3] = '$'; token.len_min[3] = 0; token.len_max[3] = 128; - token.sep[3] = '$'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; token.len[4] = 72; diff --git a/src/modules/module_07700.c b/src/modules/module_07700.c index 490c7ec4b..af5dd78d6 100644 --- a/src/modules/module_07700.c +++ b/src/modules/module_07700.c @@ -59,16 +59,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; + token.sep[0] = '$'; token.len_min[0] = 1; token.len_max[0] = 40; - token.sep[0] = '$'; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[1] = 16; - token.len_max[1] = 16; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 16; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_07701.c b/src/modules/module_07701.c index cd7a0c211..8ca22e4c3 100644 --- a/src/modules/module_07701.c +++ b/src/modules/module_07701.c @@ -51,16 +51,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; + token.sep[0] = '$'; token.len_min[0] = 1; token.len_max[0] = 40; - token.sep[0] = '$'; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[1] = 16; - token.len_max[1] = 16; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 16; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_07800.c b/src/modules/module_07800.c index 03c607845..080a26252 100644 --- a/src/modules/module_07800.c +++ b/src/modules/module_07800.c @@ -60,16 +60,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; + token.sep[0] = '$'; token.len_min[0] = 1; token.len_max[0] = 40; - token.sep[0] = '$'; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[1] = 40; - token.len_max[1] = 40; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 40; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_07801.c b/src/modules/module_07801.c index 21ce106d9..0e390d259 100644 --- a/src/modules/module_07801.c +++ b/src/modules/module_07801.c @@ -60,16 +60,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; + token.sep[0] = '$'; token.len_min[0] = 1; token.len_max[0] = 40; - token.sep[0] = '$'; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[1] = 40; - token.len_max[1] = 40; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 40; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_07900.c b/src/modules/module_07900.c index a1cfb0e91..bebfb6aab 100644 --- a/src/modules/module_07900.c +++ b/src/modules/module_07900.c @@ -334,6 +334,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; diff --git a/src/modules/module_08000.c b/src/modules/module_08000.c index 238f4d613..0c774b5a6 100644 --- a/src/modules/module_08000.c +++ b/src/modules/module_08000.c @@ -82,6 +82,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; diff --git a/src/modules/module_08100.c b/src/modules/module_08100.c index 8bbf03c06..14459192a 100644 --- a/src/modules/module_08100.c +++ b/src/modules/module_08100.c @@ -54,6 +54,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; diff --git a/src/modules/module_08200.c b/src/modules/module_08200.c index 2d148936d..4098df8c8 100644 --- a/src/modules/module_08200.c +++ b/src/modules/module_08200.c @@ -122,18 +122,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.sep[0] = ':'; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = ':'; - token.len_min[1] = 32; - token.len_max[1] = 32; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 32; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = ':'; diff --git a/src/modules/module_08300.c b/src/modules/module_08300.c index 233812261..88975f396 100644 --- a/src/modules/module_08300.c +++ b/src/modules/module_08300.c @@ -49,12 +49,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.sep[0] = ':'; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; token.sep[1] = ':'; token.len_min[1] = 0; diff --git a/src/modules/module_08400.c b/src/modules/module_08400.c index 60cb06c68..199177f2c 100644 --- a/src/modules/module_08400.c +++ b/src/modules/module_08400.c @@ -51,17 +51,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 40; - token.len_max[1] = 40; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 40; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_08500.c b/src/modules/module_08500.c index c3cd866ca..30984cb2e 100644 --- a/src/modules/module_08500.c +++ b/src/modules/module_08500.c @@ -103,25 +103,26 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_RACF; - token.len_min[0] = 6; - token.len_max[0] = 6; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '*'; token.len_min[1] = 0; token.len_max[1] = 8; - token.sep[1] = '*'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.sep[2] = '$'; token.len_min[2] = 2; token.len_max[2] = 16; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_08600.c b/src/modules/module_08600.c index 4feea6537..498e3f378 100644 --- a/src/modules/module_08600.c +++ b/src/modules/module_08600.c @@ -57,11 +57,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_08700.c b/src/modules/module_08700.c index 6cf0ab3ac..6b3b2970e 100644 --- a/src/modules/module_08700.c +++ b/src/modules/module_08700.c @@ -81,6 +81,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.len[0] = 1; diff --git a/src/modules/module_08800.c b/src/modules/module_08800.c index a47feaa36..7de1ecf2c 100644 --- a/src/modules/module_08800.c +++ b/src/modules/module_08800.c @@ -93,6 +93,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -102,32 +104,27 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 2; - token.len_max[1] = 2; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; - token.len_min[2] = 32; - token.len_max[2] = 32; token.sep[2] = '$'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[3] = 2; - token.len_max[3] = 2; token.sep[3] = '$'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[3] = 2; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH; - token.len_min[4] = 32; - token.len_max[4] = 32; token.sep[4] = '$'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[5] = 3072; - token.len_max[5] = 3072; token.sep[5] = '$'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 3072; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_08900.c b/src/modules/module_08900.c index c5b1014d8..d7b7a9a62 100644 --- a/src/modules/module_08900.c +++ b/src/modules/module_08900.c @@ -271,41 +271,42 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SCRYPT; - token.len_min[0] = 6; - token.len_max[0] = 6; token.sep[0] = ':'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = ':'; token.len_min[1] = 1; token.len_max[1] = 6; - token.sep[1] = ':'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.sep[2] = ':'; token.len_min[2] = 1; token.len_max[2] = 6; - token.sep[2] = ':'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + token.sep[3] = ':'; token.len_min[3] = 1; token.len_max[3] = 6; - token.sep[3] = ':'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; + token.sep[4] = ':'; token.len_min[4] = 0; token.len_max[4] = 45; - token.sep[4] = ':'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; + token.sep[5] = ':'; token.len_min[5] = 44; token.len_max[5] = 88; - token.sep[5] = ':'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; diff --git a/src/modules/module_09100.c b/src/modules/module_09100.c index 45cbd94ad..b0378756a 100644 --- a/src/modules/module_09100.c +++ b/src/modules/module_09100.c @@ -72,6 +72,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.len[0] = 1; diff --git a/src/modules/module_09200.c b/src/modules/module_09200.c index 60526214d..bfc3aac69 100644 --- a/src/modules/module_09200.c +++ b/src/modules/module_09200.c @@ -95,6 +95,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -104,10 +106,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 14; - token.len_max[1] = 14; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 14; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; token.len[2] = 43; token.attr[2] = TOKEN_ATTR_FIXED_LENGTH diff --git a/src/modules/module_09300.c b/src/modules/module_09300.c index 1c1137021..e60d47b36 100644 --- a/src/modules/module_09300.c +++ b/src/modules/module_09300.c @@ -271,6 +271,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -280,10 +282,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 14; - token.len_max[1] = 14; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 14; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; token.len[2] = 43; token.attr[2] = TOKEN_ATTR_FIXED_LENGTH diff --git a/src/modules/module_09400.c b/src/modules/module_09400.c index 4f9c7a5e3..a5961f4fb 100644 --- a/src/modules/module_09400.c +++ b/src/modules/module_09400.c @@ -92,57 +92,51 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_OFFICE2007; - token.len_min[0] = 8; - token.len_max[0] = 8; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 8; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 4; - token.len_max[1] = 4; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 4; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 2; - token.len_max[2] = 2; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 2; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 2; - token.len_max[4] = 2; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 2; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[5] = 32; - token.len_max[5] = 32; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 32; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[6] = 32; - token.len_max[6] = 32; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[7] = 40; - token.len_max[7] = 40; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 40; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_09500.c b/src/modules/module_09500.c index e6b6f9c5b..a9b179889 100644 --- a/src/modules/module_09500.c +++ b/src/modules/module_09500.c @@ -95,57 +95,51 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_OFFICE2010; - token.len_min[0] = 8; - token.len_max[0] = 8; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 8; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 4; - token.len_max[1] = 4; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 4; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 6; - token.len_max[2] = 6; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 6; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 2; - token.len_max[4] = 2; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 2; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[5] = 32; - token.len_max[5] = 32; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 32; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[6] = 32; - token.len_max[6] = 32; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[7] = 64; - token.len_max[7] = 64; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 64; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_09600.c b/src/modules/module_09600.c index 8458d0490..10b55cd3e 100644 --- a/src/modules/module_09600.c +++ b/src/modules/module_09600.c @@ -129,57 +129,51 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_OFFICE2013; - token.len_min[0] = 8; - token.len_max[0] = 8; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 8; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 4; - token.len_max[1] = 4; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 4; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 6; - token.len_max[2] = 6; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 6; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 2; - token.len_max[4] = 2; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 2; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[5] = 32; - token.len_max[5] = 32; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 32; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[6] = 32; - token.len_max[6] = 32; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[7] = 64; - token.len_max[7] = 64; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 64; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_09700.c b/src/modules/module_09700.c index 4e1850b91..a50e380b7 100644 --- a/src/modules/module_09700.c +++ b/src/modules/module_09700.c @@ -115,6 +115,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 2; @@ -125,27 +127,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 32; - token.len_max[2] = 32; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH; - token.len_min[3] = 32; - token.len_max[3] = 32; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[4] = 32; - token.len_max[4] = 32; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_09710.c b/src/modules/module_09710.c index 588c9d4ad..10ca46814 100644 --- a/src/modules/module_09710.c +++ b/src/modules/module_09710.c @@ -135,6 +135,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 2; @@ -145,27 +147,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 32; - token.len_max[2] = 32; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH; - token.len_min[3] = 32; - token.len_max[3] = 32; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[4] = 32; - token.len_max[4] = 32; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_09720.c b/src/modules/module_09720.c index 68583435d..ee1b6c6e8 100644 --- a/src/modules/module_09720.c +++ b/src/modules/module_09720.c @@ -117,6 +117,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 2; @@ -127,33 +129,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 32; - token.len_max[2] = 32; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH; - token.len_min[3] = 32; - token.len_max[3] = 32; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[4] = 32; - token.len_max[4] = 32; token.sep[4] = ':'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[5] = 10; - token.len_max[5] = 10; token.sep[5] = ':'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 10; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_09800.c b/src/modules/module_09800.c index e4e1f31e1..899b852e7 100644 --- a/src/modules/module_09800.c +++ b/src/modules/module_09800.c @@ -117,6 +117,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 2; @@ -127,27 +129,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 32; - token.len_max[2] = 32; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH; - token.len_min[3] = 32; - token.len_max[3] = 32; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[4] = 40; - token.len_max[4] = 40; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 40; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); @@ -158,10 +156,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { token.token_cnt = 6; - token.len_min[5] = 64; - token.len_max[5] = 64; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_09810.c b/src/modules/module_09810.c index 7e210f91a..b689304ea 100644 --- a/src/modules/module_09810.c +++ b/src/modules/module_09810.c @@ -136,6 +136,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 2; @@ -146,27 +148,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 32; - token.len_max[2] = 32; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH; - token.len_min[3] = 32; - token.len_max[3] = 32; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[4] = 40; - token.len_max[4] = 40; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 40; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); @@ -177,10 +175,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { token.token_cnt = 6; - token.len_min[5] = 64; - token.len_max[5] = 64; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_09820.c b/src/modules/module_09820.c index eaccd0bee..7508f8fff 100644 --- a/src/modules/module_09820.c +++ b/src/modules/module_09820.c @@ -119,6 +119,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -128,32 +130,27 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 32; - token.len_max[2] = 32; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH; - token.len_min[3] = 32; - token.len_max[3] = 32; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[4] = 40; - token.len_max[4] = 40; token.sep[4] = ':'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 40; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[5] = 10; - token.len_max[5] = 10; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 10; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); @@ -166,15 +163,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.sep[4] = '*'; - token.len_min[5] = 64; - token.len_max[5] = 64; token.sep[5] = ':'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[6] = 10; - token.len_max[6] = 10; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 10; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_09900.c b/src/modules/module_09900.c index d2bb6eef8..3d845f55a 100644 --- a/src/modules/module_09900.c +++ b/src/modules/module_09900.c @@ -60,11 +60,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_10000.c b/src/modules/module_10000.c index a111fea93..ce6518d3d 100644 --- a/src/modules/module_10000.c +++ b/src/modules/module_10000.c @@ -92,15 +92,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_DJANGOPBKDF2; token.sep[0] = '$'; - token.len_min[0] = 13; - token.len_max[0] = 13; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 13; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; @@ -115,9 +116,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[3] = '$'; - token.len_min[3] = 44; - token.len_max[3] = 44; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 44; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_10100.c b/src/modules/module_10100.c index 333fb5104..096b8eba2 100644 --- a/src/modules/module_10100.c +++ b/src/modules/module_10100.c @@ -50,24 +50,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.sep[0] = ':'; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = ':'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = ':'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.len[3] = 32; diff --git a/src/modules/module_10200.c b/src/modules/module_10200.c index 3ef6b4fcb..b236e573a 100644 --- a/src/modules/module_10200.c +++ b/src/modules/module_10200.c @@ -68,6 +68,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; diff --git a/src/modules/module_10300.c b/src/modules/module_10300.c index cf3998d78..0768b6029 100644 --- a/src/modules/module_10300.c +++ b/src/modules/module_10300.c @@ -69,6 +69,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; diff --git a/src/modules/module_10400.c b/src/modules/module_10400.c index e7352fae2..65a76701e 100644 --- a/src/modules/module_10400.c +++ b/src/modules/module_10400.c @@ -124,6 +124,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 12; token.signatures_cnt = 1; @@ -133,69 +135,59 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 2; - token.len_max[3] = 2; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 2; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[4] = '*'; token.len_min[4] = 1; token.len_max[4] = 11; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[5] = 1; - token.len_max[5] = 1; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[6] = 2; - token.len_max[6] = 2; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 2; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[7] = 32; - token.len_max[7] = 32; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 32; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[8] = 2; - token.len_max[8] = 2; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 2; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[9] = 64; - token.len_max[9] = 64; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 64; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[10] = 2; - token.len_max[10] = 2; - token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.sep[10] = '*'; + token.len[10] = 2; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[11] = 64; - token.len_max[11] = 64; token.sep[11] = '*'; - token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH + token.len[11] = 64; + token.attr[11] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_10410.c b/src/modules/module_10410.c index 9aa05f47f..1e0914738 100644 --- a/src/modules/module_10410.c +++ b/src/modules/module_10410.c @@ -145,6 +145,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 12; token.signatures_cnt = 1; @@ -154,70 +156,60 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 2; - token.len_max[3] = 2; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 2; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[4] = '*'; token.len_min[4] = 1; token.len_max[4] = 11; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[5] = 1; - token.len_max[5] = 1; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[6] = 2; - token.len_max[6] = 2; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 2; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[7] = 32; - token.len_max[7] = 32; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 32; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[8] = 2; - token.len_max[8] = 2; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 2; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[9] = 64; - token.len_max[9] = 64; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 64; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[10] = 2; - token.len_max[10] = 2; - token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.sep[10] = '*'; + token.len[10] = 2; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[11] = 64; - token.len_max[11] = 64; - token.sep[11] = '*'; - token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.sep[11] = '*'; + token.len[11] = 64; + token.attr[11] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_10420.c b/src/modules/module_10420.c index 397c152d3..23e8cb663 100644 --- a/src/modules/module_10420.c +++ b/src/modules/module_10420.c @@ -125,6 +125,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 13; token.signatures_cnt = 1; @@ -134,76 +136,65 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 2; - token.len_max[3] = 2; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 2; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[4] = '*'; token.len_min[4] = 1; token.len_max[4] = 11; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[5] = 1; - token.len_max[5] = 1; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[6] = 2; - token.len_max[6] = 2; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 2; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[7] = 32; - token.len_max[7] = 32; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 32; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[8] = 2; - token.len_max[8] = 2; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 2; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[9] = 64; - token.len_max[9] = 64; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 64; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[10] = 2; - token.len_max[10] = 2; - token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.sep[10] = '*'; + token.len[10] = 2; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[11] = 64; - token.len_max[11] = 64; - token.sep[11] = ':'; - token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.sep[11] = ':'; + token.len[11] = 64; + token.attr[11] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; - token.len_min[12] = 10; - token.len_max[12] = 10; - token.sep[12] = '*'; - token.attr[12] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.sep[12] = '*'; + token.len[12] = 10; + token.attr[12] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_10500.c b/src/modules/module_10500.c index 3cf1e08c1..b9d932bc0 100644 --- a/src/modules/module_10500.c +++ b/src/modules/module_10500.c @@ -155,6 +155,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 12; token.signatures_cnt = 1; @@ -164,70 +166,61 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[4] = '*'; token.len_min[4] = 1; token.len_max[4] = 11; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[5] = 1; - token.len_max[5] = 1; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[6] = 2; - token.len_max[6] = 2; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 2; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[7] = '*'; token.len_min[7] = 32; token.len_max[7] = 64; - token.sep[7] = '*'; token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[8] = 2; - token.len_max[8] = 2; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 2; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[9] = 64; - token.len_max[9] = 64; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 64; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[10] = 2; - token.len_max[10] = 2; - token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.sep[10] = '*'; + token.len[10] = 2; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[11] = 64; - token.len_max[11] = 64; - token.sep[11] = '*'; - token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.sep[11] = '*'; + token.len[11] = 64; + token.attr[11] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_10600.c b/src/modules/module_10600.c index 8f12154d1..dc5422137 100644 --- a/src/modules/module_10600.c +++ b/src/modules/module_10600.c @@ -99,6 +99,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 16; token.signatures_cnt = 1; @@ -108,92 +110,88 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[4] = '*'; token.len_min[4] = 1; token.len_max[4] = 11; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[5] = 1; - token.len_max[5] = 1; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[6] = '*'; token.len_min[6] = 1; token.len_max[6] = 4; - token.sep[6] = '*'; token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[7] = '*'; token.len_min[7] = 0; token.len_max[7] = 1024; - token.sep[7] = '*'; token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[8] = '*'; token.len_min[8] = 1; token.len_max[8] = 4; - token.sep[8] = '*'; token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[9] = '*'; token.len_min[9] = 0; token.len_max[9] = 1024; - token.sep[9] = '*'; token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[10] = '*'; token.len_min[10] = 1; token.len_max[10] = 4; - token.sep[10] = '*'; token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[11] = '*'; token.len_min[11] = 0; token.len_max[11] = 1024; - token.sep[11] = '*'; token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[12] = '*'; token.len_min[12] = 1; token.len_max[12] = 4; - token.sep[12] = '*'; token.attr[12] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[13] = '*'; token.len_min[13] = 0; token.len_max[13] = 1024; - token.sep[13] = '*'; token.attr[13] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[14] = '*'; token.len_min[14] = 1; token.len_max[14] = 4; - token.sep[14] = '*'; token.attr[14] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[15] = '*'; token.len_min[15] = 0; token.len_max[15] = 1024; - token.sep[15] = '*'; token.attr[15] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_10700.c b/src/modules/module_10700.c index 51d351c39..e8a8edce2 100644 --- a/src/modules/module_10700.c +++ b/src/modules/module_10700.c @@ -170,6 +170,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 16; token.signatures_cnt = 1; @@ -179,92 +181,88 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[4] = '*'; token.len_min[4] = 1; token.len_max[4] = 11; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[5] = 1; - token.len_max[5] = 1; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[6] = '*'; token.len_min[6] = 1; token.len_max[6] = 4; - token.sep[6] = '*'; token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[7] = '*'; token.len_min[7] = 0; token.len_max[7] = 1024; - token.sep[7] = '*'; token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[8] = '*'; token.len_min[8] = 1; token.len_max[8] = 4; - token.sep[8] = '*'; token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[9] = '*'; token.len_min[9] = 0; token.len_max[9] = 1024; - token.sep[9] = '*'; token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[10] = '*'; token.len_min[10] = 1; token.len_max[10] = 4; - token.sep[10] = '*'; token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[11] = '*'; token.len_min[11] = 0; token.len_max[11] = 1024; - token.sep[11] = '*'; token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[12] = '*'; token.len_min[12] = 1; token.len_max[12] = 4; - token.sep[12] = '*'; token.attr[12] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[13] = '*'; token.len_min[13] = 0; token.len_max[13] = 1024; - token.sep[13] = '*'; token.attr[13] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[14] = '*'; token.len_min[14] = 1; token.len_max[14] = 4; - token.sep[14] = '*'; token.attr[14] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[15] = '*'; token.len_min[15] = 0; token.len_max[15] = 1024; - token.sep[15] = '*'; token.attr[15] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_10800.c b/src/modules/module_10800.c index 7bce90227..d121df35b 100644 --- a/src/modules/module_10800.c +++ b/src/modules/module_10800.c @@ -100,11 +100,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 96; - token.len_max[0] = 96; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 96; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_10810.c b/src/modules/module_10810.c index eca1e2c89..a21fcdb56 100644 --- a/src/modules/module_10810.c +++ b/src/modules/module_10810.c @@ -86,12 +86,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 96; - token.len_max[0] = 96; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 96; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_10820.c b/src/modules/module_10820.c index f3c5de9e6..97dd5b775 100644 --- a/src/modules/module_10820.c +++ b/src/modules/module_10820.c @@ -86,12 +86,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 96; - token.len_max[0] = 96; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 96; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_10830.c b/src/modules/module_10830.c index a37e13146..6e3831d78 100644 --- a/src/modules/module_10830.c +++ b/src/modules/module_10830.c @@ -87,12 +87,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 96; - token.len_max[0] = 96; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 96; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_10840.c b/src/modules/module_10840.c index 9dc69e059..77e070dc0 100644 --- a/src/modules/module_10840.c +++ b/src/modules/module_10840.c @@ -87,12 +87,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 96; - token.len_max[0] = 96; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 96; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_10870.c b/src/modules/module_10870.c index 735ae8d87..3e2e4bfdd 100644 --- a/src/modules/module_10870.c +++ b/src/modules/module_10870.c @@ -87,11 +87,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 96; - token.len_max[0] = 96; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 96; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_10900.c b/src/modules/module_10900.c index 81393a8e6..75385f023 100644 --- a/src/modules/module_10900.c +++ b/src/modules/module_10900.c @@ -125,15 +125,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_PBKDF2_SHA256; token.sep[0] = ':'; - token.len_min[0] = 6; - token.len_max[0] = 6; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = ':'; diff --git a/src/modules/module_10901.c b/src/modules/module_10901.c index ed7f7448a..ed95f467d 100644 --- a/src/modules/module_10901.c +++ b/src/modules/module_10901.c @@ -94,6 +94,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; @@ -105,9 +107,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; //length of base64 encoded hash - token.len_min[1] = 432; - token.len_max[1] = 432; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 432; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_11000.c b/src/modules/module_11000.c index 7615ac640..60ab88df0 100644 --- a/src/modules/module_11000.c +++ b/src/modules/module_11000.c @@ -65,17 +65,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 56; - token.len_max[1] = 56; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 56; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_11100.c b/src/modules/module_11100.c index fbf53a92f..c95bd6893 100644 --- a/src/modules/module_11100.c +++ b/src/modules/module_11100.c @@ -52,6 +52,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -67,15 +69,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[2] = '*'; - token.len_min[2] = 8; - token.len_max[2] = 8; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 8; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_11200.c b/src/modules/module_11200.c index 5296043f7..938b179b1 100644 --- a/src/modules/module_11200.c +++ b/src/modules/module_11200.c @@ -52,6 +52,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -62,15 +64,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 40; - token.len_max[1] = 40; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 40; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '*'; - token.len_min[2] = 40; - token.len_max[2] = 40; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 40; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_11300.c b/src/modules/module_11300.c index 00035b60c..7b81b3d26 100644 --- a/src/modules/module_11300.c +++ b/src/modules/module_11300.c @@ -134,6 +134,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 10; token.signatures_cnt = 1; @@ -156,9 +158,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '$'; - token.len_min[3] = 2; - token.len_max[3] = 2; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 2; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[4] = '$'; diff --git a/src/modules/module_11400.c b/src/modules/module_11400.c index fc167c209..f6f656629 100644 --- a/src/modules/module_11400.c +++ b/src/modules/module_11400.c @@ -87,15 +87,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 15; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SIP_AUTH; token.sep[0] = '*'; - token.len_min[0] = 5; - token.len_max[0] = 5; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 5; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; @@ -159,14 +160,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[12] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[13] = '*'; - token.len_min[13] = 3; - token.len_max[13] = 3; - token.attr[13] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[13] = 3; + token.attr[13] = TOKEN_ATTR_FIXED_LENGTH; token.sep[14] = '*'; - token.len_min[14] = 32; - token.len_max[14] = 32; - token.attr[14] = TOKEN_ATTR_VERIFY_LENGTH + token.len[14] = 32; + token.attr[14] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_11500.c b/src/modules/module_11500.c index 9cdad89a1..fa691a2e2 100644 --- a/src/modules/module_11500.c +++ b/src/modules/module_11500.c @@ -48,18 +48,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 8; - token.len_max[0] = 8; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 8; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = hashconfig->separator; - token.len_min[1] = 8; - token.len_max[1] = 8; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 8; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_11600.c b/src/modules/module_11600.c index d105aed32..9f1d37992 100644 --- a/src/modules/module_11600.c +++ b/src/modules/module_11600.c @@ -438,6 +438,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 11; token.signatures_cnt = 1; @@ -448,9 +450,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; @@ -460,9 +461,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 1; - token.len_max[3] = 1; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 1; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[4] = '$'; @@ -477,9 +477,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[6] = '$'; - token.len_min[6] = 32; - token.len_max[6] = 32; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '$'; diff --git a/src/modules/module_11700.c b/src/modules/module_11700.c index 9e5308405..55b1bd13b 100644 --- a/src/modules/module_11700.c +++ b/src/modules/module_11700.c @@ -71,6 +71,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 64; diff --git a/src/modules/module_11750.c b/src/modules/module_11750.c index e575c0f9a..bf49d3f9e 100644 --- a/src/modules/module_11750.c +++ b/src/modules/module_11750.c @@ -71,12 +71,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_11760.c b/src/modules/module_11760.c index 96153191c..b9d0c19a2 100644 --- a/src/modules/module_11760.c +++ b/src/modules/module_11760.c @@ -71,12 +71,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_11800.c b/src/modules/module_11800.c index 2daaf0c83..36fa205ce 100644 --- a/src/modules/module_11800.c +++ b/src/modules/module_11800.c @@ -71,6 +71,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 128; diff --git a/src/modules/module_11850.c b/src/modules/module_11850.c index 73d4c8fd4..4e952013a 100644 --- a/src/modules/module_11850.c +++ b/src/modules/module_11850.c @@ -71,12 +71,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_11860.c b/src/modules/module_11860.c index bd9879085..3147c7a8c 100644 --- a/src/modules/module_11860.c +++ b/src/modules/module_11860.c @@ -71,12 +71,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_11900.c b/src/modules/module_11900.c index ee74a44e2..6e85beb0d 100644 --- a/src/modules/module_11900.c +++ b/src/modules/module_11900.c @@ -94,15 +94,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_PBKDF2_MD5; token.sep[0] = ':'; - token.len_min[0] = 3; - token.len_max[0] = 3; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 3; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = ':'; diff --git a/src/modules/module_12000.c b/src/modules/module_12000.c index f36f8f0d0..733f161b6 100644 --- a/src/modules/module_12000.c +++ b/src/modules/module_12000.c @@ -94,15 +94,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_PBKDF2_SHA1; token.sep[0] = ':'; - token.len_min[0] = 4; - token.len_max[0] = 4; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 4; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = ':'; diff --git a/src/modules/module_12001.c b/src/modules/module_12001.c index 264509ae2..e2be237fe 100644 --- a/src/modules/module_12001.c +++ b/src/modules/module_12001.c @@ -94,6 +94,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; @@ -103,9 +105,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 64; - token.len_max[1] = 64; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 64; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_12100.c b/src/modules/module_12100.c index 71a00d7a3..556476236 100644 --- a/src/modules/module_12100.c +++ b/src/modules/module_12100.c @@ -95,15 +95,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_PBKDF2_SHA512; token.sep[0] = ':'; - token.len_min[0] = 6; - token.len_max[0] = 6; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = ':'; diff --git a/src/modules/module_12200.c b/src/modules/module_12200.c index ab4a4d8c5..c731fc89f 100644 --- a/src/modules/module_12200.c +++ b/src/modules/module_12200.c @@ -106,6 +106,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; @@ -116,27 +118,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 16; - token.len_max[3] = 16; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; - token.len_min[4] = 16; - token.len_max[4] = 16; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 16; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_12300.c b/src/modules/module_12300.c index 75bc6fd5d..1352e956d 100644 --- a/src/modules/module_12300.c +++ b/src/modules/module_12300.c @@ -89,6 +89,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.len[0] = 128; diff --git a/src/modules/module_12400.c b/src/modules/module_12400.c index c57efa59b..e84420685 100644 --- a/src/modules/module_12400.c +++ b/src/modules/module_12400.c @@ -93,6 +93,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; diff --git a/src/modules/module_12500.c b/src/modules/module_12500.c index c8f014b7b..ada4ac4d8 100644 --- a/src/modules/module_12500.c +++ b/src/modules/module_12500.c @@ -116,33 +116,31 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_RAR3; token.sep[0] = '*'; - token.len_min[0] = 6; - token.len_max[0] = 6; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; - token.len_min[2] = 16; - token.len_max[2] = 16; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 16; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_12600.c b/src/modules/module_12600.c index 3fb0c60db..27606ceeb 100644 --- a/src/modules/module_12600.c +++ b/src/modules/module_12600.c @@ -66,17 +66,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 64; - token.len_max[1] = 64; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 64; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_12700.c b/src/modules/module_12700.c index 7100a6b87..f7af4f4d1 100644 --- a/src/modules/module_12700.c +++ b/src/modules/module_12700.c @@ -79,6 +79,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -88,15 +90,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '$'; token.len_min[1] = 1; token.len_max[1] = 6; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[2] = '$'; token.len_min[2] = 144; token.len_max[2] = 65536; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_12800.c b/src/modules/module_12800.c index f962cfb7b..066ed8a1d 100644 --- a/src/modules/module_12800.c +++ b/src/modules/module_12800.c @@ -108,32 +108,31 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_MS_DRSR; - token.len_min[0] = 11; - token.len_max[0] = 11; token.sep[0] = ','; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 11; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 20; - token.len_max[1] = 20; token.sep[1] = ','; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 20; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; + token.sep[2] = ','; token.len_min[2] = 1; token.len_max[2] = 6; - token.sep[2] = ','; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 64; - token.len_max[3] = 64; token.sep[3] = ','; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_12900.c b/src/modules/module_12900.c index a3be18b9c..2a09a0652 100644 --- a/src/modules/module_12900.c +++ b/src/modules/module_12900.c @@ -108,6 +108,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.len[0] = 64; diff --git a/src/modules/module_13000.c b/src/modules/module_13000.c index 55c74af28..2bb211b7d 100644 --- a/src/modules/module_13000.c +++ b/src/modules/module_13000.c @@ -123,6 +123,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -133,39 +135,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 2; - token.len_max[1] = 2; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '$'; - token.len_min[3] = 2; - token.len_max[3] = 2; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 2; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[4] = '$'; - token.len_min[4] = 32; - token.len_max[4] = 32; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '$'; - token.len_min[5] = 1; - token.len_max[5] = 1; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[6] = '$'; - token.len_min[6] = 16; - token.len_max[6] = 16; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 16; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_13100.c b/src/modules/module_13100.c index 1be89316a..23e0ee1f0 100644 --- a/src/modules/module_13100.c +++ b/src/modules/module_13100.c @@ -105,6 +105,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KRB5TGS; @@ -146,9 +148,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // etype token.sep[1] = '$'; - token.len_min[1] = 2; - token.len_max[1] = 2; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // user$realm$spn @@ -159,9 +160,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // checksum token.sep[3] = '$'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // edata2 @@ -179,17 +179,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // etype token.sep[1] = '$'; - token.len_min[1] = 2; - token.len_max[1] = 2; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // checksum token.sep[2] = '$'; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // edata2 @@ -215,9 +213,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // checksum token.sep[2] = '$'; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // edata2 diff --git a/src/modules/module_13200.c b/src/modules/module_13200.c index 54ddbba29..22d201208 100644 --- a/src/modules/module_13200.c +++ b/src/modules/module_13200.c @@ -74,21 +74,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_AXCRYPT; token.sep[0] = '*'; - token.len_min[0] = 9; - token.len_max[0] = 9; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 9; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; @@ -98,15 +98,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '*'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 48; - token.len_max[4] = 48; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 48; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_13300.c b/src/modules/module_13300.c index 5da86224e..daef383d7 100644 --- a/src/modules/module_13300.c +++ b/src/modules/module_13300.c @@ -55,6 +55,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_13400.c b/src/modules/module_13400.c index d559115e1..7187f5815 100644 --- a/src/modules/module_13400.c +++ b/src/modules/module_13400.c @@ -112,19 +112,19 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KEEPASS; token.sep[0] = '*'; - token.len_min[0] = 9; - token.len_max[0] = 9; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 9; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; @@ -148,33 +148,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 11; token.sep[4] = '*'; - token.len_min[4] = 32; - token.len_max[4] = 32; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; - token.len_min[5] = 64; - token.len_max[5] = 64; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[6] = '*'; - token.len_min[6] = 32; - token.len_max[6] = 32; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '*'; - token.len_min[7] = 64; - token.len_max[7] = 64; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 64; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[8] = '*'; - token.len_min[8] = 1; - token.len_max[8] = 1; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 1; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[9] = '*'; @@ -194,21 +189,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 14; token.sep[11] = '*'; - token.len_min[11] = 1; - token.len_max[11] = 1; - token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH + token.len[11] = 1; + token.attr[11] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[12] = '*'; - token.len_min[12] = 2; - token.len_max[12] = 2; - token.attr[12] = TOKEN_ATTR_VERIFY_LENGTH + token.len[12] = 2; + token.attr[12] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[13] = '*'; - token.len_min[13] = 64; - token.len_max[13] = 64; - token.attr[13] = TOKEN_ATTR_VERIFY_LENGTH + token.len[13] = 64; + token.attr[13] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; } } @@ -217,33 +209,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 9; token.sep[4] = '*'; - token.len_min[4] = 64; - token.len_max[4] = 64; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 64; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; - token.len_min[5] = 64; - token.len_max[5] = 64; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[6] = '*'; - token.len_min[6] = 32; - token.len_max[6] = 32; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '*'; - token.len_min[7] = 64; - token.len_max[7] = 64; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 64; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[8] = '*'; - token.len_min[8] = 64; - token.len_max[8] = 64; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 64; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; if (is_keyfile_present == true) @@ -251,21 +238,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 12; token.sep[9] = '*'; - token.len_min[9] = 1; - token.len_max[9] = 1; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 1; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[10] = '*'; - token.len_min[10] = 2; - token.len_max[10] = 2; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.len[10] = 2; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[11] = '*'; - token.len_min[11] = 64; - token.len_max[11] = 64; - token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH + token.len[11] = 64; + token.attr[11] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; } } diff --git a/src/modules/module_13500.c b/src/modules/module_13500.c index 42829d9f8..8aa803f3e 100644 --- a/src/modules/module_13500.c +++ b/src/modules/module_13500.c @@ -73,12 +73,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = 32; diff --git a/src/modules/module_13600.c b/src/modules/module_13600.c index 60988c4d6..6ab9db77f 100644 --- a/src/modules/module_13600.c +++ b/src/modules/module_13600.c @@ -119,70 +119,66 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 10; token.signatures_cnt = 2; token.signatures_buf[0] = SIGNATURE_ZIP2_START; token.signatures_buf[1] = SIGNATURE_ZIP2_STOP; - token.len_min[0] = 6; - token.len_max[0] = 6; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 1; - token.len_max[3] = 1; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 1; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[4] = '*'; token.len_min[4] = 16; token.len_max[4] = 32; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[5] = '*'; token.len_min[5] = 1; token.len_max[5] = 6; - token.sep[5] = '*'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[6] = '*'; token.len_min[6] = 1; token.len_max[6] = 6; - token.sep[6] = '*'; token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[7] = '*'; token.len_min[7] = 0; token.len_max[7] = 0x200000 * 4 * 2; - token.sep[7] = '*'; token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[8] = 20; - token.len_max[8] = 20; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 20; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[9] = 7; - token.len_max[9] = 7; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 7; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_13800.c b/src/modules/module_13800.c index 8bae1d163..af1b68946 100644 --- a/src/modules/module_13800.c +++ b/src/modules/module_13800.c @@ -86,18 +86,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; - token.len_min[0] = 64; - token.len_max[0] = 64; token.sep[0] = hashconfig->separator; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 256; - token.len_max[1] = 256; token.sep[1] = hashconfig->separator; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 256; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_13900.c b/src/modules/module_13900.c index b5eadb8c7..ed573ec79 100644 --- a/src/modules/module_13900.c +++ b/src/modules/module_13900.c @@ -51,17 +51,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 9; - token.len_max[1] = 9; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 9; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_14000.c b/src/modules/module_14000.c index 28b07df76..80d1fd79f 100644 --- a/src/modules/module_14000.c +++ b/src/modules/module_14000.c @@ -163,17 +163,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 16; - token.len_max[1] = 16; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 16; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_14100.c b/src/modules/module_14100.c index 2c93b2d53..bece404ad 100644 --- a/src/modules/module_14100.c +++ b/src/modules/module_14100.c @@ -114,17 +114,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 16; - token.len_max[1] = 16; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 16; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_14400.c b/src/modules/module_14400.c index a45d818e7..7c10075a6 100644 --- a/src/modules/module_14400.c +++ b/src/modules/module_14400.c @@ -63,17 +63,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 20; - token.len_max[1] = 20; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 20; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_14500.c b/src/modules/module_14500.c index 23ff627be..8033ed481 100644 --- a/src/modules/module_14500.c +++ b/src/modules/module_14500.c @@ -144,6 +144,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -160,27 +162,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 16 * 2; - token.len_max[3] = 16 * 2; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16 * 2; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; - token.len_min[4] = 16 * 2; - token.len_max[4] = 16 * 2; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 16 * 2; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '$'; - token.len_min[5] = 16 * 2; - token.len_max[5] = 16 * 2; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 16 * 2; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_14700.c b/src/modules/module_14700.c index 5bdfe431c..601e07063 100644 --- a/src/modules/module_14700.c +++ b/src/modules/module_14700.c @@ -94,50 +94,49 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_ITUNES_BACKUP; - token.len_min[0] = 15; - token.len_max[0] = 15; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 15; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '*'; token.len_min[1] = 1; token.len_max[1] = 2; - token.sep[1] = '*'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 80; - token.len_max[2] = 80; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 80; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[3] = '*'; token.len_min[3] = 1; token.len_max[3] = 6; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 40; - token.len_max[4] = 40; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 40; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[5] = '*'; token.len_min[5] = 0; token.len_max[5] = 10; - token.sep[5] = '*'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[6] = '*'; token.len_min[6] = 0; token.len_max[6] = 40; - token.sep[6] = '*'; token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_14800.c b/src/modules/module_14800.c index 9e88690e4..2825b93ce 100644 --- a/src/modules/module_14800.c +++ b/src/modules/module_14800.c @@ -110,50 +110,49 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_ITUNES_BACKUP; - token.len_min[0] = 15; - token.len_max[0] = 15; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 15; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = '*'; token.len_min[1] = 1; token.len_max[1] = 2; - token.sep[1] = '*'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 80; - token.len_max[2] = 80; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 80; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[3] = '*'; token.len_min[3] = 1; token.len_max[3] = 6; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 40; - token.len_max[4] = 40; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 40; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[5] = '*'; token.len_min[5] = 0; token.len_max[5] = 10; - token.sep[5] = '*'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[6] = '*'; token.len_min[6] = 0; token.len_max[6] = 40; - token.sep[6] = '*'; token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_14900.c b/src/modules/module_14900.c index 33614cc1d..2bedb5553 100644 --- a/src/modules/module_14900.c +++ b/src/modules/module_14900.c @@ -67,18 +67,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; - token.len_min[0] = 8; - token.len_max[0] = 8; token.sep[0] = hashconfig->separator; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 8; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 8; - token.len_max[1] = 8; token.sep[1] = hashconfig->separator; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 8; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_15000.c b/src/modules/module_15000.c index 8a4fe3b6c..b41d51d35 100644 --- a/src/modules/module_15000.c +++ b/src/modules/module_15000.c @@ -97,17 +97,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 64; - token.len_max[1] = 64; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 64; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_15100.c b/src/modules/module_15100.c index 670aa3754..e1c27067c 100644 --- a/src/modules/module_15100.c +++ b/src/modules/module_15100.c @@ -200,6 +200,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -216,14 +218,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 8; - token.len_max[2] = 8; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[2] = 8; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH; token.sep[3] = '$'; - token.len_min[3] = 28; - token.len_max[3] = 28; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 28; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64B; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_15200.c b/src/modules/module_15200.c index 0f1ef64ef..91c25f0c3 100644 --- a/src/modules/module_15200.c +++ b/src/modules/module_15200.c @@ -77,6 +77,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; diff --git a/src/modules/module_15300.c b/src/modules/module_15300.c index 661ad20c9..8f1782dee 100644 --- a/src/modules/module_15300.c +++ b/src/modules/module_15300.c @@ -105,6 +105,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 10; token.signatures_cnt = 1; @@ -116,55 +118,52 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // version - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // context - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // sid + token.sep[3] = '*'; token.len_min[3] = 10; token.len_max[3] = 60; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; // cipher + token.sep[4] = '*'; token.len_min[4] = 4; token.len_max[4] = 6; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; // hash + token.sep[5] = '*'; token.len_min[5] = 4; token.len_max[5] = 6; - token.sep[5] = '*'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH; // iterations + token.sep[6] = '*'; token.len_min[6] = 1; token.len_max[6] = 6; - token.sep[6] = '*'; token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iv - token.len_min[7] = 32; - token.len_max[7] = 32; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 32; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // content len + token.sep[8] = '*'; token.len_min[8] = 1; token.len_max[8] = 6; - token.sep[8] = '*'; token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; diff --git a/src/modules/module_15310.c b/src/modules/module_15310.c index 85ebc3860..51128f356 100644 --- a/src/modules/module_15310.c +++ b/src/modules/module_15310.c @@ -121,6 +121,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 10; token.signatures_cnt = 1; @@ -132,55 +134,52 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // version - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // context - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // sid + token.sep[3] = '*'; token.len_min[3] = 10; token.len_max[3] = 60; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; // cipher + token.sep[4] = '*'; token.len_min[4] = 4; token.len_max[4] = 6; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; // hash + token.sep[5] = '*'; token.len_min[5] = 4; token.len_max[5] = 6; - token.sep[5] = '*'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH; // iterations + token.sep[6] = '*'; token.len_min[6] = 1; token.len_max[6] = 6; - token.sep[6] = '*'; token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iv - token.len_min[7] = 32; - token.len_max[7] = 32; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 32; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // content len + token.sep[8] = '*'; token.len_min[8] = 1; token.len_max[8] = 6; - token.sep[8] = '*'; token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; diff --git a/src/modules/module_15400.c b/src/modules/module_15400.c index ffca28876..a42b7ba67 100644 --- a/src/modules/module_15400.c +++ b/src/modules/module_15400.c @@ -90,21 +90,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_CHACHA20; token.sep[0] = '*'; - token.len_min[0] = 10; - token.len_max[0] = 10; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 10; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 16; - token.len_max[1] = 16; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 16; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '*'; @@ -113,21 +113,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[3] = '*'; - token.len_min[3] = 16; - token.len_max[3] = 16; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 16; - token.len_max[4] = 16; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 16; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; - token.len_min[5] = 16; - token.len_max[5] = 16; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 16; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_15500.c b/src/modules/module_15500.c index a352777a8..2d190f1dd 100644 --- a/src/modules/module_15500.c +++ b/src/modules/module_15500.c @@ -89,27 +89,26 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_JKS_SHA1; token.sep[0] = '*'; - token.len_min[0] = 10; - token.len_max[0] = 10; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 10; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 40; - token.len_max[1] = 40; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 40; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '*'; - token.len_min[2] = 40; - token.len_max[2] = 40; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 40; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; @@ -119,15 +118,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 2; - token.len_max[4] = 2; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 2; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; - token.len_min[5] = 28; - token.len_max[5] = 28; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 28; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[6] = '*'; diff --git a/src/modules/module_15600.c b/src/modules/module_15600.c index 76766b004..a9605061f 100644 --- a/src/modules/module_15600.c +++ b/src/modules/module_15600.c @@ -126,15 +126,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_ETHEREUM_PBKDF2; token.sep[0] = '*'; - token.len_min[0] = 11; - token.len_max[0] = 11; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 11; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; @@ -150,15 +151,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 64; - token.len_max[3] = 64; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 64; - token.len_max[4] = 64; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 64; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_15700.c b/src/modules/module_15700.c index 5743dea70..baf0c72c1 100644 --- a/src/modules/module_15700.c +++ b/src/modules/module_15700.c @@ -287,15 +287,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_ETHEREUM_SCRYPT; token.sep[0] = '*'; - token.len_min[0] = 11; - token.len_max[0] = 11; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 11; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; @@ -317,21 +318,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[4] = '*'; - token.len_min[4] = 64; - token.len_max[4] = 64; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 64; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; - token.len_min[5] = 64; - token.len_max[5] = 64; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[6] = '*'; - token.len_min[6] = 64; - token.len_max[6] = 64; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 64; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_15900.c b/src/modules/module_15900.c index 0f4af0d5c..f8c15a99d 100644 --- a/src/modules/module_15900.c +++ b/src/modules/module_15900.c @@ -117,6 +117,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 10; token.signatures_cnt = 1; @@ -128,41 +130,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // version - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // context - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // sid + token.sep[3] = '*'; token.len_min[3] = 10; token.len_max[3] = 60; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; // cipher + token.sep[4] = '*'; token.len_min[4] = 4; token.len_max[4] = 6; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; // hash + token.sep[5] = '*'; token.len_min[5] = 4; token.len_max[5] = 6; - token.sep[5] = '*'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH; // iterations + token.sep[6] = '*'; token.len_min[6] = 1; token.len_max[6] = 6; - token.sep[6] = '*'; token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; @@ -174,9 +174,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; // content len + token.sep[8] = '*'; token.len_min[8] = 1; token.len_max[8] = 6; - token.sep[8] = '*'; token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; diff --git a/src/modules/module_15910.c b/src/modules/module_15910.c index 5b85bb2b6..9a1c59be9 100644 --- a/src/modules/module_15910.c +++ b/src/modules/module_15910.c @@ -127,6 +127,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 10; token.signatures_cnt = 1; @@ -138,55 +140,52 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // version - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // context - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // sid + token.sep[3] = '*'; token.len_min[3] = 10; token.len_max[3] = 60; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; // cipher + token.sep[4] = '*'; token.len_min[4] = 4; token.len_max[4] = 6; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; // hash + token.sep[5] = '*'; token.len_min[5] = 4; token.len_max[5] = 6; - token.sep[5] = '*'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH; // iterations + token.sep[6] = '*'; token.len_min[6] = 1; token.len_max[6] = 6; - token.sep[6] = '*'; token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iv - token.len_min[7] = 32; - token.len_max[7] = 32; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 32; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // content len + token.sep[8] = '*'; token.len_min[8] = 1; token.len_max[8] = 6; - token.sep[8] = '*'; token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; diff --git a/src/modules/module_16000.c b/src/modules/module_16000.c index f5b533c67..0d9536f73 100644 --- a/src/modules/module_16000.c +++ b/src/modules/module_16000.c @@ -55,6 +55,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 10; diff --git a/src/modules/module_16100.c b/src/modules/module_16100.c index 15418a7b7..edcf33e8b 100644 --- a/src/modules/module_16100.c +++ b/src/modules/module_16100.c @@ -72,6 +72,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -82,9 +84,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 8; - token.len_max[1] = 8; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 8; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; @@ -94,9 +95,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '$'; - token.len_min[3] = 4; - token.len_max[3] = 4; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 4; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_16200.c b/src/modules/module_16200.c index e846b875b..36e14358e 100644 --- a/src/modules/module_16200.c +++ b/src/modules/module_16200.c @@ -116,15 +116,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_APPLE_SECURE_NOTES; token.sep[0] = '*'; - token.len_min[0] = 5; - token.len_max[0] = 5; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 5; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; @@ -140,15 +141,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '*'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 48; - token.len_max[4] = 48; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 48; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_16300.c b/src/modules/module_16300.c index 9ac1c7cf0..1efe11c73 100644 --- a/src/modules/module_16300.c +++ b/src/modules/module_16300.c @@ -128,15 +128,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_ETHEREUM_PRESALE; token.sep[0] = '*'; - token.len_min[0] = 11; - token.len_max[0] = 11; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 11; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; @@ -146,15 +147,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '*'; - token.len_min[2] = 40; - token.len_max[2] = 40; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 40; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_16400.c b/src/modules/module_16400.c index e2c1c9abf..009d82ad2 100644 --- a/src/modules/module_16400.c +++ b/src/modules/module_16400.c @@ -64,6 +64,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; diff --git a/src/modules/module_16500.c b/src/modules/module_16500.c index 6bd19f712..d4add2cf9 100644 --- a/src/modules/module_16500.c +++ b/src/modules/module_16500.c @@ -123,6 +123,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.sep[0] = '.'; diff --git a/src/modules/module_16600.c b/src/modules/module_16600.c index cde2db041..0571028f7 100644 --- a/src/modules/module_16600.c +++ b/src/modules/module_16600.c @@ -70,6 +70,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -80,21 +82,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_16700.c b/src/modules/module_16700.c index e683a5356..50314c20d 100644 --- a/src/modules/module_16700.c +++ b/src/modules/module_16700.c @@ -85,6 +85,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -107,9 +109,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; @@ -119,9 +120,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[5] = '$'; - token.len_min[5] = 48; - token.len_max[5] = 48; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 48; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_16800.c b/src/modules/module_16800.c index bff43cdfd..f01ac61ee 100644 --- a/src/modules/module_16800.c +++ b/src/modules/module_16800.c @@ -333,24 +333,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.sep[0] = sep; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = sep; - token.len_min[1] = 12; - token.len_max[1] = 12; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 12; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = sep; - token.len_min[2] = 12; - token.len_max[2] = 12; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 12; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = sep; diff --git a/src/modules/module_16801.c b/src/modules/module_16801.c index 82fe33bb1..43886ed82 100644 --- a/src/modules/module_16801.c +++ b/src/modules/module_16801.c @@ -355,26 +355,25 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + // real 16801 pmkid hash-lines token.token_cnt = 3; token.sep[0] = sep; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = sep; - token.len_min[1] = 12; - token.len_max[1] = 12; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 12; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = sep; - token.len_min[2] = 12; - token.len_max[2] = 12; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 12; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); @@ -386,21 +385,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 4; token.sep[0] = sep; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = sep; - token.len_min[1] = 12; - token.len_max[1] = 12; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 12; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = sep; - token.len_min[2] = 12; - token.len_max[2] = 12; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 12; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = sep; diff --git a/src/modules/module_16900.c b/src/modules/module_16900.c index 9ab655617..213b5940e 100644 --- a/src/modules/module_16900.c +++ b/src/modules/module_16900.c @@ -127,6 +127,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -137,21 +139,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '*'; - token.len_min[3] = 64; - token.len_max[3] = 64; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; @@ -161,9 +160,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; - token.len_min[5] = 64; - token.len_max[5] = 64; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_17010.c b/src/modules/module_17010.c index ede464576..865a6f8eb 100644 --- a/src/modules/module_17010.c +++ b/src/modules/module_17010.c @@ -137,6 +137,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 13; // signature $gpg$ @@ -144,93 +146,84 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.signatures_buf[0] = SIGNATURE_GPG; // signature $gpg$ - token.len_min[0] = 5; - token.len_max[0] = 5; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 5; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; // "1" -- unknown option - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // size of the encrypted data in bytes + token.sep[2] = '*'; token.len_min[2] = 3; token.len_max[2] = 4; - token.sep[2] = '*'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // size of the key: 1024, 2048, 4096, etc. + token.sep[3] = '*'; token.len_min[3] = 3; token.len_max[3] = 4; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // encrypted key -- twice the amount of byte because its interpreted as characters + token.sep[4] = '*'; token.len_min[4] = 256; token.len_max[4] = 3072; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // "3" - String2Key parameter - token.len_min[5] = 1; - token.len_max[5] = 1; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // "254" - String2Key parameters - token.len_min[6] = 3; - token.len_max[6] = 3; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 3; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // "2" - String2Key parameters - token.len_min[7] = 1; - token.len_max[7] = 1; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 1; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // cipher mode: 7 or 9 - token.len_min[8] = 1; - token.len_max[8] = 1; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 1; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // size of initial vector in bytes: 16 - token.len_min[9] = 2; - token.len_max[9] = 2; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 2; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // initial vector - twice the amount of bytes because its interpreted as characters - token.len_min[10] = 32; - token.len_max[10] = 32; token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.len[10] = 32; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // iteration count + token.sep[11] = '*'; token.len_min[11] = 1; token.len_max[11] = 8; - token.sep[11] = '*'; token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // salt - 8 bytes / 16 characters - token.len_min[12] = 16; - token.len_max[12] = 16; - token.attr[12] = TOKEN_ATTR_VERIFY_LENGTH + token.len[12] = 16; + token.attr[12] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_17020.c b/src/modules/module_17020.c index 4ce8e21ea..c4c9c7bef 100644 --- a/src/modules/module_17020.c +++ b/src/modules/module_17020.c @@ -141,6 +141,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 13; // signature $gpg$ @@ -148,93 +150,84 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.signatures_buf[0] = SIGNATURE_GPG; // signature $gpg$ - token.len_min[0] = 5; - token.len_max[0] = 5; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 5; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; // "1" -- unknown option - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // size of the encrypted data in bytes + token.sep[2] = '*'; token.len_min[2] = 3; token.len_max[2] = 4; - token.sep[2] = '*'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // size of the key: 1024, 2048, 4096, etc. + token.sep[3] = '*'; token.len_min[3] = 3; token.len_max[3] = 4; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // encrypted key -- twice the amount of byte because its interpreted as characters + token.sep[4] = '*'; token.len_min[4] = 256; token.len_max[4] = 3072; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // "3" - String2Key parameter - token.len_min[5] = 1; - token.len_max[5] = 1; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // "254" - String2Key parameters - token.len_min[6] = 3; - token.len_max[6] = 3; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 3; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // "10" - String2Key parameters - token.len_min[7] = 2; - token.len_max[7] = 2; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 2; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // cipher mode: 7 or 9 - token.len_min[8] = 1; - token.len_max[8] = 1; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 1; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // size of initial vector in bytes: 16 - token.len_min[9] = 2; - token.len_max[9] = 2; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 2; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // initial vector - twice the amount of bytes because its interpreted as characters - token.len_min[10] = 32; - token.len_max[10] = 32; token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.len[10] = 32; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // iteration count + token.sep[11] = '*'; token.len_min[11] = 1; token.len_max[11] = 8; - token.sep[11] = '*'; token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // salt - 8 bytes / 16 characters - token.len_min[12] = 16; - token.len_max[12] = 16; - token.attr[12] = TOKEN_ATTR_VERIFY_LENGTH + token.len[12] = 16; + token.attr[12] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_17030.c b/src/modules/module_17030.c index 5b06d694e..05867755c 100644 --- a/src/modules/module_17030.c +++ b/src/modules/module_17030.c @@ -137,6 +137,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 13; // signature $gpg$ @@ -144,93 +146,84 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.signatures_buf[0] = SIGNATURE_GPG; // signature $gpg$ - token.len_min[0] = 5; - token.len_max[0] = 5; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 5; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; // "1" -- unknown option - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // size of the encrypted data in bytes + token.sep[2] = '*'; token.len_min[2] = 3; token.len_max[2] = 4; - token.sep[2] = '*'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // size of the key: 1024, 2048, 4096, etc. + token.sep[3] = '*'; token.len_min[3] = 3; token.len_max[3] = 4; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // encrypted key -- twice the amount of byte because its interpreted as characters + token.sep[4] = '*'; token.len_min[4] = 256; token.len_max[4] = 3072; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // "3" - String2Key parameter - token.len_min[5] = 1; - token.len_max[5] = 1; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // "254" - String2Key parameters - token.len_min[6] = 3; - token.len_max[6] = 3; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 3; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // "10" - String2Key parameters - token.len_min[7] = 1; - token.len_max[7] = 1; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 1; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // cipher mode: 7 or 9 - token.len_min[8] = 1; - token.len_max[8] = 1; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 1; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // size of initial vector in bytes: 16 - token.len_min[9] = 2; - token.len_max[9] = 2; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 2; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // initial vector - twice the amount of bytes because its interpreted as characters - token.len_min[10] = 32; - token.len_max[10] = 32; token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.len[10] = 32; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // iteration count + token.sep[11] = '*'; token.len_min[11] = 1; token.len_max[11] = 8; - token.sep[11] = '*'; token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // salt - 8 bytes / 16 characters - token.len_min[12] = 16; - token.len_max[12] = 16; - token.attr[12] = TOKEN_ATTR_VERIFY_LENGTH + token.len[12] = 16; + token.attr[12] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_17300.c b/src/modules/module_17300.c index 69b2d9a71..139bf7181 100644 --- a/src/modules/module_17300.c +++ b/src/modules/module_17300.c @@ -50,6 +50,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 56; diff --git a/src/modules/module_17400.c b/src/modules/module_17400.c index 8960f81b0..74a7b2275 100644 --- a/src/modules/module_17400.c +++ b/src/modules/module_17400.c @@ -50,6 +50,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 64; diff --git a/src/modules/module_17500.c b/src/modules/module_17500.c index 21f36b68c..2bd2448e4 100644 --- a/src/modules/module_17500.c +++ b/src/modules/module_17500.c @@ -50,6 +50,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 96; diff --git a/src/modules/module_17600.c b/src/modules/module_17600.c index be05ad43d..b6760541b 100644 --- a/src/modules/module_17600.c +++ b/src/modules/module_17600.c @@ -50,6 +50,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 128; diff --git a/src/modules/module_17700.c b/src/modules/module_17700.c index f0ac2fe15..803bed8c5 100644 --- a/src/modules/module_17700.c +++ b/src/modules/module_17700.c @@ -50,6 +50,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 56; diff --git a/src/modules/module_17800.c b/src/modules/module_17800.c index aa0c1d710..ae6abb885 100644 --- a/src/modules/module_17800.c +++ b/src/modules/module_17800.c @@ -50,6 +50,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 64; diff --git a/src/modules/module_17900.c b/src/modules/module_17900.c index 95bc5f611..3db6a9496 100644 --- a/src/modules/module_17900.c +++ b/src/modules/module_17900.c @@ -50,6 +50,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 96; diff --git a/src/modules/module_18000.c b/src/modules/module_18000.c index 1d99d0a4e..5f3209c5b 100644 --- a/src/modules/module_18000.c +++ b/src/modules/module_18000.c @@ -50,6 +50,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 128; diff --git a/src/modules/module_18100.c b/src/modules/module_18100.c index d2d3eaee3..d7b1f62a9 100644 --- a/src/modules/module_18100.c +++ b/src/modules/module_18100.c @@ -57,12 +57,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 6; - token.len_max[0] = 6; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_18200.c b/src/modules/module_18200.c index b7c4aab11..05ac3885d 100644 --- a/src/modules/module_18200.c +++ b/src/modules/module_18200.c @@ -104,6 +104,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KRB5ASREP; @@ -131,7 +133,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE krb5asrep->format = 1; - parse_off += 2; + parse_off += 3; } else { @@ -145,8 +147,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (account_info_stop == NULL) return (PARSER_SEPARATOR_UNMATCHED); - account_info_stop++; // we want the : char included - const int account_info_len = account_info_stop - account_info_start; token.token_cnt = 4; @@ -171,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // checksum token.sep[3] = '$'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // edata2 @@ -195,9 +194,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // checksum token.sep[2] = '$'; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // edata2 @@ -292,7 +290,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (krb5asrep->format == 1) { - line_len = snprintf (line_buf, line_size, "%s23%s%08x%08x%08x%08x$%s", + line_len = snprintf (line_buf, line_size, "%s23$%s:%08x%08x%08x%08x$%s", SIGNATURE_KRB5ASREP, (char *) krb5asrep->account_info, byte_swap_32 (krb5asrep->checksum[0]), @@ -303,7 +301,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE } else { - line_len = snprintf (line_buf, line_size, "%s%s%08x%08x%08x%08x$%s", + line_len = snprintf (line_buf, line_size, "%s%s:%08x%08x%08x%08x$%s", SIGNATURE_KRB5ASREP, (char *) krb5asrep->account_info, byte_swap_32 (krb5asrep->checksum[0]), diff --git a/src/modules/module_18300.c b/src/modules/module_18300.c index 0bd20be83..6a3750718 100644 --- a/src/modules/module_18300.c +++ b/src/modules/module_18300.c @@ -116,6 +116,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -138,9 +140,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; @@ -150,9 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[5] = '$'; - token.len_min[5] = 80; - token.len_max[5] = 80; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 80; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_18400.c b/src/modules/module_18400.c index 7f681910b..549e6ab71 100644 --- a/src/modules/module_18400.c +++ b/src/modules/module_18400.c @@ -96,75 +96,67 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 12; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_ODF; - token.len_min[0] = 5; - token.len_max[0] = 5; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 5; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[3] = '*'; token.len_min[3] = 4; token.len_max[3] = 6; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 2; - token.len_max[4] = 2; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 2; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[5] = 64; - token.len_max[5] = 64; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[6] = 2; - token.len_max[6] = 2; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 2; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[7] = 32; - token.len_max[7] = 32; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 32; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[8] = 2; - token.len_max[8] = 2; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 2; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[9] = 32; - token.len_max[9] = 32; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 32; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[10] = 1; - token.len_max[10] = 1; token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.len[10] = 1; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.len_min[11] = 16; @@ -256,15 +248,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct - u32 ct_buf[256]; + u8 ct_buf[(256 * 4 * 2) + 1]; - for (int i = 0; i < 256; i++) ct_buf[i] = byte_swap_32 (odf12->encrypted_data[i]); + memset (ct_buf, 0, sizeof (ct_buf)); - u8 ct_buf8[(256 * 4 * 2) + 1]; + const int ct_len = hex_encode ((const u8 *) odf12->encrypted_data, odf12->encrypted_len, ct_buf); - const int ct_len = hex_encode ((const u8 *) ct_buf, odf12->encrypted_len, ct_buf8); - - ct_buf8[ct_len] = 0; + ct_buf[ct_len] = 0; const int out_len = snprintf (line_buf, line_size, "%s*1*1*%u*32*%08x%08x%08x%08x%08x%08x%08x%08x*16*%08x%08x%08x%08x*16*%08x%08x%08x%08x*0*%s", SIGNATURE_ODF, @@ -285,7 +275,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE byte_swap_32 (salt->salt_buf[1]), byte_swap_32 (salt->salt_buf[2]), byte_swap_32 (salt->salt_buf[3]), - (char *) ct_buf8); + (char *) ct_buf); return out_len; } diff --git a/src/modules/module_18500.c b/src/modules/module_18500.c index 920a624de..f4e0e3cdc 100644 --- a/src/modules/module_18500.c +++ b/src/modules/module_18500.c @@ -68,11 +68,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_18600.c b/src/modules/module_18600.c index 38ce745cd..ec7e5cbef 100644 --- a/src/modules/module_18600.c +++ b/src/modules/module_18600.c @@ -191,80 +191,72 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 12; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_ODF; - token.len_min[0] = 5; - token.len_max[0] = 5; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 5; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[3] = '*'; token.len_min[3] = 4; token.len_max[3] = 6; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 2; - token.len_max[4] = 2; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 2; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[5] = 40; - token.len_max[5] = 40; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 40; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[6] = 1; - token.len_max[6] = 1; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 1; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[7] = 16; - token.len_max[7] = 16; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 16; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[8] = 2; - token.len_max[8] = 2; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 2; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[9] = 32; - token.len_max[9] = 32; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 32; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[10] = 1; - token.len_max[10] = 1; token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.len[10] = 1; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[11] = '*'; token.len_min[11] = 16; token.len_max[11] = 2048; - token.sep[11] = '*'; token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_18700.c b/src/modules/module_18700.c index f1d6823af..57c7bdc1e 100644 --- a/src/modules/module_18700.c +++ b/src/modules/module_18700.c @@ -48,11 +48,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 8; - token.len_max[0] = 8; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 8; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_18800.c b/src/modules/module_18800.c index 342f2ecfc..45e30f6b6 100644 --- a/src/modules/module_18800.c +++ b/src/modules/module_18800.c @@ -125,11 +125,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 80; - token.len_max[0] = 80; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 80; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_18900.c b/src/modules/module_18900.c index b23b81467..2141796f2 100644 --- a/src/modules/module_18900.c +++ b/src/modules/module_18900.c @@ -96,6 +96,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; @@ -107,52 +109,46 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // version - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // cipher - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter + token.sep[3] = '*'; token.len_min[3] = 1; token.len_max[3] = 6; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // user_salt - token.len_min[4] = 128; - token.len_max[4] = 128; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 128; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // ck_salt - token.len_min[5] = 128; - token.len_max[5] = 128; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 128; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // user_iv - token.len_min[6] = 32; - token.len_max[6] = 32; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // masterkey_blob - token.len_min[7] = 192; - token.len_max[7] = 192; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 192; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_19000.c b/src/modules/module_19000.c index d0d23c2b4..7179bac0c 100644 --- a/src/modules/module_19000.c +++ b/src/modules/module_19000.c @@ -72,12 +72,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.sep[0] = '@'; - token.len_min[0] = 0; - token.len_max[0] = 0; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[0] = 0; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; token.sep[1] = '@'; token.len_min[1] = 1; diff --git a/src/modules/module_19100.c b/src/modules/module_19100.c index 44538ca08..af94f1c9b 100644 --- a/src/modules/module_19100.c +++ b/src/modules/module_19100.c @@ -64,12 +64,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.sep[0] = '@'; - token.len_min[0] = 0; - token.len_max[0] = 0; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[0] = 0; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; token.sep[1] = '@'; token.len_min[1] = 1; diff --git a/src/modules/module_19200.c b/src/modules/module_19200.c index 657e132ea..9def88b03 100644 --- a/src/modules/module_19200.c +++ b/src/modules/module_19200.c @@ -67,12 +67,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.sep[0] = '@'; - token.len_min[0] = 0; - token.len_max[0] = 0; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[0] = 0; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; token.sep[1] = '@'; token.len_min[1] = 1; diff --git a/src/modules/module_19300.c b/src/modules/module_19300.c index c78e03727..2e9bb17d9 100644 --- a/src/modules/module_19300.c +++ b/src/modules/module_19300.c @@ -90,12 +90,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = hashconfig->separator; diff --git a/src/modules/module_19500.c b/src/modules/module_19500.c index 130a3bea6..3e6748efa 100644 --- a/src/modules/module_19500.c +++ b/src/modules/module_19500.c @@ -82,12 +82,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = hashconfig->separator; diff --git a/src/modules/module_19600.c b/src/modules/module_19600.c index 19a327f75..cbe9a58d3 100644 --- a/src/modules/module_19600.c +++ b/src/modules/module_19600.c @@ -89,6 +89,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KRB5TGS; @@ -125,16 +127,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.sep[3] = '$'; // hmac-sha1 stripped to 12bytes - token.len_min[3] = 24; - token.len_max[3] = 24; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.len[3] = 24; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; token.len_min[4] = 64; token.len_max[4] = 40960; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + | TOKEN_ATTR_VERIFY_HEX; } // assume $krb5tgs$17$user$realm$*spn*$checksum$edata2 else @@ -164,16 +165,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[3] = TOKEN_ATTR_FIXED_LENGTH; token.sep[4] = '$'; - token.len_min[4] = 24; - token.len_max[4] = 24; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.len[4] = 24; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '$'; token.len_min[5] = 64; token.len_max[5] = 40960; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + | TOKEN_ATTR_VERIFY_HEX; is_spn_provided = 1; } diff --git a/src/modules/module_19700.c b/src/modules/module_19700.c index 4ccaefea1..e2f296076 100644 --- a/src/modules/module_19700.c +++ b/src/modules/module_19700.c @@ -89,6 +89,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KRB5TGS; @@ -125,10 +127,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.sep[3] = '$'; // hmac-sha1 stripped to 12bytes - token.len_min[3] = 24; - token.len_max[3] = 24; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.len[3] = 24; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; token.len_min[4] = 64; @@ -164,16 +165,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[3] = TOKEN_ATTR_FIXED_LENGTH; token.sep[4] = '$'; - token.len_min[4] = 24; - token.len_max[4] = 24; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.len[4] = 24; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '$'; token.len_min[5] = 64; token.len_max[5] = 40960; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + | TOKEN_ATTR_VERIFY_HEX; is_spn_provided = 1; } diff --git a/src/modules/module_19800.c b/src/modules/module_19800.c index 9c5957fe5..4f28ab31a 100644 --- a/src/modules/module_19800.c +++ b/src/modules/module_19800.c @@ -89,6 +89,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KRB5PA; diff --git a/src/modules/module_19900.c b/src/modules/module_19900.c index 7a0fb6e04..af380c9c6 100644 --- a/src/modules/module_19900.c +++ b/src/modules/module_19900.c @@ -89,6 +89,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KRB5PA; diff --git a/src/modules/module_20011.c b/src/modules/module_20011.c index 8e3892521..c01b548bb 100644 --- a/src/modules/module_20011.c +++ b/src/modules/module_20011.c @@ -104,6 +104,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -113,10 +115,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[2] = 4096; diff --git a/src/modules/module_20012.c b/src/modules/module_20012.c index 76f6f8b6a..627765d09 100644 --- a/src/modules/module_20012.c +++ b/src/modules/module_20012.c @@ -104,6 +104,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -113,10 +115,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[2] = 4096; diff --git a/src/modules/module_20013.c b/src/modules/module_20013.c index d0e6a8958..b8cfbf9b7 100644 --- a/src/modules/module_20013.c +++ b/src/modules/module_20013.c @@ -104,6 +104,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -113,10 +115,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[2] = 4096; diff --git a/src/modules/module_20200.c b/src/modules/module_20200.c index d775cc986..5be8bdc89 100644 --- a/src/modules/module_20200.c +++ b/src/modules/module_20200.c @@ -93,6 +93,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; @@ -100,14 +102,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // the hash starts with a $ token.sep[0] = '$'; - token.len_min[0] = 0; - token.len_max[0] = 0; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[0] = 0; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; token.sep[1] = '$'; - token.len_min[1] = 13; - token.len_max[1] = 13; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 13; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; // iterations in decimal representation @@ -126,9 +126,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // payload in alternate base64 representanion token.sep[4] = '$'; - token.len_min[4] = HASH_LEN_B64; - token.len_max[4] = HASH_LEN_B64; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = HASH_LEN_B64; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64B; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_20300.c b/src/modules/module_20300.c index 792243334..2ccbb5c08 100644 --- a/src/modules/module_20300.c +++ b/src/modules/module_20300.c @@ -92,6 +92,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; @@ -99,14 +101,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // the hash starts with a $ token.sep[0] = '$'; - token.len_min[0] = 0; - token.len_max[0] = 0; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[0] = 0; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; token.sep[1] = '$'; - token.len_min[1] = 13; - token.len_max[1] = 13; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 13; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; // iterations in decimal representation @@ -125,9 +125,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // payload in alternate base64 representanion token.sep[4] = '$'; - token.len_min[4] = HASH_LEN_B64; - token.len_max[4] = HASH_LEN_B64; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = HASH_LEN_B64; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64B; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_20400.c b/src/modules/module_20400.c index be36d1fb9..80c4f56f4 100644 --- a/src/modules/module_20400.c +++ b/src/modules/module_20400.c @@ -92,6 +92,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; @@ -99,14 +101,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // the hash starts with a $ token.sep[0] = '$'; - token.len_min[0] = 0; - token.len_max[0] = 0; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[0] = 0; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; token.sep[1] = '$'; - token.len_min[1] = 6; - token.len_max[1] = 6; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 6; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; // iterations in decimal representation @@ -125,9 +125,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // payload in alternate base64 representanion token.sep[4] = '$'; - token.len_min[4] = HASH_LEN_B64; - token.len_max[4] = HASH_LEN_B64; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = HASH_LEN_B64; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64B; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_20500.c b/src/modules/module_20500.c index 7b05986a1..3a001c93e 100644 --- a/src/modules/module_20500.c +++ b/src/modules/module_20500.c @@ -105,11 +105,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 24; - token.len_max[0] = 24; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 24; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_20510.c b/src/modules/module_20510.c index 04fef62f8..e89e8dfc2 100644 --- a/src/modules/module_20510.c +++ b/src/modules/module_20510.c @@ -146,11 +146,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 24; - token.len_max[0] = 24; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 24; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_20600.c b/src/modules/module_20600.c index d957e6f76..dc35c6081 100644 --- a/src/modules/module_20600.c +++ b/src/modules/module_20600.c @@ -99,6 +99,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -107,9 +109,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // sig token.sep[0] = ':'; - token.len_min[0] = 10; - token.len_max[0] = 10; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 10; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; // iter diff --git a/src/modules/module_20710.c b/src/modules/module_20710.c index 9a7cfbed0..49705221e 100644 --- a/src/modules/module_20710.c +++ b/src/modules/module_20710.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_20711.c b/src/modules/module_20711.c index 44e8c9976..1103ddf7b 100644 --- a/src/modules/module_20711.c +++ b/src/modules/module_20711.c @@ -70,6 +70,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -80,14 +82,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 16; - token.len_max[1] = 16; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 16; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; token.sep[2] = '$'; - token.len_min[2] = 64; - token.len_max[2] = 64; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 64; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_20720.c b/src/modules/module_20720.c index 1eab75d78..3dc89ef5e 100644 --- a/src/modules/module_20720.c +++ b/src/modules/module_20720.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_20800.c b/src/modules/module_20800.c index 5aa0103d9..54a1b02d5 100644 --- a/src/modules/module_20800.c +++ b/src/modules/module_20800.c @@ -54,11 +54,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_20900.c b/src/modules/module_20900.c index 41022fb54..8a0dd5c60 100644 --- a/src/modules/module_20900.c +++ b/src/modules/module_20900.c @@ -54,11 +54,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_21000.c b/src/modules/module_21000.c index 32355f409..f8fadf552 100644 --- a/src/modules/module_21000.c +++ b/src/modules/module_21000.c @@ -67,11 +67,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 128; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_21100.c b/src/modules/module_21100.c index 6198d0916..b722be594 100644 --- a/src/modules/module_21100.c +++ b/src/modules/module_21100.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_21200.c b/src/modules/module_21200.c index af03a0feb..f51d214a6 100644 --- a/src/modules/module_21200.c +++ b/src/modules/module_21200.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_21300.c b/src/modules/module_21300.c index 7dfc04005..1825bef35 100644 --- a/src/modules/module_21300.c +++ b/src/modules/module_21300.c @@ -53,12 +53,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_21400.c b/src/modules/module_21400.c index dc57927f6..2959a503f 100644 --- a/src/modules/module_21400.c +++ b/src/modules/module_21400.c @@ -54,11 +54,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_21420.c b/src/modules/module_21420.c index 6df334958..e55c031ab 100644 --- a/src/modules/module_21420.c +++ b/src/modules/module_21420.c @@ -54,12 +54,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_21500.c b/src/modules/module_21500.c index 314eda447..837c942bb 100644 --- a/src/modules/module_21500.c +++ b/src/modules/module_21500.c @@ -95,6 +95,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -110,9 +112,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[2] = '$'; - token.len_min[2] = 88; - token.len_max[2] = 88; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 88; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_21501.c b/src/modules/module_21501.c index abccc527c..a36517053 100644 --- a/src/modules/module_21501.c +++ b/src/modules/module_21501.c @@ -109,6 +109,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -119,15 +121,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 24; - token.len_max[1] = 24; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 24; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.sep[2] = '$'; - token.len_min[2] = 88; - token.len_max[2] = 88; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 88; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_21600.c b/src/modules/module_21600.c index 7120445ea..1342e697c 100644 --- a/src/modules/module_21600.c +++ b/src/modules/module_21600.c @@ -90,6 +90,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 2; @@ -97,9 +99,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.signatures_buf[1] = SIGNATURE_WEB2PY_STOP; token.sep[0] = '('; - token.len_min[0] = 6; - token.len_max[0] = 6; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = ','; @@ -109,9 +110,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 10; - token.len_max[2] = 10; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 10; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[3] = '$'; @@ -119,9 +119,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.len_max[3] = SALT_MAX; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[4] = 40; - token.len_max[4] = 40; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 40; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_21700.c b/src/modules/module_21700.c index 96c12c811..8ca3f4ca6 100644 --- a/src/modules/module_21700.c +++ b/src/modules/module_21700.c @@ -125,6 +125,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -135,9 +137,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 66; - token.len_max[1] = 66; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 66; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '*'; @@ -147,9 +148,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 64; - token.len_max[3] = 64; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_21800.c b/src/modules/module_21800.c index 13fd8523c..752f3451c 100644 --- a/src/modules/module_21800.c +++ b/src/modules/module_21800.c @@ -116,6 +116,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -126,21 +128,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 66; - token.len_max[1] = 66; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 66; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '*'; - token.len_min[2] = 2048; - token.len_max[2] = 2048; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 2048; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 64; - token.len_max[3] = 64; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_22000.c b/src/modules/module_22000.c index 79238c32f..5c20d6c7d 100644 --- a/src/modules/module_22000.c +++ b/src/modules/module_22000.c @@ -717,24 +717,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.sep[0] = sep; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = sep; - token.len_min[1] = 12; - token.len_max[1] = 12; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 12; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = sep; - token.len_min[2] = 12; - token.len_max[2] = 12; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 12; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = sep; @@ -759,39 +758,36 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 9; token.signatures_cnt = 1; token.signatures_buf[0] = "WPA"; token.sep[0] = '*'; - token.len_min[0] = 3; - token.len_max[0] = 3; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 3; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 2; - token.len_max[1] = 2; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '*'; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 12; - token.len_max[3] = 12; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 12; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 12; - token.len_max[4] = 12; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 12; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; diff --git a/src/modules/module_22001.c b/src/modules/module_22001.c index 6bd49698d..8bd35cd2b 100644 --- a/src/modules/module_22001.c +++ b/src/modules/module_22001.c @@ -719,24 +719,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.sep[0] = sep; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = sep; - token.len_min[1] = 12; - token.len_max[1] = 12; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 12; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = sep; - token.len_min[2] = 12; - token.len_max[2] = 12; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 12; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = sep; @@ -760,39 +759,36 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 9; token.signatures_cnt = 1; token.signatures_buf[0] = "WPA"; token.sep[0] = '*'; - token.len_min[0] = 3; - token.len_max[0] = 3; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 3; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 2; - token.len_max[1] = 2; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '*'; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 12; - token.len_max[3] = 12; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 12; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 12; - token.len_max[4] = 12; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 12; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; diff --git a/src/modules/module_22100.c b/src/modules/module_22100.c index 67b67ddbe..833eb4a63 100644 --- a/src/modules/module_22100.c +++ b/src/modules/module_22100.c @@ -159,6 +159,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 9; token.signatures_cnt = 1; @@ -169,51 +171,43 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 2; - token.len_max[2] = 2; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 2; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; - token.len_min[4] = 7; - token.len_max[4] = 7; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 7; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[5] = '$'; - token.len_min[5] = 2; - token.len_max[5] = 2; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 2; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[6] = '$'; - token.len_min[6] = 24; - token.len_max[6] = 24; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 24; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '$'; - token.len_min[7] = 2; - token.len_max[7] = 2; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 2; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[8] = '$'; - token.len_min[8] = 120; - token.len_max[8] = 120; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 120; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_22200.c b/src/modules/module_22200.c index 8f1937ab7..6e9141ba8 100644 --- a/src/modules/module_22200.c +++ b/src/modules/module_22200.c @@ -91,6 +91,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; diff --git a/src/modules/module_22300.c b/src/modules/module_22300.c index eced4ebd8..64f33ad4f 100644 --- a/src/modules/module_22300.c +++ b/src/modules/module_22300.c @@ -51,12 +51,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_22301.c b/src/modules/module_22301.c index a22d7e6c7..f75c196dc 100644 --- a/src/modules/module_22301.c +++ b/src/modules/module_22301.c @@ -53,6 +53,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -62,21 +64,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 64; - token.len_max[2] = 64; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 64; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_22400.c b/src/modules/module_22400.c index 29efc0a3a..cd373a75d 100644 --- a/src/modules/module_22400.c +++ b/src/modules/module_22400.c @@ -134,6 +134,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -144,33 +146,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 64; - token.len_max[4] = 64; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 64; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; - token.len_min[5] = 64; - token.len_max[5] = 64; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_22500.c b/src/modules/module_22500.c index 3dd33067e..534539b4e 100644 --- a/src/modules/module_22500.c +++ b/src/modules/module_22500.c @@ -63,6 +63,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -73,21 +75,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; - token.len_min[2] = 16; - token.len_max[2] = 16; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 16; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 64; - token.len_max[3] = 64; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_22600.c b/src/modules/module_22600.c index 1178c3e91..236ba6453 100644 --- a/src/modules/module_22600.c +++ b/src/modules/module_22600.c @@ -94,6 +94,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; diff --git a/src/modules/module_22700.c b/src/modules/module_22700.c index 4409ddb29..009b4a280 100644 --- a/src/modules/module_22700.c +++ b/src/modules/module_22700.c @@ -271,6 +271,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; @@ -280,22 +282,19 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 32; - token.len_max[2] = 32; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[3] = 32; - token.len_max[3] = 32; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[4] = 32; diff --git a/src/modules/module_22911.c b/src/modules/module_22911.c index 0f76a3793..8beeca76b 100644 --- a/src/modules/module_22911.c +++ b/src/modules/module_22911.c @@ -68,6 +68,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -78,21 +80,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 16; - token.len_max[3] = 16; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; diff --git a/src/modules/module_22921.c b/src/modules/module_22921.c index 54f13a4ee..182c1c6f3 100644 --- a/src/modules/module_22921.c +++ b/src/modules/module_22921.c @@ -69,6 +69,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -79,21 +81,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 16; - token.len_max[3] = 16; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; diff --git a/src/modules/module_22931.c b/src/modules/module_22931.c index d9309918a..5296c58fc 100644 --- a/src/modules/module_22931.c +++ b/src/modules/module_22931.c @@ -68,6 +68,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -78,21 +80,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 2; - token.len_max[2] = 2; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 2; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; diff --git a/src/modules/module_22941.c b/src/modules/module_22941.c index ff219aa56..e2b2e8116 100644 --- a/src/modules/module_22941.c +++ b/src/modules/module_22941.c @@ -68,6 +68,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -78,21 +80,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 2; - token.len_max[2] = 2; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 2; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; diff --git a/src/modules/module_22951.c b/src/modules/module_22951.c index 84b474740..ad0d95659 100644 --- a/src/modules/module_22951.c +++ b/src/modules/module_22951.c @@ -68,6 +68,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -78,21 +80,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 2; - token.len_max[2] = 2; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 2; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; diff --git a/src/modules/module_23001.c b/src/modules/module_23001.c index 18a5e482b..02e4bd62b 100644 --- a/src/modules/module_23001.c +++ b/src/modules/module_23001.c @@ -72,69 +72,62 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 11; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SECUREZIP; - token.len_min[0] = 6; - token.len_max[0] = 6; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 1; - token.len_max[4] = 1; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 1; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[5] = '*'; token.len_min[5] = 0; token.len_max[5] = 32; - token.sep[5] = '*'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[6] = 288; - token.len_max[6] = 288; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 288; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[7] = 1; - token.len_max[7] = 1; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 1; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[8] = 1; - token.len_max[8] = 1; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 1; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[9] = 1; - token.len_max[9] = 1; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 1; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.len_min[10] = 0; diff --git a/src/modules/module_23002.c b/src/modules/module_23002.c index 1adf4be72..223096535 100644 --- a/src/modules/module_23002.c +++ b/src/modules/module_23002.c @@ -72,74 +72,67 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 11; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SECUREZIP; - token.len_min[0] = 6; - token.len_max[0] = 6; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 1; - token.len_max[4] = 1; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 1; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[5] = '*'; token.len_min[5] = 0; token.len_max[5] = 32; - token.sep[5] = '*'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[6] = 288; - token.len_max[6] = 288; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 288; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[7] = 1; - token.len_max[7] = 1; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 1; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[8] = 1; - token.len_max[8] = 1; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 1; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[9] = 1; - token.len_max[9] = 1; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 1; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[10] = '*'; token.len_min[10] = 0; token.len_max[10] = 64; - token.sep[10] = '*'; token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_23003.c b/src/modules/module_23003.c index 95542b881..3e1dd0428 100644 --- a/src/modules/module_23003.c +++ b/src/modules/module_23003.c @@ -73,74 +73,67 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 11; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SECUREZIP; - token.len_min[0] = 6; - token.len_max[0] = 6; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 1; - token.len_max[4] = 1; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 1; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[5] = '*'; token.len_min[5] = 0; token.len_max[5] = 32; - token.sep[5] = '*'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[6] = 288; - token.len_max[6] = 288; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 288; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[7] = 1; - token.len_max[7] = 1; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 1; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[8] = 1; - token.len_max[8] = 1; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 1; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[9] = 1; - token.len_max[9] = 1; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 1; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[10] = '*'; token.len_min[10] = 0; token.len_max[10] = 64; - token.sep[10] = '*'; token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_23100.c b/src/modules/module_23100.c index 4d626f31b..f3057c803 100644 --- a/src/modules/module_23100.c +++ b/src/modules/module_23100.c @@ -95,27 +95,26 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KEYCHAIN; token.sep[0] = '*'; - token.len_min[0] = 10; - token.len_max[0] = 10; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 10; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 40; - token.len_max[1] = 40; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 40; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '*'; - token.len_min[2] = 16; - token.len_max[2] = 16; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 16; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[3] = 96; diff --git a/src/modules/module_23200.c b/src/modules/module_23200.c index d7639d994..bcea54bce 100644 --- a/src/modules/module_23200.c +++ b/src/modules/module_23200.c @@ -77,26 +77,25 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_XMPP; token.sep[0] = '$'; - token.len_min[0] = 0; - token.len_max[0] = 0; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[0] = 0; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; token.sep[1] = '$'; - token.len_min[1] = 10; - token.len_max[1] = 10; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 10; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; @@ -118,9 +117,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[6] = '$'; - token.len_min[6] = 40; - token.len_max[6] = 40; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 40; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_23300.c b/src/modules/module_23300.c index ccf052c88..21d03e82c 100644 --- a/src/modules/module_23300.c +++ b/src/modules/module_23300.c @@ -95,6 +95,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; @@ -104,40 +106,36 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '$'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 1; - token.len_max[3] = 1; token.sep[3] = '$'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 1; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[4] = '$'; token.len_min[4] = 4; token.len_max[4] = 6; - token.sep[4] = '$'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[5] = '$'; token.len_min[5] = 16; token.len_max[5] = 32; - token.sep[5] = '$'; token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[6] = 32; - token.len_max[6] = 32; token.sep[6] = '$'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[7] = 128; diff --git a/src/modules/module_23400.c b/src/modules/module_23400.c index 6112bb03d..7a0e5fb95 100644 --- a/src/modules/module_23400.c +++ b/src/modules/module_23400.c @@ -110,6 +110,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -120,9 +122,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; @@ -143,9 +144,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[5] = '*'; - token.len_min[5] = 44; - token.len_max[5] = 44; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 44; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_23500.c b/src/modules/module_23500.c index e3c9f53bb..4e4220296 100644 --- a/src/modules/module_23500.c +++ b/src/modules/module_23500.c @@ -111,21 +111,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_AXCRYPT2; token.sep[0] = '*'; - token.len_min[0] = 9; - token.len_max[0] = 9; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 9; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; @@ -135,15 +135,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '*'; - token.len_min[3] = 128; - token.len_max[3] = 128; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 128; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 288; - token.len_max[4] = 288; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 288; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; diff --git a/src/modules/module_23600.c b/src/modules/module_23600.c index 6d67ece13..b94c2530a 100644 --- a/src/modules/module_23600.c +++ b/src/modules/module_23600.c @@ -111,21 +111,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_AXCRYPT2; token.sep[0] = '*'; - token.len_min[0] = 9; - token.len_max[0] = 9; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 9; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; @@ -135,15 +135,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '*'; - token.len_min[3] = 128; - token.len_max[3] = 128; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 128; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 288; - token.len_max[4] = 288; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 288; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; diff --git a/src/modules/module_23700.c b/src/modules/module_23700.c index 59f3364d0..e8296c575 100644 --- a/src/modules/module_23700.c +++ b/src/modules/module_23700.c @@ -135,33 +135,31 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 9; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_RAR3; token.sep[0] = '*'; - token.len_min[0] = 6; - token.len_max[0] = 6; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; - token.len_min[2] = 16; - token.len_max[2] = 16; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 16; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 8; - token.len_max[3] = 8; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 8; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; @@ -177,9 +175,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[6] = '*'; - token.len_min[6] = 1; - token.len_max[6] = 1; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 1; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[7] = '*'; diff --git a/src/modules/module_23800.c b/src/modules/module_23800.c index 9305db990..5f164b084 100644 --- a/src/modules/module_23800.c +++ b/src/modules/module_23800.c @@ -420,33 +420,31 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 9; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_RAR3; token.sep[0] = '*'; - token.len_min[0] = 6; - token.len_max[0] = 6; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; - token.len_min[2] = 16; - token.len_max[2] = 16; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 16; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 8; - token.len_max[3] = 8; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 8; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; @@ -462,9 +460,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[6] = '*'; - token.len_min[6] = 1; - token.len_max[6] = 1; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 1; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[7] = '*'; diff --git a/src/modules/module_23900.c b/src/modules/module_23900.c index 15eda1a91..ffc1f2b39 100644 --- a/src/modules/module_23900.c +++ b/src/modules/module_23900.c @@ -89,6 +89,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; @@ -98,22 +100,19 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 2; - token.len_max[2] = 2; token.sep[2] = '$'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 2; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[3] = 16; - token.len_max[3] = 16; token.sep[3] = '$'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[4] = 192; diff --git a/src/modules/module_24100.c b/src/modules/module_24100.c index 53bf5e9f0..699fbf7b5 100644 --- a/src/modules/module_24100.c +++ b/src/modules/module_24100.c @@ -96,21 +96,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_MONGODB_SHA1; token.sep[0] = '*'; - token.len_min[0] = 15; - token.len_max[0] = 15; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 15; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; @@ -126,9 +126,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[4] = '*'; - token.len_min[4] = 24; - token.len_max[4] = 24; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 24; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.len[5] = 28; diff --git a/src/modules/module_24200.c b/src/modules/module_24200.c index 86a6334b4..9457eb4a7 100644 --- a/src/modules/module_24200.c +++ b/src/modules/module_24200.c @@ -127,21 +127,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_MONGODB_SHA256; token.sep[0] = '*'; - token.len_min[0] = 15; - token.len_max[0] = 15; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 15; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; @@ -157,9 +157,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[4] = '*'; - token.len_min[4] = 40; - token.len_max[4] = 40; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 40; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.len[5] = 44; diff --git a/src/modules/module_24300.c b/src/modules/module_24300.c index c1e66d458..cad17a5b4 100644 --- a/src/modules/module_24300.c +++ b/src/modules/module_24300.c @@ -50,12 +50,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_24410.c b/src/modules/module_24410.c index 4b8ab978f..6e59fd160 100644 --- a/src/modules/module_24410.c +++ b/src/modules/module_24410.c @@ -122,6 +122,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; @@ -132,15 +134,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; diff --git a/src/modules/module_24420.c b/src/modules/module_24420.c index c0aea4c28..90f00ffa0 100644 --- a/src/modules/module_24420.c +++ b/src/modules/module_24420.c @@ -122,6 +122,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; @@ -132,15 +134,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; diff --git a/src/modules/module_24500.c b/src/modules/module_24500.c index a4d60ed31..f95cdbef5 100644 --- a/src/modules/module_24500.c +++ b/src/modules/module_24500.c @@ -96,6 +96,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; @@ -106,9 +108,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; @@ -118,15 +119,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '*'; - token.len_min[3] = 64; - token.len_max[3] = 64; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = DATA_LEN_TELEGRAM * 2; - token.len_max[4] = DATA_LEN_TELEGRAM * 2; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = DATA_LEN_TELEGRAM * 2; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_24600.c b/src/modules/module_24600.c index 66d3e6e20..0194cb05e 100644 --- a/src/modules/module_24600.c +++ b/src/modules/module_24600.c @@ -151,21 +151,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SQLCIPHER; token.sep[0] = '*'; - token.len_min[0] = 9; - token.len_max[0] = 9; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 9; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; @@ -175,21 +175,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '*'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 32; - token.len_max[4] = 32; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; - token.len_min[5] = 32; - token.len_max[5] = 32; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 32; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_24700.c b/src/modules/module_24700.c index 30edc76cd..24b41cf61 100644 --- a/src/modules/module_24700.c +++ b/src/modules/module_24700.c @@ -51,6 +51,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 10; diff --git a/src/modules/module_24800.c b/src/modules/module_24800.c index e25e7841e..fff6a347b 100644 --- a/src/modules/module_24800.c +++ b/src/modules/module_24800.c @@ -49,11 +49,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 28; - token.len_max[0] = 28; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 28; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_24900.c b/src/modules/module_24900.c index ec4c2113c..d3e419861 100644 --- a/src/modules/module_24900.c +++ b/src/modules/module_24900.c @@ -93,11 +93,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 8; - token.len_max[0] = 8; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[0] = 8; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_25000.c b/src/modules/module_25000.c index 144aef509..69857dac7 100644 --- a/src/modules/module_25000.c +++ b/src/modules/module_25000.c @@ -120,6 +120,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SNMPV3; diff --git a/src/modules/module_25100.c b/src/modules/module_25100.c index be0d0d852..20a97afdc 100644 --- a/src/modules/module_25100.c +++ b/src/modules/module_25100.c @@ -116,6 +116,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SNMPV3; diff --git a/src/modules/module_25200.c b/src/modules/module_25200.c index 1ed4630a4..5f790669d 100644 --- a/src/modules/module_25200.c +++ b/src/modules/module_25200.c @@ -116,6 +116,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SNMPV3; @@ -125,28 +127,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // packet number + token.sep[1] = '$'; token.len_min[1] = 1; token.len_max[1] = 8; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // salt + token.sep[2] = '$'; token.len_min[2] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.len_max[2] = SNMPV3_SALT_MAX * 2; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // engineid + token.sep[3] = '$'; token.len_min[3] = 26; token.len_max[3] = SNMPV3_ENGINEID_MAX; - token.sep[3] = '$'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // digest - token.len[4] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.sep[4] = '$'; + token.len[4] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_25300.c b/src/modules/module_25300.c index 801f548f6..d2d56bbd4 100644 --- a/src/modules/module_25300.c +++ b/src/modules/module_25300.c @@ -120,6 +120,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -130,21 +132,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 6; - token.len_max[1] = 6; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 6; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 24; - token.len_max[2] = 24; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 24; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.sep[3] = '$'; - token.len_min[3] = 88; - token.len_max[3] = 88; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 88; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_25400.c b/src/modules/module_25400.c index f3c57908f..7b2402267 100644 --- a/src/modules/module_25400.c +++ b/src/modules/module_25400.c @@ -165,6 +165,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 12; token.signatures_cnt = 1; @@ -174,70 +176,61 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[4] = '*'; token.len_min[4] = 1; token.len_max[4] = 11; - token.sep[4] = '*'; token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[5] = 1; - token.len_max[5] = 1; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[6] = 2; - token.len_max[6] = 2; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 2; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[7] = '*'; token.len_min[7] = 32; token.len_max[7] = 64; - token.sep[7] = '*'; token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[8] = 2; - token.len_max[8] = 2; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 2; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[9] = 64; - token.len_max[9] = 64; token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 64; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[10] = 2; - token.len_max[10] = 2; - token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.sep[10] = '*'; + token.len[10] = 2; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[11] = 64; - token.len_max[11] = 64; - token.sep[11] = '*'; - token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.sep[11] = '*'; + token.len[11] = 64; + token.attr[11] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); // was a const, now no longer, as we need it again for the new hashformat @@ -253,83 +246,74 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE input_len = tmp_len; } - token.token_cnt = 13; + token.token_cnt = 13; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_PDF; - token.len[0] = 5; - token.attr[0] = TOKEN_ATTR_FIXED_LENGTH - | TOKEN_ATTR_VERIFY_SIGNATURE; + token.len[0] = 5; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[1] = '*'; + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[2] = '*'; + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[3] = 3; - token.len_max[3] = 3; - token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[3] = '*'; + token.len[3] = 3; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 1; - token.len_max[4] = 6; - token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; + token.sep[4] = '*'; + token.len_min[4] = 1; + token.len_max[4] = 6; + token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH; - token.len_min[5] = 1; - token.len_max[5] = 1; - token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[5] = '*'; + token.len[5] = 1; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[6] = 2; - token.len_max[6] = 2; - token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[6] = '*'; + token.len[6] = 2; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[7] = 32; - token.len_max[7] = 64; - token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - token.len_min[8] = 2; - token.len_max[8] = 2; - token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_DIGIT; - - token.len_min[9] = 64; - token.len_max[9] = 64; - token.sep[9] = '*'; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - token.len_min[10] = 2; - token.len_max[10] = 2; - token.sep[10] = '*'; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_DIGIT; - - token.len_min[11] = 64; - token.len_max[11] = 64; - token.sep[11] = '*'; - token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH + token.sep[7] = '*'; + token.len_min[7] = 32; + token.len_max[7] = 64; + token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; + token.sep[8] = '*'; + token.len[8] = 2; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_DIGIT; + + token.sep[9] = '*'; + token.len[9] = 64; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; + + token.sep[10] = '*'; + token.len[10] = 2; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_DIGIT; + + token.sep[11] = '*'; + token.len[11] = 64; + token.attr[11] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; + + token.sep[12] = '*'; token.len_min[12] = 0; token.len_max[12] = 32; // "truncate the password string to exactly 32 bytes." see "Algorithm 3.2 computing an encryption key" - token.sep[12] = '*'; token.attr[12] = TOKEN_ATTR_VERIFY_LENGTH; rc_tokenizer = input_tokenizer ((const u8 *) input_buf, input_len, &token); diff --git a/src/modules/module_25500.c b/src/modules/module_25500.c index 47355ff26..7d68a8648 100644 --- a/src/modules/module_25500.c +++ b/src/modules/module_25500.c @@ -122,6 +122,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -132,21 +134,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 24; - token.len_max[1] = 24; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 24; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.sep[2] = '$'; - token.len_min[2] = 16; - token.len_max[2] = 16; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 16; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.sep[3] = '$'; - token.len_min[3] = 96; - token.len_max[3] = 96; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 96; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_25600.c b/src/modules/module_25600.c index dde892210..e39224b54 100644 --- a/src/modules/module_25600.c +++ b/src/modules/module_25600.c @@ -171,6 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 4; @@ -183,10 +185,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 2; - token.len_max[1] = 2; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.len[2] = 22; diff --git a/src/modules/module_25700.c b/src/modules/module_25700.c index 62960a2ff..c6a805dcc 100644 --- a/src/modules/module_25700.c +++ b/src/modules/module_25700.c @@ -62,18 +62,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; - token.len_min[0] = 8; - token.len_max[0] = 8; token.sep[0] = hashconfig->separator; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 8; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 8; - token.len_max[1] = 8; token.sep[1] = hashconfig->separator; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 8; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_25800.c b/src/modules/module_25800.c index 6f6023657..9c3189f21 100644 --- a/src/modules/module_25800.c +++ b/src/modules/module_25800.c @@ -171,6 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 4; @@ -183,10 +185,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 2; - token.len_max[1] = 2; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.len[2] = 22; diff --git a/src/modules/module_25900.c b/src/modules/module_25900.c index ca6f8bc91..b8ce7a24a 100644 --- a/src/modules/module_25900.c +++ b/src/modules/module_25900.c @@ -132,6 +132,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -139,31 +141,27 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // Signature token.sep[0] = '*'; - token.len_min[0] = 42; - token.len_max[0] = 42; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 42; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; // Secure Session Identifier (from SESSION_RESPONSE) token.sep[1] = '*'; - token.len_min[1] = 4; - token.len_max[1] = 4; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 4; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // XOR of Client Public Value X (from SESSION_REQUEST) // and Server Public Value Y (from SESSION_RESPONSE) token.sep[2] = '*'; - token.len_min[2] = 64; - token.len_max[2] = 64; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 64; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // Message Authentication Code (from SESSION_RESPONSE) token.sep[3] = '*'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_26000.c b/src/modules/module_26000.c index 6a1deccb4..2d7ea5f7b 100644 --- a/src/modules/module_26000.c +++ b/src/modules/module_26000.c @@ -77,6 +77,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 2; @@ -84,33 +86,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.signatures_buf[1] = SIGNATURE_MOZILLA_3DES; token.sep[0] = '*'; - token.len_min[0] = 9; - token.len_max[0] = 9; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 9; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 4; - token.len_max[1] = 4; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 4; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[2] = '*'; - token.len_min[2] = 40; - token.len_max[2] = 40; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 40; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 40; - token.len_max[3] = 40; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 40; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; - token.len_min[4] = 32; - token.len_max[4] = 32; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_26100.c b/src/modules/module_26100.c index f7e2dac5a..91a170b44 100644 --- a/src/modules/module_26100.c +++ b/src/modules/module_26100.c @@ -94,6 +94,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 2; @@ -101,27 +103,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.signatures_buf[1] = SIGNATURE_MOZILLA_AES; token.sep[0] = '*'; - token.len_min[0] = 9; - token.len_max[0] = 9; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 9; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 3; - token.len_max[1] = 3; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 3; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[2] = '*'; - token.len_min[2] = 40; - token.len_max[2] = 40; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 40; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '*'; - token.len_min[3] = 64; - token.len_max[3] = 64; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '*'; @@ -131,15 +129,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[5] = '*'; - token.len_min[5] = 32; - token.len_max[5] = 32; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 32; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[6] = '*'; - token.len_min[6] = 32; - token.len_max[6] = 32; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_26200.c b/src/modules/module_26200.c index d47e63729..c3696d5fc 100644 --- a/src/modules/module_26200.c +++ b/src/modules/module_26200.c @@ -81,11 +81,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_26300.c b/src/modules/module_26300.c index 2a18f7f4e..0a219af8a 100644 --- a/src/modules/module_26300.c +++ b/src/modules/module_26300.c @@ -54,6 +54,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_26401.c b/src/modules/module_26401.c index d0b4dade8..108fb1697 100644 --- a/src/modules/module_26401.c +++ b/src/modules/module_26401.c @@ -56,17 +56,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 32; - token.len_max[1] = 32; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 32; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_26402.c b/src/modules/module_26402.c index b660feca4..f720ea3e7 100644 --- a/src/modules/module_26402.c +++ b/src/modules/module_26402.c @@ -56,17 +56,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 32; - token.len_max[1] = 32; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 32; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_26403.c b/src/modules/module_26403.c index 4337a46da..7248f4a74 100644 --- a/src/modules/module_26403.c +++ b/src/modules/module_26403.c @@ -56,17 +56,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 32; - token.len_max[1] = 32; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 32; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_26500.c b/src/modules/module_26500.c index 849f94b34..7e766f036 100644 --- a/src/modules/module_26500.c +++ b/src/modules/module_26500.c @@ -94,6 +94,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; @@ -104,15 +106,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 32; - token.len_max[1] = 32; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 32; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 40; - token.len_max[2] = 40; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 40; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '$'; @@ -122,9 +122,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[4] = '$'; - token.len_min[4] = 80; - token.len_max[4] = 80; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 80; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_26600.c b/src/modules/module_26600.c index 929c37a76..a60917cc9 100644 --- a/src/modules/module_26600.c +++ b/src/modules/module_26600.c @@ -132,6 +132,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -142,15 +144,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 44; - token.len_max[1] = 44; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 44; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.sep[2] = '$'; - token.len_min[2] = 24; - token.len_max[2] = 24; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 24; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.sep[3] = '$'; @@ -291,7 +291,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if ((ct_len % 4) > 0) j++; - u32 tmp_buf[784] = { 0 }; + u32 tmp_buf[788] = { 0 }; for (u32 i = 0; i < j; i++) tmp_buf[i] = byte_swap_32 (metamask->ct_buf[i]); diff --git a/src/modules/module_26610.c b/src/modules/module_26610.c index 96ec0a12c..532246128 100644 --- a/src/modules/module_26610.c +++ b/src/modules/module_26610.c @@ -18,7 +18,6 @@ static const u32 DGST_POS2 = 2; static const u32 DGST_POS3 = 3; static const u32 DGST_SIZE = DGST_SIZE_4_4; static const u32 HASH_CATEGORY = HASH_CATEGORY_CRYPTOCURRENCY_WALLET; -// 22610 generates a decryption key based on a password-guess and uses that to AES-GCM decrypt the data decrypts static const char *HASH_NAME = "MetaMask Wallet (short hash, plaintext check)"; static const u64 KERN_TYPE = 26610; static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE @@ -28,7 +27,6 @@ static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE | OPTS_TYPE_DEEP_COMP_KERNEL; static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED; static const char *ST_PASS = "hashcat1"; -// hash generated using with python3 tools/metamask2hashcat.py --vault tools/2hashcat_tests/metamask2hashcat.json --shortdata static const char *ST_HASH = "$metamask-short$jfGI3TXguhb8GPnKSXFrMzRk2NCEc131Gt5G3kZr5+s=$h+BoIf2CQ5BEjaIOShFE7g==$R95fzGt4UQ0uwrcrVYnIi4UcSlWn9wlmer+//526ZDwYAp50K82F1u1oacYcdjjhuEvbZnWk/uBG00UkgLLlOw=="; u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ATTACK_EXEC; } @@ -48,11 +46,11 @@ const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, typedef struct pbkdf2_sha256_tmp { - u32 ipad[8]; - u32 opad[8]; + u32 ipad[8]; + u32 opad[8]; - u32 dgst[32]; - u32 out[32]; + u32 dgst[32]; + u32 out[32]; } pbkdf2_sha256_tmp_t; @@ -61,7 +59,7 @@ typedef struct pbkdf2_sha256_aes_gcm u32 salt_buf[64]; u32 iv_buf[4]; u32 iv_len; - u32 ct_buf[784]; // TODO this can be smaller and would speedup the attack, only 64 bytes of ciphertext are allowed + u32 ct_buf[16]; u32 ct_len; } pbkdf2_sha256_aes_gcm_t; @@ -135,10 +133,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE pbkdf2_sha256_aes_gcm_t *metamask = (pbkdf2_sha256_aes_gcm_t *) esalt_buf; - #define CT_MAX_LEN_BASE64 (((3136+16) * 8) / 6) + 3 // TODO this can be smaller and would speedup the attack, only 64 bytes of ciphertext are allowed - hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -149,20 +147,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 44; - token.len_max[1] = 44; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 44; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.sep[2] = '$'; - token.len_min[2] = 24; - token.len_max[2] = 24; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 24; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.sep[3] = '$'; - token.len_min[3] = 32; - token.len_max[3] = 100; // TODO this can be smaller and would speedup the attack, only 64 bytes of ciphertext are allowed + token.len_min[3] = 88; + token.len_max[3] = 88; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; @@ -170,10 +166,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - u8 tmp_buf[CT_MAX_LEN_BASE64] = { 0 }; - - size_t tmp_len = 0; - // iter salt->salt_iter = 10000 - 1; @@ -183,9 +175,11 @@ 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]; + u8 tmp_buf[88+1]; + memset (tmp_buf, 0, sizeof (tmp_buf)); - tmp_len = base64_decode (base64_to_int, salt_pos, salt_len, tmp_buf); + size_t tmp_len = base64_decode (base64_to_int, salt_pos, salt_len, tmp_buf); if (tmp_len != 32) return (PARSER_SALT_LENGTH); @@ -231,20 +225,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_len = base64_decode (base64_to_int, ct_pos, ct_len, tmp_buf); + if (tmp_len != 64) return (PARSER_CT_LENGTH); + memcpy ((u8 *) metamask->ct_buf, tmp_buf, tmp_len); u32 j = tmp_len / 4; - if ((tmp_len % 4) > 0) j++; - - for (u32 i = 0; i < j; i++) metamask->ct_buf[i] = byte_swap_32 (metamask->ct_buf[i]); + for (u32 i = 0; i < j; i++) + { + metamask->ct_buf[i] = byte_swap_32 (metamask->ct_buf[i]); + } metamask->ct_len = tmp_len; - digest[0] = (metamask->ct_buf[0]); - digest[1] = (metamask->ct_buf[1]); - digest[2] = (metamask->ct_buf[2]); - digest[3] = (metamask->ct_buf[3]); + digest[0] = metamask->ct_buf[0]; + digest[1] = metamask->ct_buf[1]; + digest[2] = metamask->ct_buf[2]; + digest[3] = metamask->ct_buf[3]; return (PARSER_OK); } @@ -255,40 +252,42 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt - #define SALT_LEN_BASE64 ((32 * 8) / 6) + 3 - #define IV_LEN_BASE64 ((16 * 8) / 6) + 3 - #define CT_MAX_LEN_BASE64 (((3136+16) * 8) / 6) + 3 // TODO this can be much smaller now, probably 32 ? + u8 salt_buf[44+1]; - u8 salt_buf[SALT_LEN_BASE64] = { 0 }; + memset (salt_buf, 0, sizeof (salt_buf)); base64_encode (int_to_base64, (const u8 *) salt->salt_buf, (const int) salt->salt_len, salt_buf); // iv - u32 tmp_iv_buf[4] = { 0 }; + u32 tmp_iv_buf[4]; tmp_iv_buf[0] = byte_swap_32 (metamask->iv_buf[0]); tmp_iv_buf[1] = byte_swap_32 (metamask->iv_buf[1]); tmp_iv_buf[2] = byte_swap_32 (metamask->iv_buf[2]); tmp_iv_buf[3] = byte_swap_32 (metamask->iv_buf[3]); - u8 iv_buf[IV_LEN_BASE64+1] = { 0 }; + u8 iv_buf[24+1]; + + memset (iv_buf, 0, sizeof (iv_buf)); base64_encode (int_to_base64, (const u8 *) tmp_iv_buf, (const int) metamask->iv_len, iv_buf); // ct + u32 tmp_buf[16]; + + memset (tmp_buf, 0, sizeof (tmp_buf)); + u32 ct_len = metamask->ct_len; u32 j = ct_len / 4; - if ((ct_len % 4) > 0) j++; - - u32 tmp_buf[784] = { 0 }; // TODO this can be smaller and would speedup the attack, only 64 bytes of ciphertext are allowed - for (u32 i = 0; i < j; i++) tmp_buf[i] = byte_swap_32 (metamask->ct_buf[i]); - u8 ct_buf[CT_MAX_LEN_BASE64] = { 0 }; + u8 ct_buf[88+1]; + + memset (ct_buf, 0, sizeof (ct_buf)); base64_encode (int_to_base64, (const u8 *) tmp_buf, (const int) metamask->ct_len, ct_buf); diff --git a/src/modules/module_26700.c b/src/modules/module_26700.c index 45a0652eb..050eb196a 100644 --- a/src/modules/module_26700.c +++ b/src/modules/module_26700.c @@ -123,6 +123,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SNMPV3; @@ -132,28 +134,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // packet number + token.sep[1] = '$'; token.len_min[1] = 1; token.len_max[1] = 8; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // salt + token.sep[2] = '$'; token.len_min[2] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.len_max[2] = SNMPV3_SALT_MAX * 2; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // engineid + token.sep[3] = '$'; token.len_min[3] = 26; token.len_max[3] = SNMPV3_ENGINEID_MAX; - token.sep[3] = '$'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // digest - token.len[4] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.sep[4] = '$'; + token.len[4] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_26800.c b/src/modules/module_26800.c index 0dc5e25fe..fc43bf17a 100644 --- a/src/modules/module_26800.c +++ b/src/modules/module_26800.c @@ -123,6 +123,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SNMPV3; @@ -132,28 +134,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // packet number + token.sep[1] = '$'; token.len_min[1] = 1; token.len_max[1] = 8; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // salt + token.sep[2] = '$'; token.len_min[2] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.len_max[2] = SNMPV3_SALT_MAX * 2; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // engineid + token.sep[3] = '$'; token.len_min[3] = 26; token.len_max[3] = SNMPV3_ENGINEID_MAX; - token.sep[3] = '$'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // digest - token.len[4] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.sep[4] = '$'; + token.len[4] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_26900.c b/src/modules/module_26900.c index 933918c27..633e9e512 100644 --- a/src/modules/module_26900.c +++ b/src/modules/module_26900.c @@ -163,6 +163,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SNMPV3; @@ -172,28 +174,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // packet number + token.sep[1] = '$'; token.len_min[1] = 1; token.len_max[1] = 8; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // salt + token.sep[2] = '$'; token.len_min[2] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.len_max[2] = SNMPV3_SALT_MAX * 2; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // engineid + token.sep[3] = '$'; token.len_min[3] = 26; token.len_max[3] = SNMPV3_ENGINEID_MAX; - token.sep[3] = '$'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // digest - token.len[4] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.sep[4] = '$'; + token.len[4] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_27000.c b/src/modules/module_27000.c index 0cfb69bcb..c9cca63b4 100644 --- a/src/modules/module_27000.c +++ b/src/modules/module_27000.c @@ -129,45 +129,44 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; // username + token.sep[0] = ':'; token.len_min[0] = 0; token.len_max[0] = 60; - token.sep[0] = ':'; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; // unused - token.len_min[1] = 0; - token.len_max[1] = 0; + token.len[1] = 0; token.sep[1] = ':'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; // domain + token.sep[2] = ':'; token.len_min[2] = 0; token.len_max[2] = 45; - token.sep[2] = ':'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; // lm response + token.sep[3] = ':'; token.len_min[3] = 0; token.len_max[3] = 48; - token.sep[3] = ':'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // ntlm response - token.len_min[4] = 48; - token.len_max[4] = 48; token.sep[4] = ':'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 48; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // challenge - token.len_min[5] = 16; - token.len_max[5] = 16; token.sep[5] = ':'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 16; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_27100.c b/src/modules/module_27100.c index d096f903d..84aaa66d8 100644 --- a/src/modules/module_27100.c +++ b/src/modules/module_27100.c @@ -89,38 +89,37 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; // username + token.sep[0] = ':'; token.len_min[0] = 0; token.len_max[0] = 60; - token.sep[0] = ':'; token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH; // unused - token.len_min[1] = 0; - token.len_max[1] = 0; token.sep[1] = ':'; + token.len[1] = 0; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; // domain + token.sep[2] = ':'; token.len_min[2] = 0; token.len_max[2] = 45; - token.sep[2] = ':'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; // lm response - token.len_min[3] = 16; - token.len_max[3] = 16; token.sep[3] = ':'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // ntlm response - token.len_min[4] = 32; - token.len_max[4] = 32; token.sep[4] = ':'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // challenge diff --git a/src/modules/module_27200.c b/src/modules/module_27200.c index 6f165a58b..ffa2c6c8b 100644 --- a/src/modules/module_27200.c +++ b/src/modules/module_27200.c @@ -80,17 +80,17 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 40; - token.len_max[1] = 40; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 40; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_27300.c b/src/modules/module_27300.c index 376082ff1..1512bbbb4 100644 --- a/src/modules/module_27300.c +++ b/src/modules/module_27300.c @@ -163,6 +163,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_SNMPV3; @@ -172,28 +174,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // packet number + token.sep[1] = '$'; token.len_min[1] = 1; token.len_max[1] = 8; - token.sep[1] = '$'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // salt + token.sep[2] = '$'; token.len_min[2] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.len_max[2] = SNMPV3_SALT_MAX * 2; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // engineid + token.sep[3] = '$'; token.len_min[3] = 26; token.len_max[3] = SNMPV3_ENGINEID_MAX; - token.sep[3] = '$'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_HEX; // digest - token.len[4] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.sep[4] = '$'; + token.len[4] = SNMPV3_MSG_AUTH_PARAMS_LEN * 2; token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; diff --git a/src/modules/module_27400.c b/src/modules/module_27400.c index 31183701c..3bd35cff5 100644 --- a/src/modules/module_27400.c +++ b/src/modules/module_27400.c @@ -95,12 +95,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_VMWARE_VMX; - token.sep[0] = '$'; token.len[0] = 7; token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; @@ -112,15 +113,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '$'; - token.len_min[3] = 64; - token.len_max[3] = 64; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_27500.c b/src/modules/module_27500.c index 0c5c1e6fa..12d576bff 100644 --- a/src/modules/module_27500.c +++ b/src/modules/module_27500.c @@ -114,12 +114,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_VBOX; - token.sep[0] = '$'; token.len[0] = 8; token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; @@ -131,9 +132,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 64; - token.len_max[2] = 64; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 64; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '$'; @@ -143,9 +143,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[4] = '$'; - token.len_min[4] = 64; - token.len_max[4] = 64; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 64; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '$'; @@ -155,15 +154,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[6] = '$'; - token.len_min[6] = 64; - token.len_max[6] = 64; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 64; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '$'; - token.len_min[7] = 64; - token.len_max[7] = 64; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 64; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_27600.c b/src/modules/module_27600.c index 971556193..d458cbd8a 100644 --- a/src/modules/module_27600.c +++ b/src/modules/module_27600.c @@ -114,12 +114,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_VBOX; - token.sep[0] = '$'; token.len[0] = 8; token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; @@ -131,9 +132,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 64; - token.len_max[2] = 64; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 64; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '$'; @@ -143,9 +143,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[4] = '$'; - token.len_min[4] = 128; - token.len_max[4] = 128; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 128; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '$'; @@ -155,15 +154,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[6] = '$'; - token.len_min[6] = 64; - token.len_max[6] = 64; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 64; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '$'; - token.len_min[7] = 64; - token.len_max[7] = 64; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 64; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_27700.c b/src/modules/module_27700.c index da1516233..10ecefe70 100644 --- a/src/modules/module_27700.c +++ b/src/modules/module_27700.c @@ -271,6 +271,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -280,34 +282,31 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[2] = '*'; token.len_min[2] = 1; token.len_max[2] = 10; - token.sep[2] = '*'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[3] = '*'; token.len_min[3] = 1; token.len_max[3] = 2; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 1; - token.len_max[4] = 1; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 1; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[5] = 16; - token.len_max[5] = 16; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 16; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[6] = 64; diff --git a/src/modules/module_27800.c b/src/modules/module_27800.c index 8f69f60ed..4aefff85a 100644 --- a/src/modules/module_27800.c +++ b/src/modules/module_27800.c @@ -62,18 +62,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; - token.len_min[0] = 8; - token.len_max[0] = 8; token.sep[0] = hashconfig->separator; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 8; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; - token.len_min[1] = 8; - token.len_max[1] = 8; token.sep[1] = hashconfig->separator; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 8; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_27900.c b/src/modules/module_27900.c index 2e76feace..ea06e0f2c 100644 --- a/src/modules/module_27900.c +++ b/src/modules/module_27900.c @@ -48,18 +48,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 8; - token.len_max[0] = 8; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 8; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = hashconfig->separator; - token.len_min[1] = 8; - token.len_max[1] = 8; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 8; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_28000.c b/src/modules/module_28000.c index c73cb7f6f..653e6dddf 100644 --- a/src/modules/module_28000.c +++ b/src/modules/module_28000.c @@ -64,18 +64,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 16; - token.len_max[0] = 16; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 16; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = hashconfig->separator; - token.len_min[1] = 16; - token.len_max[1] = 16; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 16; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_28100.c b/src/modules/module_28100.c index b75dafce0..c315a2c97 100644 --- a/src/modules/module_28100.c +++ b/src/modules/module_28100.c @@ -108,69 +108,62 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 9; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_WINHELLO; - token.len_min[0] = 10; - token.len_max[0] = 10; token.sep[0] = '*'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 10; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 6; // fixed SHA512 - token.len_max[1] = 6; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 6; // fixed SHA512 + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; // pbkdf2 iter - token.len_min[2] = 5; // fixed 10000 - token.len_max[2] = 5; token.sep[2] = '*'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 5; // fixed 10000 + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // pbdfk2 salt - token.len_min[3] = 8; - token.len_max[3] = 8; token.sep[3] = '*'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 8; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // sign (hash) - token.len_min[4] = 128; - token.len_max[4] = 128; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 128; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // mk - token.len_min[5] = 128; - token.len_max[5] = 128; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 128; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // hmac - token.len_min[6] = 64; - token.len_max[6] = 64; token.sep[6] = '*'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 64; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // verify blob - token.len_min[7] = 1384; - token.len_max[7] = 1384; token.sep[7] = '*'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 1384; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // magicv - token.len_min[8] = 34; // fixed 785435725a573571565662727670754100 - token.len_max[8] = 34; token.sep[8] = '*'; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 34; // fixed 785435725a573571565662727670754100 + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_28200.c b/src/modules/module_28200.c index af538472a..4eaf61bc6 100644 --- a/src/modules/module_28200.c +++ b/src/modules/module_28200.c @@ -285,57 +285,54 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_EXODUS; - token.len_min[0] = 6; - token.len_max[0] = 6; token.sep[0] = ':'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; + token.sep[1] = ':'; token.len_min[1] = 1; token.len_max[1] = 6; - token.sep[1] = ':'; token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[2] = ':'; token.len_min[2] = 1; token.len_max[2] = 6; - token.sep[2] = ':'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[3] = ':'; token.len_min[3] = 1; token.len_max[3] = 6; - token.sep[3] = ':'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 44; - token.len_max[4] = 44; token.sep[4] = ':'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 44; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; - token.len_min[5] = 16; - token.len_max[5] = 16; token.sep[5] = ':'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 16; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; - token.len_min[6] = 44; - token.len_max[6] = 44; token.sep[6] = ':'; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 44; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; - token.len_min[7] = 24; - token.len_max[7] = 24; token.sep[7] = ':'; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 24; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_28300.c b/src/modules/module_28300.c index b5c74be75..b820dd9cb 100644 --- a/src/modules/module_28300.c +++ b/src/modules/module_28300.c @@ -51,6 +51,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; @@ -60,22 +62,19 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[2] = 28; - token.len_max[2] = 28; token.sep[2] = '$'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 28; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; - token.len_min[3] = 152; - token.len_max[3] = 152; token.sep[3] = '$'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 152; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_28400.c b/src/modules/module_28400.c index b003b336c..dbeba6126 100644 --- a/src/modules/module_28400.c +++ b/src/modules/module_28400.c @@ -171,6 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 4; @@ -183,10 +185,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 2; - token.len_max[1] = 2; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.len[2] = 22; diff --git a/src/modules/module_28501.c b/src/modules/module_28501.c index be173044f..8692e05e6 100644 --- a/src/modules/module_28501.c +++ b/src/modules/module_28501.c @@ -69,6 +69,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len_min[0] = 26; diff --git a/src/modules/module_28502.c b/src/modules/module_28502.c index 2c9fdeae3..daafa9be3 100644 --- a/src/modules/module_28502.c +++ b/src/modules/module_28502.c @@ -69,6 +69,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len_min[0] = 26; diff --git a/src/modules/module_28503.c b/src/modules/module_28503.c index d52cd51ec..696bbf2d8 100644 --- a/src/modules/module_28503.c +++ b/src/modules/module_28503.c @@ -91,6 +91,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_28504.c b/src/modules/module_28504.c index dae2ae67d..93e35784c 100644 --- a/src/modules/module_28504.c +++ b/src/modules/module_28504.c @@ -91,6 +91,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_28505.c b/src/modules/module_28505.c index 49db31745..133bf1e43 100644 --- a/src/modules/module_28505.c +++ b/src/modules/module_28505.c @@ -69,6 +69,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 34; diff --git a/src/modules/module_28506.c b/src/modules/module_28506.c index 35b378088..296122758 100644 --- a/src/modules/module_28506.c +++ b/src/modules/module_28506.c @@ -69,6 +69,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 34; diff --git a/src/modules/module_28600.c b/src/modules/module_28600.c index 48058649c..e152e8dc8 100644 --- a/src/modules/module_28600.c +++ b/src/modules/module_28600.c @@ -133,15 +133,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_POSTGRES_SHA256; token.sep[0] = '$'; - token.len_min[0] = 13; - token.len_max[0] = 13; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 13; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = ':'; @@ -157,9 +158,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_BASE64A; token.sep[3] = ':'; - token.len_min[3] = 44; - token.len_max[3] = 44; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 44; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_BASE64A; token.len[4] = 44; diff --git a/src/modules/module_28700.c b/src/modules/module_28700.c index 4c956f230..e86ccb448 100644 --- a/src/modules/module_28700.c +++ b/src/modules/module_28700.c @@ -97,6 +97,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_AWS_SIG_V4; @@ -106,35 +108,32 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; // longdate - token.len_min[1] = 16; - token.len_max[1] = 16; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + token.len[1] = 16; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH; // region + token.sep[2] = '$'; token.len_min[2] = 1; token.len_max[2] = 16; - token.sep[2] = '$'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; // service + token.sep[3] = '$'; token.len_min[3] = 1; token.len_max[3] = 16; - token.sep[3] = '$'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; // canonical - token.len_min[4] = 32 * 2; - token.len_max[4] = 32 * 2; token.sep[4] = '$'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32 * 2; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // digest - token.len_min[5] = 32 * 2; - token.len_max[5] = 32 * 2; token.sep[5] = '$'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 32 * 2; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_28800.c b/src/modules/module_28800.c index 98a8baeab..d34c860e5 100644 --- a/src/modules/module_28800.c +++ b/src/modules/module_28800.c @@ -99,6 +99,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KRB5DB; @@ -134,10 +136,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[3] = '$'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; } // assume $krb5db$17$user$realm$*spn*$hash else @@ -167,10 +168,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[3] = TOKEN_ATTR_FIXED_LENGTH; token.sep[4] = '$'; - token.len_min[4] = 32; - token.len_max[4] = 32; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_HEX; is_spn_provided = 1; } diff --git a/src/modules/module_28900.c b/src/modules/module_28900.c index 10c2ae4ab..929e09a04 100644 --- a/src/modules/module_28900.c +++ b/src/modules/module_28900.c @@ -99,6 +99,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KRB5DB; @@ -134,9 +136,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[3] = '$'; - token.len_min[3] = 64; - token.len_max[3] = 64; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; } @@ -168,9 +169,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[3] = TOKEN_ATTR_FIXED_LENGTH; token.sep[4] = '$'; - token.len_min[4] = 64; - token.len_max[4] = 64; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 64; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; is_spn_provided = 1; diff --git a/src/modules/module_29000.c b/src/modules/module_29000.c index b1a1f4698..175d2c0a5 100644 --- a/src/modules/module_29000.c +++ b/src/modules/module_29000.c @@ -74,12 +74,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 40; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = hashconfig->separator; diff --git a/src/modules/module_29100.c b/src/modules/module_29100.c index 5d2227f41..b0db0f42f 100644 --- a/src/modules/module_29100.c +++ b/src/modules/module_29100.c @@ -58,6 +58,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.sep[0] = '.'; diff --git a/src/modules/module_29200.c b/src/modules/module_29200.c index 245e25d44..9a9d95c03 100644 --- a/src/modules/module_29200.c +++ b/src/modules/module_29200.c @@ -79,6 +79,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_RADMIN3; @@ -95,9 +97,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // SHA1 salt token.sep[2] = '*'; - token.len_min[2] = 64; - token.len_max[2] = 64; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 64; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // verifier diff --git a/src/modules/module_29311.c b/src/modules/module_29311.c index 78bc26ca6..b6603ad73 100644 --- a/src/modules/module_29311.c +++ b/src/modules/module_29311.c @@ -125,6 +125,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -135,15 +137,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29312.c b/src/modules/module_29312.c index 1ee66f9a7..6d8bfe643 100644 --- a/src/modules/module_29312.c +++ b/src/modules/module_29312.c @@ -125,6 +125,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -135,15 +137,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29313.c b/src/modules/module_29313.c index a0f8032f8..064ef2c46 100644 --- a/src/modules/module_29313.c +++ b/src/modules/module_29313.c @@ -125,6 +125,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -135,15 +137,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29321.c b/src/modules/module_29321.c index cad92dfd1..c443ce2a3 100644 --- a/src/modules/module_29321.c +++ b/src/modules/module_29321.c @@ -126,6 +126,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -136,15 +138,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29322.c b/src/modules/module_29322.c index 5adaccc95..0dad95126 100644 --- a/src/modules/module_29322.c +++ b/src/modules/module_29322.c @@ -126,6 +126,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -136,15 +138,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29323.c b/src/modules/module_29323.c index a20b7167b..1186809af 100644 --- a/src/modules/module_29323.c +++ b/src/modules/module_29323.c @@ -126,6 +126,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -136,15 +138,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29331.c b/src/modules/module_29331.c index b5b198a57..00f89b10c 100644 --- a/src/modules/module_29331.c +++ b/src/modules/module_29331.c @@ -111,6 +111,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -121,15 +123,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29332.c b/src/modules/module_29332.c index 03154bcf0..aea7fb0a5 100644 --- a/src/modules/module_29332.c +++ b/src/modules/module_29332.c @@ -111,6 +111,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -121,15 +123,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29333.c b/src/modules/module_29333.c index adab22650..cd3c4ac05 100644 --- a/src/modules/module_29333.c +++ b/src/modules/module_29333.c @@ -111,6 +111,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -121,15 +123,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29341.c b/src/modules/module_29341.c index 873c646c2..01e0947aa 100644 --- a/src/modules/module_29341.c +++ b/src/modules/module_29341.c @@ -138,6 +138,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -148,15 +150,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29342.c b/src/modules/module_29342.c index 465e3a52a..cf6f6abf2 100644 --- a/src/modules/module_29342.c +++ b/src/modules/module_29342.c @@ -138,6 +138,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -148,15 +150,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29343.c b/src/modules/module_29343.c index 2eb1dbbf0..6ed61b839 100644 --- a/src/modules/module_29343.c +++ b/src/modules/module_29343.c @@ -138,6 +138,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -148,15 +150,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = TC_SALT_HEX_LEN; - token.len_max[1] = TC_SALT_HEX_LEN; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = TC_SALT_HEX_LEN; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = TC_DATA_HEX_LEN; - token.len_max[2] = TC_DATA_HEX_LEN; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = TC_DATA_HEX_LEN; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29411.c b/src/modules/module_29411.c index 7c5063bf5..e0695a5a0 100644 --- a/src/modules/module_29411.c +++ b/src/modules/module_29411.c @@ -153,6 +153,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -163,15 +165,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29412.c b/src/modules/module_29412.c index ca95614b2..cf5e403b8 100644 --- a/src/modules/module_29412.c +++ b/src/modules/module_29412.c @@ -153,6 +153,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -163,15 +165,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29413.c b/src/modules/module_29413.c index d96acbe4a..f8ea19758 100644 --- a/src/modules/module_29413.c +++ b/src/modules/module_29413.c @@ -153,6 +153,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -163,15 +165,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29421.c b/src/modules/module_29421.c index 25c39d811..69d86b307 100644 --- a/src/modules/module_29421.c +++ b/src/modules/module_29421.c @@ -163,6 +163,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -173,15 +175,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29422.c b/src/modules/module_29422.c index 202fbb1b6..8099b8998 100644 --- a/src/modules/module_29422.c +++ b/src/modules/module_29422.c @@ -163,6 +163,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -173,15 +175,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29423.c b/src/modules/module_29423.c index a4f586d09..afaa1b147 100644 --- a/src/modules/module_29423.c +++ b/src/modules/module_29423.c @@ -163,6 +163,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -173,15 +175,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29431.c b/src/modules/module_29431.c index 05efeee6e..a48035fc5 100644 --- a/src/modules/module_29431.c +++ b/src/modules/module_29431.c @@ -140,6 +140,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -150,15 +152,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29432.c b/src/modules/module_29432.c index 44cdac43d..a3ace917a 100644 --- a/src/modules/module_29432.c +++ b/src/modules/module_29432.c @@ -140,6 +140,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -150,15 +152,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29433.c b/src/modules/module_29433.c index 2970869b8..9ea966525 100644 --- a/src/modules/module_29433.c +++ b/src/modules/module_29433.c @@ -154,6 +154,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -164,15 +166,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29441.c b/src/modules/module_29441.c index e3e9e95c9..65a34b8c3 100644 --- a/src/modules/module_29441.c +++ b/src/modules/module_29441.c @@ -155,6 +155,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -165,15 +167,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29442.c b/src/modules/module_29442.c index aece9619e..2e688d499 100644 --- a/src/modules/module_29442.c +++ b/src/modules/module_29442.c @@ -155,6 +155,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -165,15 +167,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29443.c b/src/modules/module_29443.c index dcda52155..124bac2e6 100644 --- a/src/modules/module_29443.c +++ b/src/modules/module_29443.c @@ -155,6 +155,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -165,15 +167,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29451.c b/src/modules/module_29451.c index 0cee1aac1..e2cfc368c 100644 --- a/src/modules/module_29451.c +++ b/src/modules/module_29451.c @@ -172,6 +172,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -182,15 +184,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29452.c b/src/modules/module_29452.c index 61c3d7aba..39c826da1 100644 --- a/src/modules/module_29452.c +++ b/src/modules/module_29452.c @@ -172,6 +172,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -182,15 +184,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29453.c b/src/modules/module_29453.c index 5d102ac56..e5bbe5d9e 100644 --- a/src/modules/module_29453.c +++ b/src/modules/module_29453.c @@ -172,6 +172,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -182,15 +184,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29461.c b/src/modules/module_29461.c index 9bc7f7dd7..0489a8e6b 100644 --- a/src/modules/module_29461.c +++ b/src/modules/module_29461.c @@ -174,6 +174,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -184,15 +186,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29462.c b/src/modules/module_29462.c index 28f2194f8..329eee24b 100644 --- a/src/modules/module_29462.c +++ b/src/modules/module_29462.c @@ -174,6 +174,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -184,15 +186,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29463.c b/src/modules/module_29463.c index 2726ab426..2b61a3e43 100644 --- a/src/modules/module_29463.c +++ b/src/modules/module_29463.c @@ -174,6 +174,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -184,15 +186,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29471.c b/src/modules/module_29471.c index 9590b080c..2fa8e247d 100644 --- a/src/modules/module_29471.c +++ b/src/modules/module_29471.c @@ -163,6 +163,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -173,15 +175,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29472.c b/src/modules/module_29472.c index 241788a69..7fc95a2d9 100644 --- a/src/modules/module_29472.c +++ b/src/modules/module_29472.c @@ -163,6 +163,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -173,15 +175,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29473.c b/src/modules/module_29473.c index 67c180f78..1b8a7d6e4 100644 --- a/src/modules/module_29473.c +++ b/src/modules/module_29473.c @@ -169,6 +169,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -179,15 +181,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29481.c b/src/modules/module_29481.c index 71a3e078c..3cf55a275 100644 --- a/src/modules/module_29481.c +++ b/src/modules/module_29481.c @@ -165,6 +165,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -175,15 +177,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29482.c b/src/modules/module_29482.c index 137350cbe..aece087db 100644 --- a/src/modules/module_29482.c +++ b/src/modules/module_29482.c @@ -165,6 +165,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -175,15 +177,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29483.c b/src/modules/module_29483.c index b3de3bc24..d958e5424 100644 --- a/src/modules/module_29483.c +++ b/src/modules/module_29483.c @@ -165,6 +165,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -175,15 +177,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 896; - token.len_max[2] = 896; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 896; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29511.c b/src/modules/module_29511.c index e2b098ba7..673f1833c 100644 --- a/src/modules/module_29511.c +++ b/src/modules/module_29511.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29512.c b/src/modules/module_29512.c index 8db821145..0079abd74 100644 --- a/src/modules/module_29512.c +++ b/src/modules/module_29512.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29513.c b/src/modules/module_29513.c index 61e6c6a46..20fb7620b 100644 --- a/src/modules/module_29513.c +++ b/src/modules/module_29513.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29521.c b/src/modules/module_29521.c index 5a1bb3320..43ba8a537 100644 --- a/src/modules/module_29521.c +++ b/src/modules/module_29521.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29522.c b/src/modules/module_29522.c index e424d3c66..cc940ef1b 100644 --- a/src/modules/module_29522.c +++ b/src/modules/module_29522.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29523.c b/src/modules/module_29523.c index 0a6a7705b..7d7c17ae9 100644 --- a/src/modules/module_29523.c +++ b/src/modules/module_29523.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29531.c b/src/modules/module_29531.c index 2fd82133e..bc175f9b0 100644 --- a/src/modules/module_29531.c +++ b/src/modules/module_29531.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29532.c b/src/modules/module_29532.c index 3ebdb3fcb..fc864498b 100644 --- a/src/modules/module_29532.c +++ b/src/modules/module_29532.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29533.c b/src/modules/module_29533.c index ef52bafba..a21a581ea 100644 --- a/src/modules/module_29533.c +++ b/src/modules/module_29533.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29541.c b/src/modules/module_29541.c index 9bab26aed..4f9d02309 100644 --- a/src/modules/module_29541.c +++ b/src/modules/module_29541.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29542.c b/src/modules/module_29542.c index 08bf7e871..397e70c92 100644 --- a/src/modules/module_29542.c +++ b/src/modules/module_29542.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29543.c b/src/modules/module_29543.c index 9c77dacc5..4dd2e82f8 100644 --- a/src/modules/module_29543.c +++ b/src/modules/module_29543.c @@ -151,6 +151,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -169,9 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // key size token.sep[2] = '$'; - token.len_min[2] = 3; - token.len_max[2] = 3; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 3; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; // iter @@ -183,9 +184,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt token.sep[4] = '$'; - token.len_min[4] = LUKS_SALT_HEX_LEN; - token.len_max[4] = LUKS_SALT_HEX_LEN; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = LUKS_SALT_HEX_LEN; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; // af @@ -197,9 +197,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // ct token.sep[6] = '$'; - token.len_min[6] = LUKS_CT_HEX_LEN; - token.len_max[6] = LUKS_CT_HEX_LEN; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = LUKS_CT_HEX_LEN; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29600.c b/src/modules/module_29600.c index 9d7eb86f9..e05edcd63 100644 --- a/src/modules/module_29600.c +++ b/src/modules/module_29600.c @@ -109,6 +109,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; // salt diff --git a/src/modules/module_29700.c b/src/modules/module_29700.c index 50c36de3e..857076ab4 100644 --- a/src/modules/module_29700.c +++ b/src/modules/module_29700.c @@ -122,19 +122,19 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KEEPASS; token.sep[0] = '*'; - token.len_min[0] = 9; - token.len_max[0] = 9; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 9; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '*'; @@ -158,33 +158,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 11; token.sep[4] = '*'; - token.len_min[4] = 32; - token.len_max[4] = 32; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 32; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; - token.len_min[5] = 64; - token.len_max[5] = 64; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[6] = '*'; - token.len_min[6] = 32; - token.len_max[6] = 32; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '*'; - token.len_min[7] = 64; - token.len_max[7] = 64; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 64; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[8] = '*'; - token.len_min[8] = 1; - token.len_max[8] = 1; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 1; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[9] = '*'; @@ -204,21 +199,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 14; token.sep[11] = '*'; - token.len_min[11] = 1; - token.len_max[11] = 1; - token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH + token.len[11] = 1; + token.attr[11] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[12] = '*'; - token.len_min[12] = 2; - token.len_max[12] = 2; - token.attr[12] = TOKEN_ATTR_VERIFY_LENGTH + token.len[12] = 2; + token.attr[12] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[13] = '*'; - token.len_min[13] = 64; - token.len_max[13] = 64; - token.attr[13] = TOKEN_ATTR_VERIFY_LENGTH + token.len[13] = 64; + token.attr[13] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; } } @@ -227,33 +219,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 9; token.sep[4] = '*'; - token.len_min[4] = 64; - token.len_max[4] = 64; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 64; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '*'; - token.len_min[5] = 64; - token.len_max[5] = 64; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 64; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[6] = '*'; - token.len_min[6] = 32; - token.len_max[6] = 32; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 32; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '*'; - token.len_min[7] = 64; - token.len_max[7] = 64; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 64; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[8] = '*'; - token.len_min[8] = 64; - token.len_max[8] = 64; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 64; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; if (is_keyfile_present == true) @@ -261,21 +248,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.token_cnt = 12; token.sep[9] = '*'; - token.len_min[9] = 1; - token.len_max[9] = 1; - token.attr[9] = TOKEN_ATTR_VERIFY_LENGTH + token.len[9] = 1; + token.attr[9] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[10] = '*'; - token.len_min[10] = 2; - token.len_max[10] = 2; - token.attr[10] = TOKEN_ATTR_VERIFY_LENGTH + token.len[10] = 2; + token.attr[10] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[11] = '*'; - token.len_min[11] = 64; - token.len_max[11] = 64; - token.attr[11] = TOKEN_ATTR_VERIFY_LENGTH + token.len[11] = 64; + token.attr[11] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; } } diff --git a/src/modules/module_29800.c b/src/modules/module_29800.c index 653587030..364076c45 100644 --- a/src/modules/module_29800.c +++ b/src/modules/module_29800.c @@ -278,6 +278,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 7; token.signatures_cnt = 1; @@ -287,34 +289,31 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 1; - token.len_max[1] = 1; token.sep[1] = '*'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[2] = '*'; token.len_min[2] = 1; token.len_max[2] = 10; - token.sep[2] = '*'; token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; + token.sep[3] = '*'; token.len_min[3] = 1; token.len_max[3] = 2; - token.sep[3] = '*'; token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[4] = 1; - token.len_max[4] = 1; token.sep[4] = '*'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 1; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; - token.len_min[5] = 16; - token.len_max[5] = 16; token.sep[5] = '*'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 16; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len[6] = 64; diff --git a/src/modules/module_29910.c b/src/modules/module_29910.c index 0960c3cb2..23ed260c7 100644 --- a/src/modules/module_29910.c +++ b/src/modules/module_29910.c @@ -92,6 +92,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; @@ -102,39 +104,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 16; - token.len_max[3] = 16; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; - token.len_min[4] = 16; - token.len_max[4] = 16; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 16; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '$'; - token.len_min[5] = 2; - token.len_max[5] = 2; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 2; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[6] = '$'; - token.len_min[6] = 64; - token.len_max[6] = 64; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 64; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '$'; diff --git a/src/modules/module_29920.c b/src/modules/module_29920.c index e73dc1268..bb433b090 100644 --- a/src/modules/module_29920.c +++ b/src/modules/module_29920.c @@ -92,6 +92,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 9; token.signatures_cnt = 1; @@ -102,39 +104,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 16; - token.len_max[3] = 16; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; - token.len_min[4] = 16; - token.len_max[4] = 16; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 16; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '$'; - token.len_min[5] = 2; - token.len_max[5] = 2; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 2; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[6] = '$'; - token.len_min[6] = 64; - token.len_max[6] = 64; - token.attr[6] = TOKEN_ATTR_VERIFY_LENGTH + token.len[6] = 64; + token.attr[6] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '$'; @@ -144,9 +140,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[8] = '$'; - token.len_min[8] = 256; - token.len_max[8] = 256; - token.attr[8] = TOKEN_ATTR_VERIFY_LENGTH + token.len[8] = 256; + token.attr[8] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29930.c b/src/modules/module_29930.c index f436d64f4..bf467b029 100644 --- a/src/modules/module_29930.c +++ b/src/modules/module_29930.c @@ -87,6 +87,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 5; token.signatures_cnt = 1; @@ -97,27 +99,23 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 16; - token.len_max[3] = 16; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; - token.len_min[4] = 16; - token.len_max[4] = 16; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 16; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_29940.c b/src/modules/module_29940.c index 02d6ec047..5cdca974e 100644 --- a/src/modules/module_29940.c +++ b/src/modules/module_29940.c @@ -87,6 +87,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 6; token.signatures_cnt = 1; @@ -97,33 +99,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 1; - token.len_max[1] = 1; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 1; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[2] = '$'; - token.len_min[2] = 1; - token.len_max[2] = 1; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 1; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '$'; - token.len_min[3] = 16; - token.len_max[3] = 16; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 16; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; - token.len_min[4] = 16; - token.len_max[4] = 16; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + token.len[4] = 16; + token.attr[4] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[5] = '$'; - token.len_min[5] = 256; - token.len_max[5] = 256; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + token.len[5] = 256; + token.attr[5] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_30000.c b/src/modules/module_30000.c index 0c9cd8c6d..2a3fd4704 100644 --- a/src/modules/module_30000.c +++ b/src/modules/module_30000.c @@ -53,15 +53,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_WERKZEUG_MD5; token.sep[0] = '$'; - token.len_min[0] = 3; - token.len_max[0] = 3; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 3; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; @@ -70,9 +71,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[2] = '$'; - token.len_min[2] = 32; - token.len_max[2] = 32; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 32; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) diff --git a/src/modules/module_30120.c b/src/modules/module_30120.c index 15d602fa9..f17570333 100644 --- a/src/modules/module_30120.c +++ b/src/modules/module_30120.c @@ -84,15 +84,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_WERKZEUG_SHA256; token.sep[0] = '$'; - token.len_min[0] = 6; - token.len_max[0] = 6; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; @@ -101,9 +102,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[2] = '$'; - token.len_min[2] = 64; - token.len_max[2] = 64; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 64; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) diff --git a/src/modules/module_30420.c b/src/modules/module_30420.c index 64237bdab..8074d3412 100644 --- a/src/modules/module_30420.c +++ b/src/modules/module_30420.c @@ -54,11 +54,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 56; - token.len_max[0] = 56; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 56; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_30500.c b/src/modules/module_30500.c index f9d0a6342..e68921944 100644 --- a/src/modules/module_30500.c +++ b/src/modules/module_30500.c @@ -80,12 +80,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.len_min[1] = SALT_MIN; diff --git a/src/modules/module_30600.c b/src/modules/module_30600.c index 5172ffecf..713fa6f64 100644 --- a/src/modules/module_30600.c +++ b/src/modules/module_30600.c @@ -171,6 +171,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 4; @@ -183,10 +185,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; - token.len_min[1] = 2; - token.len_max[1] = 2; token.sep[1] = '$'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 2; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_DIGIT; token.len[2] = 22; diff --git a/src/modules/module_30700.c b/src/modules/module_30700.c index 953ed21da..b078dc447 100644 --- a/src/modules/module_30700.c +++ b/src/modules/module_30700.c @@ -56,27 +56,26 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_ANOPE; token.sep[0] = ':'; - token.len_min[0] = 6; - token.len_max[0] = 6; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 6; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = ':'; - token.len_min[1] = 64; - token.len_max[1] = 64; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 64; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = ':'; - token.len_min[2] = 64; - token.len_max[2] = 64; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 64; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_30901.c b/src/modules/module_30901.c index 0422f4f20..3d60c3d90 100644 --- a/src/modules/module_30901.c +++ b/src/modules/module_30901.c @@ -74,6 +74,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len_min[0] = 26; diff --git a/src/modules/module_30902.c b/src/modules/module_30902.c index 3a765943b..984496707 100644 --- a/src/modules/module_30902.c +++ b/src/modules/module_30902.c @@ -75,6 +75,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len_min[0] = 26; diff --git a/src/modules/module_30903.c b/src/modules/module_30903.c index 1d179a527..3bcdad5af 100644 --- a/src/modules/module_30903.c +++ b/src/modules/module_30903.c @@ -97,6 +97,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_30904.c b/src/modules/module_30904.c index 27add2ea6..a3c9f2abe 100644 --- a/src/modules/module_30904.c +++ b/src/modules/module_30904.c @@ -97,6 +97,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_30905.c b/src/modules/module_30905.c index 5f8297f20..e3e9b7d55 100644 --- a/src/modules/module_30905.c +++ b/src/modules/module_30905.c @@ -75,6 +75,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 34; diff --git a/src/modules/module_30906.c b/src/modules/module_30906.c index fce7b67e7..1be061fad 100644 --- a/src/modules/module_30906.c +++ b/src/modules/module_30906.c @@ -75,6 +75,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len[0] = 34; diff --git a/src/modules/module_31000.c b/src/modules/module_31000.c index b6b9a330c..b7a3c2208 100644 --- a/src/modules/module_31000.c +++ b/src/modules/module_31000.c @@ -51,6 +51,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUS hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_31100.c b/src/modules/module_31100.c index 008f84d4c..8db92fb91 100644 --- a/src/modules/module_31100.c +++ b/src/modules/module_31100.c @@ -54,11 +54,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 64; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_31200.c b/src/modules/module_31200.c index 32c1a181a..50bc5405e 100644 --- a/src/modules/module_31200.c +++ b/src/modules/module_31200.c @@ -81,21 +81,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 4; token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_VEEAM_VBK; token.sep[0] = '*'; - token.len_min[0] = 5; - token.len_max[0] = 5; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 5; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '*'; - token.len_min[1] = 128; - token.len_max[1] = 128; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 128; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '*'; @@ -105,9 +105,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_DIGIT; token.sep[3] = '*'; - token.len_min[3] = 32; - token.len_max[3] = 32; - token.attr[3] = TOKEN_ATTR_VERIFY_HEX + token.len[3] = 32; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_31300.c b/src/modules/module_31300.c index 731c34e43..ae4130837 100644 --- a/src/modules/module_31300.c +++ b/src/modules/module_31300.c @@ -52,6 +52,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.signatures_cnt = 1; @@ -62,15 +64,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_SIGNATURE; token.sep[1] = '$'; - token.len_min[1] = 32; - token.len_max[1] = 32; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + token.len[1] = 32; + token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[2] = '$'; - token.len_min[2] = 96; - token.len_max[2] = 96; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 96; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_31400.c b/src/modules/module_31400.c index fb1b6e03a..bcc8654bb 100644 --- a/src/modules/module_31400.c +++ b/src/modules/module_31400.c @@ -74,6 +74,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 2; token.signatures_cnt = 1; diff --git a/src/modules/module_31700.c b/src/modules/module_31700.c index df52e64ab..a99bdc663 100644 --- a/src/modules/module_31700.c +++ b/src/modules/module_31700.c @@ -69,12 +69,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 3; token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + token.len[0] = 32; + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[1] = hashconfig->separator; diff --git a/src/modules/module_31800.c b/src/modules/module_31800.c index e8d5cf375..e1dfa3b04 100644 --- a/src/modules/module_31800.c +++ b/src/modules/module_31800.c @@ -135,6 +135,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 8; token.signatures_cnt = 1; @@ -150,15 +152,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; token.sep[2] = '$'; - token.len_min[2] = 64; - token.len_max[2] = 64; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + token.len[2] = 64; + token.attr[2] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[3] = '$'; - token.len_min[3] = 64; - token.len_max[3] = 64; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + token.len[3] = 64; + token.attr[3] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; token.sep[4] = '$'; @@ -180,9 +180,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE | TOKEN_ATTR_VERIFY_HEX; token.sep[7] = '$'; - token.len_min[7] = 32; - token.len_max[7] = 32; - token.attr[7] = TOKEN_ATTR_VERIFY_LENGTH + token.len[7] = 32; + token.attr[7] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX; const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); diff --git a/src/modules/module_31900.c b/src/modules/module_31900.c new file mode 100644 index 000000000..96c6840be --- /dev/null +++ b/src/modules/module_31900.c @@ -0,0 +1,356 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "common.h" +#include "types.h" +#include "modules.h" +#include "bitops.h" +#include "convert.h" +#include "shared.h" +#include "memory.h" + +static const u32 ATTACK_EXEC = ATTACK_EXEC_OUTSIDE_KERNEL; +static const u32 DGST_POS0 = 0; +static const u32 DGST_POS1 = 1; +static const u32 DGST_POS2 = 2; +static const u32 DGST_POS3 = 3; +static const u32 DGST_SIZE = DGST_SIZE_4_4; +static const u32 HASH_CATEGORY = HASH_CATEGORY_CRYPTOCURRENCY_WALLET; +static const char *HASH_NAME = "MetaMask Mobile Wallet"; +static const u64 KERN_TYPE = 31900; +static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE + | OPTI_TYPE_SLOW_HASH_SIMD_LOOP; +static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE + | OPTS_TYPE_PT_GENERATE_LE; +static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED; +static const char *ST_PASS = "hashcat1"; +static const char *ST_HASH = "$metamaskMobile$MjU1NTA5MTU2ODY5MjY4OQ==$3cccb51c401e54abc82987fd9310a8d3$WQhIECN0blOaV31RC3lKfQ=="; + +u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ATTACK_EXEC; } +u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS0; } +u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS1; } +u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS2; } +u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS3; } +u32 module_dgst_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_SIZE; } +u32 module_hash_category (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_CATEGORY; } +const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_NAME; } +u64 module_kern_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return KERN_TYPE; } +u32 module_opti_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTI_TYPE; } +u64 module_opts_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTS_TYPE; } +u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return SALT_TYPE; } +const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; } +const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; } + +typedef struct pbkdf2_sha512_tmp +{ + u64 ipad[8]; + u64 opad[8]; + + u64 dgst[32]; + u64 out[32]; + +} pbkdf2_sha512_tmp_t; + +typedef struct pbkdf2_sha512_aes_cbc +{ + u32 salt_buf[64]; + u32 iv_buf[4]; + u32 iv_len; + u32 ct_buf[4]; + u32 ct_len; + +} pbkdf2_sha512_aes_cbc_t; + +static const char *SIGNATURE_METAMASK_WALLET = "$metamaskMobile$"; + +char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param) +{ + char *jit_build_options = NULL; + + // Extra treatment for Apple systems + if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) + { + return jit_build_options; + } + + // HIP + if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP) + { + hc_asprintf (&jit_build_options, "-D _unroll"); + } + + // ROCM + if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true)) + { + hc_asprintf (&jit_build_options, "-D _unroll"); + } + + return jit_build_options; +} + +u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u64 esalt_size = (const u64) sizeof (pbkdf2_sha512_aes_cbc_t); + + return esalt_size; +} + +u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u64 tmp_size = (const u64) sizeof (pbkdf2_sha512_tmp_t); + + return tmp_size; +} + +u32 module_pw_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u32 pw_min = 8; + + return pw_min; +} + +u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + // this overrides the reductions of PW_MAX in case optimized kernel is selected + // IOW, even in optimized kernel mode it support length 256 + + const u32 pw_max = PW_MAX; + + return pw_max; +} + +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) +{ + u32 *digest = (u32 *) digest_buf; + + pbkdf2_sha512_aes_cbc_t *metamask = (pbkdf2_sha512_aes_cbc_t *) esalt_buf; + + #define CT_MAX_LEN_BASE64 ((3136 * 8) / 6) + 3 + + hc_token_t token; + + token.token_cnt = 4; + + token.signatures_cnt = 1; + token.signatures_buf[0] = SIGNATURE_METAMASK_WALLET; + + token.len[0] = strlen (SIGNATURE_METAMASK_WALLET); + token.attr[0] = TOKEN_ATTR_FIXED_LENGTH + | TOKEN_ATTR_VERIFY_SIGNATURE; + + token.sep[1] = '$'; + token.len_min[1] = 24; + token.len_max[1] = 24; + token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_BASE64A; + + token.sep[2] = '$'; + token.len_min[2] = 32; + token.len_max[2] = 32; + token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_HEX; + + token.sep[3] = '$'; + token.len_min[3] = 24; + token.len_max[3] = 24; + token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_BASE64A; + + const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); + + if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); + + size_t tmp_len = 0; + + // iter + + salt->salt_iter = 5000 - 1; + + // salt + + const u8 *salt_pos = token.buf[1]; + const int salt_len = token.len[1]; + + memcpy ((u8 *) metamask->salt_buf, salt_pos, salt_len); + + salt->salt_len = salt_len; + + memcpy ((u8 *) salt->salt_buf, metamask->salt_buf, salt->salt_len); + + // iv + + const u8 *iv_pos = token.buf[2]; + const int iv_len = token.len[2] / 2; + + metamask->iv_buf[0] = hex_to_u32 (iv_pos + 0); + metamask->iv_buf[1] = hex_to_u32 (iv_pos + 8); + metamask->iv_buf[2] = hex_to_u32 (iv_pos + 16); + metamask->iv_buf[3] = hex_to_u32 (iv_pos + 24); + + metamask->iv_buf[0] = byte_swap_32 (metamask->iv_buf[0]); + metamask->iv_buf[1] = byte_swap_32 (metamask->iv_buf[1]); + metamask->iv_buf[2] = byte_swap_32 (metamask->iv_buf[2]); + metamask->iv_buf[3] = byte_swap_32 (metamask->iv_buf[3]); + + metamask->iv_len = iv_len; + + // ciphertext + + const u8 *ct_pos = token.buf[3]; + const int ct_len = token.len[3]; + + u8 tmp_buf[24+1]; + + memset (tmp_buf, 0, sizeof (tmp_buf)); + + tmp_len = base64_decode (base64_to_int, ct_pos, ct_len, tmp_buf); + + if (tmp_len != 16) return (PARSER_CT_LENGTH); + + memcpy ((u8 *) metamask->ct_buf, tmp_buf, tmp_len); + + metamask->ct_buf[0] = byte_swap_32 (metamask->ct_buf[0]); + metamask->ct_buf[1] = byte_swap_32 (metamask->ct_buf[1]); + metamask->ct_buf[2] = byte_swap_32 (metamask->ct_buf[2]); + metamask->ct_buf[3] = byte_swap_32 (metamask->ct_buf[3]); + + metamask->ct_len = tmp_len / 4; + + // digest + + digest[0] = metamask->ct_buf[0]; + digest[1] = metamask->ct_buf[1]; + digest[2] = metamask->ct_buf[2]; + digest[3] = metamask->ct_buf[3]; + + return (PARSER_OK); +} + +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 u32 *digest = (const u32 *) digest_buf; + + pbkdf2_sha512_aes_cbc_t *metamask = (pbkdf2_sha512_aes_cbc_t *) esalt_buf; + + // salt + + u8 *salt_buf = (u8 *) salt->salt_buf; + + // iv + + u8 iv_buf[32+1]; + + memset (iv_buf, 0, sizeof (iv_buf)); + + u32_to_hex (byte_swap_32 (metamask->iv_buf[0]), iv_buf + 0); + u32_to_hex (byte_swap_32 (metamask->iv_buf[1]), iv_buf + 8); + u32_to_hex (byte_swap_32 (metamask->iv_buf[2]), iv_buf + 16); + u32_to_hex (byte_swap_32 (metamask->iv_buf[3]), iv_buf + 24); + + // ct + + u32 tmp_buf[4]; + + tmp_buf[0] = byte_swap_32 (digest[0]); + tmp_buf[1] = byte_swap_32 (digest[1]); + tmp_buf[2] = byte_swap_32 (digest[2]); + tmp_buf[3] = byte_swap_32 (digest[3]); + + u8 ct_buf[24+1]; + + memset (ct_buf, 0, sizeof (ct_buf)); + + base64_encode (int_to_base64, (const u8 *) tmp_buf, (const int) metamask->ct_len * 4, ct_buf); + + u8 *out_buf = (u8 *) line_buf; + + int out_len = snprintf ((char *) out_buf, line_size, "%s%s$%s$%s", + SIGNATURE_METAMASK_WALLET, + salt_buf, + iv_buf, + ct_buf); + + return out_len; +} + +void module_init (module_ctx_t *module_ctx) +{ + module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT; + module_ctx->module_interface_version = MODULE_INTERFACE_VERSION_CURRENT; + + module_ctx->module_attack_exec = module_attack_exec; + module_ctx->module_benchmark_esalt = MODULE_DEFAULT; + module_ctx->module_benchmark_hook_salt = MODULE_DEFAULT; + module_ctx->module_benchmark_mask = MODULE_DEFAULT; + module_ctx->module_benchmark_charset = MODULE_DEFAULT; + module_ctx->module_benchmark_salt = MODULE_DEFAULT; + module_ctx->module_build_plain_postprocess = MODULE_DEFAULT; + module_ctx->module_deep_comp_kernel = MODULE_DEFAULT; + module_ctx->module_deprecated_notice = MODULE_DEFAULT; + module_ctx->module_dgst_pos0 = module_dgst_pos0; + module_ctx->module_dgst_pos1 = module_dgst_pos1; + module_ctx->module_dgst_pos2 = module_dgst_pos2; + module_ctx->module_dgst_pos3 = module_dgst_pos3; + module_ctx->module_dgst_size = module_dgst_size; + module_ctx->module_dictstat_disable = MODULE_DEFAULT; + module_ctx->module_esalt_size = module_esalt_size; + module_ctx->module_extra_buffer_size = MODULE_DEFAULT; + module_ctx->module_extra_tmp_size = MODULE_DEFAULT; + module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; + module_ctx->module_forced_outfile_format = MODULE_DEFAULT; + module_ctx->module_hash_binary_count = MODULE_DEFAULT; + module_ctx->module_hash_binary_parse = MODULE_DEFAULT; + module_ctx->module_hash_binary_save = MODULE_DEFAULT; + module_ctx->module_hash_decode_postprocess = MODULE_DEFAULT; + module_ctx->module_hash_decode_potfile = MODULE_DEFAULT; + module_ctx->module_hash_decode_zero_hash = MODULE_DEFAULT; + module_ctx->module_hash_decode = module_hash_decode; + module_ctx->module_hash_encode_status = MODULE_DEFAULT; + module_ctx->module_hash_encode_potfile = MODULE_DEFAULT; + module_ctx->module_hash_encode = module_hash_encode; + module_ctx->module_hash_init_selftest = MODULE_DEFAULT; + module_ctx->module_hash_mode = MODULE_DEFAULT; + module_ctx->module_hash_category = module_hash_category; + module_ctx->module_hash_name = module_hash_name; + module_ctx->module_hashes_count_min = MODULE_DEFAULT; + module_ctx->module_hashes_count_max = MODULE_DEFAULT; + module_ctx->module_hlfmt_disable = MODULE_DEFAULT; + module_ctx->module_hook_extra_param_size = MODULE_DEFAULT; + module_ctx->module_hook_extra_param_init = MODULE_DEFAULT; + module_ctx->module_hook_extra_param_term = MODULE_DEFAULT; + module_ctx->module_hook12 = MODULE_DEFAULT; + module_ctx->module_hook23 = MODULE_DEFAULT; + module_ctx->module_hook_salt_size = MODULE_DEFAULT; + module_ctx->module_hook_size = MODULE_DEFAULT; + module_ctx->module_jit_build_options = module_jit_build_options; + module_ctx->module_jit_cache_disable = MODULE_DEFAULT; + module_ctx->module_kernel_accel_max = MODULE_DEFAULT; + module_ctx->module_kernel_accel_min = MODULE_DEFAULT; + module_ctx->module_kernel_loops_max = MODULE_DEFAULT; + module_ctx->module_kernel_loops_min = MODULE_DEFAULT; + module_ctx->module_kernel_threads_max = MODULE_DEFAULT; + module_ctx->module_kernel_threads_min = MODULE_DEFAULT; + module_ctx->module_kern_type = module_kern_type; + module_ctx->module_kern_type_dynamic = MODULE_DEFAULT; + module_ctx->module_opti_type = module_opti_type; + module_ctx->module_opts_type = module_opts_type; + module_ctx->module_outfile_check_disable = MODULE_DEFAULT; + module_ctx->module_outfile_check_nocomp = MODULE_DEFAULT; + module_ctx->module_potfile_custom_check = MODULE_DEFAULT; + module_ctx->module_potfile_disable = MODULE_DEFAULT; + module_ctx->module_potfile_keep_all_hashes = MODULE_DEFAULT; + module_ctx->module_pwdump_column = MODULE_DEFAULT; + module_ctx->module_pw_max = module_pw_max; + module_ctx->module_pw_min = module_pw_min; + module_ctx->module_salt_max = MODULE_DEFAULT; + module_ctx->module_salt_min = MODULE_DEFAULT; + module_ctx->module_salt_type = module_salt_type; + module_ctx->module_separator = MODULE_DEFAULT; + module_ctx->module_st_hash = module_st_hash; + module_ctx->module_st_pass = module_st_pass; + module_ctx->module_tmp_size = module_tmp_size; + module_ctx->module_unstable_warning = MODULE_DEFAULT; + module_ctx->module_warmup_disable = MODULE_DEFAULT; +} diff --git a/src/modules/module_99999.c b/src/modules/module_99999.c index f09d550d7..6189d4aea 100644 --- a/src/modules/module_99999.c +++ b/src/modules/module_99999.c @@ -65,6 +65,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE hc_token_t token; + memset (&token, 0, sizeof (hc_token_t)); + token.token_cnt = 1; token.len_min[0] = 1; diff --git a/src/shared.c b/src/shared.c index 542eb4088..a4b835aee 100644 --- a/src/shared.c +++ b/src/shared.c @@ -1153,10 +1153,6 @@ int input_tokenizer (const u8 *input_buf, const int input_len, hc_token_t *token int len = token->len[token_idx]; if (len_left < len) return (PARSER_TOKEN_LENGTH); - - token->buf[token_idx + 1] = token->buf[token_idx] + len; - - len_left -= len; } else { @@ -1175,7 +1171,10 @@ int input_tokenizer (const u8 *input_buf, const int input_len, hc_token_t *token len_left -= len + 1; // +1 = separator } } + } + if (token->sep[token_idx] != 0x00) + { const u8 *next_pos = NULL; if (token->attr[token_idx] & TOKEN_ATTR_SEPARATOR_FARTHEST) @@ -1197,6 +1196,21 @@ int input_tokenizer (const u8 *input_buf, const int input_len, hc_token_t *token len_left -= len + 1; // +1 = separator } + else + { + const int len = token->len[token_idx]; + + token->buf[token_idx + 1] = token->buf[token_idx] + len; + + len_left -= len; + + if (token->sep[token_idx] != 0) + { + token->buf[token_idx + 1]++; // +1 = separator + + len_left--; // -1 = separator + } + } } if (token->attr[token_idx] & TOKEN_ATTR_FIXED_LENGTH) diff --git a/tools/2hashcat_tests/metamask2hashcat.android.json b/tools/2hashcat_tests/metamask2hashcat.android.json new file mode 100644 index 000000000..443668f83 --- /dev/null +++ b/tools/2hashcat_tests/metamask2hashcat.android.json @@ -0,0 +1 @@ +{"collectibles":"{\"favorites\":{}}","engine":"{\"backgroundState\":{\"AccountTrackerController\":{\"accounts\":{\"0x66F9C09118B1C726BC24811a611baf60af42070A\":{\"balance\":\"0x0\"}},\"_U\":0,\"_V\":0,\"_W\":null,\"_X\":null},\"AddressBookController\":{\"addressBook\":{}},\"AssetsContractController\":{},\"CollectiblesController\":{\"allCollectibleContracts\":{},\"allCollectibles\":{},\"ignoredCollectibles\":[],\"collectibleContracts\":[],\"collectibles\":[]},\"CurrencyRateController\":{\"conversionDate\":1650127160.54,\"conversionRate\":3025.29,\"nativeCurrency\":\"ETH\",\"currentCurrency\":\"usd\",\"pendingCurrentCurrency\":null,\"pendingNativeCurrency\":null,\"usdConversionRate\":3025.29},\"KeyringController\":{\"keyrings\":[],\"vault\":\"{\\\"cipher\\\":\\\"pzGHRQw3aj//zSjUNAA83WC1EttUHvm4eNNd7YpdoA+bLsU1FXecXYckE3KGWcBIHIdQjdPp2OEgUms0D4XmoWFoAKVnuEUiokWMHy0jpI9z6QTpkSET7xaUY1ZAEWxas1HDBjUBFMhTsuOPiXD1k69tQkxTEe8bHcFFhFsEKfh743b0YypfFbTcOC5HdiuzwEkrtO+nhwBeHBzjzVyGgjQVlqFQiWzbg7JdVPvozbnB5KaongYSEn19o4EbxWiIx7RQWsQ88LR79fWS/nzT0udjxjj9Auu58lGAyvpYTHZzt6n1yapQVXRoHAV44h1AH30f8LY+c2yDKRcPtgc8qqTZXDWzwm4UeFf1BiwUXA6qjN9dFDa0F9Gvl8ugL9HbboGQHQcgQtIKbQnjQSmYucR7kUrZVn/i5jShNglt5lMb4WO28wBaMebBl0tIPPw8xa16tZ3C1Z7RmJrdr3HXDTrwSm5ybqkcngeIOLQwqIOT0WGkSAg6BAce/0oeAp1kgaZWj5BNqnGAsTzaHK1VggFbbQjoX/CQG65vEZBGQXsmdJSfd3m+sTAO113QCpiovvOQFAwcn5eQXQgIv57k2UCrE+SuQcahfd0cZ9GerjI=\\\",\\\"iv\\\":\\\"8fc2c478acc10f6428355312fce293de\\\",\\\"salt\\\":\\\"QW4ie0WH8XP7ust40yy7pg==\\\",\\\"lib\\\":\\\"original\\\"}\"},\"PersonalMessageManager\":{\"unapprovedMessages\":{},\"unapprovedMessagesCount\":0},\"NetworkController\":{\"network\":\"loading\",\"isCustomNetwork\":false,\"provider\":{\"type\":\"mainnet\",\"chainId\":\"1\"},\"properties\":{}},\"PreferencesController\":{\"featureFlags\":{},\"frequentRpcList\":[],\"identities\":{\"0x66F9C09118B1C726BC24811a611baf60af42070A\":{\"address\":\"0x66F9C09118B1C726BC24811a611baf60af42070A\",\"name\":\"Account 1\",\"importTime\":1650114145762}},\"ipfsGateway\":\"https://cloudflare-ipfs.com/ipfs/\",\"lostIdentities\":{},\"selectedAddress\":\"0x66F9C09118B1C726BC24811a611baf60af42070A\",\"useStaticTokenList\":true,\"useCollectibleDetection\":false,\"openSeaEnabled\":false,\"_U\":0,\"_V\":0,\"_W\":null,\"_X\":null},\"TokenBalancesController\":{\"contractBalances\":{}},\"TokenRatesController\":{\"contractExchangeRates\":{}},\"TokensController\":{\"allTokens\":{},\"allIgnoredTokens\":{},\"ignoredTokens\":[],\"suggestedAssets\":[],\"tokens\":[]},\"TransactionController\":{\"methodData\":{},\"transactions\":[],\"internalTransactions\":[],\"swapsTransactions\":{}},\"TypedMessageManager\":{\"unapprovedMessages\":{},\"unapprovedMessagesCount\":0},\"GasFeeController\":{\"gasFeeEstimates\":{},\"estimatedGasFeeTimeBounds\":{},\"gasEstimateType\":\"none\"},\"TokenDetectionController\":{},\"CollectibleDetectionController\":{},\"TokenListController\":{\"tokensChainsCache\":{}},\"SwapsController\":{\"quotes\":{},\"quoteValues\":{},\"fetchParams\":{\"slippage\":0,\"sourceToken\":\"\",\"sourceAmount\":0,\"destinationToken\":\"\",\"walletAddress\":\"\"},\"fetchParamsMetaData\":{\"sourceTokenInfo\":{\"decimals\":0,\"address\":\"\",\"symbol\":\"\"},\"destinationTokenInfo\":{\"decimals\":0,\"address\":\"\",\"symbol\":\"\"}},\"topAggSavings\":null,\"approvalTransaction\":null,\"quotesLastFetched\":0,\"error\":{\"key\":null,\"description\":null},\"topAggId\":null,\"isInPolling\":false,\"pollingCyclesLeft\":3,\"quoteRefreshSeconds\":null,\"usedGasEstimate\":null,\"usedCustomGas\":null},\"PhishingController\":{}}}","privacy":"{\"privacyMode\":true,\"thirdPartyApiMode\":true,\"approvedHosts\":{}}","bookmarks":"[]","recents":"[]","browser":"{\"activeTab\":null,\"history\":[],\"whitelist\":[],\"tabs\":[]}","modals":"{\"networkModalVisible\":false,\"accountsModalVisible\":false,\"collectibleContractModalVisible\":false,\"receiveModalVisible\":false,\"dappTransactionModalVisible\":false,\"approveModalVisible\":false}","settings":"{\"searchEngine\":\"DuckDuckGo\",\"primaryCurrency\":\"ETH\",\"useBlockieIcon\":true,\"hideZeroBalanceTokens\":false,\"lockTime\":30000}","alert":"{\"isVisible\":false,\"autodismiss\":null,\"content\":null,\"data\":null}","transaction":"{\"selectedAsset\":{},\"transaction\":{}}","user":"{\"loadingMsg\":\"Deleting current wallet\",\"loadingSet\":false,\"backUpSeedphraseVisible\":false,\"protectWalletModalVisible\":false,\"gasEducationCarouselSeen\":false,\"nftDetectionDismissed\":false,\"appTheme\":\"os\",\"passwordSet\":true,\"seedphraseBackedUp\":true,\"userLoggedIn\":true}","wizard":"{\"step\":0}","notification":"{\"notifications\":[]}","swaps":"{\"1\":{\"isLive\":true},\"isLive\":true,\"hasOnboarded\":false}","fiatOrders":"{\"selectedCountry\":\"US\",\"orders\":[]}","infuraAvailability":"{\"isBlocked\":false}","navigation":"{\"currentRoute\":\"WalletView\"}","networkOnboarded":"{\"networkOnboardedState\":[],\"networkState\":{\"showNetworkOnboarding\":false,\"nativeToken\":\"\",\"networkType\":\"\",\"networkUrl\":\"\"},\"switchedNetwork\":{\"networkUrl\":\"\",\"networkStatus\":false}}","_persist":"{\"version\":10,\"rehydrated\":true}"} diff --git a/tools/2hashcat_tests/metamask2hashcat.ios.json b/tools/2hashcat_tests/metamask2hashcat.ios.json new file mode 100644 index 000000000..9b90c972d --- /dev/null +++ b/tools/2hashcat_tests/metamask2hashcat.ios.json @@ -0,0 +1 @@ +{"collectibles":"{\"favorites\":{}}","engine":"{\"backgroundState\":{\"AccountTrackerController\":{\"accounts\":{\"0x66F9C09118B1C726BC24811a611baf60af42070A\":{\"balance\":\"0x0\"}},\"_U\":0,\"_V\":0,\"_W\":null,\"_X\":null},\"AddressBookController\":{\"addressBook\":{}},\"AssetsContractController\":{},\"CollectiblesController\":{\"allCollectibleContracts\":{},\"allCollectibles\":{},\"ignoredCollectibles\":[],\"collectibleContracts\":[],\"collectibles\":[]},\"CurrencyRateController\":{\"conversionDate\":1649988414.582,\"conversionRate\":3019.01,\"nativeCurrency\":\"ETH\",\"currentCurrency\":\"usd\",\"pendingCurrentCurrency\":null,\"pendingNativeCurrency\":null,\"usdConversionRate\":3019.01},\"KeyringController\":{\"vault\":\"{\\\"cipher\\\":\\\"oyvzsghbruyPSrkcEv0B+qfkODclFQNIPWuvWHSgIMr26dcVDcsj+sBjzMrJ0mWP0jZQ1xhKt1bAp3v8+rLPauI8OsJ/1uoImqAcBRBu1ORUHmwk2kYIiYLC+qgqvf6OHZGmhF3OAT4Fpt4TSZIP5kVI12DHLNO0yLZDkBliXhQSmuhmY8CCpE13IaTrBWipe/E5lblr5zQWvgfz6lBzrxzE87eY4bAGJ5bh4P/5Nxc=\\\",\\\"iv\\\":\\\"9ec290a383a4c4cf5fcae9137455dc72\\\",\\\"salt\\\":\\\"ywv4d3UyjBtjVQ0gip0Swg==\\\",\\\"lib\\\":\\\"original\\\"}\"},\"PersonalMessageManager\":{\"unapprovedMessages\":{},\"unapprovedMessagesCount\":0},\"NetworkController\":{\"network\":\"1\",\"isCustomNetwork\":false,\"provider\":{\"type\":\"mainnet\",\"chainId\":\"1\"},\"properties\":{\"isEIP1559Compatible\":true}},\"PreferencesController\":{\"featureFlags\":{},\"frequentRpcList\":[],\"identities\":{\"0x66F9C09118B1C726BC24811a611baf60af42070A\":{\"address\":\"0x66F9C09118B1C726BC24811a611baf60af42070A\",\"name\":\"Account 1\",\"importTime\":1649815458524}},\"ipfsGateway\":\"https://cloudflare-ipfs.com/ipfs/\",\"lostIdentities\":{},\"selectedAddress\":\"0x66F9C09118B1C726BC24811a611baf60af42070A\",\"useStaticTokenList\":true,\"useCollectibleDetection\":false,\"openSeaEnabled\":false,\"_U\":0,\"_V\":0,\"_W\":null,\"_X\":null},\"TokenBalancesController\":{\"contractBalances\":{}},\"TokenRatesController\":{\"contractExchangeRates\":{}},\"TokensController\":{\"allTokens\":{},\"allIgnoredTokens\":{},\"ignoredTokens\":[],\"suggestedAssets\":[],\"tokens\":[]},\"TransactionController\":{\"methodData\":{},\"transactions\":[{\"blockNumber\":\"10717310\",\"id\":\"5edf6880-e552-11ea-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1598195253000,\"transaction\":{\"data\":\"0x\",\"from\":\"0x9aa65464b4cfbe3dc2bdb3df412aee2b3de86687\",\"gas\":\"0x5208\",\"gasPrice\":\"0x156ba09800\",\"gasUsed\":\"0x5208\",\"nonce\":\"0x3593\",\"to\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"value\":\"0x5b471c5b794400\"},\"transactionHash\":\"0x1331372b3750105d06a4d6e89a17cbd148b71a7c521f96ba3099c46457e5caef\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":false},{\"blockNumber\":\"10717318\",\"id\":\"a6fe8b00-e552-11ea-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1598195374000,\"transaction\":{\"data\":\"0xa9059cbb000000000000000000000000da511c376ad5dbcc5e7ffccc5fb9396f91271f1d0000000000000000000000000000000000000000000000056bc75e2d63100000\",\"from\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"gas\":\"0x1036b\",\"gasPrice\":\"0x1ac688c51f\",\"gasUsed\":\"0x9d97\",\"nonce\":\"0x0\",\"to\":\"0xbe9375c6a420d2eeb258962efb95551a5b722803\",\"value\":\"0x0\"},\"transactionHash\":\"0xa75468b70d963d11dcfbe96213c1511e37c3e3aeb6fd676bc6ac51868626d302\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":true},{\"blockNumber\":\"10717322\",\"id\":\"c39ac300-e552-11ea-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1598195422000,\"transaction\":{\"data\":\"0x\",\"from\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"gas\":\"0x5208\",\"gasPrice\":\"0x165a0bc000\",\"gasUsed\":\"0x5208\",\"nonce\":\"0x1\",\"to\":\"0x36f403aa625e7122c1455c23624abf7378b5c80b\",\"value\":\"0x43a204cc0afbb7\"},\"transactionHash\":\"0xf0b86dfd64fbd28f446ac185c3cae4a7228aecad5fa77ac0551d5d9d7a768b6f\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":false},{\"blockNumber\":\"14305381\",\"id\":\"e8d97e80-99de-11ec-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1646194321000,\"transaction\":{\"data\":\"0x\",\"from\":\"0xeb2629a2734e272bcc07bda959863f316f4bd4cf\",\"gas\":\"0x5208\",\"gasPrice\":\"0xa23f6685e\",\"gasUsed\":\"0x5208\",\"nonce\":\"0x49b32a\",\"to\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"value\":\"0x8d500fae96000\"},\"transactionHash\":\"0x106f49a9205a3c1d636b5d47766c948b54cd18180d4fe956520c5395c4393daa\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":false},{\"blockNumber\":\"14305384\",\"id\":\"f858c780-99de-11ec-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1646194347000,\"transaction\":{\"data\":\"0x\",\"from\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"gas\":\"0x5208\",\"gasPrice\":\"0x1382de8600\",\"gasUsed\":\"0x5208\",\"nonce\":\"0x2\",\"to\":\"0x108b48bae093cea505fdd725c7bef561abda3f1b\",\"value\":\"0x294799d093000\"},\"transactionHash\":\"0xa26fa2604f27eecd2fb89e843ad034950b3aa2e5615b32138ea52930dbbc484b\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":false},{\"blockNumber\":\"14305392\",\"id\":\"68674d80-99df-11ec-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1646194535000,\"transaction\":{\"data\":\"0x\",\"from\":\"0xb5d85cbf7cb3ee0d56b3bb207d5fc4b82f43f511\",\"gas\":\"0x5208\",\"gasPrice\":\"0xc6d980a03\",\"gasUsed\":\"0x5208\",\"nonce\":\"0x5d6a22\",\"to\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"value\":\"0x81f1ad9f4e000\"},\"transactionHash\":\"0xc98bfc1edbd1b36734466915ceccacb22b8024ed76a6911225df209bc737698e\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":false},{\"blockNumber\":\"14305393\",\"id\":\"77e69680-99df-11ec-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1646194561000,\"transaction\":{\"data\":\"0x\",\"from\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"gas\":\"0x5208\",\"gasPrice\":\"0x156d6a5b80\",\"gasUsed\":\"0x5208\",\"nonce\":\"0x3\",\"to\":\"0x63889c748ec8d558b90f8bf93d9540851f01e74c\",\"value\":\"0x141635d530400\"},\"transactionHash\":\"0xcb35054a37268a871ca74e827fa6c7333de3a62102718acafc37cf7d99987312\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":false},{\"blockNumber\":\"14305487\",\"id\":\"c21d4701-99e2-11ec-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1646195974000,\"transaction\":{\"data\":\"0xa9059cbb0000000000000000000000006d0c7d96c2cb4105a25301df2a1d102cc71cf8ae00000000000000000000000000000000000000000002bacd5bc40aa9c6800000\",\"from\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"gas\":\"0xcab7\",\"gasPrice\":\"0xdd2f15172\",\"gasUsed\":\"0xb7f7\",\"nonce\":\"0x4\",\"to\":\"0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce\",\"value\":\"0x0\"},\"transactionHash\":\"0x33c2a4c9f47072600ad15c6e48e8d2685046b96b6e1152871ef63de279cb1eb5\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":true},{\"blockNumber\":\"14305487\",\"id\":\"c21d4700-99e2-11ec-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1646195974000,\"transaction\":{\"data\":\"0x\",\"from\":\"0x6d0c7d96c2cb4105a25301df2a1d102cc71cf8ae\",\"gas\":\"0x5208\",\"gasPrice\":\"0xdd2f15172\",\"gasUsed\":\"0x5208\",\"nonce\":\"0xb\",\"to\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"value\":\"0xaf25434c52c7e\"},\"transactionHash\":\"0x3b7d33cd9878b2aa9dd9c4b025bffc49211c0a4b10a65c24e07a4e5c5bef103f\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":false},{\"blockNumber\":\"14370492\",\"id\":\"62d5e880-a1d3-11ec-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1647068981000,\"transaction\":{\"data\":\"0x\",\"from\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"gas\":\"0x5208\",\"gasPrice\":\"0x296352580\",\"gasUsed\":\"0x5208\",\"nonce\":\"0x5\",\"to\":\"0x012e97041ed39dba037307055a8180327fee15b6\",\"value\":\"0x2f01750aed80\"},\"transactionHash\":\"0xd68054922a1053f4bcc340d548677eaa28efd0ceccf548e3c1b5f123f02eb8e5\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":false},{\"blockNumber\":\"14410592\",\"id\":\"9aa1cc00-a6bc-11ec-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1647608952000,\"transaction\":{\"data\":\"0x\",\"from\":\"0x4976a4a02f38326660d17bf34b431dc6e2eb2327\",\"gas\":\"0x32918\",\"gasPrice\":\"0xa0168e5cf\",\"gasUsed\":\"0x5208\",\"nonce\":\"0x10532c\",\"to\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"value\":\"0x17bc0cc54afb000\"},\"transactionHash\":\"0x4c6171d65d38c54c53c5a649f4fadb21670af9d383c2fdeceaa5487c1554624a\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":false},{\"blockNumber\":\"14410593\",\"id\":\"a1c8da00-a6bc-11ec-b269-29db90905b87\",\"networkID\":\"1\",\"chainId\":\"1\",\"time\":1647608964000,\"transaction\":{\"data\":\"0x\",\"from\":\"0x66f9c09118b1c726bc24811a611baf60af42070a\",\"gas\":\"0x5208\",\"gasPrice\":\"0x3bff249faa4\",\"gasUsed\":\"0x5208\",\"nonce\":\"0x6\",\"to\":\"0xe067e61d1adaff1c56ec89a31697102622be2a93\",\"value\":\"0x482731101752e0\"},\"transactionHash\":\"0xafd3a07905262628e5311ba4222e86adbff5dacde459aff74da7a78618b0104f\",\"verifiedOnBlockchain\":true,\"status\":\"confirmed\",\"toSmartContract\":false}],\"internalTransactions\":[],\"swapsTransactions\":{}},\"TypedMessageManager\":{\"unapprovedMessages\":{},\"unapprovedMessagesCount\":0},\"GasFeeController\":{\"gasFeeEstimates\":{},\"estimatedGasFeeTimeBounds\":{},\"gasEstimateType\":\"none\"},\"TokenDetectionController\":{},\"CollectibleDetectionController\":{},\"TokenListController\":{\"tokensChainsCache\":{}},\"SwapsController\":{\"quotes\":{},\"quoteValues\":{},\"fetchParams\":{\"slippage\":0,\"sourceToken\":\"\",\"sourceAmount\":0,\"destinationToken\":\"\",\"walletAddress\":\"\"},\"fetchParamsMetaData\":{\"sourceTokenInfo\":{\"decimals\":0,\"address\":\"\",\"symbol\":\"\"},\"destinationTokenInfo\":{\"decimals\":0,\"address\":\"\",\"symbol\":\"\"}},\"topAggSavings\":null,\"approvalTransaction\":null,\"quotesLastFetched\":0,\"error\":{\"key\":null,\"description\":null},\"topAggId\":null,\"isInPolling\":false,\"pollingCyclesLeft\":3,\"quoteRefreshSeconds\":null,\"usedGasEstimate\":null,\"usedCustomGas\":null},\"PhishingController\":{}}}","privacy":"{\"approvedHosts\":{},\"privacyMode\":true,\"thirdPartyApiMode\":true}","bookmarks":"[]","recents":"[]","browser":"{\"history\":[],\"whitelist\":[],\"tabs\":[],\"activeTab\":null}","modals":"{\"networkModalVisible\":false,\"accountsModalVisible\":false,\"collectibleContractModalVisible\":false,\"receiveModalVisible\":false,\"dappTransactionModalVisible\":false,\"approveModalVisible\":false}","settings":"{\"searchEngine\":\"DuckDuckGo\",\"primaryCurrency\":\"ETH\",\"lockTime\":30000,\"useBlockieIcon\":true,\"hideZeroBalanceTokens\":false}","alert":"{\"isVisible\":false,\"autodismiss\":null,\"content\":null,\"data\":null}","transaction":"{\"selectedAsset\":{},\"transaction\":{}}","user":"{\"loadingMsg\":\"\",\"loadingSet\":false,\"passwordSet\":true,\"seedphraseBackedUp\":true,\"backUpSeedphraseVisible\":false,\"protectWalletModalVisible\":false,\"gasEducationCarouselSeen\":false,\"nftDetectionDismissed\":false,\"userLoggedIn\":true,\"appTheme\":\"os\"}","wizard":"{\"step\":3}","notification":"{\"notifications\":[]}","swaps":"{\"1\":{\"isLive\":true},\"isLive\":true,\"hasOnboarded\":false}","fiatOrders":"{\"orders\":[],\"selectedCountry\":\"US\"}","infuraAvailability":"{\"isBlocked\":false}","navigation":"{\"currentRoute\":\"WalletView\"}","networkOnboarded":"{\"networkOnboardedState\":[],\"networkState\":{\"showNetworkOnboarding\":false,\"nativeToken\":\"\",\"networkType\":\"\",\"networkUrl\":\"\"},\"switchedNetwork\":{\"networkUrl\":\"\",\"networkStatus\":false}}","_persist":"{\"version\":10,\"rehydrated\":true}"} diff --git a/tools/metamask2hashcat.py b/tools/metamask2hashcat.py index cc631b444..fe2f0e006 100755 --- a/tools/metamask2hashcat.py +++ b/tools/metamask2hashcat.py @@ -2,12 +2,14 @@ # -*- coding: utf-8 -*- # Author: Gabriele 'matrix' Gristina -# Version: 1.0 +# Version: 2.0 # Date: Thu 12 Aug 2021 06:44:14 PM CEST # License: MIT # Extract metamask vault from browser and save to file, then you can use this tool # reference: https://metamask.zendesk.com/hc/en-us/articles/360018766351-How-to-use-the-Vault-Decryptor-with-the-MetaMask-Vault-Data +# From version 2.0 works also for Metamask Mobile +# reference: https://github.com/3rdIteration/btcrecover/pull/346 import json import argparse @@ -19,21 +21,58 @@ def metamask_parser(file, shortdata): j = json.load(f) - if 'salt' not in j or 'iv' not in j or 'data' not in j: - print("! Invalid vault format ...") - parser.print_help() - exit(1) + isMobile = False - if((len(j['data']) > 3000) or shortdata): - data_bin = base64.b64decode(j['data']) - # TODO limit data to 16 bytes, we only check the first block of data, so we don't need more data. - # The use of smaller buffers should speedup the attack. - # Still the pbkdf 10k iter will be taking the most time by far probably. - j['data'] = base64.b64encode(data_bin[0:64]).decode("ascii") - - print('$metamask-short$' + j['salt'] + '$' + j['iv'] + '$' + j['data']) + if 'engine' not in j: + if 'salt' not in j or 'iv' not in j or 'data' not in j: + print("! Invalid vault format ...") + parser.print_help() + exit(1) else: - print('$metamask$' + j['salt'] + '$' + j['iv'] + '$' + j['data']) + f.close() + wallet_data = open(file, "rb").read().decode("utf-8","ignore").replace("\\","") + + # taken from https://github.com/3rdIteration/btcrecover/blob/master/btcrecover/btcrpass.py#L3096-L3103 + walletStartText = "vault" + wallet_data_start = wallet_data.lower().find(walletStartText) + wallet_data_trimmed = wallet_data[wallet_data_start:] + wallet_data_start = wallet_data_trimmed.find("cipher") + wallet_data_trimmed = wallet_data_trimmed[wallet_data_start - 2:] + wallet_data_end = wallet_data_trimmed.find("}") + wallet_data = wallet_data_trimmed[:wallet_data_end + 1] + wallet_json = json.loads(wallet_data) + + j = json.loads(wallet_data) + + if 'lib' in j and 'original' in j['lib']: + isMobile = True + else: + print("! Invalid vault format ...") + parser.print_help() + exit(1) + + if isMobile is False: + + if((len(j['data']) > 3000) or shortdata): + data_bin = base64.b64decode(j['data']) + # TODO limit data to 16 bytes, we only check the first block of data, so we don't need more data. + # The use of smaller buffers should speedup the attack. + # Still the pbkdf 10k iter will be taking the most time by far probably. + j['data'] = base64.b64encode(data_bin[0:64]).decode("ascii") + + print('$metamask-short$' + j['salt'] + '$' + j['iv'] + '$' + j['data']) + else: + print('$metamask$' + j['salt'] + '$' + j['iv'] + '$' + j['data']) + + else: + + # extract only first 16 bytes of ciphertext + + cipher_bin = base64.b64decode(j['cipher']) + j['cipher'] = base64.b64encode(cipher_bin[:16]).decode("ascii") + + print('$metamaskMobile$' + j['salt'] + '$' + j['iv'] + '$' + j['cipher']) + except ValueError as e: parser.print_help() exit(1) @@ -52,4 +91,3 @@ if __name__ == "__main__": else: parser.print_help() exit(1) - diff --git a/tools/test.sh b/tools/test.sh index 62d297e63..d8b78efac 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -591,7 +591,7 @@ function attack_0() # out-of-memory, workaround - echo "${output}" | head -1 > tmp_file_out + echo "${output}" | grep -v "^Unsupported\|^$" | head -1 > tmp_file_out echo "${search}" > tmp_file_search out_md5=$(md5sum tmp_file_out | cut -d' ' -f1) @@ -874,7 +874,7 @@ function attack_1() # out-of-memory, workaround - echo "${output}" | head -1 > tmp_file_out + echo "${output}" | grep -v "^Unsupported\|^$" | head -1 > tmp_file_out echo "${search}" > tmp_file_search out_md5=$(md5sum tmp_file_out | cut -d' ' -f1) @@ -1180,7 +1180,7 @@ function attack_3() # out-of-memory, workaround - echo "${output}" | head -1 > tmp_file_out + echo "${output}" | grep -v "^Unsupported\|^$" | head -1 > tmp_file_out echo "${search}" > tmp_file_search out_md5=$(md5sum tmp_file_out | cut -d' ' -f1) @@ -1840,9 +1840,10 @@ function attack_6() newRet=$? if [ "${newRet}" -eq 2 ]; then + # out-of-memory, workaround - echo "${output}" | head -1 > tmp_file_out + echo "${output}" | grep -v "^Unsupported\|^$" | head -1 > tmp_file_out echo "${search}" > tmp_file_search out_md5=$(md5sum tmp_file_out | cut -d' ' -f1) @@ -2273,7 +2274,7 @@ function attack_7() # out-of-memory, workaround - echo "${output}" | head -1 > tmp_file_out + echo "${output}" | grep -v "^Unsupported\|^$" | head -1 > tmp_file_out echo "${search}" > tmp_file_search out_md5=$(md5sum tmp_file_out | cut -d' ' -f1) @@ -2287,7 +2288,6 @@ function attack_7() fi if [ "${newRet}" -ne 0 ]; then - if [ "${newRet}" -eq 2 ]; then ret=20 else diff --git a/tools/test_modules/m26610.pm b/tools/test_modules/m26610.pm index 45dc4e18c..71f2d05b0 100644 --- a/tools/test_modules/m26610.pm +++ b/tools/test_modules/m26610.pm @@ -21,9 +21,6 @@ sub module_generate_hash my $iv = shift // random_hex_string (32); my $ct = shift; - my $ct_min_len = 30; - my $ct_max_len = 64; - my $kdf = Crypt::PBKDF2->new ( hasher => Crypt::PBKDF2->hasher_from_algorithm ('HMACSHA2', 256), @@ -31,34 +28,18 @@ sub module_generate_hash output_len => 32 ); + my $ct_len = 64; + my $salt_bin = pack ("H*", $salt); my $key = $kdf->PBKDF2 ($salt_bin, $word); my $iv_bin = pack ("H*", $iv); - my $pt; - if (defined $ct) - { - my $ct_bin = pack ("H*", $ct); + my $pt = "[{\"type\":\"HD Key Tree\",\"data\":{\"mnemonic\":[112,97,121,109,101,110,116,32,117,112,115,101,116,32,109,101,116,97,108,32,99,104,97,112,116,101,114,32,114,117,110,32,97,100,109,105,116,32,109,101,97,115,117,114,101,32,114,101,109,105,110,100,32,115,117,112,112,108,121,32,104,111,112,101,32,101,110,101,109,121,32,104,101,100,103,101,104,111,103],\"numberOfAccounts\":1,\"hdPath\":\"m/44'/60'/0'/0\"}}]"; - my $data_bin = $ct_bin; - - my $aes = Crypt::AuthEnc::GCM->new ("AES", $key, $iv_bin); - - $pt = $aes->decrypt_add ($data_bin); - - } - else - { - # generate plaintext - - # TODO now the data is all ASCII 'a', would be better to have it mimic the same structure as the reference data: - # [{"type":"HD Key Tree","data":{"mnemonic":[112,97,121,109,101,110,116,32,117,112,115,101,116,32,109,101,116,97,108,32,99,104,97,112,116,101,114,32,114,117,110,32,97,100,109,105,116,32,109,101,97,115,117,114,101,32,114,101,109,105,110,100,32,115,117,112,112,108,121,32,104,111,112,101,32,101,110,101,109,121,32,104,101,100,103,101,104,111,103],"numberOfAccounts":1,"hdPath":"m/44'/60'/0'/0"}}] - # generated from tools/2hashcat_tests/metamask2hashcat-test.py - $pt = "a" x ($ct_min_len + int (rand ($ct_max_len - $ct_min_len)) + 1); - } + $pt = substr ($pt, 0, $ct_len); my $aes = Crypt::AuthEnc::GCM->new ("AES", $key, $iv_bin); @@ -80,7 +61,7 @@ sub module_verify_hash my $hash = substr ($line, 0, $idx); my $word = substr ($line, $idx + 1); - return unless substr ($hash, 0, 10) eq '$metamask-short$'; + return unless substr ($hash, 0, 16) eq '$metamask-short$'; my (undef, $signature, $salt, $iv, $ct) = split '\$', $hash; @@ -95,12 +76,7 @@ sub module_verify_hash return unless length $salt_bin == 32; return unless length $iv_bin == 16; - - my $ct_len = length ($ct_bin); - my $ct_min_len = 30; - my $ct_max_len = 3136; - - return unless ($ct_len >= $ct_min_len && $ct_len <= $ct_max_len); + return unless length $ct_bin == 64; my $word_packed = pack_if_HEX_notation ($word); diff --git a/tools/test_modules/m29800.pm b/tools/test_modules/m29800.pm index 8854632dd..85c0e8c37 100644 --- a/tools/test_modules/m29800.pm +++ b/tools/test_modules/m29800.pm @@ -12,7 +12,7 @@ use Crypt::ScryptKDF qw (scrypt_raw); use Encode; use Crypt::CBC; -sub module_constraints { [[0, 256], [8, 8], [-1, -1], [-1, -1], [-1, -1]] } +sub module_constraints { [[8, 256], [8, 8], [-1, -1], [-1, -1], [-1, -1]] } my $SCRYPT_N = 32768; my $SCRYPT_R = 8; diff --git a/tools/test_modules/m31900.pm b/tools/test_modules/m31900.pm new file mode 100644 index 000000000..c3dbf5c91 --- /dev/null +++ b/tools/test_modules/m31900.pm @@ -0,0 +1,91 @@ +#!/usr/bin/env perl + +## +## Author......: See docs/credits.txt +## License.....: MIT +## + +use strict; +use warnings; + +use Crypt::PBKDF2; +use Crypt::CBC; +use MIME::Base64 qw (decode_base64 encode_base64); + +sub module_constraints { [[8, 256], [16, 16], [-1, -1], [-1, -1], [-1, -1]] } + +sub module_generate_hash +{ + my $word = shift; + my $salt = shift; + my $iv = shift // random_hex_string (32); + my $ct = shift; + + my $kdf = Crypt::PBKDF2->new + ( + hasher => Crypt::PBKDF2->hasher_from_algorithm ('HMACSHA2', 512), + iterations => 5000, + output_len => 32 + ); + + my $salt_b64 = encode_base64 ($salt, ""); + + my $key = $kdf->PBKDF2 ($salt_b64, $word); + + my $iv_bin = pack ("H*", $iv); + + my $cipher = Crypt::CBC->new ({ + key => $key, + cipher => "Crypt::Rijndael", + iv => $iv_bin, + literal_key => 1, + header => "none", + keysize => 32, + padding => "none" + }); + + my $pt = "[{\"type\":\"HD Key Tree\",\"data\":{\"mnemonic\":\"ocean hidden kidney famous rich season gloom husband spring convince attitude boy\",\"numberOfAccounts\":1,\"hdPath\":\"m/44'/60'/0'/0\"}}]"; + + my $ct1 = substr ($cipher->encrypt ($pt), 0, 16); + + my $hash = sprintf ('$metamaskMobile$%s$%s$%s', $salt_b64, $iv, encode_base64 ($ct1, "")); + + return $hash; +} + +sub module_verify_hash +{ + my $line = shift; + + my $idx = index ($line, ':'); + + return unless $idx >= 0; + + my $hash = substr ($line, 0, $idx); + my $word = substr ($line, $idx + 1); + + return unless substr ($hash, 0, 16) eq '$metamaskMobile$'; + + my (undef, $signature, $salt, $iv, $ct) = split '\$', $hash; + + return unless defined $signature; + return unless defined $salt; + return unless defined $iv; + return unless defined $ct; + + my $salt_b64 = decode_base64 ($salt); + my $iv_bin = pack ("H*", $iv); + my $ct_bin = decode_base64 ($ct); + + return unless length $salt_b64 == 16; + return unless length $iv_bin == 16; + return unless length $ct_bin == 16; + + my $word_packed = pack_if_HEX_notation ($word); + + my $new_hash = module_generate_hash ($word_packed, $salt_b64, $iv, unpack ("H*", $ct_bin)); + + return ($new_hash, $word); +} + +1;