mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 16:18:09 +00:00
Fix formatting to comply with hashcat coding guidelines
This commit is contained in:
parent
23ee9379c1
commit
db4ec8ed2c
@ -67,7 +67,7 @@ __kernel void m18100_mxx (__global pw_t *pws, __constant const kernel_rule_t *ru
|
||||
|
||||
// grab 4 consecutive bytes of the hash, starting at offset
|
||||
// on some systems, &3 is faster than %4, so we will use it in our switch()
|
||||
switch(otp_offset&3)
|
||||
switch(otp_offset & 3)
|
||||
{
|
||||
case 1:
|
||||
otp_code = ((ctx.opad.h[otp_offset/4] & 0x00ffffff) << 8) | ((ctx.opad.h[otp_offset/4+1] & 0xff000000) >> 24);
|
||||
@ -160,7 +160,7 @@ __kernel void m18100_sxx (__global pw_t *pws, __constant const kernel_rule_t *ru
|
||||
|
||||
// grab 4 consecutive bytes of the hash, starting at offset
|
||||
// on some systems, &3 is faster than %4, so we will use it in our switch()
|
||||
switch(otp_offset&3)
|
||||
switch(otp_offset & 3)
|
||||
{
|
||||
case 1:
|
||||
otp_code = ((ctx.opad.h[otp_offset/4] & 0x00ffffff) << 8) | ((ctx.opad.h[otp_offset/4+1] & 0xff000000) >> 24);
|
||||
|
@ -76,7 +76,7 @@ __kernel void m18100_mxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
|
||||
// grab 4 consecutive bytes of the hash, starting at offset
|
||||
// on some systems, &3 is faster than %4, so we will use it in our switch()
|
||||
switch(otp_offset&3)
|
||||
switch(otp_offset & 3)
|
||||
{
|
||||
case 1:
|
||||
otp_code = ((ctx.opad.h[otp_offset/4] & 0x00ffffff) << 8) | ((ctx.opad.h[otp_offset/4+1] & 0xff000000) >> 24);
|
||||
@ -180,7 +180,7 @@ __kernel void m18100_sxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
|
||||
// grab 4 consecutive bytes of the hash, starting at offset
|
||||
// on some systems, &3 is faster than %4, so we will use it in our switch()
|
||||
switch(otp_offset&3)
|
||||
switch(otp_offset & 3)
|
||||
{
|
||||
case 1:
|
||||
otp_code = ((ctx.opad.h[otp_offset/4] & 0x00ffffff) << 8) | ((ctx.opad.h[otp_offset/4+1] & 0xff000000) >> 24);
|
||||
|
@ -284,10 +284,10 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
||||
|
||||
// encode our plain
|
||||
base32_encode (int_to_base32, (const u8 *) plain_ptr, plain_len, (u8 *) temp_buf);
|
||||
plain_len = strlen((const char *) temp_buf);
|
||||
plain_len = strlen ((const char *) temp_buf);
|
||||
|
||||
// copy the base32 content into our plain buffer
|
||||
plain_ptr = (u8 *) strdup((const char *) temp_ptr);
|
||||
plain_ptr = (u8 *) strdup ((const char *) temp_ptr);
|
||||
}
|
||||
|
||||
// crackpos
|
||||
|
@ -5193,7 +5193,7 @@ int totp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE
|
||||
int otp_code = 0;
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
otp_code = otp_code * 10 + itoa32_to_int(input_buf[i]);
|
||||
otp_code = otp_code * 10 + itoa32_to_int (input_buf[i]);
|
||||
}
|
||||
if (rc_tokenizer != PARSER_OK) return (rc_tokenizer);
|
||||
|
||||
@ -5203,16 +5203,14 @@ int totp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE
|
||||
|
||||
// convert ascii timestamp to ulong timestamp
|
||||
unsigned long timestamp = 0;
|
||||
timestamp = hc_strtoul((const char *) salt_pos, NULL, 10);
|
||||
timestamp = hc_strtoul ((const char *) salt_pos, NULL, 10);
|
||||
|
||||
// divide our timestamp by our step. We will use the RFC 6238 default of 30 for now
|
||||
timestamp /= 30;
|
||||
|
||||
// convert counter to 8-byte salt
|
||||
for (int i = 2; i--; timestamp >>= 32)
|
||||
{
|
||||
salt->salt_buf[i] = byte_swap_32(timestamp);
|
||||
}
|
||||
salt->salt_buf[1] = byte_swap_32 (timestamp);
|
||||
salt->salt_buf[0] = byte_swap_32 (timestamp >> 32);
|
||||
|
||||
// our salt will always be 8 bytes
|
||||
salt->salt_len = 8;
|
||||
@ -22337,7 +22335,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
||||
// for now, we only need to worry about 32 bit counters.
|
||||
// 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.
|
||||
snprintf (out_buf, out_len - 1, "%06d:%d", digest_buf[1], byte_swap_32(salt.salt_buf[1]) * 30);
|
||||
snprintf (out_buf, out_len - 1, "%06d:%d", digest_buf[1], byte_swap_32 (salt.salt_buf[1]) * 30);
|
||||
}
|
||||
else if (hash_mode == 99999)
|
||||
{
|
||||
|
@ -9974,8 +9974,8 @@ END_CODE
|
||||
}
|
||||
elsif ($mode == 18100)
|
||||
{
|
||||
my $paddedTime = sprintf("%016x", int(int($salt_buf) / 30));
|
||||
my $data = pack('H*', $paddedTime);
|
||||
my $paddedTime = sprintf ("%016x", int (int ($salt_buf) / 30));
|
||||
my $data = pack ('H*', $paddedTime);
|
||||
my $key = $word_buf;
|
||||
|
||||
$hash_buf = hmac_hex ($data, $key, \&sha1, 64);
|
||||
@ -9987,7 +9987,7 @@ END_CODE
|
||||
$token %= 1000000;
|
||||
|
||||
## token must be leading zero padded, and salt leading zero stripped
|
||||
$tmp_hash = sprintf ("%06d:%d", $token, int($salt_buf));
|
||||
$tmp_hash = sprintf ("%06d:%d", $token, int ($salt_buf));
|
||||
}
|
||||
elsif ($mode == 99999)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user