1 | /* settings.h
|
---|
2 | *
|
---|
3 | * Copyright (C) 2006-2017 wolfSSL Inc.
|
---|
4 | *
|
---|
5 | * This file is part of wolfSSL.
|
---|
6 | *
|
---|
7 | * wolfSSL is free software; you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation; either version 2 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * wolfSSL is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with this program; if not, write to the Free Software
|
---|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
---|
20 | */
|
---|
21 |
|
---|
22 |
|
---|
23 | /* Place OS specific preprocessor flags, defines, includes here, will be
|
---|
24 | included into every file because types.h includes it */
|
---|
25 |
|
---|
26 |
|
---|
27 | #ifndef CTAO_CRYPT_SETTINGS_H
|
---|
28 | #define CTAO_CRYPT_SETTINGS_H
|
---|
29 |
|
---|
30 | #ifdef __cplusplus
|
---|
31 | extern "C" {
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Uncomment next line if using IPHONE */
|
---|
35 | /* #define IPHONE */
|
---|
36 |
|
---|
37 | /* Uncomment next line if using ThreadX */
|
---|
38 | /* #define THREADX */
|
---|
39 |
|
---|
40 | /* Uncomment next line if using Micrium ucOS */
|
---|
41 | /* #define MICRIUM */
|
---|
42 |
|
---|
43 | /* Uncomment next line if using Mbed */
|
---|
44 | /* #define MBED */
|
---|
45 |
|
---|
46 | /* Uncomment next line if using Microchip PIC32 ethernet starter kit */
|
---|
47 | /* #define MICROCHIP_PIC32 */
|
---|
48 |
|
---|
49 | /* Uncomment next line if using Microchip TCP/IP stack, version 5 */
|
---|
50 | /* #define MICROCHIP_TCPIP_V5 */
|
---|
51 |
|
---|
52 | /* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */
|
---|
53 | /* #define MICROCHIP_TCPIP */
|
---|
54 |
|
---|
55 | /* Uncomment next line if using PIC32MZ Crypto Engine */
|
---|
56 | /* #define CYASSL_MICROCHIP_PIC32MZ */
|
---|
57 |
|
---|
58 | /* Uncomment next line if using FreeRTOS */
|
---|
59 | /* #define FREERTOS */
|
---|
60 |
|
---|
61 | /* Uncomment next line if using FreeRTOS Windows Simulator */
|
---|
62 | /* #define FREERTOS_WINSIM */
|
---|
63 |
|
---|
64 | /* Uncomment next line if using RTIP */
|
---|
65 | /* #define EBSNET */
|
---|
66 |
|
---|
67 | /* Uncomment next line if using lwip */
|
---|
68 | /* #define CYASSL_LWIP */
|
---|
69 |
|
---|
70 | /* Uncomment next line if building CyaSSL for a game console */
|
---|
71 | /* #define CYASSL_GAME_BUILD */
|
---|
72 |
|
---|
73 | /* Uncomment next line if building CyaSSL for LSR */
|
---|
74 | /* #define CYASSL_LSR */
|
---|
75 |
|
---|
76 | /* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */
|
---|
77 | /* #define FREESCALE_MQX */
|
---|
78 |
|
---|
79 | /* Uncomment next line if using STM32F2 */
|
---|
80 | /* #define CYASSL_STM32F2 */
|
---|
81 |
|
---|
82 | /* Uncomment next line if using QL SEP settings */
|
---|
83 | /* #define CYASSL_QL */
|
---|
84 |
|
---|
85 | /* Uncomment next line if building for EROAD */
|
---|
86 | /* #define CYASSL_EROAD */
|
---|
87 |
|
---|
88 | /* Uncomment next line if building for IAR EWARM */
|
---|
89 | /* #define CYASSL_IAR_ARM */
|
---|
90 |
|
---|
91 | /* Uncomment next line if using TI-RTOS settings */
|
---|
92 | /* #define CYASSL_TIRTOS */
|
---|
93 |
|
---|
94 | /* Uncomment next line if building with PicoTCP */
|
---|
95 | /* #define CYASSL_PICOTCP */
|
---|
96 |
|
---|
97 | /* Uncomment next line if building for PicoTCP demo bundle */
|
---|
98 | /* #define CYASSL_PICOTCP_DEMO */
|
---|
99 |
|
---|
100 | #include <cyassl/ctaocrypt/visibility.h>
|
---|
101 |
|
---|
102 | #ifdef IPHONE
|
---|
103 | #define SIZEOF_LONG_LONG 8
|
---|
104 | #endif
|
---|
105 |
|
---|
106 |
|
---|
107 | #ifdef CYASSL_USER_SETTINGS
|
---|
108 | #include <user_settings.h>
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | /* for reverse compatibility after name change */
|
---|
112 | #include <cyassl/ctaocrypt/settings_comp.h>
|
---|
113 |
|
---|
114 | #ifdef THREADX
|
---|
115 | #define SIZEOF_LONG_LONG 8
|
---|
116 | #endif
|
---|
117 |
|
---|
118 | #ifdef HAVE_NETX
|
---|
119 | #include "nx_api.h"
|
---|
120 | #endif
|
---|
121 |
|
---|
122 | #if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */
|
---|
123 | #define CYASSL_LWIP
|
---|
124 | #define NO_WRITEV
|
---|
125 | #define SINGLE_THREADED
|
---|
126 | #define CYASSL_USER_IO
|
---|
127 | #define NO_FILESYSTEM
|
---|
128 | #endif
|
---|
129 |
|
---|
130 | #if defined(CYASSL_IAR_ARM)
|
---|
131 | #define NO_MAIN_DRIVER
|
---|
132 | #define SINGLE_THREADED
|
---|
133 | #define USE_CERT_BUFFERS_1024
|
---|
134 | #define BENCH_EMBEDDED
|
---|
135 | #define NO_FILESYSTEM
|
---|
136 | #define NO_WRITEV
|
---|
137 | #define CYASSL_USER_IO
|
---|
138 | #define BENCH_EMBEDDED
|
---|
139 | #endif
|
---|
140 |
|
---|
141 | #ifdef MICROCHIP_PIC32
|
---|
142 | /* #define CYASSL_MICROCHIP_PIC32MZ */
|
---|
143 | #define SIZEOF_LONG_LONG 8
|
---|
144 | #define SINGLE_THREADED
|
---|
145 | #define CYASSL_USER_IO
|
---|
146 | #define NO_WRITEV
|
---|
147 | #define NO_DEV_RANDOM
|
---|
148 | #define NO_FILESYSTEM
|
---|
149 | #define USE_FAST_MATH
|
---|
150 | #define TFM_TIMING_RESISTANT
|
---|
151 | #endif
|
---|
152 |
|
---|
153 | #ifdef CYASSL_MICROCHIP_PIC32MZ
|
---|
154 | #define CYASSL_PIC32MZ_CE
|
---|
155 | #define CYASSL_PIC32MZ_CRYPT
|
---|
156 | #define HAVE_AES_ENGINE
|
---|
157 | #define CYASSL_PIC32MZ_RNG
|
---|
158 | /* #define CYASSL_PIC32MZ_HASH */
|
---|
159 | #define CYASSL_AES_COUNTER
|
---|
160 | #define HAVE_AESGCM
|
---|
161 | #define NO_BIG_INT
|
---|
162 |
|
---|
163 | #endif
|
---|
164 |
|
---|
165 | #ifdef MICROCHIP_TCPIP_V5
|
---|
166 | /* include timer functions */
|
---|
167 | #include "TCPIP Stack/TCPIP.h"
|
---|
168 | #endif
|
---|
169 |
|
---|
170 | #ifdef MICROCHIP_TCPIP
|
---|
171 | /* include timer, NTP functions */
|
---|
172 | #ifdef MICROCHIP_MPLAB_HARMONY
|
---|
173 | #include "tcpip/tcpip.h"
|
---|
174 | #else
|
---|
175 | #include "system/system_services.h"
|
---|
176 | #include "tcpip/sntp.h"
|
---|
177 | #endif
|
---|
178 | #endif
|
---|
179 |
|
---|
180 | #ifdef MBED
|
---|
181 | #define CYASSL_USER_IO
|
---|
182 | #define NO_FILESYSTEM
|
---|
183 | #define NO_CERT
|
---|
184 | #define USE_CERT_BUFFERS_1024
|
---|
185 | #define NO_WRITEV
|
---|
186 | #define NO_DEV_RANDOM
|
---|
187 | #define NO_SHA512
|
---|
188 | #define NO_DH
|
---|
189 | #define NO_DSA
|
---|
190 | #define NO_HC128
|
---|
191 | #define HAVE_ECC
|
---|
192 | #define NO_SESSION_CACHE
|
---|
193 | #define CYASSL_CMSIS_RTOS
|
---|
194 | #endif
|
---|
195 |
|
---|
196 |
|
---|
197 | #ifdef CYASSL_EROAD
|
---|
198 | #define FREESCALE_MQX
|
---|
199 | #define FREESCALE_MMCAU
|
---|
200 | #define SINGLE_THREADED
|
---|
201 | #define NO_STDIO_FILESYSTEM
|
---|
202 | #define CYASSL_LEANPSK
|
---|
203 | #define HAVE_NULL_CIPHER
|
---|
204 | #define NO_OLD_TLS
|
---|
205 | #define NO_ASN
|
---|
206 | #define NO_BIG_INT
|
---|
207 | #define NO_RSA
|
---|
208 | #define NO_DSA
|
---|
209 | #define NO_DH
|
---|
210 | #define NO_CERTS
|
---|
211 | #define NO_PWDBASED
|
---|
212 | #define NO_DES3
|
---|
213 | #define NO_MD4
|
---|
214 | #define NO_RC4
|
---|
215 | #define NO_MD5
|
---|
216 | #define NO_SESSION_CACHE
|
---|
217 | #define NO_MAIN_DRIVER
|
---|
218 | #endif
|
---|
219 |
|
---|
220 | #ifdef CYASSL_PICOTCP
|
---|
221 | #define errno pico_err
|
---|
222 | #include "pico_defines.h"
|
---|
223 | #include "pico_stack.h"
|
---|
224 | #include "pico_constants.h"
|
---|
225 | #define CUSTOM_RAND_GENERATE pico_rand
|
---|
226 | #endif
|
---|
227 |
|
---|
228 | #ifdef CYASSL_PICOTCP_DEMO
|
---|
229 | #define CYASSL_STM32
|
---|
230 | #define USE_FAST_MATH
|
---|
231 | #define TFM_TIMING_RESISTANT
|
---|
232 | #define XMALLOC(s, h, type) PICO_ZALLOC((s))
|
---|
233 | #define XFREE(p, h, type) PICO_FREE((p))
|
---|
234 | #define SINGLE_THREADED
|
---|
235 | #define NO_WRITEV
|
---|
236 | #define CYASSL_USER_IO
|
---|
237 | #define NO_DEV_RANDOM
|
---|
238 | #define NO_FILESYSTEM
|
---|
239 | #endif
|
---|
240 |
|
---|
241 | #ifdef FREERTOS_WINSIM
|
---|
242 | #define FREERTOS
|
---|
243 | #define USE_WINDOWS_API
|
---|
244 | #endif
|
---|
245 |
|
---|
246 |
|
---|
247 | /* Micrium will use Visual Studio for compilation but not the Win32 API */
|
---|
248 | #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \
|
---|
249 | && !defined(EBSNET) && !defined(CYASSL_EROAD) && !defined(INTIME_RTOS)
|
---|
250 | #define USE_WINDOWS_API
|
---|
251 | #endif
|
---|
252 |
|
---|
253 |
|
---|
254 | #if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER)
|
---|
255 | #include <stdlib.h>
|
---|
256 | #define XMALLOC(s, h, type) malloc((s))
|
---|
257 | #define XFREE(p, h, type) free((p))
|
---|
258 | #define XREALLOC(p, n, h, t) realloc((p), (n))
|
---|
259 | #endif
|
---|
260 |
|
---|
261 | #if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL)
|
---|
262 | #undef XMALLOC
|
---|
263 | #define XMALLOC yaXMALLOC
|
---|
264 | #undef XFREE
|
---|
265 | #define XFREE yaXFREE
|
---|
266 | #undef XREALLOC
|
---|
267 | #define XREALLOC yaXREALLOC
|
---|
268 | #endif
|
---|
269 |
|
---|
270 |
|
---|
271 | #ifdef FREERTOS
|
---|
272 | #ifndef NO_WRITEV
|
---|
273 | #define NO_WRITEV
|
---|
274 | #endif
|
---|
275 | #ifndef NO_SHA512
|
---|
276 | #define NO_SHA512
|
---|
277 | #endif
|
---|
278 | #ifndef NO_DH
|
---|
279 | #define NO_DH
|
---|
280 | #endif
|
---|
281 | #ifndef NO_DSA
|
---|
282 | #define NO_DSA
|
---|
283 | #endif
|
---|
284 | #ifndef NO_HC128
|
---|
285 | #define NO_HC128
|
---|
286 | #endif
|
---|
287 |
|
---|
288 | #ifndef SINGLE_THREADED
|
---|
289 | #include "FreeRTOS.h"
|
---|
290 | #include "semphr.h"
|
---|
291 | #endif
|
---|
292 | #endif
|
---|
293 |
|
---|
294 | #ifdef CYASSL_TIRTOS
|
---|
295 | #define SIZEOF_LONG_LONG 8
|
---|
296 | #define NO_WRITEV
|
---|
297 | #define NO_CYASSL_DIR
|
---|
298 | #define USE_FAST_MATH
|
---|
299 | #define TFM_TIMING_RESISTANT
|
---|
300 | #define NO_DEV_RANDOM
|
---|
301 | #define NO_FILESYSTEM
|
---|
302 | #define USE_CERT_BUFFERS_2048
|
---|
303 | #define NO_ERROR_STRINGS
|
---|
304 | #define USER_TIME
|
---|
305 |
|
---|
306 | #ifdef __IAR_SYSTEMS_ICC__
|
---|
307 | #pragma diag_suppress=Pa089
|
---|
308 | #elif !defined(__GNUC__)
|
---|
309 | /* Suppress the sslpro warning */
|
---|
310 | #pragma diag_suppress=11
|
---|
311 | #endif
|
---|
312 |
|
---|
313 | #include <ti/ndk/nettools/mytime/mytime.h>
|
---|
314 | #endif
|
---|
315 |
|
---|
316 | #ifdef EBSNET
|
---|
317 | #include "rtip.h"
|
---|
318 |
|
---|
319 | /* #define DEBUG_CYASSL */
|
---|
320 | #define NO_CYASSL_DIR /* tbd */
|
---|
321 |
|
---|
322 | #if (POLLOS)
|
---|
323 | #define SINGLE_THREADED
|
---|
324 | #endif
|
---|
325 |
|
---|
326 | #if (RTPLATFORM)
|
---|
327 | #if (!RTP_LITTLE_ENDIAN)
|
---|
328 | #define BIG_ENDIAN_ORDER
|
---|
329 | #endif
|
---|
330 | #else
|
---|
331 | #if (!KS_LITTLE_ENDIAN)
|
---|
332 | #define BIG_ENDIAN_ORDER
|
---|
333 | #endif
|
---|
334 | #endif
|
---|
335 |
|
---|
336 | #if (WINMSP3)
|
---|
337 | #undef SIZEOF_LONG
|
---|
338 | #define SIZEOF_LONG_LONG 8
|
---|
339 | #else
|
---|
340 | #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG
|
---|
341 | #endif
|
---|
342 |
|
---|
343 | #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC))
|
---|
344 | #define XFREE(p, h, type) (rtp_free(p))
|
---|
345 | #define XREALLOC(p, n, h, t) realloc((p), (n))
|
---|
346 |
|
---|
347 | #endif /* EBSNET */
|
---|
348 |
|
---|
349 | #ifdef CYASSL_GAME_BUILD
|
---|
350 | #define SIZEOF_LONG_LONG 8
|
---|
351 | #if defined(__PPU) || defined(__XENON)
|
---|
352 | #define BIG_ENDIAN_ORDER
|
---|
353 | #endif
|
---|
354 | #endif
|
---|
355 |
|
---|
356 | #ifdef CYASSL_LSR
|
---|
357 | #define HAVE_WEBSERVER
|
---|
358 | #define SIZEOF_LONG_LONG 8
|
---|
359 | #define CYASSL_LOW_MEMORY
|
---|
360 | #define NO_WRITEV
|
---|
361 | #define NO_SHA512
|
---|
362 | #define NO_DH
|
---|
363 | #define NO_DSA
|
---|
364 | #define NO_HC128
|
---|
365 | #define NO_DEV_RANDOM
|
---|
366 | #define NO_CYASSL_DIR
|
---|
367 | #define NO_RABBIT
|
---|
368 | #ifndef NO_FILESYSTEM
|
---|
369 | #define LSR_FS
|
---|
370 | #include "inc/hw_types.h"
|
---|
371 | #include "fs.h"
|
---|
372 | #endif
|
---|
373 | #define CYASSL_LWIP
|
---|
374 | #include <errno.h> /* for tcp errno */
|
---|
375 | #define CYASSL_SAFERTOS
|
---|
376 | #if defined(__IAR_SYSTEMS_ICC__)
|
---|
377 | /* enum uses enum */
|
---|
378 | #pragma diag_suppress=Pa089
|
---|
379 | #endif
|
---|
380 | #endif
|
---|
381 |
|
---|
382 | #ifdef CYASSL_SAFERTOS
|
---|
383 | #ifndef SINGLE_THREADED
|
---|
384 | #include "SafeRTOS/semphr.h"
|
---|
385 | #endif
|
---|
386 |
|
---|
387 | #include "SafeRTOS/heap.h"
|
---|
388 | #define XMALLOC(s, h, type) pvPortMalloc((s))
|
---|
389 | #define XFREE(p, h, type) vPortFree((p))
|
---|
390 | #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
|
---|
391 | #endif
|
---|
392 |
|
---|
393 | #ifdef CYASSL_LOW_MEMORY
|
---|
394 | #undef RSA_LOW_MEM
|
---|
395 | #define RSA_LOW_MEM
|
---|
396 | #undef CYASSL_SMALL_STACK
|
---|
397 | #define CYASSL_SMALL_STACK
|
---|
398 | #undef TFM_TIMING_RESISTANT
|
---|
399 | #define TFM_TIMING_RESISTANT
|
---|
400 | #endif
|
---|
401 |
|
---|
402 | #ifdef FREESCALE_MQX
|
---|
403 | #define SIZEOF_LONG_LONG 8
|
---|
404 | #define NO_WRITEV
|
---|
405 | #define NO_DEV_RANDOM
|
---|
406 | #define NO_RABBIT
|
---|
407 | #define NO_CYASSL_DIR
|
---|
408 | #define USE_FAST_MATH
|
---|
409 | #define TFM_TIMING_RESISTANT
|
---|
410 | #define FREESCALE_K70_RNGA
|
---|
411 | /* #define FREESCALE_K53_RNGB */
|
---|
412 | #include "mqx.h"
|
---|
413 | #ifndef NO_FILESYSTEM
|
---|
414 | #include "mfs.h"
|
---|
415 | #include "fio.h"
|
---|
416 | #endif
|
---|
417 | #ifndef SINGLE_THREADED
|
---|
418 | #include "mutex.h"
|
---|
419 | #endif
|
---|
420 |
|
---|
421 | #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s))
|
---|
422 | #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));}
|
---|
423 | /* Note: MQX has no realloc, using fastmath above */
|
---|
424 | #endif
|
---|
425 |
|
---|
426 | #ifdef CYASSL_STM32F2
|
---|
427 | #define SIZEOF_LONG_LONG 8
|
---|
428 | #define NO_DEV_RANDOM
|
---|
429 | #define NO_CYASSL_DIR
|
---|
430 | #define NO_RABBIT
|
---|
431 | #define STM32F2_RNG
|
---|
432 | #define STM32F2_CRYPTO
|
---|
433 | #define KEIL_INTRINSICS
|
---|
434 | #endif
|
---|
435 |
|
---|
436 | #ifdef MICRIUM
|
---|
437 |
|
---|
438 | #include "stdlib.h"
|
---|
439 | #include "net_cfg.h"
|
---|
440 | #include "ssl_cfg.h"
|
---|
441 | #include "net_secure_os.h"
|
---|
442 |
|
---|
443 | #define CYASSL_TYPES
|
---|
444 |
|
---|
445 | typedef CPU_INT08U byte;
|
---|
446 | typedef CPU_INT16U word16;
|
---|
447 | typedef CPU_INT32U word32;
|
---|
448 |
|
---|
449 | #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32)
|
---|
450 | #define SIZEOF_LONG 4
|
---|
451 | #undef SIZEOF_LONG_LONG
|
---|
452 | #else
|
---|
453 | #undef SIZEOF_LONG
|
---|
454 | #define SIZEOF_LONG_LONG 8
|
---|
455 | #endif
|
---|
456 |
|
---|
457 | #define STRING_USER
|
---|
458 |
|
---|
459 | #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr)))
|
---|
460 | #define XSTRNCPY(pstr_dest, pstr_src, len_max) \
|
---|
461 | ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \
|
---|
462 | (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max)))
|
---|
463 | #define XSTRNCMP(pstr_1, pstr_2, len_max) \
|
---|
464 | ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \
|
---|
465 | (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))
|
---|
466 | #define XSTRSTR(pstr, pstr_srch) \
|
---|
467 | ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \
|
---|
468 | (CPU_CHAR *)(pstr_srch)))
|
---|
469 | #define XMEMSET(pmem, data_val, size) \
|
---|
470 | ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \
|
---|
471 | (CPU_SIZE_T)(size)))
|
---|
472 | #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \
|
---|
473 | (void *)(psrc), (CPU_SIZE_T)(size)))
|
---|
474 | #define XMEMCMP(pmem_1, pmem_2, size) \
|
---|
475 | (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \
|
---|
476 | (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES)
|
---|
477 | #define XMEMMOVE XMEMCPY
|
---|
478 |
|
---|
479 | #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
|
---|
480 | #define MICRIUM_MALLOC
|
---|
481 | #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \
|
---|
482 | (CPU_SIZE_T)(s), (void *)0))
|
---|
483 | #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \
|
---|
484 | (p), (void *)0))
|
---|
485 | #define XREALLOC(p, n, h, t) realloc((p), (n))
|
---|
486 | #endif
|
---|
487 |
|
---|
488 | #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED)
|
---|
489 | #undef NO_FILESYSTEM
|
---|
490 | #else
|
---|
491 | #define NO_FILESYSTEM
|
---|
492 | #endif
|
---|
493 |
|
---|
494 | #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG)
|
---|
495 | #define DEBUG_CYASSL
|
---|
496 | #else
|
---|
497 | #undef DEBUG_CYASSL
|
---|
498 | #endif
|
---|
499 |
|
---|
500 | #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED)
|
---|
501 | #define OPENSSL_EXTRA
|
---|
502 | #else
|
---|
503 | #undef OPENSSL_EXTRA
|
---|
504 | #endif
|
---|
505 |
|
---|
506 | #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED)
|
---|
507 | #undef SINGLE_THREADED
|
---|
508 | #else
|
---|
509 | #define SINGLE_THREADED
|
---|
510 | #endif
|
---|
511 |
|
---|
512 | #if (SSL_CFG_DH_EN == DEF_ENABLED)
|
---|
513 | #undef NO_DH
|
---|
514 | #else
|
---|
515 | #define NO_DH
|
---|
516 | #endif
|
---|
517 |
|
---|
518 | #if (SSL_CFG_DSA_EN == DEF_ENABLED)
|
---|
519 | #undef NO_DSA
|
---|
520 | #else
|
---|
521 | #define NO_DSA
|
---|
522 | #endif
|
---|
523 |
|
---|
524 | #if (SSL_CFG_PSK_EN == DEF_ENABLED)
|
---|
525 | #undef NO_PSK
|
---|
526 | #else
|
---|
527 | #define NO_PSK
|
---|
528 | #endif
|
---|
529 |
|
---|
530 | #if (SSL_CFG_3DES_EN == DEF_ENABLED)
|
---|
531 | #undef NO_DES
|
---|
532 | #else
|
---|
533 | #define NO_DES
|
---|
534 | #endif
|
---|
535 |
|
---|
536 | #if (SSL_CFG_AES_EN == DEF_ENABLED)
|
---|
537 | #undef NO_AES
|
---|
538 | #else
|
---|
539 | #define NO_AES
|
---|
540 | #endif
|
---|
541 |
|
---|
542 | #if (SSL_CFG_RC4_EN == DEF_ENABLED)
|
---|
543 | #undef NO_RC4
|
---|
544 | #else
|
---|
545 | #define NO_RC4
|
---|
546 | #endif
|
---|
547 |
|
---|
548 | #if (SSL_CFG_RABBIT_EN == DEF_ENABLED)
|
---|
549 | #undef NO_RABBIT
|
---|
550 | #else
|
---|
551 | #define NO_RABBIT
|
---|
552 | #endif
|
---|
553 |
|
---|
554 | #if (SSL_CFG_HC128_EN == DEF_ENABLED)
|
---|
555 | #undef NO_HC128
|
---|
556 | #else
|
---|
557 | #define NO_HC128
|
---|
558 | #endif
|
---|
559 |
|
---|
560 | #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG)
|
---|
561 | #define BIG_ENDIAN_ORDER
|
---|
562 | #else
|
---|
563 | #undef BIG_ENDIAN_ORDER
|
---|
564 | #define LITTLE_ENDIAN_ORDER
|
---|
565 | #endif
|
---|
566 |
|
---|
567 | #if (SSL_CFG_MD4_EN == DEF_ENABLED)
|
---|
568 | #undef NO_MD4
|
---|
569 | #else
|
---|
570 | #define NO_MD4
|
---|
571 | #endif
|
---|
572 |
|
---|
573 | #if (SSL_CFG_WRITEV_EN == DEF_ENABLED)
|
---|
574 | #undef NO_WRITEV
|
---|
575 | #else
|
---|
576 | #define NO_WRITEV
|
---|
577 | #endif
|
---|
578 |
|
---|
579 | #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED)
|
---|
580 | #define NO_DEV_RANDOM
|
---|
581 | #else
|
---|
582 | #undef NO_DEV_RANDOM
|
---|
583 | #endif
|
---|
584 |
|
---|
585 | #if (SSL_CFG_USER_IO_EN == DEF_ENABLED)
|
---|
586 | #define CYASSL_USER_IO
|
---|
587 | #else
|
---|
588 | #undef CYASSL_USER_IO
|
---|
589 | #endif
|
---|
590 |
|
---|
591 | #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED)
|
---|
592 | #undef LARGE_STATIC_BUFFERS
|
---|
593 | #undef STATIC_CHUNKS_ONLY
|
---|
594 | #else
|
---|
595 | #define LARGE_STATIC_BUFFERS
|
---|
596 | #define STATIC_CHUNKS_ONLY
|
---|
597 | #endif
|
---|
598 |
|
---|
599 | #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED)
|
---|
600 | #define CYASSL_DER_LOAD
|
---|
601 | #else
|
---|
602 | #undef CYASSL_DER_LOAD
|
---|
603 | #endif
|
---|
604 |
|
---|
605 | #if (SSL_CFG_DTLS_EN == DEF_ENABLED)
|
---|
606 | #define CYASSL_DTLS
|
---|
607 | #else
|
---|
608 | #undef CYASSL_DTLS
|
---|
609 | #endif
|
---|
610 |
|
---|
611 | #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED)
|
---|
612 | #define CYASSL_CALLBACKS
|
---|
613 | #else
|
---|
614 | #undef CYASSL_CALLBACKS
|
---|
615 | #endif
|
---|
616 |
|
---|
617 | #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED)
|
---|
618 | #define USE_FAST_MATH
|
---|
619 | #else
|
---|
620 | #undef USE_FAST_MATH
|
---|
621 | #endif
|
---|
622 |
|
---|
623 | #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED)
|
---|
624 | #define TFM_TIMING_RESISTANT
|
---|
625 | #else
|
---|
626 | #undef TFM_TIMING_RESISTANT
|
---|
627 | #endif
|
---|
628 |
|
---|
629 | #endif /* MICRIUM */
|
---|
630 |
|
---|
631 |
|
---|
632 | #ifdef CYASSL_QL
|
---|
633 | #ifndef CYASSL_SEP
|
---|
634 | #define CYASSL_SEP
|
---|
635 | #endif
|
---|
636 | #ifndef OPENSSL_EXTRA
|
---|
637 | #define OPENSSL_EXTRA
|
---|
638 | #endif
|
---|
639 | #ifndef SESSION_CERTS
|
---|
640 | #define SESSION_CERTS
|
---|
641 | #endif
|
---|
642 | #ifndef HAVE_AESCCM
|
---|
643 | #define HAVE_AESCCM
|
---|
644 | #endif
|
---|
645 | #ifndef ATOMIC_USER
|
---|
646 | #define ATOMIC_USER
|
---|
647 | #endif
|
---|
648 | #ifndef CYASSL_DER_LOAD
|
---|
649 | #define CYASSL_DER_LOAD
|
---|
650 | #endif
|
---|
651 | #ifndef KEEP_PEER_CERT
|
---|
652 | #define KEEP_PEER_CERT
|
---|
653 | #endif
|
---|
654 | #ifndef HAVE_ECC
|
---|
655 | #define HAVE_ECC
|
---|
656 | #endif
|
---|
657 | #ifndef SESSION_INDEX
|
---|
658 | #define SESSION_INDEX
|
---|
659 | #endif
|
---|
660 | #endif /* CYASSL_QL */
|
---|
661 |
|
---|
662 |
|
---|
663 | #if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \
|
---|
664 | !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY)
|
---|
665 | #define USE_CYASSL_MEMORY
|
---|
666 | #endif
|
---|
667 |
|
---|
668 |
|
---|
669 | #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS)
|
---|
670 | #undef KEEP_PEER_CERT
|
---|
671 | #define KEEP_PEER_CERT
|
---|
672 | #endif
|
---|
673 |
|
---|
674 |
|
---|
675 | /* stream ciphers except arc4 need 32bit alignment, intel ok without */
|
---|
676 | #ifndef XSTREAM_ALIGNMENT
|
---|
677 | #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__)
|
---|
678 | #define NO_XSTREAM_ALIGNMENT
|
---|
679 | #else
|
---|
680 | #define XSTREAM_ALIGNMENT
|
---|
681 | #endif
|
---|
682 | #endif
|
---|
683 |
|
---|
684 |
|
---|
685 | /* FreeScale MMCAU hardware crypto has 4 byte alignment */
|
---|
686 | #ifdef FREESCALE_MMCAU
|
---|
687 | #define CYASSL_MMCAU_ALIGNMENT 4
|
---|
688 | #endif
|
---|
689 |
|
---|
690 | /* if using hardware crypto and have alignment requirements, specify the
|
---|
691 | requirement here. The record header of SSL/TLS will prvent easy alignment.
|
---|
692 | This hint tries to help as much as possible. */
|
---|
693 | #ifndef CYASSL_GENERAL_ALIGNMENT
|
---|
694 | #ifdef CYASSL_AESNI
|
---|
695 | #define CYASSL_GENERAL_ALIGNMENT 16
|
---|
696 | #elif defined(XSTREAM_ALIGNMENT)
|
---|
697 | #define CYASSL_GENERAL_ALIGNMENT 4
|
---|
698 | #elif defined(FREESCALE_MMCAU)
|
---|
699 | #define CYASSL_GENERAL_ALIGNMENT CYASSL_MMCAU_ALIGNMENT
|
---|
700 | #else
|
---|
701 | #define CYASSL_GENERAL_ALIGNMENT 0
|
---|
702 | #endif
|
---|
703 | #endif
|
---|
704 |
|
---|
705 | #ifdef HAVE_CRL
|
---|
706 | /* not widely supported yet */
|
---|
707 | #undef NO_SKID
|
---|
708 | #define NO_SKID
|
---|
709 | #endif
|
---|
710 |
|
---|
711 |
|
---|
712 | #ifdef __INTEL_COMPILER
|
---|
713 | #pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */
|
---|
714 | #endif
|
---|
715 |
|
---|
716 |
|
---|
717 | /* Place any other flags or defines here */
|
---|
718 |
|
---|
719 |
|
---|
720 | #ifdef __cplusplus
|
---|
721 | } /* extern "C" */
|
---|
722 | #endif
|
---|
723 |
|
---|
724 |
|
---|
725 | #endif /* CTAO_CRYPT_SETTINGS_H */
|
---|