settings.h 17 KB

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