summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/src/secureim.h
blob: 5dcb462f8ceaeb19fc58447a7d5dc009c15739fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef __SECURE_IM__
#define __SECURE_IM__

// ðåæèìû øèôðîâàíèÿ SecureIM
#define MODE_NATIVE	0
#define MODE_PGP	1
#define MODE_GPG	2
#define MODE_RSAAES	3
#define MODE_CNT	(3+1)
#define MODE_RSA	4

#define SECURED		0x10

// ñòàòóñû äëÿ Native è RSA/AES ðåæèìîâ
#define STATUS_DISABLED		0
#define STATUS_ENABLED		1
#define STATUS_ALWAYSTRY	2

#define SiG_KEYR 0
#define SiG_KEY3 SiG_KEYR
#define SiG_KEY4 SiG_KEYR
#define SiG_ENON 1
#define SiG_ENOF 2
#define SiG_RSND 3
#define SiG_INIT 4
#define SiG_DEIN 5
#define SiG_DISA 6
#define SiG_FAKE 7
#define SiG_KEYA 8
#define SiG_KEYB 9
#define SiG_PART 10
#define SiG_SECU 11
#define SiG_SECP 12
#define SiG_PGPM 13
#define SiG_NONE -1
#define SiG_GAME -2

struct SIG {
	char *sig;
	BYTE len;
	char key;
};

const SIG signs[] = {
	{"----Key3@hell----",           17,   SiG_KEYR},
   {"----Key4@hell----",           17,   SiG_KEYR},
   {"----Secured@hell----",        20,   SiG_ENON},
   {"----Offline@hell----",        20,   SiG_ENOF},
   {"----Resend@hell----",         19,   SiG_RSND},
   {"----INIT@HELL----",           17,   SiG_INIT},
   {"----DEINIT@HELL----",         19,   SiG_DEIN},
   {"----DISABLED@HELL----",       21,   SiG_DISA},
   {"----FAKE@HELL----",           17,   SiG_FAKE},
   {"----KeyA@hell----",           17,   SiG_KEYA},
   {"----KeyB@hell----",           17,   SiG_KEYB},
   {"----Part@hell----",           17,   SiG_PART},
   {"[SECURE]",                     8,   SiG_SECU},
   {"[$ECURE]",                     8,   SiG_SECP},
   {"-----BEGIN PGP MESSAGE-----", 27,   SiG_PGPM},
   {"@@BattleShip",                12,   SiG_GAME},
   {"GoMoku 0.0.2.2:",             15,   SiG_GAME},
   {"@@GoMoku",                     8,   SiG_GAME},
   {"pbiChess:",                    9,   SiG_GAME},
   {"pbiReverse:",                 11,   SiG_GAME},
   {"pbiCorners:",                 11,   SiG_GAME},
   {"pbiCheckersInt:",             15,   SiG_GAME},
   {"pbiCheckersRus:",             15,   SiG_GAME},
   {"pbiCheckersPool:",            16,   SiG_GAME},
	{0}
};

#define SIG_KEY3 signs[ 0].sig
#define SIG_KEY4 signs[ 1].sig
#define SIG_ENON signs[ 2].sig
#define SIG_ENOF signs[ 3].sig
#define SIG_RSND signs[ 4].sig
#define SIG_INIT signs[ 5].sig
#define SIG_DEIN signs[ 6].sig
#define SIG_DISA signs[ 7].sig
#define SIG_FAKE signs[ 8].sig
#define SIG_KEYA signs[ 9].sig
#define SIG_KEYB signs[10].sig
#define SIG_PART signs[11].sig
#define SIG_SECU signs[12].sig
#define SIG_SECP signs[13].sig

#define LEN_KEY3 signs[ 0].len
#define LEN_KEY4 signs[ 1].len
#define LEN_ENON signs[ 2].len
#define LEN_ENOF signs[ 3].len
#define LEN_RSND signs[ 4].len
#define LEN_INIT signs[ 5].len
#define LEN_DEIN signs[ 6].len
#define LEN_DISA signs[ 7].len
#define LEN_FAKE signs[ 8].len
#define LEN_KEYA signs[ 9].len
#define LEN_KEYB signs[10].len
#define LEN_PART signs[11].len
#define LEN_SECU signs[12].len
#define LEN_SECP signs[13].len

#define TBL_IEC		0x01
#define TBL_ICO		0x02
#define TBL_POP		0x03

#define IEC_CL_DIS	0x00
#define IEC_CL_EST	0x01
#define IEC_CNT		(0x01+1)

#define ICO_CM_DIS	0x00
#define ICO_CM_EST	0x01
#define ICO_MW_DIS	0x02
#define ICO_MW_EST	0x03
#define ICO_ST_DIS 	0x04
#define ICO_ST_ENA	0x05
#define ICO_ST_TRY	0x06
#define ICO_OV_NAT	0x07
#define ICO_OV_PGP	0x08
#define ICO_OV_GPG	0x09
#define ICO_OV_RSA	0x0A
#define ICO_CNT		(0x0A+1)

#define POP_PU_DIS	0x00
#define POP_PU_EST	0x01
#define POP_PU_PRC	0x02
#define POP_PU_MSR	0x03
#define POP_PU_MSS	0x04
#define POP_CNT		(0x04+1)

#define ADV_CNT		8
#define ALL_CNT		(IEC_CNT+ICO_CNT+POP_CNT)

#endif