user_settings.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. /* user_settings.h
  2. *
  3. * Copyright (C) 2006-2021 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 15
  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 WOLFSSL_CMSIS_RTOSv2
  88. #elif MDK_CONF_THREAD == 16
  89. #define SINGLE_THREADED
  90. #endif
  91. // <e>File System
  92. #define MDK_CONF_FILESYSTEM 1
  93. #if MDK_CONF_FILESYSTEM == 0
  94. #define NO_FILESYSTEM
  95. #else
  96. #define WOLFSSL_KEIL_FS
  97. #define NO_WOLFSSL_DIR
  98. #endif
  99. // </e>
  100. // <o> Network<0=>None <1=>RLnet <2=>User I/O
  101. #define MDK_CONF_NETWORK 1
  102. #if MDK_CONF_NETWORK == 0
  103. #elif MDK_CONF_NETWORK == 1
  104. #define WOLFSSL_KEIL_TCP_NET
  105. #elif MDK_CONF_NETWORK == 2
  106. #define WOLFSSL_USER_IO
  107. #endif
  108. // <h>Debug options
  109. // <e>Debug Message
  110. #define MDK_CONF_DebugMessage 0
  111. #if MDK_CONF_DebugMessage == 1
  112. #define DEBUG_WOLFSSL
  113. #endif
  114. // </e>
  115. // <e>Check malloc
  116. #define MDK_CONF_CheckMalloc 1
  117. #if MDK_CONF_CheckMalloc == 1
  118. #define WOLFSSL_MALLOC_CHECK
  119. #define USE_WOLFSSL_MEMORY
  120. #endif
  121. // </e>
  122. // <e>ErrNo.h
  123. #define MDK_CONF_ErrNo 1
  124. #if MDK_CONF_ErrNo == 1
  125. #define HAVE_ERRNO
  126. #endif
  127. // </e>
  128. // <e>Error Strings
  129. #define MDK_CONF_ErrorStrings 1
  130. #if MDK_CONF_ErrorStrings == 0
  131. #define NO_ERROR_STRINGS
  132. #endif
  133. // </e>
  134. //</h>
  135. //</h>
  136. // <h> wolfCrypt Configuration
  137. // <h>Hash/Crypt Algrithm
  138. // <e>MD2
  139. #define MDK_CONF_MD2 0
  140. #if MDK_CONF_MD2 == 1
  141. #define WOLFSSL_MD2
  142. #endif
  143. // </e>
  144. // <e>MD4
  145. #define MDK_CONF_MD4 0
  146. #if MDK_CONF_MD4 == 0
  147. #define NO_MD4
  148. #endif
  149. // </e>
  150. // <e>MD5
  151. #define MDK_CONF_MD5 1
  152. #if MDK_CONF_MD5 == 0
  153. #define NO_MD5
  154. #endif
  155. // </e>
  156. // <e>SHA
  157. #define MDK_CONF_SHA 1
  158. #if MDK_CONF_SHA == 0
  159. #define NO_SHA
  160. #endif
  161. // </e>
  162. // <e>SHA-256
  163. #define MDK_CONF_SHA256 1
  164. #if MDK_CONF_SHA256 == 0
  165. #define NO_SHA256
  166. #endif
  167. // </e>
  168. // <e>SHA-384
  169. #define MDK_CONF_SHA384 1
  170. #if MDK_CONF_SHA384 == 1
  171. #define WOLFSSL_SHA384
  172. #endif
  173. // </e>
  174. // <e>SHA-512
  175. #define MDK_CONF_SHA512 1
  176. #if MDK_CONF_SHA512 == 1
  177. #define WOLFSSL_SHA512
  178. #endif
  179. // </e>
  180. // <e>Hash DRBG
  181. #define MDK_CONF_HASHDRBG 1
  182. #if MDK_CONF_HASHDRBG == 1
  183. #define HAVE_HASHDRBG
  184. #endif
  185. // </e>
  186. // <e>RIPEMD
  187. #define MDK_CONF_RIPEMD 1
  188. #if MDK_CONF_RIPEMD == 1
  189. #define WOLFSSL_RIPEMD
  190. #endif
  191. // </e>
  192. // <e>BLAKE2
  193. #define MDK_CONF_BLAKE2 0
  194. #if MDK_CONF_BLAKE2 == 1
  195. #define HAVE_BLAKE2
  196. #endif
  197. // </e>
  198. // <e>HMAC
  199. #define MDK_CONF_HMAC 1
  200. #if MDK_CONF_HMAC == 0
  201. #define NO_HMAC
  202. #endif
  203. // </e>
  204. // <e>HMAC KDF
  205. #define MDK_CONF_HKDF 1
  206. #if MDK_CONF_HKDF == 1
  207. #define HAVE_HKDF
  208. #endif
  209. // </e>
  210. // <e>AES CCM
  211. #define MDK_CONF_AESCCM 1
  212. #if MDK_CONF_AESCCM == 1
  213. #define HAVE_AESCCM
  214. #endif
  215. // </e>
  216. // <e>AES GCM
  217. #define MDK_CONF_AESGCM 1
  218. #if MDK_CONF_AESGCM == 1
  219. #define HAVE_AESGCM
  220. #endif
  221. // </e>
  222. // <e>RC4
  223. #define MDK_CONF_RC4 0
  224. #if MDK_CONF_RC4 == 0
  225. #define NO_RC4
  226. #endif
  227. // </e>
  228. // <e>HC128
  229. #define MDK_CONF_HC128 1
  230. #if MDK_CONF_HC128 == 0
  231. #define NO_HC128
  232. #endif
  233. // </e>
  234. // <e>RABBIT
  235. #define MDK_CONF_RABBIT 1
  236. #if MDK_CONF_RABBIT == 0
  237. #define NO_RABBIT
  238. #endif
  239. // </e>
  240. // <e>CHACHA
  241. #define MDK_CONF_CHACHA 1
  242. #if MDK_CONF_CHACHA == 1
  243. #define HAVE_CHACHA
  244. #endif
  245. // </e>
  246. // <e>POLY1305
  247. #define MDK_CONF_POLY1305 1
  248. #if MDK_CONF_POLY1305 == 1
  249. #define HAVE_POLY1305
  250. #define HAVE_ONE_TIME_AUTH
  251. #endif
  252. // </e>
  253. // <e>DES3
  254. #define MDK_CONF_DES3 1
  255. #if MDK_CONF_DES3 == 0
  256. #define NO_DES3
  257. #endif
  258. // </e>
  259. // <e>AES
  260. #define MDK_CONF_AES 1
  261. #if MDK_CONF_AES == 0
  262. #define NO_AES
  263. #endif
  264. // </e>
  265. // <e>CAMELLIA
  266. #define MDK_CONF_CAMELLIA 1
  267. #if MDK_CONF_CAMELLIA == 1
  268. #define HAVE_CAMELLIA
  269. #endif
  270. // </e>
  271. // <e>DH
  272. #define MDK_CONF_DH 1
  273. #if MDK_CONF_DH == 0
  274. #define NO_DH
  275. #endif
  276. // </e>
  277. // <e>DSA
  278. #define MDK_CONF_DSA 1
  279. #if MDK_CONF_DSA == 0
  280. #define NO_DSA
  281. #endif
  282. // </e>
  283. // <e>SRP
  284. #define MDK_CONF_SRP 1
  285. #if MDK_CONF_SRP == 1
  286. #define HAVE_SRP
  287. #endif
  288. // </e>
  289. // <e>PWDBASED
  290. #define MDK_CONF_PWDBASED 1
  291. #if MDK_CONF_PWDBASED == 0
  292. #define NO_PWDBASED
  293. #endif
  294. // </e>
  295. // <e>ECC
  296. #define MDK_CONF_ECC 1
  297. #if MDK_CONF_ECC == 1
  298. #define HAVE_ECC
  299. #endif
  300. // </e>
  301. // <e>CURVE25519
  302. #define MDK_CONF_CURVE25519 1
  303. #if MDK_CONF_CURVE25519 == 1
  304. #define HAVE_CURVE25519
  305. #define CURVED25519_SMALL
  306. #endif
  307. // </e>
  308. // <e>CURVE25519 SMALL
  309. #define MDK_CONF_CURVE25519_SMALL 0
  310. #if MDK_CONF_CURVE25519_SMALL == 1
  311. #define CURVED25519_SMALL
  312. #endif
  313. // </e>
  314. // <e>ED25519
  315. #define MDK_CONF_ED25519 1
  316. #if MDK_CONF_ED25519 == 1
  317. #define HAVE_ED25519
  318. #endif
  319. // </e>
  320. // <e>ED25519 SMALL
  321. #define MDK_CONF_ED25519_SMALL 0
  322. #if MDK_CONF_ED25519_SMALL == 1
  323. #define ED25519_SMALL
  324. #endif
  325. // </e>
  326. // <e>PKCS7
  327. #define MDK_CONF_PKCS7 0
  328. #if MDK_CONF_PKCS7 == 1
  329. #define HAVE_PKCS7
  330. #endif
  331. // </e>
  332. // </h>
  333. // <e>Random Seed, for TEST Only
  334. #define MDK_CONF_RNDSEED 1
  335. #if MDK_CONF_RNDSEED == 1
  336. #define WOLFSSL_GENSEED_FORTEST
  337. #endif
  338. // </e>
  339. // <h>Hardware Crypt (See document for usage)
  340. // <e>Hardware RNG
  341. #define MDK_CONF_STM32F2_RNG 0
  342. #if MDK_CONF_STM32F2_RNG == 1
  343. #define WOLFSSL_STM32_CUBEMX
  344. #define STM32_RNG
  345. #define WC_ASYNC_DEV_SIZE 320+24
  346. #define STM32_HAL_TIMEOUT 0xFF
  347. #if defined(STM32F2xx)
  348. #define WOLFSSL_STM32F2
  349. #elif defined(STM32F4xx)
  350. #define WOLFSSL_STM32F4
  351. #elif defined(STM32F7xx)
  352. #define WOLFSSL_STM32F7
  353. #endif
  354. #endif
  355. // </e>
  356. // <e>Hardware Crypt
  357. #define MDK_CONF_STM32F2_CRYPTO 0
  358. #if MDK_CONF_STM32F2_CRYPTO == 1
  359. #define WOLFSSL_STM32_CUBEMX
  360. #define STM32_CRYPTO
  361. #define WC_ASYNC_DEV_SIZE 320+24
  362. #define STM32_HAL_TIMEOUT 0xFF
  363. #if defined(STM32F2xx)
  364. #define WOLFSSL_STM32F2
  365. #elif defined(STM32F4xx)
  366. #define WOLFSSL_STM32F4
  367. #elif defined(STM32F7xx)
  368. #define WOLFSSL_STM32F7
  369. #endif
  370. #endif
  371. // </e>
  372. // <e>Hardware Hash
  373. #define MDK_CONF_STM32F2_HASH 0
  374. #if MDK_CONF_STM32F2_HASH == 1
  375. #define WOLFSSL_STM32_CUBEMX
  376. #define STM32_HASH
  377. #define WC_ASYNC_DEV_SIZE 320+24
  378. #define STM32_HAL_TIMEOUT 0xFF
  379. #if defined(STM32F2xx)
  380. #define WOLFSSL_STM32F2
  381. #elif defined(STM32F4xx)
  382. #define WOLFSSL_STM32F4
  383. #elif defined(STM32F7xx)
  384. #define WOLFSSL_STM32F7
  385. #endif
  386. #endif
  387. // </e>
  388. // </h>
  389. // <h>Cert/Key Strage
  390. // <o>Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
  391. #define MDK_CONF_CERT_BUFF 0
  392. #if MDK_CONF_CERT_BUFF== 1
  393. #define USE_CERT_BUFFERS_1024
  394. #elif MDK_CONF_CERT_BUFF == 2
  395. #define USE_CERT_BUFFERS_2048
  396. #endif
  397. //</h>
  398. // <h>Cert/Key Generation
  399. // <e>CertGen
  400. #define MDK_CONF_CERT_GEN 0
  401. #if MDK_CONF_CERT_GEN == 1
  402. #define WOLFSSL_CERT_GEN
  403. #endif
  404. // </e>
  405. // <e>KeyGen
  406. #define MDK_CONF_KEY_GEN 0
  407. #if MDK_CONF_KEY_GEN == 1
  408. #define WOLFSSL_KEY_GEN
  409. #endif
  410. // </e>
  411. // </h>
  412. // <e>Use Fast Math
  413. #define MDK_CONF_FASTMATH 1
  414. #if MDK_CONF_FASTMATH == 1
  415. #define USE_FAST_MATH
  416. #define TFM_TIMING_RESISTANT
  417. #endif
  418. // </e>
  419. // <e>Small Stack
  420. #define MDK_CONF_SmallStack 1
  421. #if MDK_CONF_SmallStack == 0
  422. #define NO_WOLFSSL_SMALL_STACK
  423. #endif
  424. // </e>
  425. // </h>
  426. /**** wolfSSL Configuration ****/
  427. // <h> wolfSSL Configuration
  428. // <e>TLS 1.3
  429. #define MDK_CONF_TLS 1
  430. #if MDK_CONF_TLS == 1
  431. #define WOLFSSL_TLS13
  432. #define HAVE_TLS_EXTENSIONS
  433. #define HAVE_SUPPORTED_CURVES
  434. #define WC_RSA_PSS
  435. #define HAVE_HKDF
  436. #define HAVE_FFDHE_2048
  437. #endif
  438. // </e>
  439. // <e>Include Old TLS
  440. #define MDK_CONF_NO_OLDTLS 0
  441. #if MDK_CONF_NO_OLDTLS == 0
  442. #define NO_OLD_TLS
  443. #endif
  444. // </e>
  445. // <e>CRL
  446. #define MDK_CONF_CRL 0
  447. #if MDK_CONF_CRL == 1
  448. #define HAVE_CRL
  449. #define WOLFSSL_DER_LOAD
  450. #endif
  451. // </e>
  452. // <e>OCSP
  453. #define MDK_CONF_OCSP 0
  454. #if MDK_CONF_OCSP == 1
  455. #define HAVE_OCSP
  456. #endif
  457. // </e>
  458. // <e>OpenSSL Extra
  459. #define MDK_CONF_OPENSSL_EXTRA 0
  460. #if MDK_CONF_OPENSSL_EXTRA == 1
  461. #define OPENSSL_EXTRA
  462. #endif
  463. // </e>
  464. //</h>