user_settings.h 9.6 KB

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