mirror of
https://github.com/hashcat/hashcat.git
synced 2025-06-26 09:52:37 +00:00
Merge pull request #3291 from philsmd/29100_code_style
minor code style changes in -m 29100 = Flask
This commit is contained in:
commit
ec0d33d666
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author......: See docs/credits.txt
|
* Author......: See docs/credits.txt
|
||||||
* License.....: MIT
|
* License.....: MIT
|
||||||
@ -11,7 +9,6 @@
|
|||||||
#include "bitops.h"
|
#include "bitops.h"
|
||||||
#include "convert.h"
|
#include "convert.h"
|
||||||
#include "shared.h"
|
#include "shared.h"
|
||||||
#include "emu_inc_hash_md5.h"
|
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
static const u32 ATTACK_EXEC = ATTACK_EXEC_INSIDE_KERNEL;
|
static const u32 ATTACK_EXEC = ATTACK_EXEC_INSIDE_KERNEL;
|
||||||
@ -82,6 +79,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
| TOKEN_ATTR_VERIFY_BASE64C;
|
| TOKEN_ATTR_VERIFY_BASE64C;
|
||||||
|
|
||||||
const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token);
|
const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token);
|
||||||
|
|
||||||
if (rc_tokenizer != PARSER_OK) return (rc_tokenizer);
|
if (rc_tokenizer != PARSER_OK) return (rc_tokenizer);
|
||||||
|
|
||||||
const int salt1_len = token.len[0];
|
const int salt1_len = token.len[0];
|
||||||
@ -100,9 +98,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
|
|
||||||
|
|
||||||
u8 tmp_buf[100] = { 0 };
|
u8 tmp_buf[100] = { 0 };
|
||||||
|
|
||||||
const int decoded_len = base64_decode (base64url_to_int, hash_pos, hash_len, tmp_buf);
|
const int decoded_len = base64_decode (base64url_to_int, hash_pos, hash_len, tmp_buf);
|
||||||
|
|
||||||
if (decoded_len != 20) return (PARSER_HASH_LENGTH);
|
if (decoded_len != 20) return (PARSER_HASH_LENGTH);
|
||||||
|
|
||||||
memcpy (digest_buf, tmp_buf, 20);
|
memcpy (digest_buf, tmp_buf, 20);
|
||||||
|
|
||||||
u32 *digest = (u32 *) digest_buf;
|
u32 *digest = (u32 *) digest_buf;
|
||||||
|
|
||||||
digest[0] = byte_swap_32 (digest[0]);
|
digest[0] = byte_swap_32 (digest[0]);
|
||||||
@ -121,6 +123,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
char tmp_buf[128] = { 0 };
|
char tmp_buf[128] = { 0 };
|
||||||
|
|
||||||
char ptr_plain[128];
|
char ptr_plain[128];
|
||||||
|
|
||||||
u32 tmp[5];
|
u32 tmp[5];
|
||||||
|
|
||||||
tmp[0] = byte_swap_32 (digest32[0]);
|
tmp[0] = byte_swap_32 (digest32[0]);
|
||||||
@ -130,6 +133,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
tmp[4] = byte_swap_32 (digest32[4]);
|
tmp[4] = byte_swap_32 (digest32[4]);
|
||||||
|
|
||||||
memcpy (tmp_buf, tmp, 20);
|
memcpy (tmp_buf, tmp, 20);
|
||||||
|
|
||||||
base64_encode (int_to_base64url, (const u8 *) tmp_buf, 48, (u8 *) ptr_plain);
|
base64_encode (int_to_base64url, (const u8 *) tmp_buf, 48, (u8 *) ptr_plain);
|
||||||
|
|
||||||
ptr_plain[27] = 0;
|
ptr_plain[27] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user