mirror of
https://github.com/hashcat/hashcat
synced 2024-11-24 14:27:14 +01:00
Support 64 bit timestamps properly
This commit is contained in:
parent
770e21e5ee
commit
fddfd835d2
@ -32,7 +32,7 @@ __kernel void m18100_mxx (__global pw_t *pws, __constant const kernel_rule_t *ru
|
||||
|
||||
COPY_PW (pws[gid]);
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
const u32 salt_len = 8;
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
@ -125,7 +125,7 @@ __kernel void m18100_sxx (__global pw_t *pws, __constant const kernel_rule_t *ru
|
||||
|
||||
COPY_PW (pws[gid]);
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
const u32 salt_len = 8;
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
|
@ -37,7 +37,7 @@ __kernel void m18100_mxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
w[idx] = swap32_S (pws[gid].i[idx]);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
const u32 salt_len = 8;
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
@ -155,7 +155,7 @@ __kernel void m18100_sxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
w[idx] = swap32_S (pws[gid].i[idx]);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
const u32 salt_len = 8;
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
|
@ -37,7 +37,7 @@ __kernel void m18100_mxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
w[idx] = pws[gid].i[idx];
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
const u32 salt_len = 8;
|
||||
|
||||
u32x s[64] = { 0 };
|
||||
|
||||
@ -141,7 +141,7 @@ __kernel void m18100_sxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
w[idx] = pws[gid].i[idx];
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
const u32 salt_len = 8;
|
||||
|
||||
u32x s[64] = { 0 };
|
||||
|
||||
|
@ -5201,6 +5201,10 @@ int totp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE
|
||||
// convert ascii timestamp to ulong timestamp
|
||||
u64 timestamp = hc_strtoull ((const char *) salt_pos, NULL, 10);
|
||||
|
||||
// store the original salt value. Step division will destroy granularity for output
|
||||
salt->salt_buf[3] = ((u32) (timestamp >> 0));
|
||||
salt->salt_buf[2] = ((u32) (timestamp >> 32));
|
||||
|
||||
// divide our timestamp by our step. We will use the RFC 6238 default of 30 for now
|
||||
timestamp /= 30;
|
||||
|
||||
@ -5208,8 +5212,8 @@ int totp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE
|
||||
salt->salt_buf[1] = byte_swap_32 ((u32) (timestamp >> 0));
|
||||
salt->salt_buf[0] = byte_swap_32 ((u32) (timestamp >> 32));
|
||||
|
||||
// our salt will always be 8 bytes
|
||||
salt->salt_len = 8;
|
||||
// our salt will always be 8 bytes, but we are going to cheat and store it twice, so...
|
||||
salt->salt_len = 16;
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
@ -22331,8 +22335,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
||||
// we also need to multiply salt by our step to see the floor of our original timestamp range.
|
||||
// again, we will use the default RFC 6238 step of 30.
|
||||
|
||||
u64 tmp_salt_buf = (((u64) byte_swap_32 (salt.salt_buf[0])) << 32) | ((u64) byte_swap_32 (salt.salt_buf[1]));
|
||||
tmp_salt_buf *= 30;
|
||||
u64 tmp_salt_buf = (((u64) (salt.salt_buf[2])) << 32) | ((u64) (salt.salt_buf[3]));
|
||||
|
||||
snprintf (out_buf, out_len - 1, "%06d:%llu", digest_buf[1], tmp_salt_buf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user