user_settings.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. /* user_settings.h
  2. *
  3. * Copyright (C) 2006-2022 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. #define WOLFSSL_MDK5_COMPLv5
  22. #define NO_MAIN_DRIVER
  23. #define BENCH_EMBEDDED
  24. #define NO_DEV_RANDOM
  25. #define WOLFSSL_USER_CURRTIME
  26. #define SIZEOF_LONG_LONG 8
  27. #define NO_WRITEV
  28. #define NO_DEV_RANDOM
  29. #define TFM_TIMING_RESISTANT
  30. #define ECC_TIMING_RESISTANT
  31. #define WC_RSA_BLINDING
  32. #define WOLFSSL_USER_CURRTIME /* for benchmark */
  33. #define WOLFSSL_CURRTIME_OSTICK /* use OS tich for current_time */
  34. #define WOLFSSL_GMTIME
  35. #define NO_MULTIBYTE_PRINT
  36. // <<< Use Configuration Wizard in Context Menu >>>
  37. // <h>Common options
  38. // <o> MPU<0=>Undefined<1=>STM32F2xx<2=>STM32F4xx<3=>STM32F7xx
  39. #define MDK_CONF_MPU 3
  40. #if MDK_CONF_MPU == 0
  41. #elif MDK_CONF_MPU == 1
  42. #define WOLFSSL_STM32_CUBEMX
  43. #define STM32F2xx
  44. #elif MDK_CONF_MPU == 2
  45. #define WOLFSSL_STM32_CUBEMX
  46. #define STM32F4xx
  47. #elif MDK_CONF_MPU == 3
  48. #define WOLFSSL_STM32_CUBEMX
  49. #define STM32F7xx
  50. #endif
  51. // <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS<4=>Windows
  52. // <5=>PThread <6=>ThreadX
  53. // <7=>Micrium <8=>EBSnet<9=>MQX
  54. // <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
  55. // <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
  56. #define MDK_CONF_THREAD 15
  57. #if MDK_CONF_THREAD== 0
  58. #define SINGLE_THREADED
  59. #elif MDK_CONF_THREAD == 1
  60. #define FREERTOS
  61. #elif MDK_CONF_THREAD == 3
  62. #define WOLFSSL_SAFERTOS
  63. #elif MDK_CONF_THREAD == 4
  64. #define USE_WINDOWS_API
  65. #elif MDK_CONF_THREAD == 5
  66. #define WOLFSSL_PTHREADS
  67. #elif MDK_CONF_THREAD == 6
  68. #define THREADX
  69. #define NETX
  70. #elif MDK_CONF_THREAD == 7
  71. #define MICRIUM
  72. #elif MDK_CONF_THREAD == 8
  73. #define EBSNET
  74. #elif MDK_CONF_THREAD == 9
  75. #define FREESCALE_MQX
  76. #define FREESCALE_KSDK_MQX
  77. #elif MDK_CONF_THREAD == 10
  78. #define WOLFSSL_TIRTOS
  79. #elif MDK_CONF_THREAD == 11
  80. #define WOLFSSL_uITRON4
  81. #elif MDK_CONF_THREAD == 12
  82. #define WOLFSSL_uTKERNEL2
  83. #elif MDK_CONF_THREAD == 13
  84. #define WOLFSSL_FROSTED
  85. #elif MDK_CONF_THREAD == 14
  86. #define WOLFSSL_CMSIS_RTOS
  87. #elif MDK_CONF_THREAD == 15
  88. #define WOLFSSL_CMSIS_RTOSv2
  89. #elif MDK_CONF_THREAD == 16
  90. #define SINGLE_THREADED
  91. #endif
  92. // <e>File System
  93. #define MDK_CONF_FILESYSTEM 1
  94. #if MDK_CONF_FILESYSTEM == 0
  95. #define NO_FILESYSTEM
  96. #else
  97. #define WOLFSSL_KEIL_FS
  98. #define NO_WOLFSSL_DIR
  99. #endif
  100. // </e>
  101. // <o> Network<0=>None <1=>RLnet <2=>User I/O
  102. #define MDK_CONF_NETWORK 0
  103. #if MDK_CONF_NETWORK == 0
  104. #elif MDK_CONF_NETWORK == 1
  105. #define WOLFSSL_KEIL_TCP_NET
  106. #elif MDK_CONF_NETWORK == 2
  107. #define WOLFSSL_USER_IO
  108. #endif
  109. // <h>Debug options
  110. // <e>Debug Message
  111. #define MDK_CONF_DebugMessage 0
  112. #if MDK_CONF_DebugMessage == 1
  113. #define DEBUG_WOLFSSL
  114. #endif
  115. // </e>
  116. // <e>Check malloc
  117. #define MDK_CONF_CheckMalloc 1
  118. #if MDK_CONF_CheckMalloc == 1
  119. #define WOLFSSL_MALLOC_CHECK
  120. #define USE_WOLFSSL_MEMORY
  121. #endif
  122. // </e>
  123. // <e>ErrNo.h
  124. #define MDK_CONF_ErrNo 1
  125. #if MDK_CONF_ErrNo == 1
  126. #define HAVE_ERRNO
  127. #endif
  128. // </e>
  129. // <e>Error Strings
  130. #define MDK_CONF_ErrorStrings 1
  131. #if MDK_CONF_ErrorStrings == 0
  132. #define NO_ERROR_STRINGS
  133. #endif
  134. // </e>
  135. //</h>
  136. //</h>
  137. // <h> wolfCrypt Configuration
  138. // <h>Hash/Crypt Algrithm
  139. // <e>MD2
  140. #define MDK_CONF_MD2 0
  141. #if MDK_CONF_MD2 == 1
  142. #define WOLFSSL_MD2
  143. #endif
  144. // </e>
  145. // <e>MD4
  146. #define MDK_CONF_MD4 0
  147. #if MDK_CONF_MD4 == 0
  148. #define NO_MD4
  149. #endif
  150. // </e>
  151. // <e>MD5
  152. #define MDK_CONF_MD5 1
  153. #if MDK_CONF_MD5 == 0
  154. #define NO_MD5
  155. #endif
  156. // </e>
  157. // <e>SHA
  158. #define MDK_CONF_SHA 1
  159. #if MDK_CONF_SHA == 0
  160. #define NO_SHA
  161. #endif
  162. // </e>
  163. // <e>SHA-256
  164. #define MDK_CONF_SHA256 1
  165. #if MDK_CONF_SHA256 == 0
  166. #define NO_SHA256
  167. #endif
  168. // </e>
  169. // <e>SHA-384
  170. #define MDK_CONF_SHA384 1
  171. #if MDK_CONF_SHA384 == 1
  172. #define WOLFSSL_SHA384
  173. #endif
  174. // </e>
  175. // <e>SHA-512
  176. #define MDK_CONF_SHA512 1
  177. #if MDK_CONF_SHA512 == 1
  178. #define WOLFSSL_SHA512
  179. #endif
  180. // </e>
  181. // <e>Hash DRBG
  182. #define MDK_CONF_HASHDRBG 1
  183. #if MDK_CONF_HASHDRBG == 1
  184. #define HAVE_HASHDRBG
  185. #endif
  186. // </e>
  187. // <e>RIPEMD
  188. #define MDK_CONF_RIPEMD 1
  189. #if MDK_CONF_RIPEMD == 1
  190. #define WOLFSSL_RIPEMD
  191. #endif
  192. // </e>
  193. // <e>BLAKE2
  194. #define MDK_CONF_BLAKE2 0
  195. #if MDK_CONF_BLAKE2 == 1
  196. #define HAVE_BLAKE2
  197. #endif
  198. // </e>
  199. // <e>HMAC
  200. #define MDK_CONF_HMAC 1
  201. #if MDK_CONF_HMAC == 0
  202. #define NO_HMAC
  203. #endif
  204. // </e>
  205. // <e>HMAC KDF
  206. #define MDK_CONF_HKDF 1
  207. #if MDK_CONF_HKDF == 1
  208. #define HAVE_HKDF
  209. #endif
  210. // </e>
  211. // <e>AES CCM
  212. #define MDK_CONF_AESCCM 1
  213. #if MDK_CONF_AESCCM == 1
  214. #define HAVE_AESCCM
  215. #endif
  216. // </e>
  217. // <e>AES GCM
  218. #define MDK_CONF_AESGCM 1
  219. #if MDK_CONF_AESGCM == 1
  220. #define HAVE_AESGCM
  221. #endif
  222. // </e>
  223. // <e>RC4
  224. #define MDK_CONF_RC4 0
  225. #if MDK_CONF_RC4 == 0
  226. #define NO_RC4
  227. #endif
  228. // </e>
  229. // <e>CHACHA
  230. #define MDK_CONF_CHACHA 1
  231. #if MDK_CONF_CHACHA == 1
  232. #define HAVE_CHACHA
  233. #endif
  234. // </e>
  235. // <e>POLY1305
  236. #define MDK_CONF_POLY1305 1
  237. #if MDK_CONF_POLY1305 == 1
  238. #define HAVE_POLY1305
  239. #define HAVE_ONE_TIME_AUTH
  240. #endif
  241. // </e>
  242. // <e>DES3
  243. #define MDK_CONF_DES3 1
  244. #if MDK_CONF_DES3 == 0
  245. #define NO_DES3
  246. #endif
  247. // </e>
  248. // <e>AES
  249. #define MDK_CONF_AES 1
  250. #if MDK_CONF_AES == 0
  251. #define NO_AES
  252. #endif
  253. // </e>
  254. // <e>CAMELLIA
  255. #define MDK_CONF_CAMELLIA 1
  256. #if MDK_CONF_CAMELLIA == 1
  257. #define HAVE_CAMELLIA
  258. #endif
  259. // </e>
  260. // <e>DH
  261. #define MDK_CONF_DH 1
  262. #if MDK_CONF_DH == 0
  263. #define NO_DH
  264. #endif
  265. // </e>
  266. // <e>DSA
  267. #define MDK_CONF_DSA 1
  268. #if MDK_CONF_DSA == 0
  269. #define NO_DSA
  270. #endif
  271. // </e>
  272. // <e>SRP
  273. #define MDK_CONF_SRP 1
  274. #if MDK_CONF_SRP == 1
  275. #define HAVE_SRP
  276. #endif
  277. // </e>
  278. // <e>PWDBASED
  279. #define MDK_CONF_PWDBASED 1
  280. #if MDK_CONF_PWDBASED == 0
  281. #define NO_PWDBASED
  282. #endif
  283. // </e>
  284. // <e>ECC
  285. #define MDK_CONF_ECC 1
  286. #if MDK_CONF_ECC == 1
  287. #define HAVE_ECC
  288. #endif
  289. // </e>
  290. // <e>CURVE25519
  291. #define MDK_CONF_CURVE25519 1
  292. #if MDK_CONF_CURVE25519 == 1
  293. #define HAVE_CURVE25519
  294. #define CURVED25519_SMALL
  295. #endif
  296. // </e>
  297. // <e>CURVE25519 SMALL
  298. #define MDK_CONF_CURVE25519_SMALL 0
  299. #if MDK_CONF_CURVE25519_SMALL == 1
  300. #define CURVED25519_SMALL
  301. #endif
  302. // </e>
  303. // <e>ED25519
  304. #define MDK_CONF_ED25519 1
  305. #if MDK_CONF_ED25519 == 1
  306. #define HAVE_ED25519
  307. #endif
  308. // </e>
  309. // <e>ED25519 SMALL
  310. #define MDK_CONF_ED25519_SMALL 0
  311. #if MDK_CONF_ED25519_SMALL == 1
  312. #define ED25519_SMALL
  313. #endif
  314. // </e>
  315. // <e>PKCS7
  316. #define MDK_CONF_PKCS7 0
  317. #if MDK_CONF_PKCS7 == 1
  318. #define HAVE_PKCS7
  319. #endif
  320. // </e>
  321. // </h>
  322. // <e>Random Seed, for TEST Only
  323. #define MDK_CONF_RNDSEED 1
  324. #if MDK_CONF_RNDSEED == 1
  325. #define WOLFSSL_GENSEED_FORTEST
  326. #endif
  327. // </e>
  328. // <h>Hardware Crypt (See document for usage)
  329. // <e>Hardware RNG
  330. #define MDK_CONF_STM32F2_RNG 0
  331. #if MDK_CONF_STM32F2_RNG == 1
  332. #define WOLFSSL_STM32_CUBEMX
  333. #define STM32_RNG
  334. #define WC_ASYNC_DEV_SIZE 320+24
  335. #define STM32_HAL_TIMEOUT 0xFF
  336. #if defined(STM32F2xx)
  337. #define WOLFSSL_STM32F2
  338. #elif defined(STM32F4xx)
  339. #define WOLFSSL_STM32F4
  340. #elif defined(STM32F7xx)
  341. #define WOLFSSL_STM32F7
  342. #endif
  343. #endif
  344. // </e>
  345. // <e>Hardware Crypt
  346. #define MDK_CONF_STM32F2_CRYPTO 0
  347. #if MDK_CONF_STM32F2_CRYPTO == 1
  348. #define WOLFSSL_STM32_CUBEMX
  349. #define STM32_CRYPTO
  350. #define WC_ASYNC_DEV_SIZE 320+24
  351. #define STM32_HAL_TIMEOUT 0xFF
  352. #if defined(STM32F2xx)
  353. #define WOLFSSL_STM32F2
  354. #elif defined(STM32F4xx)
  355. #define WOLFSSL_STM32F4
  356. #elif defined(STM32F7xx)
  357. #define WOLFSSL_STM32F7
  358. #endif
  359. #endif
  360. // </e>
  361. // <e>Hardware Hash
  362. #define MDK_CONF_STM32F2_HASH 0
  363. #if MDK_CONF_STM32F2_HASH == 1
  364. #define WOLFSSL_STM32_CUBEMX
  365. #define STM32_HASH
  366. #define WC_ASYNC_DEV_SIZE 320+24
  367. #define STM32_HAL_TIMEOUT 0xFF
  368. #if defined(STM32F2xx)
  369. #define WOLFSSL_STM32F2
  370. #elif defined(STM32F4xx)
  371. #define WOLFSSL_STM32F4
  372. #elif defined(STM32F7xx)
  373. #define WOLFSSL_STM32F7
  374. #endif
  375. #endif
  376. // </e>
  377. // </h>
  378. // <h>Cert/Key Strage
  379. // <o>Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
  380. #define MDK_CONF_CERT_BUFF 0
  381. #if MDK_CONF_CERT_BUFF== 1
  382. #define USE_CERT_BUFFERS_1024
  383. #elif MDK_CONF_CERT_BUFF == 2
  384. #define USE_CERT_BUFFERS_2048
  385. #endif
  386. //</h>
  387. // <h>Cert/Key Generation
  388. // <e>CertGen
  389. #define MDK_CONF_CERT_GEN 0
  390. #if MDK_CONF_CERT_GEN == 1
  391. #define WOLFSSL_CERT_GEN
  392. #endif
  393. // </e>
  394. // <e>KeyGen
  395. #define MDK_CONF_KEY_GEN 0
  396. #if MDK_CONF_KEY_GEN == 1
  397. #define WOLFSSL_KEY_GEN
  398. #endif
  399. // </e>
  400. // </h>
  401. // <e>Use Fast Math
  402. #define MDK_CONF_FASTMATH 1
  403. #if MDK_CONF_FASTMATH == 1
  404. #define USE_FAST_MATH
  405. #define TFM_TIMING_RESISTANT
  406. #endif
  407. // </e>
  408. // <e>Small Stack
  409. #define MDK_CONF_SmallStack 1
  410. #if MDK_CONF_SmallStack == 0
  411. #define NO_WOLFSSL_SMALL_STACK
  412. #endif
  413. // </e>
  414. // </h>
  415. /**** wolfSSL Configuration ****/
  416. // <h> wolfSSL Configuration
  417. // <e>TLS 1.3
  418. #define MDK_CONF_TLS 1
  419. #if MDK_CONF_TLS == 1
  420. #define WOLFSSL_TLS13
  421. #define HAVE_TLS_EXTENSIONS
  422. #define HAVE_SUPPORTED_CURVES
  423. #define WC_RSA_PSS
  424. #define HAVE_HKDF
  425. #define HAVE_FFDHE_2048
  426. #endif
  427. // </e>
  428. // <e>Include Old TLS
  429. #define MDK_CONF_NO_OLDTLS 0
  430. #if MDK_CONF_NO_OLDTLS == 0
  431. #define NO_OLD_TLS
  432. #endif
  433. // </e>
  434. // <e>CRL
  435. #define MDK_CONF_CRL 0
  436. #if MDK_CONF_CRL == 1
  437. #define HAVE_CRL
  438. #define WOLFSSL_DER_LOAD
  439. #endif
  440. // </e>
  441. // <e>OCSP
  442. #define MDK_CONF_OCSP 0
  443. #if MDK_CONF_OCSP == 1
  444. #define HAVE_OCSP
  445. #endif
  446. // </e>
  447. // <e>OpenSSL Extra
  448. #define MDK_CONF_OPENSSL_EXTRA 0
  449. #if MDK_CONF_OPENSSL_EXTRA == 1
  450. #define OPENSSL_EXTRA
  451. #endif
  452. // </e>
  453. //</h>