Fix some format in -m 29600

pull/3394/merge
jsteube 2 years ago
parent 126830c378
commit 51b1744805

@ -60,6 +60,7 @@ typedef struct terra
u32 salt_buf[8];
u32 ct[16]; // 16 * 4 = 64 bytes (we have extra 16 bytes in digest: 64 + 16 = 80)
u32 iv[4];
} terra_t;
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)
@ -128,39 +129,41 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (rc_tokenizer != PARSER_OK) return (rc_tokenizer);
// salt
const u8 *salt_pos = token.buf[0];
const int salt_len = token.len[0];
const u8 *iv_pos = token.buf[1];
const int iv_len = token.len[1];
const u8 *hash_pos = token.buf[2];
const int hash_len = token.len[2];
// Populating salt buf even though it's unused - we use esalt below
const bool parse_rc = generic_salt_decode (hashconfig, salt_pos, salt_len, (u8 *) salt->salt_buf, (int *) &salt->salt_len);
if (parse_rc == false) return (PARSER_SALT_LENGTH);
// Set the loop rounds - 1 round is done in the init function
salt->salt_iter = ROUNDS_PBKDF_SHA_TERRA - 1;
// Unhex the salt into the esalt buffer
if (salt_len != 32) return (PARSER_HASH_LENGTH);
terra->salt_buf[0] = hex_to_u32 (salt_pos + 0);
terra->salt_buf[1] = hex_to_u32 (salt_pos + 8);
terra->salt_buf[2] = hex_to_u32 (salt_pos + 16);
terra->salt_buf[3] = hex_to_u32 (salt_pos + 24);
// store IV
const u8 *iv_pos = token.buf[1];
const int iv_len = token.len[1];
if (iv_len != 32) return (PARSER_SALT_LENGTH);
terra->iv[0] = hex_to_u32 (iv_pos + 0);
terra->iv[1] = hex_to_u32 (iv_pos + 8);
terra->iv[2] = hex_to_u32 (iv_pos + 16);
terra->iv[3] = hex_to_u32 (iv_pos + 24);
// Base64 decode the ciphertext
const u8 *hash_pos = token.buf[2];
const int hash_len = token.len[2];
u8 tmp_buf[512];
int tmp_len;

Loading…
Cancel
Save