1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-29 03:18:30 +00:00

Rename purgeclass to purgechar_class, fix lookup tables

This commit is contained in:
Gabriele Gristina 2024-11-02 03:55:22 +01:00
parent d37d26de74
commit cedaef797a
7 changed files with 51 additions and 51 deletions

View File

@ -36,7 +36,7 @@ CONSTANT_AS u8 s_lookup[128] =
// 32: whitespace (1)
1,
// 33-47: punctuation (1)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
// 48-57: digits (0)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 58-64: punctuation (1)
@ -598,7 +598,7 @@ DECLSPEC int mangle_purgechar (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p
return (out_len);
}
DECLSPEC int mangle_purgeclass_l (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
DECLSPEC int mangle_purgechar_class_l (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
{
int out_len = 0;
@ -619,7 +619,7 @@ DECLSPEC int mangle_purgeclass_l (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u
return (out_len);
}
DECLSPEC int mangle_purgeclass_u (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
DECLSPEC int mangle_purgechar_class_u (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
{
int out_len = 0;
@ -640,7 +640,7 @@ DECLSPEC int mangle_purgeclass_u (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u
return (out_len);
}
DECLSPEC int mangle_purgeclass_d (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
DECLSPEC int mangle_purgechar_class_d (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
{
int out_len = 0;
@ -661,7 +661,7 @@ DECLSPEC int mangle_purgeclass_d (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u
return (out_len);
}
DECLSPEC int mangle_purgeclass_lh (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
DECLSPEC int mangle_purgechar_class_lh (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
{
int out_len = 0;
@ -682,7 +682,7 @@ DECLSPEC int mangle_purgeclass_lh (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const
return (out_len);
}
DECLSPEC int mangle_purgeclass_uh (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
DECLSPEC int mangle_purgechar_class_uh (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
{
int out_len = 0;
@ -703,7 +703,7 @@ DECLSPEC int mangle_purgeclass_uh (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const
return (out_len);
}
DECLSPEC int mangle_purgeclass_s (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
DECLSPEC int mangle_purgechar_class_s (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
{
int out_len = 0;
@ -724,14 +724,14 @@ DECLSPEC int mangle_purgeclass_s (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u
return (out_len);
}
DECLSPEC int mangle_purgeclass (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
DECLSPEC int mangle_purgechar_class (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len)
{
if (p0 == 'l') return mangle_purgeclass_l (p0, p1, buf, len);
else if (p0 == 'u') return mangle_purgeclass_u (p0, p1, buf, len);
else if (p0 == 'd') return mangle_purgeclass_d (p0, p1, buf, len);
else if (p0 == 'h') return mangle_purgeclass_lh (p0, p1, buf, len);
else if (p0 == 'H') return mangle_purgeclass_uh (p0, p1, buf, len);
else if (p0 == 's') return mangle_purgeclass_s (p0, p1, buf, len);
if (p0 == 'l') return mangle_purgechar_class_l (p0, p1, buf, len);
else if (p0 == 'u') return mangle_purgechar_class_u (p0, p1, buf, len);
else if (p0 == 'd') return mangle_purgechar_class_d (p0, p1, buf, len);
else if (p0 == 'h') return mangle_purgechar_class_lh (p0, p1, buf, len);
else if (p0 == 'H') return mangle_purgechar_class_uh (p0, p1, buf, len);
else if (p0 == 's') return mangle_purgechar_class_s (p0, p1, buf, len);
return len;
}
@ -966,7 +966,7 @@ DECLSPEC int apply_rule (const u32 name, MAYBE_UNUSED const u8 p0, MAYBE_UNUSED
case RULE_OP_MANGLE_TRUNCATE_AT: out_len = mangle_truncate_at (p0, p1, (PRIVATE_AS u8 *) buf, out_len); break;
case RULE_OP_MANGLE_REPLACE: out_len = mangle_replace (p0, p1, (PRIVATE_AS u8 *) buf, out_len); break;
case RULE_OP_MANGLE_PURGECHAR: out_len = mangle_purgechar (p0, p1, (PRIVATE_AS u8 *) buf, out_len); break;
case RULE_OP_MANGLE_PURGECLASS: out_len = mangle_purgeclass (p0, p1, (PRIVATE_AS u8 *) buf, out_len); break;
case RULE_OP_MANGLE_PURGECHAR_CLASS: out_len = mangle_purgechar_class (p0, p1, (PRIVATE_AS u8 *) buf, out_len); break;
case RULE_OP_MANGLE_DUPECHAR_FIRST: out_len = mangle_dupechar_first (p0, p1, (PRIVATE_AS u8 *) buf, out_len); break;
case RULE_OP_MANGLE_DUPECHAR_LAST: out_len = mangle_dupechar_last (p0, p1, (PRIVATE_AS u8 *) buf, out_len); break;
case RULE_OP_MANGLE_DUPECHAR_ALL: out_len = mangle_dupechar_all (p0, p1, (PRIVATE_AS u8 *) buf, out_len); break;

View File

@ -40,7 +40,7 @@
#define RULE_OP_MANGLE_TRUNCATE_AT '\''
#define RULE_OP_MANGLE_REPLACE 's'
#define RULE_OP_MANGLE_PURGECHAR '@'
#define RULE_OP_MANGLE_PURGECLASS 0x01
#define RULE_OP_MANGLE_PURGECHAR_CLASS 0x01
#define RULE_OP_MANGLE_TOGGLECASE_REC 'a'
#define RULE_OP_MANGLE_DUPECHAR_FIRST 'z'
#define RULE_OP_MANGLE_DUPECHAR_LAST 'Z'
@ -104,7 +104,7 @@ DECLSPEC int mangle_overstrike (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8
DECLSPEC int mangle_truncate_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len);
DECLSPEC int mangle_replace (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len);
DECLSPEC int mangle_purgechar (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len);
DECLSPEC int mangle_purgeclass (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len);
DECLSPEC int mangle_purgechar_class (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len);
DECLSPEC int mangle_dupechar_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len);
DECLSPEC int mangle_dupechar_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len);
DECLSPEC int mangle_dupechar_all (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, PRIVATE_AS u8 *buf, const int len);

View File

@ -21,7 +21,7 @@ CONSTANT_AS u8 s_lookup_optimized[128] =
// 32: whitespace (1)
1,
// 33-47: punctuation (1)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
// 48-57: digits (0)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 58-64: punctuation (1)
@ -1879,7 +1879,7 @@ DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgechar (MAYBE_UNUSED const u32 p0, M
return out_len;
}
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_l (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgechar_class_l (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
{
u32 out_len = 0;
@ -1920,7 +1920,7 @@ DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_l (MAYBE_UNUSED const u32 p0
return out_len;
}
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_u (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgechar_class_u (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
{
u32 out_len = 0;
@ -1961,7 +1961,7 @@ DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_u (MAYBE_UNUSED const u32 p0
return out_len;
}
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_d (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgechar_class_d (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
{
u32 out_len = 0;
@ -2002,7 +2002,7 @@ DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_d (MAYBE_UNUSED const u32 p0
return out_len;
}
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_lh (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgechar_class_lh (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
{
u32 out_len = 0;
@ -2043,7 +2043,7 @@ DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_lh (MAYBE_UNUSED const u32 p
return out_len;
}
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_uh (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgechar_class_uh (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
{
u32 out_len = 0;
@ -2084,7 +2084,7 @@ DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_uh (MAYBE_UNUSED const u32 p
return out_len;
}
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_s (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgechar_class_s (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
{
u32 out_len = 0;
@ -2125,14 +2125,14 @@ DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass_s (MAYBE_UNUSED const u32 p0
return out_len;
}
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgechar_class (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len)
{
if ((u8)p0 == 'l') return rule_op_mangle_purgeclass_l (p0, p1, buf0, buf1, in_len);
else if ((u8)p0 == 'u') return rule_op_mangle_purgeclass_u (p0, p1, buf0, buf1, in_len);
else if ((u8)p0 == 'd') return rule_op_mangle_purgeclass_d (p0, p1, buf0, buf1, in_len);
else if ((u8)p0 == 'h') return rule_op_mangle_purgeclass_lh (p0, p1, buf0, buf1, in_len);
else if ((u8)p0 == 'H') return rule_op_mangle_purgeclass_uh (p0, p1, buf0, buf1, in_len);
else if ((u8)p0 == 's') return rule_op_mangle_purgeclass_s (p0, p1, buf0, buf1, in_len);
if ((u8)p0 == 'l') return rule_op_mangle_purgechar_class_l (p0, p1, buf0, buf1, in_len);
else if ((u8)p0 == 'u') return rule_op_mangle_purgechar_class_u (p0, p1, buf0, buf1, in_len);
else if ((u8)p0 == 'd') return rule_op_mangle_purgechar_class_d (p0, p1, buf0, buf1, in_len);
else if ((u8)p0 == 'h') return rule_op_mangle_purgechar_class_lh (p0, p1, buf0, buf1, in_len);
else if ((u8)p0 == 'H') return rule_op_mangle_purgechar_class_uh (p0, p1, buf0, buf1, in_len);
else if ((u8)p0 == 's') return rule_op_mangle_purgechar_class_s (p0, p1, buf0, buf1, in_len);
return in_len;
}
@ -2693,7 +2693,7 @@ DECLSPEC u32 apply_rule_optimized (const u32 name, const u32 p0, const u32 p1, P
case RULE_OP_MANGLE_TRUNCATE_AT: out_len = rule_op_mangle_truncate_at (p0, p1, buf0, buf1, out_len); break;
case RULE_OP_MANGLE_REPLACE: out_len = rule_op_mangle_replace (p0, p1, buf0, buf1, out_len); break;
case RULE_OP_MANGLE_PURGECHAR: out_len = rule_op_mangle_purgechar (p0, p1, buf0, buf1, out_len); break;
case RULE_OP_MANGLE_PURGECLASS: out_len = rule_op_mangle_purgeclass (p0, p1, buf0, buf1, out_len); break;
case RULE_OP_MANGLE_PURGECHAR_CLASS: out_len = rule_op_mangle_purgechar_class (p0, p1, buf0, buf1, out_len); break;
//case RULE_OP_MANGLE_TOGGLECASE_REC: out_len = rule_op_mangle_togglecase_rec (p0, p1, buf0, buf1, out_len); break;
case RULE_OP_MANGLE_DUPECHAR_FIRST: out_len = rule_op_mangle_dupechar_first (p0, p1, buf0, buf1, out_len); break;
case RULE_OP_MANGLE_DUPECHAR_LAST: out_len = rule_op_mangle_dupechar_last (p0, p1, buf0, buf1, out_len); break;

View File

@ -46,7 +46,7 @@
#define RULE_OP_MANGLE_TRUNCATE_AT '\''
#define RULE_OP_MANGLE_REPLACE 's'
#define RULE_OP_MANGLE_PURGECHAR '@'
#define RULE_OP_MANGLE_PURGECLASS 0x01
#define RULE_OP_MANGLE_PURGECHAR_CLASS 0x01
#define RULE_OP_MANGLE_TOGGLECASE_REC 'a'
#define RULE_OP_MANGLE_DUPECHAR_FIRST 'z'
#define RULE_OP_MANGLE_DUPECHAR_LAST 'Z'
@ -114,7 +114,7 @@ DECLSPEC u32 search_on_register (const u32 in, const u32 p0);
DECLSPEC u32 replace_on_register (const u32 in, const u32 r, const u32 p1);
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_replace (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len);
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgechar (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len);
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgeclass (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len);
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_purgechar_class (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len);
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_dupechar_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len);
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_dupechar_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len);
DECLSPEC HC_INLINE_RP u32 rule_op_mangle_dupechar_all (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED PRIVATE_AS u32 *buf0, MAYBE_UNUSED PRIVATE_AS u32 *buf1, const u32 in_len);

View File

@ -331,7 +331,7 @@ typedef enum rule_functions
RULE_OP_MANGLE_TRUNCATE_AT = '\'',
RULE_OP_MANGLE_REPLACE = 's',
RULE_OP_MANGLE_PURGECHAR = '@',
RULE_OP_MANGLE_PURGECLASS = 0x01,
RULE_OP_MANGLE_PURGECHAR_CLASS = 0x01,
RULE_OP_MANGLE_TOGGLECASE_REC = 'a',
RULE_OP_MANGLE_DUPECHAR_FIRST = 'z',
RULE_OP_MANGLE_DUPECHAR_LAST = 'Z',

View File

@ -410,7 +410,7 @@ int cpu_rule_to_kernel_rule (char *rule_buf, u32 rule_len, kernel_rule_t *rule)
case 'h':
case 'H':
case 's':
SET_NAME (rule, RULE_OP_MANGLE_PURGECLASS);
SET_NAME (rule, RULE_OP_MANGLE_PURGECHAR_CLASS);
SET_P0 (rule, rule_buf[rule_pos+1]);
INCR_POS;
break;
@ -654,7 +654,7 @@ int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule)
if (rule_buf[rule_pos] == '?') rule_buf[++rule_pos] = '?'; // force @??
break;
case RULE_OP_MANGLE_PURGECLASS:
case RULE_OP_MANGLE_PURGECHAR_CLASS:
rule_buf[rule_pos++] = RULE_OP_MANGLE_PURGECHAR;
rule_buf[rule_pos] = '?';
GET_P0 (rule);

View File

@ -347,7 +347,7 @@ static int mangle_purgechar (char arr[RP_PASSWORD_SIZE], int arr_len, char c)
return (ret_len);
}
static int mangle_purgeclass_l (char arr[RP_PASSWORD_SIZE], int arr_len)
static int mangle_purgechar_class_l (char arr[RP_PASSWORD_SIZE], int arr_len)
{
int arr_pos;
@ -365,7 +365,7 @@ static int mangle_purgeclass_l (char arr[RP_PASSWORD_SIZE], int arr_len)
return (ret_len);
}
static int mangle_purgeclass_u (char arr[RP_PASSWORD_SIZE], int arr_len)
static int mangle_purgechar_class_u (char arr[RP_PASSWORD_SIZE], int arr_len)
{
int arr_pos;
@ -383,7 +383,7 @@ static int mangle_purgeclass_u (char arr[RP_PASSWORD_SIZE], int arr_len)
return (ret_len);
}
static int mangle_purgeclass_d (char arr[RP_PASSWORD_SIZE], int arr_len)
static int mangle_purgechar_class_d (char arr[RP_PASSWORD_SIZE], int arr_len)
{
int arr_pos;
@ -401,7 +401,7 @@ static int mangle_purgeclass_d (char arr[RP_PASSWORD_SIZE], int arr_len)
return (ret_len);
}
static int mangle_purgeclass_lh (char arr[RP_PASSWORD_SIZE], int arr_len)
static int mangle_purgechar_class_lh (char arr[RP_PASSWORD_SIZE], int arr_len)
{
int arr_pos;
@ -419,7 +419,7 @@ static int mangle_purgeclass_lh (char arr[RP_PASSWORD_SIZE], int arr_len)
return (ret_len);
}
static int mangle_purgeclass_uh (char arr[RP_PASSWORD_SIZE], int arr_len)
static int mangle_purgechar_class_uh (char arr[RP_PASSWORD_SIZE], int arr_len)
{
int arr_pos;
@ -437,7 +437,7 @@ static int mangle_purgeclass_uh (char arr[RP_PASSWORD_SIZE], int arr_len)
return (ret_len);
}
static int mangle_purgeclass_s (char arr[RP_PASSWORD_SIZE], int arr_len)
static int mangle_purgechar_class_s (char arr[RP_PASSWORD_SIZE], int arr_len)
{
int arr_pos;
@ -455,14 +455,14 @@ static int mangle_purgeclass_s (char arr[RP_PASSWORD_SIZE], int arr_len)
return (ret_len);
}
static int mangle_purgeclass (char arr[RP_PASSWORD_SIZE], int arr_len, char c)
static int mangle_purgechar_class (char arr[RP_PASSWORD_SIZE], int arr_len, char c)
{
if (c == 'l') return mangle_purgeclass_l (arr, arr_len);
else if (c == 'u') return mangle_purgeclass_u (arr, arr_len);
else if (c == 'd') return mangle_purgeclass_d (arr, arr_len);
else if (c == 'h') return mangle_purgeclass_lh (arr, arr_len);
else if (c == 'H') return mangle_purgeclass_uh (arr, arr_len);
else if (c == 's') return mangle_purgeclass_s (arr, arr_len);
if (c == 'l') return mangle_purgechar_class_l (arr, arr_len);
else if (c == 'u') return mangle_purgechar_class_u (arr, arr_len);
else if (c == 'd') return mangle_purgechar_class_d (arr, arr_len);
else if (c == 'h') return mangle_purgechar_class_lh (arr, arr_len);
else if (c == 'H') return mangle_purgechar_class_uh (arr, arr_len);
else if (c == 's') return mangle_purgechar_class_s (arr, arr_len);
return (arr_len);
}
@ -839,7 +839,7 @@ int _old_apply_rule (const char *rule, int rule_len, char in[RP_PASSWORD_SIZE],
case 'd':
case 'h':
case 'H':
case 's': out_len = mangle_purgeclass (out, out_len, rule_new[rule_pos]); break;
case 's': out_len = mangle_purgechar_class (out, out_len, rule_new[rule_pos]); break;
default : HCFREE_AND_RETURN (RULE_RC_SYNTAX_ERROR);
}