-
Notifications
You must be signed in to change notification settings - Fork 1
/
SecBbox.inc
327 lines (288 loc) · 5.75 KB
/
SecBbox.inc
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
{$ifdef CLR}
{$DEFINE DELPHI_NET}
{$DEFINE NET_registered}
{$endif}
{$ifndef DELPHI_NET}
{$ifndef WIN32}
{$ifndef LINUX}
{$define WIN32}
{$endif}
{$endif}
{$endif}
// we currently support Linux only on x86
{$ifdef LINUX}
{$define SB_X86ASM}
{$endif}
{$ifdef WIN32}
{$define SB_X86ASM}
{$endif}
// by default we are on 32-bit CPU
{$define SB_CPU32}
{$ifdef CPU64}
{$define SB_CPU64}
{$undef SB_CPU32}
{$endif}
{$ifndef CLR}
{$ifndef FPC}
{$define DELPHI_WIN}
{$endif}
{$endif}
{$IFDEF FPC} // set mode only with FreePascal, since Delphi doesn't know it
{$MODE DELPHI}
{$ENDIF FPC}
{$IFDEF VER120}
{$DEFINE D_3_UP}
{$DEFINE D_4_UP}
{$DEFINE VCL40}
{$ENDIF}
{$IFDEF VER125}
{$DEFINE B_3_UP}
{$DEFINE B_4_UP}
{$DEFINE B_4}
{$DEFINE VCL40}
{$DEFINE BUILDER_USED}
{$ENDIF}
{$IFDEF VER130}
{$IFDEF BCB}
{$DEFINE B_3_UP}
{$DEFINE B_4_UP}
{$DEFINE B_5_UP}
{$DEFINE B_5}
{$DEFINE VCL40}
{$DEFINE VCL50}
{$DEFINE BUILDER_USED}
{$ELSE}
{$DEFINE D_3_UP}
{$DEFINE D_4_UP}
{$DEFINE D_5_UP}
{$DEFINE VCL40}
{$DEFINE VCL50}
{.DEFINE USEADO}
{$ENDIF}
{$ENDIF}
{$IFDEF VER140}
{$IFDEF BCB}
{$DEFINE B_3_UP}
{$DEFINE B_4_UP}
{$DEFINE B_5_UP}
{$DEFINE B_6_UP}
{$DEFINE B_6}
{$DEFINE VCL40}
{$DEFINE VCL50}
{$DEFINE VCL60}
{$DEFINE BUILDER_USED}
{$ELSE}
{$DEFINE D_3_UP}
{$DEFINE D_4_UP}
{$DEFINE D_5_UP}
{$DEFINE D_6_UP}
{$DEFINE D_6}
{$DEFINE VCL40}
{$DEFINE VCL50}
{$DEFINE VCL60}
{.DEFINE USEADO}
{$ENDIF}
{$ENDIF}
{$IFDEF VER150}
{$IFNDEF BCB}
{$DEFINE D_3_UP}
{$DEFINE D_4_UP}
{$DEFINE D_5_UP}
{$DEFINE D_6_UP}
{$DEFINE D_7_UP}
{$DEFINE D_7}
{$DEFINE VCL40}
{$DEFINE VCL50}
{$DEFINE VCL60}
{$DEFINE VCL70}
{.DEFINE USEADO}
{$ENDIF}
{$ENDIF}
{$IFDEF VER160}
{$DEFINE D_3_UP}
{$DEFINE D_4_UP}
{$DEFINE D_5_UP}
{$DEFINE D_6_UP}
{$DEFINE D_7_UP}
{$DEFINE D_8_UP}
{$DEFINE D_8}
{$DEFINE VCL40}
{$DEFINE VCL50}
{$DEFINE VCL60}
{$DEFINE VCL70}
{$DEFINE VCL80}
{.$DEFINE USE_NAME_SPACE} // Optional !!!
{$ENDIF}
{$IFDEF VER170}
{$DEFINE D_3_UP}
{$DEFINE D_4_UP}
{$DEFINE D_5_UP}
{$DEFINE D_6_UP}
{$DEFINE D_7_UP}
{$DEFINE D_8_UP}
{$DEFINE D_9_UP}
{$DEFINE D_9}
{$DEFINE VCL40}
{$DEFINE VCL50}
{$DEFINE VCL60}
{$DEFINE VCL70}
{$DEFINE VCL80}
{$DEFINE VCL90}
{.$DEFINE USE_NAME_SPACE} // Optional !!!
{$ENDIF}
{$IFDEF VER180}
{$DEFINE D_3_UP}
{$DEFINE D_4_UP}
{$DEFINE D_5_UP}
{$DEFINE D_6_UP}
{$DEFINE D_7_UP}
{$DEFINE D_8_UP}
{$DEFINE D_9_UP}
{$DEFINE D_X_UP}
{$DEFINE D_X}
{$DEFINE VCL40}
{$DEFINE VCL50}
{$DEFINE VCL60}
{$DEFINE VCL70}
{$DEFINE VCL80}
{$DEFINE VCL90}
{$DEFINE VCL100}
{$DEFINE B_3_UP}
{$DEFINE B_4_UP}
{$DEFINE B_5_UP}
{$DEFINE B_6_UP}
{$DEFINE B_X_UP}
{$DEFINE B_X}
{$ifndef DELPHI_NET}
{$DEFINE BUILDER_USED}
{$endif}
{$ENDIF}
{$IFDEF VER190}
{$DEFINE D_3_UP}
{$DEFINE D_4_UP}
{$DEFINE D_5_UP}
{$DEFINE D_6_UP}
{$DEFINE D_7_UP}
{$DEFINE D_8_UP}
{$DEFINE D_9_UP}
{$DEFINE D_X_UP}
{$DEFINE D_11_UP}
{$DEFINE D_11}
{$DEFINE VCL40}
{$DEFINE VCL50}
{$DEFINE VCL60}
{$DEFINE VCL70}
{$DEFINE VCL80}
{$DEFINE VCL90}
{$DEFINE VCL100}
{$DEFINE VCL110}
{$DEFINE B_3_UP}
{$DEFINE B_4_UP}
{$DEFINE B_5_UP}
{$DEFINE B_6_UP}
{$DEFINE B_X_UP}
{$DEFINE B_11_UP}
{$DEFINE B_11}
{$ifndef DELPHI_NET}
{$DEFINE BUILDER_USED}
{$endif}
{$ENDIF}
{$ifndef CHROME}
{$ifndef DELPHI_NET}
{$IFDEF D_7_UP}
{$WARN UNSAFE_CODE OFF}
{$WARN UNSAFE_TYPE OFF}
{$WARN UNSAFE_CAST OFF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ifdef DELPHI_NET}
{$undef SB_ACTIVEX_MODE}
{$endif}
{$ifdef LINUX}
{$define KYLIX_USED}
{$define CLX_USED}
{$else}
{$define MSWINDOWS}
{$endif}
{$ifndef CHROME}
{$ifdef BUILDER_USED}
{$OBJEXPORTALL ON}
{$endif}
{$endif}
{.$define SBB_EVAL}
{$ifndef CHROME}
{$ifndef FPC}
{$Q-,R-,I-,J-}
{$endif}
{$endif}
// since there's no PGP in C++Builder 4 and 5, we exclude it's use from XML
{$ifdef B_4}
{$define SBB_EXCL_XML_PGP}
{$endif}
{$ifdef B_5}
{$define SBB_EXCL_XML_PGP}
{.$define SBB_EXCL_XPATH}
{.$define SBB_NO_PKCS11}
{$endif}
{$ifdef B_6}
{$define SBB_NO_PKCS11}
{$endif}
{$DEFINE COMPLEXENCODING_SUPPORT}
{$ifndef LINUX}
{$ifndef DELPHI_NET}
{$DEFINE NTLM_SUPPORT}
{$endif}
{$endif}
{$ifdef LINUX}
{$undef NTLM_SUPPORT}
{$endif}
{$define HAS_DEF_PARAMS}
{$define SB_HAS_WINCRYPT}
{$ifdef CLX_USED}
{$undef SB_HAS_WINCRYPT}
{$endif}
{$ifdef MONO}
{$undef SB_HAS_WINCRYPT}
{$define SBB_NO_PKCS11}
{$endif}
{$ifdef FPC}
{$ifndef WIN32}
{$undef SB_HAS_WINCRYPT}
{$define SBB_NO_PKCS11}
{$endif}
{$undef NTLM_SUPPORT}
{$endif}
{$undef TriDES_KEY_AS_REC}
{$ifdef CHROME}
{$ifdef MONO}
{$define TriDES_KEY_AS_REC}
{$endif}
{$ifdef NET_CF_1_0}
{$define TriDES_KEY_AS_REC}
{$endif}
{$endif}
{$ifdef CHROME}
{$ifdef MONO}
{$define SBB_NO_PKCS11}
{$undef SB_HAS_WINCRYPT}
{$endif}
{$ifdef NET_CF}
{$define SBB_NO_PKCS11}
{$endif}
{$endif}
{.$DEFINE SECURE_BLACKBOX_DEBUG}
{.$define SBB_NO_DES}
{.$define SBB_NO_RC2}
{.$define SBB_NO_RC4}
{.$define SBB_NO_IDEA}
{.$define SBB_NO_CAMELLIA}
{.$define SBB_NO_SEED}
{.$define SBB_NO_SRP}
{.$define SBB_EXCL_XADES_INTF}
{$ifdef SBB_EXCL_XADES}
{$define SBB_EXCL_XADES_INTF}
{$endif}
{$ifdef SB_ACTIVEX_MODE}
{$define SBB_NO_SRP}
{$endif}