#include "module.h"#include <string.h>
Go to the source code of this file.
Data Structures | |
| struct | MD5_CTX |
Defines | |
| #define | S11 7 |
| #define | S12 12 |
| #define | S13 17 |
| #define | S14 22 |
| #define | S21 5 |
| #define | S22 9 |
| #define | S23 14 |
| #define | S24 20 |
| #define | S31 4 |
| #define | S32 11 |
| #define | S33 16 |
| #define | S34 23 |
| #define | S41 6 |
| #define | S42 10 |
| #define | S43 15 |
| #define | S44 21 |
| #define | F(x, y, z) (((x) & (y)) | ((~x) & (z))) |
| #define | G(x, y, z) (((x) & (z)) | ((y) & (~z))) |
| #define | H(x, y, z) ((x) ^ (y) ^ (z)) |
| #define | MD5_I(x, y, z) ((y) ^ ((x) | (~z))) |
| #define | ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) |
| #define | FF(a, b, c, d, x, s, ac) |
| #define | GG(a, b, c, d, x, s, ac) |
| #define | HH(a, b, c, d, x, s, ac) |
| #define | II(a, b, c, d, x, s, ac) |
| #define | XTOI(c) ((c)>9 ? (c)-'A'+10 : (c)-'0') |
Typedefs | |
| typedef unsigned int | UINT4 |
| typedef void * | POINTER |
Functions | |
| static void | my_binary_to_hex (unsigned char *bin, char *hex, int length) |
| static void | MD5Transform (UINT4[4], unsigned char[64]) |
| static void | Encode (unsigned char *, UINT4 *, unsigned int) |
| static void | Decode (UINT4 *, unsigned char *, unsigned int) |
| static void | MD5Init (MD5_CTX *context) |
| static void | MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen) |
| static void | MD5Final (digest, MD5_CTX *context) |
| static void | MD5Transform (state, block) |
| static int | old_encrypt (const char *src, int len, char *dest, int size) |
| static int | old_encrypt_check_len (int passlen, int bufsize) |
| static int | old_check_password (const char *plaintext, const char *password) |
| static int | old_decrypt (const char *src, char *dest, int size) |
| int | AnopeInit (int argc, char **argv) |
| void | AnopeFini (void) |
Variables | |
| static unsigned char | PADDING [64] |
| #define FF | ( | a, | ||
| b, | ||||
| c, | ||||
| d, | ||||
| x, | ||||
| s, | ||||
| ac | ||||
| ) |
{ \
(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
Definition at line 117 of file enc_old.c.
Referenced by MD5Transform().
| #define GG | ( | a, | ||
| b, | ||||
| c, | ||||
| d, | ||||
| x, | ||||
| s, | ||||
| ac | ||||
| ) |
{ \
(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
Definition at line 122 of file enc_old.c.
Referenced by MD5Transform().
| #define HH | ( | a, | ||
| b, | ||||
| c, | ||||
| d, | ||||
| x, | ||||
| s, | ||||
| ac | ||||
| ) |
{ \
(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
Definition at line 127 of file enc_old.c.
Referenced by MD5Transform().
| #define II | ( | a, | ||
| b, | ||||
| c, | ||||
| d, | ||||
| x, | ||||
| s, | ||||
| ac | ||||
| ) |
{ \
(a) += MD5_I ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
Definition at line 132 of file enc_old.c.
Referenced by MD5Transform().
| #define ROTATE_LEFT | ( | x, | ||
| n | ||||
| ) | (((x) << (n)) | ((x) >> (32-(n)))) |
| #define S11 7 |
Definition at line 76 of file enc_old.c.
Referenced by MD5Transform().
| #define S12 12 |
Definition at line 77 of file enc_old.c.
Referenced by MD5Transform().
| #define S13 17 |
Definition at line 78 of file enc_old.c.
Referenced by MD5Transform().
| #define S14 22 |
Definition at line 79 of file enc_old.c.
Referenced by MD5Transform().
| #define S21 5 |
Definition at line 80 of file enc_old.c.
Referenced by MD5Transform().
| #define S22 9 |
Definition at line 81 of file enc_old.c.
Referenced by MD5Transform().
| #define S23 14 |
Definition at line 82 of file enc_old.c.
Referenced by MD5Transform().
| #define S24 20 |
Definition at line 83 of file enc_old.c.
Referenced by MD5Transform().
| #define S31 4 |
Definition at line 84 of file enc_old.c.
Referenced by MD5Transform().
| #define S32 11 |
Definition at line 85 of file enc_old.c.
Referenced by MD5Transform().
| #define S33 16 |
Definition at line 86 of file enc_old.c.
Referenced by MD5Transform().
| #define S34 23 |
Definition at line 87 of file enc_old.c.
Referenced by MD5Transform().
| #define S41 6 |
Definition at line 88 of file enc_old.c.
Referenced by MD5Transform().
| #define S42 10 |
Definition at line 89 of file enc_old.c.
Referenced by MD5Transform().
| #define S43 15 |
Definition at line 90 of file enc_old.c.
Referenced by MD5Transform().
| #define S44 21 |
Definition at line 91 of file enc_old.c.
Referenced by MD5Transform().
Definition at line 354 of file enc_old.c.
Referenced by old_encrypt().
| void AnopeFini | ( | void | ) |
Definition at line 433 of file enc_old.c.
References encmodule_check_password(), encmodule_decrypt(), encmodule_encrypt(), and encmodule_encrypt_check_len().
| int AnopeInit | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 419 of file enc_old.c.
References encmodule_check_password(), encmodule_decrypt(), encmodule_encrypt(), encmodule_encrypt_check_len(), ENCRYPTION, moduleAddAuthor(), moduleAddVersion(), moduleSetType(), old_check_password(), old_decrypt(), old_encrypt(), and old_encrypt_check_len().
| static void Decode | ( | UINT4 * | output, | |
| unsigned char * | input, | |||
| unsigned int | len | |||
| ) | [static] |
Definition at line 336 of file enc_old.c.
Referenced by MD5Transform().
| static void Encode | ( | unsigned char * | output, | |
| UINT4 * | input, | |||
| unsigned int | len | |||
| ) | [static] |
Definition at line 318 of file enc_old.c.
Referenced by MD5Final().
| static void MD5Final | ( | digest | , | |
| MD5_CTX * | context | |||
| ) | [static] |
Definition at line 197 of file enc_old.c.
References MD5_CTX::count, Encode(), MD5Update(), PADDING, and MD5_CTX::state.
Referenced by old_encrypt().
| static void MD5Init | ( | MD5_CTX * | context | ) | [static] |
Definition at line 140 of file enc_old.c.
Referenced by old_encrypt().
| static void MD5Transform | ( | state | , | |
| block | ||||
| ) | [static] |
| static void MD5Transform | ( | UINT4 | [4], | |
| unsigned | char[64] | |||
| ) | [static] |
Referenced by MD5Update().
| static void MD5Update | ( | MD5_CTX * | context, | |
| unsigned char * | input, | |||
| unsigned int | inputLen | |||
| ) | [static] |
Definition at line 156 of file enc_old.c.
References MD5Transform().
Referenced by MD5Final(), and old_encrypt().
| static void my_binary_to_hex | ( | unsigned char * | bin, | |
| char * | hex, | |||
| int | length | |||
| ) | [static] |
Definition at line 16 of file enc_old.c.
Referenced by old_encrypt().
| static int old_check_password | ( | const char * | plaintext, | |
| const char * | password | |||
| ) | [static] |
| static int old_decrypt | ( | const char * | src, | |
| char * | dest, | |||
| int | size | |||
| ) | [static] |
Definition at line 414 of file enc_old.c.
Referenced by AnopeInit().
| static int old_encrypt | ( | const char * | src, | |
| int | len, | |||
| char * | dest, | |||
| int | size | |||
| ) | [static] |
Definition at line 361 of file enc_old.c.
References alog(), debug, MD5Final(), MD5Init(), MD5Update(), my_binary_to_hex(), and XTOI.
Referenced by AnopeInit(), and old_check_password().
| static int old_encrypt_check_len | ( | int | passlen, | |
| int | bufsize | |||
| ) | [static] |
unsigned char PADDING[64] [static] |
{
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}
Definition at line 97 of file enc_old.c.
Referenced by MD5Final().
1.7.1