config.h 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600
  1. /**
  2. * \file config.h
  3. *
  4. * \brief Configuration options (set of defines)
  5. *
  6. * This set of compile-time options may be used to enable
  7. * or disable features selectively, and reduce the global
  8. * memory footprint.
  9. *
  10. * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
  11. * SPDX-License-Identifier: Apache-2.0
  12. *
  13. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  14. * not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at
  16. *
  17. * http://www.apache.org/licenses/LICENSE-2.0
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  21. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. *
  25. * This file is part of mbed TLS (https://tls.mbed.org)
  26. */
  27. #ifndef MBEDTLS_CONFIG_H
  28. #define MBEDTLS_CONFIG_H
  29. #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
  30. #define _CRT_SECURE_NO_DEPRECATE 1
  31. #endif
  32. /**
  33. * \name SECTION: System support
  34. *
  35. * This section sets system specific settings.
  36. * \{
  37. */
  38. /**
  39. * \def MBEDTLS_HAVE_ASM
  40. *
  41. * The compiler has support for asm().
  42. *
  43. * Requires support for asm() in compiler.
  44. *
  45. * Used in:
  46. * library/timing.c
  47. * library/padlock.c
  48. * include/mbedtls/bn_mul.h
  49. *
  50. * Comment to disable the use of assembly code.
  51. */
  52. #define MBEDTLS_HAVE_ASM
  53. /**
  54. * \def MBEDTLS_HAVE_SSE2
  55. *
  56. * CPU supports SSE2 instruction set.
  57. *
  58. * Uncomment if the CPU supports SSE2 (IA-32 specific).
  59. */
  60. //#define MBEDTLS_HAVE_SSE2
  61. /**
  62. * \def MBEDTLS_HAVE_TIME
  63. *
  64. * System has time.h and time().
  65. * The time does not need to be correct, only time differences are used,
  66. * by contrast with MBEDTLS_HAVE_TIME_DATE
  67. *
  68. * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT,
  69. * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and
  70. * MBEDTLS_PLATFORM_STD_TIME.
  71. *
  72. * Comment if your system does not support time functions
  73. */
  74. #define MBEDTLS_HAVE_TIME
  75. /**
  76. * \def MBEDTLS_HAVE_TIME_DATE
  77. *
  78. * System has time.h and time(), gmtime() and the clock is correct.
  79. * The time needs to be correct (not necesarily very accurate, but at least
  80. * the date should be correct). This is used to verify the validity period of
  81. * X.509 certificates.
  82. *
  83. * Comment if your system does not have a correct clock.
  84. */
  85. #define MBEDTLS_HAVE_TIME_DATE
  86. /**
  87. * \def MBEDTLS_PLATFORM_MEMORY
  88. *
  89. * Enable the memory allocation layer.
  90. *
  91. * By default mbed TLS uses the system-provided calloc() and free().
  92. * This allows different allocators (self-implemented or provided) to be
  93. * provided to the platform abstraction layer.
  94. *
  95. * Enabling MBEDTLS_PLATFORM_MEMORY without the
  96. * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
  97. * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
  98. * free() function pointer at runtime.
  99. *
  100. * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
  101. * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
  102. * alternate function at compile time.
  103. *
  104. * Requires: MBEDTLS_PLATFORM_C
  105. *
  106. * Enable this layer to allow use of alternative memory allocators.
  107. */
  108. //#define MBEDTLS_PLATFORM_MEMORY
  109. /**
  110. * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
  111. *
  112. * Do not assign standard functions in the platform layer (e.g. calloc() to
  113. * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF)
  114. *
  115. * This makes sure there are no linking errors on platforms that do not support
  116. * these functions. You will HAVE to provide alternatives, either at runtime
  117. * via the platform_set_xxx() functions or at compile time by setting
  118. * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a
  119. * MBEDTLS_PLATFORM_XXX_MACRO.
  120. *
  121. * Requires: MBEDTLS_PLATFORM_C
  122. *
  123. * Uncomment to prevent default assignment of standard functions in the
  124. * platform layer.
  125. */
  126. //#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
  127. /**
  128. * \def MBEDTLS_PLATFORM_EXIT_ALT
  129. *
  130. * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the
  131. * function in the platform abstraction layer.
  132. *
  133. * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will
  134. * provide a function "mbedtls_platform_set_printf()" that allows you to set an
  135. * alternative printf function pointer.
  136. *
  137. * All these define require MBEDTLS_PLATFORM_C to be defined!
  138. *
  139. * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows;
  140. * it will be enabled automatically by check_config.h
  141. *
  142. * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as
  143. * MBEDTLS_PLATFORM_XXX_MACRO!
  144. *
  145. * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME
  146. *
  147. * Uncomment a macro to enable alternate implementation of specific base
  148. * platform function
  149. */
  150. //#define MBEDTLS_PLATFORM_EXIT_ALT
  151. //#define MBEDTLS_PLATFORM_TIME_ALT
  152. //#define MBEDTLS_PLATFORM_FPRINTF_ALT
  153. //#define MBEDTLS_PLATFORM_PRINTF_ALT
  154. //#define MBEDTLS_PLATFORM_SNPRINTF_ALT
  155. //#define MBEDTLS_PLATFORM_NV_SEED_ALT
  156. /**
  157. * \def MBEDTLS_DEPRECATED_WARNING
  158. *
  159. * Mark deprecated functions so that they generate a warning if used.
  160. * Functions deprecated in one version will usually be removed in the next
  161. * version. You can enable this to help you prepare the transition to a new
  162. * major version by making sure your code is not using these functions.
  163. *
  164. * This only works with GCC and Clang. With other compilers, you may want to
  165. * use MBEDTLS_DEPRECATED_REMOVED
  166. *
  167. * Uncomment to get warnings on using deprecated functions.
  168. */
  169. //#define MBEDTLS_DEPRECATED_WARNING
  170. /**
  171. * \def MBEDTLS_DEPRECATED_REMOVED
  172. *
  173. * Remove deprecated functions so that they generate an error if used.
  174. * Functions deprecated in one version will usually be removed in the next
  175. * version. You can enable this to help you prepare the transition to a new
  176. * major version by making sure your code is not using these functions.
  177. *
  178. * Uncomment to get errors on using deprecated functions.
  179. */
  180. //#define MBEDTLS_DEPRECATED_REMOVED
  181. /* \} name SECTION: System support */
  182. /**
  183. * \name SECTION: mbed TLS feature support
  184. *
  185. * This section sets support for features that are or are not needed
  186. * within the modules that are enabled.
  187. * \{
  188. */
  189. /**
  190. * \def MBEDTLS_TIMING_ALT
  191. *
  192. * Uncomment to provide your own alternate implementation for mbedtls_timing_hardclock(),
  193. * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay()
  194. *
  195. * Only works if you have MBEDTLS_TIMING_C enabled.
  196. *
  197. * You will need to provide a header "timing_alt.h" and an implementation at
  198. * compile time.
  199. */
  200. //#define MBEDTLS_TIMING_ALT
  201. /**
  202. * \def MBEDTLS_AES_ALT
  203. *
  204. * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
  205. * alternate core implementation of a symmetric crypto or hash module (e.g.
  206. * platform specific assembly optimized implementations). Keep in mind that
  207. * the function prototypes should remain the same.
  208. *
  209. * This replaces the whole module. If you only want to replace one of the
  210. * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
  211. *
  212. * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
  213. * provide the "struct mbedtls_aes_context" definition and omit the base function
  214. * declarations and implementations. "aes_alt.h" will be included from
  215. * "aes.h" to include the new function definitions.
  216. *
  217. * Uncomment a macro to enable alternate implementation of the corresponding
  218. * module.
  219. */
  220. //#define MBEDTLS_AES_ALT
  221. //#define MBEDTLS_ARC4_ALT
  222. //#define MBEDTLS_BLOWFISH_ALT
  223. //#define MBEDTLS_CAMELLIA_ALT
  224. //#define MBEDTLS_DES_ALT
  225. //#define MBEDTLS_XTEA_ALT
  226. //#define MBEDTLS_MD2_ALT
  227. //#define MBEDTLS_MD4_ALT
  228. //#define MBEDTLS_MD5_ALT
  229. //#define MBEDTLS_RIPEMD160_ALT
  230. //#define MBEDTLS_SHA1_ALT
  231. //#define MBEDTLS_SHA256_ALT
  232. //#define MBEDTLS_SHA512_ALT
  233. /**
  234. * \def MBEDTLS_MD2_PROCESS_ALT
  235. *
  236. * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you
  237. * alternate core implementation of symmetric crypto or hash function. Keep in
  238. * mind that function prototypes should remain the same.
  239. *
  240. * This replaces only one function. The header file from mbed TLS is still
  241. * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags.
  242. *
  243. * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will
  244. * no longer provide the mbedtls_sha1_process() function, but it will still provide
  245. * the other function (using your mbedtls_sha1_process() function) and the definition
  246. * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible
  247. * with this definition.
  248. *
  249. * Note: if you use the AES_xxx_ALT macros, then is is recommended to also set
  250. * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES
  251. * tables.
  252. *
  253. * Uncomment a macro to enable alternate implementation of the corresponding
  254. * function.
  255. */
  256. //#define MBEDTLS_MD2_PROCESS_ALT
  257. //#define MBEDTLS_MD4_PROCESS_ALT
  258. //#define MBEDTLS_MD5_PROCESS_ALT
  259. //#define MBEDTLS_RIPEMD160_PROCESS_ALT
  260. //#define MBEDTLS_SHA1_PROCESS_ALT
  261. //#define MBEDTLS_SHA256_PROCESS_ALT
  262. //#define MBEDTLS_SHA512_PROCESS_ALT
  263. //#define MBEDTLS_DES_SETKEY_ALT
  264. //#define MBEDTLS_DES_CRYPT_ECB_ALT
  265. //#define MBEDTLS_DES3_CRYPT_ECB_ALT
  266. //#define MBEDTLS_AES_SETKEY_ENC_ALT
  267. //#define MBEDTLS_AES_SETKEY_DEC_ALT
  268. //#define MBEDTLS_AES_ENCRYPT_ALT
  269. //#define MBEDTLS_AES_DECRYPT_ALT
  270. /**
  271. * \def MBEDTLS_TEST_NULL_ENTROPY
  272. *
  273. * Enables testing and use of mbed TLS without any configured entropy sources.
  274. * This permits use of the library on platforms before an entropy source has
  275. * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the
  276. * MBEDTLS_ENTROPY_NV_SEED switches).
  277. *
  278. * WARNING! This switch MUST be disabled in production builds, and is suitable
  279. * only for development.
  280. * Enabling the switch negates any security provided by the library.
  281. *
  282. * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
  283. *
  284. */
  285. //#define MBEDTLS_TEST_NULL_ENTROPY
  286. /**
  287. * \def MBEDTLS_ENTROPY_HARDWARE_ALT
  288. *
  289. * Uncomment this macro to let mbed TLS use your own implementation of a
  290. * hardware entropy collector.
  291. *
  292. * Your function must be called \c mbedtls_hardware_poll(), have the same
  293. * prototype as declared in entropy_poll.h, and accept NULL as first argument.
  294. *
  295. * Uncomment to use your own hardware entropy collector.
  296. */
  297. //#define MBEDTLS_ENTROPY_HARDWARE_ALT
  298. /**
  299. * \def MBEDTLS_AES_ROM_TABLES
  300. *
  301. * Store the AES tables in ROM.
  302. *
  303. * Uncomment this macro to store the AES tables in ROM.
  304. */
  305. //#define MBEDTLS_AES_ROM_TABLES
  306. /**
  307. * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
  308. *
  309. * Use less ROM for the Camellia implementation (saves about 768 bytes).
  310. *
  311. * Uncomment this macro to use less memory for Camellia.
  312. */
  313. //#define MBEDTLS_CAMELLIA_SMALL_MEMORY
  314. /**
  315. * \def MBEDTLS_CIPHER_MODE_CBC
  316. *
  317. * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
  318. */
  319. #define MBEDTLS_CIPHER_MODE_CBC
  320. /**
  321. * \def MBEDTLS_CIPHER_MODE_CFB
  322. *
  323. * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
  324. */
  325. #define MBEDTLS_CIPHER_MODE_CFB
  326. /**
  327. * \def MBEDTLS_CIPHER_MODE_CTR
  328. *
  329. * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
  330. */
  331. #define MBEDTLS_CIPHER_MODE_CTR
  332. /**
  333. * \def MBEDTLS_CIPHER_NULL_CIPHER
  334. *
  335. * Enable NULL cipher.
  336. * Warning: Only do so when you know what you are doing. This allows for
  337. * encryption or channels without any security!
  338. *
  339. * Requires MBEDTLS_ENABLE_WEAK_CIPHERSUITES as well to enable
  340. * the following ciphersuites:
  341. * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA
  342. * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA
  343. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA
  344. * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA
  345. * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384
  346. * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256
  347. * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA
  348. * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384
  349. * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256
  350. * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA
  351. * MBEDTLS_TLS_RSA_WITH_NULL_SHA256
  352. * MBEDTLS_TLS_RSA_WITH_NULL_SHA
  353. * MBEDTLS_TLS_RSA_WITH_NULL_MD5
  354. * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384
  355. * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256
  356. * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA
  357. * MBEDTLS_TLS_PSK_WITH_NULL_SHA384
  358. * MBEDTLS_TLS_PSK_WITH_NULL_SHA256
  359. * MBEDTLS_TLS_PSK_WITH_NULL_SHA
  360. *
  361. * Uncomment this macro to enable the NULL cipher and ciphersuites
  362. */
  363. //#define MBEDTLS_CIPHER_NULL_CIPHER
  364. /**
  365. * \def MBEDTLS_CIPHER_PADDING_PKCS7
  366. *
  367. * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
  368. * specific padding modes in the cipher layer with cipher modes that support
  369. * padding (e.g. CBC)
  370. *
  371. * If you disable all padding modes, only full blocks can be used with CBC.
  372. *
  373. * Enable padding modes in the cipher layer.
  374. */
  375. #define MBEDTLS_CIPHER_PADDING_PKCS7
  376. #define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
  377. #define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
  378. #define MBEDTLS_CIPHER_PADDING_ZEROS
  379. /**
  380. * \def MBEDTLS_ENABLE_WEAK_CIPHERSUITES
  381. *
  382. * Enable weak ciphersuites in SSL / TLS.
  383. * Warning: Only do so when you know what you are doing. This allows for
  384. * channels with virtually no security at all!
  385. *
  386. * This enables the following ciphersuites:
  387. * MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA
  388. * MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA
  389. *
  390. * Uncomment this macro to enable weak ciphersuites
  391. */
  392. //#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES
  393. /**
  394. * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
  395. *
  396. * Remove RC4 ciphersuites by default in SSL / TLS.
  397. * This flag removes the ciphersuites based on RC4 from the default list as
  398. * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
  399. * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
  400. * explicitly.
  401. *
  402. * Uncomment this macro to remove RC4 ciphersuites by default.
  403. */
  404. #define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
  405. /**
  406. * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
  407. *
  408. * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
  409. * module. By default all supported curves are enabled.
  410. *
  411. * Comment macros to disable the curve and functions for it
  412. */
  413. #define MBEDTLS_ECP_DP_SECP192R1_ENABLED
  414. #define MBEDTLS_ECP_DP_SECP224R1_ENABLED
  415. #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
  416. #define MBEDTLS_ECP_DP_SECP384R1_ENABLED
  417. #define MBEDTLS_ECP_DP_SECP521R1_ENABLED
  418. #define MBEDTLS_ECP_DP_SECP192K1_ENABLED
  419. #define MBEDTLS_ECP_DP_SECP224K1_ENABLED
  420. #define MBEDTLS_ECP_DP_SECP256K1_ENABLED
  421. #define MBEDTLS_ECP_DP_BP256R1_ENABLED
  422. #define MBEDTLS_ECP_DP_BP384R1_ENABLED
  423. #define MBEDTLS_ECP_DP_BP512R1_ENABLED
  424. #define MBEDTLS_ECP_DP_CURVE25519_ENABLED
  425. /**
  426. * \def MBEDTLS_ECP_NIST_OPTIM
  427. *
  428. * Enable specific 'modulo p' routines for each NIST prime.
  429. * Depending on the prime and architecture, makes operations 4 to 8 times
  430. * faster on the corresponding curve.
  431. *
  432. * Comment this macro to disable NIST curves optimisation.
  433. */
  434. #define MBEDTLS_ECP_NIST_OPTIM
  435. /**
  436. * \def MBEDTLS_ECDSA_DETERMINISTIC
  437. *
  438. * Enable deterministic ECDSA (RFC 6979).
  439. * Standard ECDSA is "fragile" in the sense that lack of entropy when signing
  440. * may result in a compromise of the long-term signing key. This is avoided by
  441. * the deterministic variant.
  442. *
  443. * Requires: MBEDTLS_HMAC_DRBG_C
  444. *
  445. * Comment this macro to disable deterministic ECDSA.
  446. */
  447. #define MBEDTLS_ECDSA_DETERMINISTIC
  448. /**
  449. * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
  450. *
  451. * Enable the PSK based ciphersuite modes in SSL / TLS.
  452. *
  453. * This enables the following ciphersuites (if other requisites are
  454. * enabled as well):
  455. * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
  456. * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
  457. * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
  458. * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
  459. * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
  460. * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
  461. * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
  462. * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
  463. * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
  464. * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
  465. * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
  466. * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
  467. */
  468. #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
  469. /**
  470. * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
  471. *
  472. * Enable the DHE-PSK based ciphersuite modes in SSL / TLS.
  473. *
  474. * Requires: MBEDTLS_DHM_C
  475. *
  476. * This enables the following ciphersuites (if other requisites are
  477. * enabled as well):
  478. * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
  479. * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
  480. * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
  481. * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
  482. * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
  483. * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
  484. * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
  485. * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
  486. * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
  487. * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
  488. * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
  489. * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
  490. */
  491. #define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
  492. /**
  493. * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
  494. *
  495. * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
  496. *
  497. * Requires: MBEDTLS_ECDH_C
  498. *
  499. * This enables the following ciphersuites (if other requisites are
  500. * enabled as well):
  501. * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
  502. * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
  503. * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
  504. * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
  505. * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
  506. * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
  507. * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
  508. * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
  509. */
  510. #define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
  511. /**
  512. * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
  513. *
  514. * Enable the RSA-PSK based ciphersuite modes in SSL / TLS.
  515. *
  516. * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
  517. * MBEDTLS_X509_CRT_PARSE_C
  518. *
  519. * This enables the following ciphersuites (if other requisites are
  520. * enabled as well):
  521. * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
  522. * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
  523. * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
  524. * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
  525. * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
  526. * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
  527. * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
  528. * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
  529. * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
  530. * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
  531. * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
  532. * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
  533. */
  534. #define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
  535. /**
  536. * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
  537. *
  538. * Enable the RSA-only based ciphersuite modes in SSL / TLS.
  539. *
  540. * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
  541. * MBEDTLS_X509_CRT_PARSE_C
  542. *
  543. * This enables the following ciphersuites (if other requisites are
  544. * enabled as well):
  545. * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
  546. * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
  547. * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
  548. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
  549. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
  550. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
  551. * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
  552. * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
  553. * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
  554. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
  555. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
  556. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
  557. * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
  558. * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
  559. * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
  560. */
  561. #define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
  562. /**
  563. * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
  564. *
  565. * Enable the DHE-RSA based ciphersuite modes in SSL / TLS.
  566. *
  567. * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
  568. * MBEDTLS_X509_CRT_PARSE_C
  569. *
  570. * This enables the following ciphersuites (if other requisites are
  571. * enabled as well):
  572. * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
  573. * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
  574. * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
  575. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
  576. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
  577. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
  578. * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
  579. * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
  580. * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
  581. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
  582. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
  583. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
  584. * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
  585. */
  586. #define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
  587. /**
  588. * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
  589. *
  590. * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
  591. *
  592. * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
  593. * MBEDTLS_X509_CRT_PARSE_C
  594. *
  595. * This enables the following ciphersuites (if other requisites are
  596. * enabled as well):
  597. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
  598. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
  599. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
  600. * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
  601. * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
  602. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
  603. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
  604. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  605. * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
  606. * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
  607. * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
  608. * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
  609. */
  610. #define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
  611. /**
  612. * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
  613. *
  614. * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
  615. *
  616. * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C,
  617. *
  618. * This enables the following ciphersuites (if other requisites are
  619. * enabled as well):
  620. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
  621. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
  622. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
  623. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
  624. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
  625. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
  626. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
  627. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
  628. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
  629. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
  630. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
  631. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
  632. */
  633. #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
  634. /**
  635. * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
  636. *
  637. * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
  638. *
  639. * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C
  640. *
  641. * This enables the following ciphersuites (if other requisites are
  642. * enabled as well):
  643. * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
  644. * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
  645. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
  646. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
  647. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
  648. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
  649. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
  650. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
  651. * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
  652. * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
  653. * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
  654. * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
  655. */
  656. #define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
  657. /**
  658. * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
  659. *
  660. * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS.
  661. *
  662. * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C
  663. *
  664. * This enables the following ciphersuites (if other requisites are
  665. * enabled as well):
  666. * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
  667. * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
  668. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
  669. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
  670. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
  671. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
  672. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
  673. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
  674. * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
  675. * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
  676. * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
  677. * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
  678. */
  679. #define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
  680. /**
  681. * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
  682. *
  683. * Enable the ECJPAKE based ciphersuite modes in SSL / TLS.
  684. *
  685. * \warning This is currently experimental. EC J-PAKE support is based on the
  686. * Thread v1.0.0 specification; incompatible changes to the specification
  687. * might still happen. For this reason, this is disabled by default.
  688. *
  689. * Requires: MBEDTLS_ECJPAKE_C
  690. * MBEDTLS_SHA256_C
  691. * MBEDTLS_ECP_DP_SECP256R1_ENABLED
  692. *
  693. * This enables the following ciphersuites (if other requisites are
  694. * enabled as well):
  695. * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
  696. */
  697. //#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
  698. /**
  699. * \def MBEDTLS_PK_PARSE_EC_EXTENDED
  700. *
  701. * Enhance support for reading EC keys using variants of SEC1 not allowed by
  702. * RFC 5915 and RFC 5480.
  703. *
  704. * Currently this means parsing the SpecifiedECDomain choice of EC
  705. * parameters (only known groups are supported, not arbitrary domains, to
  706. * avoid validation issues).
  707. *
  708. * Disable if you only need to support RFC 5915 + 5480 key formats.
  709. */
  710. #define MBEDTLS_PK_PARSE_EC_EXTENDED
  711. /**
  712. * \def MBEDTLS_ERROR_STRERROR_DUMMY
  713. *
  714. * Enable a dummy error function to make use of mbedtls_strerror() in
  715. * third party libraries easier when MBEDTLS_ERROR_C is disabled
  716. * (no effect when MBEDTLS_ERROR_C is enabled).
  717. *
  718. * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're
  719. * not using mbedtls_strerror() or error_strerror() in your application.
  720. *
  721. * Disable if you run into name conflicts and want to really remove the
  722. * mbedtls_strerror()
  723. */
  724. #define MBEDTLS_ERROR_STRERROR_DUMMY
  725. /**
  726. * \def MBEDTLS_GENPRIME
  727. *
  728. * Enable the prime-number generation code.
  729. *
  730. * Requires: MBEDTLS_BIGNUM_C
  731. */
  732. #define MBEDTLS_GENPRIME
  733. /**
  734. * \def MBEDTLS_FS_IO
  735. *
  736. * Enable functions that use the filesystem.
  737. */
  738. #define MBEDTLS_FS_IO
  739. /**
  740. * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
  741. *
  742. * Do not add default entropy sources. These are the platform specific,
  743. * mbedtls_timing_hardclock and HAVEGE based poll functions.
  744. *
  745. * This is useful to have more control over the added entropy sources in an
  746. * application.
  747. *
  748. * Uncomment this macro to prevent loading of default entropy functions.
  749. */
  750. //#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
  751. /**
  752. * \def MBEDTLS_NO_PLATFORM_ENTROPY
  753. *
  754. * Do not use built-in platform entropy functions.
  755. * This is useful if your platform does not support
  756. * standards like the /dev/urandom or Windows CryptoAPI.
  757. *
  758. * Uncomment this macro to disable the built-in platform entropy functions.
  759. */
  760. //#define MBEDTLS_NO_PLATFORM_ENTROPY
  761. /**
  762. * \def MBEDTLS_ENTROPY_FORCE_SHA256
  763. *
  764. * Force the entropy accumulator to use a SHA-256 accumulator instead of the
  765. * default SHA-512 based one (if both are available).
  766. *
  767. * Requires: MBEDTLS_SHA256_C
  768. *
  769. * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option
  770. * if you have performance concerns.
  771. *
  772. * This option is only useful if both MBEDTLS_SHA256_C and
  773. * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
  774. */
  775. //#define MBEDTLS_ENTROPY_FORCE_SHA256
  776. /**
  777. * \def MBEDTLS_ENTROPY_NV_SEED
  778. *
  779. * Enable the non-volatile (NV) seed file-based entropy source.
  780. * (Also enables the NV seed read/write functions in the platform layer)
  781. *
  782. * This is crucial (if not required) on systems that do not have a
  783. * cryptographic entropy source (in hardware or kernel) available.
  784. *
  785. * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C
  786. *
  787. * \note The read/write functions that are used by the entropy source are
  788. * determined in the platform layer, and can be modified at runtime and/or
  789. * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used.
  790. *
  791. * \note If you use the default implementation functions that read a seedfile
  792. * with regular fopen(), please make sure you make a seedfile with the
  793. * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at
  794. * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from
  795. * and written to or you will get an entropy source error! The default
  796. * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE
  797. * bytes from the file.
  798. *
  799. * \note The entropy collector will write to the seed file before entropy is
  800. * given to an external source, to update it.
  801. */
  802. //#define MBEDTLS_ENTROPY_NV_SEED
  803. /**
  804. * \def MBEDTLS_MEMORY_DEBUG
  805. *
  806. * Enable debugging of buffer allocator memory issues. Automatically prints
  807. * (to stderr) all (fatal) messages on memory allocation issues. Enables
  808. * function for 'debug output' of allocated memory.
  809. *
  810. * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
  811. *
  812. * Uncomment this macro to let the buffer allocator print out error messages.
  813. */
  814. //#define MBEDTLS_MEMORY_DEBUG
  815. /**
  816. * \def MBEDTLS_MEMORY_BACKTRACE
  817. *
  818. * Include backtrace information with each allocated block.
  819. *
  820. * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
  821. * GLIBC-compatible backtrace() an backtrace_symbols() support
  822. *
  823. * Uncomment this macro to include backtrace information
  824. */
  825. //#define MBEDTLS_MEMORY_BACKTRACE
  826. /**
  827. * \def MBEDTLS_PK_RSA_ALT_SUPPORT
  828. *
  829. * Support external private RSA keys (eg from a HSM) in the PK layer.
  830. *
  831. * Comment this macro to disable support for external private RSA keys.
  832. */
  833. #define MBEDTLS_PK_RSA_ALT_SUPPORT
  834. /**
  835. * \def MBEDTLS_PKCS1_V15
  836. *
  837. * Enable support for PKCS#1 v1.5 encoding.
  838. *
  839. * Requires: MBEDTLS_RSA_C
  840. *
  841. * This enables support for PKCS#1 v1.5 operations.
  842. */
  843. #define MBEDTLS_PKCS1_V15
  844. /**
  845. * \def MBEDTLS_PKCS1_V21
  846. *
  847. * Enable support for PKCS#1 v2.1 encoding.
  848. *
  849. * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
  850. *
  851. * This enables support for RSAES-OAEP and RSASSA-PSS operations.
  852. */
  853. #define MBEDTLS_PKCS1_V21
  854. /**
  855. * \def MBEDTLS_RSA_NO_CRT
  856. *
  857. * Do not use the Chinese Remainder Theorem for the RSA private operation.
  858. *
  859. * Uncomment this macro to disable the use of CRT in RSA.
  860. *
  861. */
  862. //#define MBEDTLS_RSA_NO_CRT
  863. /**
  864. * \def MBEDTLS_SELF_TEST
  865. *
  866. * Enable the checkup functions (*_self_test).
  867. */
  868. #define MBEDTLS_SELF_TEST
  869. /**
  870. * \def MBEDTLS_SHA256_SMALLER
  871. *
  872. * Enable an implementation of SHA-256 that has lower ROM footprint but also
  873. * lower performance.
  874. *
  875. * The default implementation is meant to be a reasonnable compromise between
  876. * performance and size. This version optimizes more aggressively for size at
  877. * the expense of performance. Eg on Cortex-M4 it reduces the size of
  878. * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about
  879. * 30%.
  880. *
  881. * Uncomment to enable the smaller implementation of SHA256.
  882. */
  883. //#define MBEDTLS_SHA256_SMALLER
  884. /**
  885. * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
  886. *
  887. * Enable sending of alert messages in case of encountered errors as per RFC.
  888. * If you choose not to send the alert messages, mbed TLS can still communicate
  889. * with other servers, only debugging of failures is harder.
  890. *
  891. * The advantage of not sending alert messages, is that no information is given
  892. * about reasons for failures thus preventing adversaries of gaining intel.
  893. *
  894. * Enable sending of all alert messages
  895. */
  896. #define MBEDTLS_SSL_ALL_ALERT_MESSAGES
  897. /**
  898. * \def MBEDTLS_SSL_DEBUG_ALL
  899. *
  900. * Enable the debug messages in SSL module for all issues.
  901. * Debug messages have been disabled in some places to prevent timing
  902. * attacks due to (unbalanced) debugging function calls.
  903. *
  904. * If you need all error reporting you should enable this during debugging,
  905. * but remove this for production servers that should log as well.
  906. *
  907. * Uncomment this macro to report all debug messages on errors introducing
  908. * a timing side-channel.
  909. *
  910. */
  911. //#define MBEDTLS_SSL_DEBUG_ALL
  912. /** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
  913. *
  914. * Enable support for Encrypt-then-MAC, RFC 7366.
  915. *
  916. * This allows peers that both support it to use a more robust protection for
  917. * ciphersuites using CBC, providing deep resistance against timing attacks
  918. * on the padding or underlying cipher.
  919. *
  920. * This only affects CBC ciphersuites, and is useless if none is defined.
  921. *
  922. * Requires: MBEDTLS_SSL_PROTO_TLS1 or
  923. * MBEDTLS_SSL_PROTO_TLS1_1 or
  924. * MBEDTLS_SSL_PROTO_TLS1_2
  925. *
  926. * Comment this macro to disable support for Encrypt-then-MAC
  927. */
  928. #define MBEDTLS_SSL_ENCRYPT_THEN_MAC
  929. /** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
  930. *
  931. * Enable support for Extended Master Secret, aka Session Hash
  932. * (draft-ietf-tls-session-hash-02).
  933. *
  934. * This was introduced as "the proper fix" to the Triple Handshake familiy of
  935. * attacks, but it is recommended to always use it (even if you disable
  936. * renegotiation), since it actually fixes a more fundamental issue in the
  937. * original SSL/TLS design, and has implications beyond Triple Handshake.
  938. *
  939. * Requires: MBEDTLS_SSL_PROTO_TLS1 or
  940. * MBEDTLS_SSL_PROTO_TLS1_1 or
  941. * MBEDTLS_SSL_PROTO_TLS1_2
  942. *
  943. * Comment this macro to disable support for Extended Master Secret.
  944. */
  945. #define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
  946. /**
  947. * \def MBEDTLS_SSL_FALLBACK_SCSV
  948. *
  949. * Enable support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv-00).
  950. *
  951. * For servers, it is recommended to always enable this, unless you support
  952. * only one version of TLS, or know for sure that none of your clients
  953. * implements a fallback strategy.
  954. *
  955. * For clients, you only need this if you're using a fallback strategy, which
  956. * is not recommended in the first place, unless you absolutely need it to
  957. * interoperate with buggy (version-intolerant) servers.
  958. *
  959. * Comment this macro to disable support for FALLBACK_SCSV
  960. */
  961. #define MBEDTLS_SSL_FALLBACK_SCSV
  962. /**
  963. * \def MBEDTLS_SSL_HW_RECORD_ACCEL
  964. *
  965. * Enable hooking functions in SSL module for hardware acceleration of
  966. * individual records.
  967. *
  968. * Uncomment this macro to enable hooking functions.
  969. */
  970. //#define MBEDTLS_SSL_HW_RECORD_ACCEL
  971. /**
  972. * \def MBEDTLS_SSL_CBC_RECORD_SPLITTING
  973. *
  974. * Enable 1/n-1 record splitting for CBC mode in SSLv3 and TLS 1.0.
  975. *
  976. * This is a countermeasure to the BEAST attack, which also minimizes the risk
  977. * of interoperability issues compared to sending 0-length records.
  978. *
  979. * Comment this macro to disable 1/n-1 record splitting.
  980. */
  981. #define MBEDTLS_SSL_CBC_RECORD_SPLITTING
  982. /**
  983. * \def MBEDTLS_SSL_RENEGOTIATION
  984. *
  985. * Disable support for TLS renegotiation.
  986. *
  987. * The two main uses of renegotiation are (1) refresh keys on long-lived
  988. * connections and (2) client authentication after the initial handshake.
  989. * If you don't need renegotiation, it's probably better to disable it, since
  990. * it has been associated with security issues in the past and is easy to
  991. * misuse/misunderstand.
  992. *
  993. * Comment this to disable support for renegotiation.
  994. */
  995. #define MBEDTLS_SSL_RENEGOTIATION
  996. /**
  997. * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
  998. *
  999. * Enable support for receiving and parsing SSLv2 Client Hello messages for the
  1000. * SSL Server module (MBEDTLS_SSL_SRV_C).
  1001. *
  1002. * Uncomment this macro to enable support for SSLv2 Client Hello messages.
  1003. */
  1004. //#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
  1005. /**
  1006. * \def MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
  1007. *
  1008. * Pick the ciphersuite according to the client's preferences rather than ours
  1009. * in the SSL Server module (MBEDTLS_SSL_SRV_C).
  1010. *
  1011. * Uncomment this macro to respect client's ciphersuite order
  1012. */
  1013. //#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
  1014. /**
  1015. * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
  1016. *
  1017. * Enable support for RFC 6066 max_fragment_length extension in SSL.
  1018. *
  1019. * Comment this macro to disable support for the max_fragment_length extension
  1020. */
  1021. #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
  1022. /**
  1023. * \def MBEDTLS_SSL_PROTO_SSL3
  1024. *
  1025. * Enable support for SSL 3.0.
  1026. *
  1027. * Requires: MBEDTLS_MD5_C
  1028. * MBEDTLS_SHA1_C
  1029. *
  1030. * Comment this macro to disable support for SSL 3.0
  1031. */
  1032. //#define MBEDTLS_SSL_PROTO_SSL3
  1033. /**
  1034. * \def MBEDTLS_SSL_PROTO_TLS1
  1035. *
  1036. * Enable support for TLS 1.0.
  1037. *
  1038. * Requires: MBEDTLS_MD5_C
  1039. * MBEDTLS_SHA1_C
  1040. *
  1041. * Comment this macro to disable support for TLS 1.0
  1042. */
  1043. #define MBEDTLS_SSL_PROTO_TLS1
  1044. /**
  1045. * \def MBEDTLS_SSL_PROTO_TLS1_1
  1046. *
  1047. * Enable support for TLS 1.1 (and DTLS 1.0 if DTLS is enabled).
  1048. *
  1049. * Requires: MBEDTLS_MD5_C
  1050. * MBEDTLS_SHA1_C
  1051. *
  1052. * Comment this macro to disable support for TLS 1.1 / DTLS 1.0
  1053. */
  1054. #define MBEDTLS_SSL_PROTO_TLS1_1
  1055. /**
  1056. * \def MBEDTLS_SSL_PROTO_TLS1_2
  1057. *
  1058. * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
  1059. *
  1060. * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
  1061. * (Depends on ciphersuites)
  1062. *
  1063. * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
  1064. */
  1065. #define MBEDTLS_SSL_PROTO_TLS1_2
  1066. /**
  1067. * \def MBEDTLS_SSL_PROTO_DTLS
  1068. *
  1069. * Enable support for DTLS (all available versions).
  1070. *
  1071. * Enable this and MBEDTLS_SSL_PROTO_TLS1_1 to enable DTLS 1.0,
  1072. * and/or this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2.
  1073. *
  1074. * Requires: MBEDTLS_SSL_PROTO_TLS1_1
  1075. * or MBEDTLS_SSL_PROTO_TLS1_2
  1076. *
  1077. * Comment this macro to disable support for DTLS
  1078. */
  1079. #define MBEDTLS_SSL_PROTO_DTLS
  1080. /**
  1081. * \def MBEDTLS_SSL_ALPN
  1082. *
  1083. * Enable support for RFC 7301 Application Layer Protocol Negotiation.
  1084. *
  1085. * Comment this macro to disable support for ALPN.
  1086. */
  1087. #define MBEDTLS_SSL_ALPN
  1088. /**
  1089. * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY
  1090. *
  1091. * Enable support for the anti-replay mechanism in DTLS.
  1092. *
  1093. * Requires: MBEDTLS_SSL_TLS_C
  1094. * MBEDTLS_SSL_PROTO_DTLS
  1095. *
  1096. * \warning Disabling this is often a security risk!
  1097. * See mbedtls_ssl_conf_dtls_anti_replay() for details.
  1098. *
  1099. * Comment this to disable anti-replay in DTLS.
  1100. */
  1101. #define MBEDTLS_SSL_DTLS_ANTI_REPLAY
  1102. /**
  1103. * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY
  1104. *
  1105. * Enable support for HelloVerifyRequest on DTLS servers.
  1106. *
  1107. * This feature is highly recommended to prevent DTLS servers being used as
  1108. * amplifiers in DoS attacks against other hosts. It should always be enabled
  1109. * unless you know for sure amplification cannot be a problem in the
  1110. * environment in which your server operates.
  1111. *
  1112. * \warning Disabling this can ba a security risk! (see above)
  1113. *
  1114. * Requires: MBEDTLS_SSL_PROTO_DTLS
  1115. *
  1116. * Comment this to disable support for HelloVerifyRequest.
  1117. */
  1118. #define MBEDTLS_SSL_DTLS_HELLO_VERIFY
  1119. /**
  1120. * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
  1121. *
  1122. * Enable server-side support for clients that reconnect from the same port.
  1123. *
  1124. * Some clients unexpectedly close the connection and try to reconnect using the
  1125. * same source port. This needs special support from the server to handle the
  1126. * new connection securely, as described in section 4.2.8 of RFC 6347. This
  1127. * flag enables that support.
  1128. *
  1129. * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY
  1130. *
  1131. * Comment this to disable support for clients reusing the source port.
  1132. */
  1133. #define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
  1134. /**
  1135. * \def MBEDTLS_SSL_DTLS_BADMAC_LIMIT
  1136. *
  1137. * Enable support for a limit of records with bad MAC.
  1138. *
  1139. * See mbedtls_ssl_conf_dtls_badmac_limit().
  1140. *
  1141. * Requires: MBEDTLS_SSL_PROTO_DTLS
  1142. */
  1143. #define MBEDTLS_SSL_DTLS_BADMAC_LIMIT
  1144. /**
  1145. * \def MBEDTLS_SSL_SESSION_TICKETS
  1146. *
  1147. * Enable support for RFC 5077 session tickets in SSL.
  1148. * Client-side, provides full support for session tickets (maintainance of a
  1149. * session store remains the responsibility of the application, though).
  1150. * Server-side, you also need to provide callbacks for writing and parsing
  1151. * tickets, including authenticated encryption and key management. Example
  1152. * callbacks are provided by MBEDTLS_SSL_TICKET_C.
  1153. *
  1154. * Comment this macro to disable support for SSL session tickets
  1155. */
  1156. #define MBEDTLS_SSL_SESSION_TICKETS
  1157. /**
  1158. * \def MBEDTLS_SSL_EXPORT_KEYS
  1159. *
  1160. * Enable support for exporting key block and master secret.
  1161. * This is required for certain users of TLS, e.g. EAP-TLS.
  1162. *
  1163. * Comment this macro to disable support for key export
  1164. */
  1165. #define MBEDTLS_SSL_EXPORT_KEYS
  1166. /**
  1167. * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
  1168. *
  1169. * Enable support for RFC 6066 server name indication (SNI) in SSL.
  1170. *
  1171. * Requires: MBEDTLS_X509_CRT_PARSE_C
  1172. *
  1173. * Comment this macro to disable support for server name indication in SSL
  1174. */
  1175. #define MBEDTLS_SSL_SERVER_NAME_INDICATION
  1176. /**
  1177. * \def MBEDTLS_SSL_TRUNCATED_HMAC
  1178. *
  1179. * Enable support for RFC 6066 truncated HMAC in SSL.
  1180. *
  1181. * Comment this macro to disable support for truncated HMAC in SSL
  1182. */
  1183. #define MBEDTLS_SSL_TRUNCATED_HMAC
  1184. /**
  1185. * \def MBEDTLS_THREADING_ALT
  1186. *
  1187. * Provide your own alternate threading implementation.
  1188. *
  1189. * Requires: MBEDTLS_THREADING_C
  1190. *
  1191. * Uncomment this to allow your own alternate threading implementation.
  1192. */
  1193. //#define MBEDTLS_THREADING_ALT
  1194. /**
  1195. * \def MBEDTLS_THREADING_PTHREAD
  1196. *
  1197. * Enable the pthread wrapper layer for the threading layer.
  1198. *
  1199. * Requires: MBEDTLS_THREADING_C
  1200. *
  1201. * Uncomment this to enable pthread mutexes.
  1202. */
  1203. //#define MBEDTLS_THREADING_PTHREAD
  1204. /**
  1205. * \def MBEDTLS_VERSION_FEATURES
  1206. *
  1207. * Allow run-time checking of compile-time enabled features. Thus allowing users
  1208. * to check at run-time if the library is for instance compiled with threading
  1209. * support via mbedtls_version_check_feature().
  1210. *
  1211. * Requires: MBEDTLS_VERSION_C
  1212. *
  1213. * Comment this to disable run-time checking and save ROM space
  1214. */
  1215. #define MBEDTLS_VERSION_FEATURES
  1216. /**
  1217. * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
  1218. *
  1219. * If set, the X509 parser will not break-off when parsing an X509 certificate
  1220. * and encountering an extension in a v1 or v2 certificate.
  1221. *
  1222. * Uncomment to prevent an error.
  1223. */
  1224. //#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
  1225. /**
  1226. * \def MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
  1227. *
  1228. * If set, the X509 parser will not break-off when parsing an X509 certificate
  1229. * and encountering an unknown critical extension.
  1230. *
  1231. * \warning Depending on your PKI use, enabling this can be a security risk!
  1232. *
  1233. * Uncomment to prevent an error.
  1234. */
  1235. //#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
  1236. /**
  1237. * \def MBEDTLS_X509_CHECK_KEY_USAGE
  1238. *
  1239. * Enable verification of the keyUsage extension (CA and leaf certificates).
  1240. *
  1241. * Disabling this avoids problems with mis-issued and/or misused
  1242. * (intermediate) CA and leaf certificates.
  1243. *
  1244. * \warning Depending on your PKI use, disabling this can be a security risk!
  1245. *
  1246. * Comment to skip keyUsage checking for both CA and leaf certificates.
  1247. */
  1248. #define MBEDTLS_X509_CHECK_KEY_USAGE
  1249. /**
  1250. * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
  1251. *
  1252. * Enable verification of the extendedKeyUsage extension (leaf certificates).
  1253. *
  1254. * Disabling this avoids problems with mis-issued and/or misused certificates.
  1255. *
  1256. * \warning Depending on your PKI use, disabling this can be a security risk!
  1257. *
  1258. * Comment to skip extendedKeyUsage checking for certificates.
  1259. */
  1260. #define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
  1261. /**
  1262. * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
  1263. *
  1264. * Enable parsing and verification of X.509 certificates, CRLs and CSRS
  1265. * signed with RSASSA-PSS (aka PKCS#1 v2.1).
  1266. *
  1267. * Comment this macro to disallow using RSASSA-PSS in certificates.
  1268. */
  1269. #define MBEDTLS_X509_RSASSA_PSS_SUPPORT
  1270. /**
  1271. * \def MBEDTLS_ZLIB_SUPPORT
  1272. *
  1273. * If set, the SSL/TLS module uses ZLIB to support compression and
  1274. * decompression of packet data.
  1275. *
  1276. * \warning TLS-level compression MAY REDUCE SECURITY! See for example the
  1277. * CRIME attack. Before enabling this option, you should examine with care if
  1278. * CRIME or similar exploits may be a applicable to your use case.
  1279. *
  1280. * \note Currently compression can't be used with DTLS.
  1281. *
  1282. * Used in: library/ssl_tls.c
  1283. * library/ssl_cli.c
  1284. * library/ssl_srv.c
  1285. *
  1286. * This feature requires zlib library and headers to be present.
  1287. *
  1288. * Uncomment to enable use of ZLIB
  1289. */
  1290. //#define MBEDTLS_ZLIB_SUPPORT
  1291. /* \} name SECTION: mbed TLS feature support */
  1292. /**
  1293. * \name SECTION: mbed TLS modules
  1294. *
  1295. * This section enables or disables entire modules in mbed TLS
  1296. * \{
  1297. */
  1298. /**
  1299. * \def MBEDTLS_AESNI_C
  1300. *
  1301. * Enable AES-NI support on x86-64.
  1302. *
  1303. * Module: library/aesni.c
  1304. * Caller: library/aes.c
  1305. *
  1306. * Requires: MBEDTLS_HAVE_ASM
  1307. *
  1308. * This modules adds support for the AES-NI instructions on x86-64
  1309. */
  1310. #define MBEDTLS_AESNI_C
  1311. /**
  1312. * \def MBEDTLS_AES_C
  1313. *
  1314. * Enable the AES block cipher.
  1315. *
  1316. * Module: library/aes.c
  1317. * Caller: library/ssl_tls.c
  1318. * library/pem.c
  1319. * library/ctr_drbg.c
  1320. *
  1321. * This module enables the following ciphersuites (if other requisites are
  1322. * enabled as well):
  1323. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
  1324. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
  1325. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
  1326. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
  1327. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
  1328. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
  1329. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
  1330. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
  1331. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
  1332. * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
  1333. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
  1334. * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
  1335. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
  1336. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
  1337. * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
  1338. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
  1339. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
  1340. * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
  1341. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
  1342. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
  1343. * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
  1344. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
  1345. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
  1346. * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
  1347. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
  1348. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
  1349. * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
  1350. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
  1351. * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  1352. * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
  1353. * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
  1354. * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
  1355. * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
  1356. * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
  1357. * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
  1358. * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
  1359. * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
  1360. * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
  1361. * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
  1362. * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
  1363. * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
  1364. * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
  1365. * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
  1366. * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
  1367. * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
  1368. * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
  1369. * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
  1370. * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
  1371. * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
  1372. * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
  1373. * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
  1374. * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
  1375. * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
  1376. * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
  1377. * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
  1378. * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
  1379. * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
  1380. * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
  1381. *
  1382. * PEM_PARSE uses AES for decrypting encrypted keys.
  1383. */
  1384. #define MBEDTLS_AES_C
  1385. /**
  1386. * \def MBEDTLS_ARC4_C
  1387. *
  1388. * Enable the ARCFOUR stream cipher.
  1389. *
  1390. * Module: library/arc4.c
  1391. * Caller: library/ssl_tls.c
  1392. *
  1393. * This module enables the following ciphersuites (if other requisites are
  1394. * enabled as well):
  1395. * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
  1396. * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
  1397. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
  1398. * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
  1399. * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
  1400. * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
  1401. * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
  1402. * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
  1403. * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
  1404. * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
  1405. */
  1406. #define MBEDTLS_ARC4_C
  1407. /**
  1408. * \def MBEDTLS_ASN1_PARSE_C
  1409. *
  1410. * Enable the generic ASN1 parser.
  1411. *
  1412. * Module: library/asn1.c
  1413. * Caller: library/x509.c
  1414. * library/dhm.c
  1415. * library/pkcs12.c
  1416. * library/pkcs5.c
  1417. * library/pkparse.c
  1418. */
  1419. #define MBEDTLS_ASN1_PARSE_C
  1420. /**
  1421. * \def MBEDTLS_ASN1_WRITE_C
  1422. *
  1423. * Enable the generic ASN1 writer.
  1424. *
  1425. * Module: library/asn1write.c
  1426. * Caller: library/ecdsa.c
  1427. * library/pkwrite.c
  1428. * library/x509_create.c
  1429. * library/x509write_crt.c
  1430. * library/mbedtls_x509write_csr.c
  1431. */
  1432. #define MBEDTLS_ASN1_WRITE_C
  1433. /**
  1434. * \def MBEDTLS_BASE64_C
  1435. *
  1436. * Enable the Base64 module.
  1437. *
  1438. * Module: library/base64.c
  1439. * Caller: library/pem.c
  1440. *
  1441. * This module is required for PEM support (required by X.509).
  1442. */
  1443. #define MBEDTLS_BASE64_C
  1444. /**
  1445. * \def MBEDTLS_BIGNUM_C
  1446. *
  1447. * Enable the multi-precision integer library.
  1448. *
  1449. * Module: library/bignum.c
  1450. * Caller: library/dhm.c
  1451. * library/ecp.c
  1452. * library/ecdsa.c
  1453. * library/rsa.c
  1454. * library/ssl_tls.c
  1455. *
  1456. * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
  1457. */
  1458. #define MBEDTLS_BIGNUM_C
  1459. /**
  1460. * \def MBEDTLS_BLOWFISH_C
  1461. *
  1462. * Enable the Blowfish block cipher.
  1463. *
  1464. * Module: library/blowfish.c
  1465. */
  1466. #define MBEDTLS_BLOWFISH_C
  1467. /**
  1468. * \def MBEDTLS_CAMELLIA_C
  1469. *
  1470. * Enable the Camellia block cipher.
  1471. *
  1472. * Module: library/camellia.c
  1473. * Caller: library/ssl_tls.c
  1474. *
  1475. * This module enables the following ciphersuites (if other requisites are
  1476. * enabled as well):
  1477. * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
  1478. * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
  1479. * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
  1480. * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
  1481. * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
  1482. * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
  1483. * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
  1484. * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
  1485. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
  1486. * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
  1487. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
  1488. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
  1489. * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
  1490. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
  1491. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
  1492. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
  1493. * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
  1494. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
  1495. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
  1496. * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
  1497. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
  1498. * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
  1499. * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
  1500. * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
  1501. * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
  1502. * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
  1503. * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
  1504. * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
  1505. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
  1506. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
  1507. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
  1508. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
  1509. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
  1510. * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
  1511. * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
  1512. * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
  1513. * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
  1514. * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
  1515. * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
  1516. * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
  1517. * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
  1518. * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
  1519. */
  1520. #define MBEDTLS_CAMELLIA_C
  1521. /**
  1522. * \def MBEDTLS_CCM_C
  1523. *
  1524. * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
  1525. *
  1526. * Module: library/ccm.c
  1527. *
  1528. * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
  1529. *
  1530. * This module enables the AES-CCM ciphersuites, if other requisites are
  1531. * enabled as well.
  1532. */
  1533. #define MBEDTLS_CCM_C
  1534. /**
  1535. * \def MBEDTLS_CERTS_C
  1536. *
  1537. * Enable the test certificates.
  1538. *
  1539. * Module: library/certs.c
  1540. * Caller:
  1541. *
  1542. * This module is used for testing (ssl_client/server).
  1543. */
  1544. #define MBEDTLS_CERTS_C
  1545. /**
  1546. * \def MBEDTLS_CIPHER_C
  1547. *
  1548. * Enable the generic cipher layer.
  1549. *
  1550. * Module: library/cipher.c
  1551. * Caller: library/ssl_tls.c
  1552. *
  1553. * Uncomment to enable generic cipher wrappers.
  1554. */
  1555. #define MBEDTLS_CIPHER_C
  1556. /**
  1557. * \def MBEDTLS_CMAC_C
  1558. *
  1559. * Enable the CMAC (Cipher-based Message Authentication Code) mode for block
  1560. * ciphers.
  1561. *
  1562. * Module: library/cmac.c
  1563. *
  1564. * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C
  1565. *
  1566. */
  1567. //#define MBEDTLS_CMAC_C
  1568. /**
  1569. * \def MBEDTLS_CTR_DRBG_C
  1570. *
  1571. * Enable the CTR_DRBG AES-256-based random generator.
  1572. *
  1573. * Module: library/ctr_drbg.c
  1574. * Caller:
  1575. *
  1576. * Requires: MBEDTLS_AES_C
  1577. *
  1578. * This module provides the CTR_DRBG AES-256 random number generator.
  1579. */
  1580. #define MBEDTLS_CTR_DRBG_C
  1581. /**
  1582. * \def MBEDTLS_DEBUG_C
  1583. *
  1584. * Enable the debug functions.
  1585. *
  1586. * Module: library/debug.c
  1587. * Caller: library/ssl_cli.c
  1588. * library/ssl_srv.c
  1589. * library/ssl_tls.c
  1590. *
  1591. * This module provides debugging functions.
  1592. */
  1593. #define MBEDTLS_DEBUG_C
  1594. /**
  1595. * \def MBEDTLS_DES_C
  1596. *
  1597. * Enable the DES block cipher.
  1598. *
  1599. * Module: library/des.c
  1600. * Caller: library/pem.c
  1601. * library/ssl_tls.c
  1602. *
  1603. * This module enables the following ciphersuites (if other requisites are
  1604. * enabled as well):
  1605. * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
  1606. * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
  1607. * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
  1608. * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
  1609. * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
  1610. * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
  1611. * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
  1612. * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
  1613. * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
  1614. * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
  1615. *
  1616. * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
  1617. */
  1618. #define MBEDTLS_DES_C
  1619. /**
  1620. * \def MBEDTLS_DHM_C
  1621. *
  1622. * Enable the Diffie-Hellman-Merkle module.
  1623. *
  1624. * Module: library/dhm.c
  1625. * Caller: library/ssl_cli.c
  1626. * library/ssl_srv.c
  1627. *
  1628. * This module is used by the following key exchanges:
  1629. * DHE-RSA, DHE-PSK
  1630. */
  1631. #define MBEDTLS_DHM_C
  1632. /**
  1633. * \def MBEDTLS_ECDH_C
  1634. *
  1635. * Enable the elliptic curve Diffie-Hellman library.
  1636. *
  1637. * Module: library/ecdh.c
  1638. * Caller: library/ssl_cli.c
  1639. * library/ssl_srv.c
  1640. *
  1641. * This module is used by the following key exchanges:
  1642. * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
  1643. *
  1644. * Requires: MBEDTLS_ECP_C
  1645. */
  1646. #define MBEDTLS_ECDH_C
  1647. /**
  1648. * \def MBEDTLS_ECDSA_C
  1649. *
  1650. * Enable the elliptic curve DSA library.
  1651. *
  1652. * Module: library/ecdsa.c
  1653. * Caller:
  1654. *
  1655. * This module is used by the following key exchanges:
  1656. * ECDHE-ECDSA
  1657. *
  1658. * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
  1659. */
  1660. #define MBEDTLS_ECDSA_C
  1661. /**
  1662. * \def MBEDTLS_ECJPAKE_C
  1663. *
  1664. * Enable the elliptic curve J-PAKE library.
  1665. *
  1666. * \warning This is currently experimental. EC J-PAKE support is based on the
  1667. * Thread v1.0.0 specification; incompatible changes to the specification
  1668. * might still happen. For this reason, this is disabled by default.
  1669. *
  1670. * Module: library/ecjpake.c
  1671. * Caller:
  1672. *
  1673. * This module is used by the following key exchanges:
  1674. * ECJPAKE
  1675. *
  1676. * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C
  1677. */
  1678. //#define MBEDTLS_ECJPAKE_C
  1679. /**
  1680. * \def MBEDTLS_ECP_C
  1681. *
  1682. * Enable the elliptic curve over GF(p) library.
  1683. *
  1684. * Module: library/ecp.c
  1685. * Caller: library/ecdh.c
  1686. * library/ecdsa.c
  1687. * library/ecjpake.c
  1688. *
  1689. * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
  1690. */
  1691. #define MBEDTLS_ECP_C
  1692. /**
  1693. * \def MBEDTLS_ENTROPY_C
  1694. *
  1695. * Enable the platform-specific entropy code.
  1696. *
  1697. * Module: library/entropy.c
  1698. * Caller:
  1699. *
  1700. * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
  1701. *
  1702. * This module provides a generic entropy pool
  1703. */
  1704. #define MBEDTLS_ENTROPY_C
  1705. /**
  1706. * \def MBEDTLS_ERROR_C
  1707. *
  1708. * Enable error code to error string conversion.
  1709. *
  1710. * Module: library/error.c
  1711. * Caller:
  1712. *
  1713. * This module enables mbedtls_strerror().
  1714. */
  1715. #define MBEDTLS_ERROR_C
  1716. /**
  1717. * \def MBEDTLS_GCM_C
  1718. *
  1719. * Enable the Galois/Counter Mode (GCM) for AES.
  1720. *
  1721. * Module: library/gcm.c
  1722. *
  1723. * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
  1724. *
  1725. * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
  1726. * requisites are enabled as well.
  1727. */
  1728. #define MBEDTLS_GCM_C
  1729. /**
  1730. * \def MBEDTLS_HAVEGE_C
  1731. *
  1732. * Enable the HAVEGE random generator.
  1733. *
  1734. * Warning: the HAVEGE random generator is not suitable for virtualized
  1735. * environments
  1736. *
  1737. * Warning: the HAVEGE random generator is dependent on timing and specific
  1738. * processor traits. It is therefore not advised to use HAVEGE as
  1739. * your applications primary random generator or primary entropy pool
  1740. * input. As a secondary input to your entropy pool, it IS able add
  1741. * the (limited) extra entropy it provides.
  1742. *
  1743. * Module: library/havege.c
  1744. * Caller:
  1745. *
  1746. * Requires: MBEDTLS_TIMING_C
  1747. *
  1748. * Uncomment to enable the HAVEGE random generator.
  1749. */
  1750. //#define MBEDTLS_HAVEGE_C
  1751. /**
  1752. * \def MBEDTLS_HMAC_DRBG_C
  1753. *
  1754. * Enable the HMAC_DRBG random generator.
  1755. *
  1756. * Module: library/hmac_drbg.c
  1757. * Caller:
  1758. *
  1759. * Requires: MBEDTLS_MD_C
  1760. *
  1761. * Uncomment to enable the HMAC_DRBG random number geerator.
  1762. */
  1763. #define MBEDTLS_HMAC_DRBG_C
  1764. /**
  1765. * \def MBEDTLS_MD_C
  1766. *
  1767. * Enable the generic message digest layer.
  1768. *
  1769. * Module: library/mbedtls_md.c
  1770. * Caller:
  1771. *
  1772. * Uncomment to enable generic message digest wrappers.
  1773. */
  1774. #define MBEDTLS_MD_C
  1775. /**
  1776. * \def MBEDTLS_MD2_C
  1777. *
  1778. * Enable the MD2 hash algorithm.
  1779. *
  1780. * Module: library/mbedtls_md2.c
  1781. * Caller:
  1782. *
  1783. * Uncomment to enable support for (rare) MD2-signed X.509 certs.
  1784. */
  1785. //#define MBEDTLS_MD2_C
  1786. /**
  1787. * \def MBEDTLS_MD4_C
  1788. *
  1789. * Enable the MD4 hash algorithm.
  1790. *
  1791. * Module: library/mbedtls_md4.c
  1792. * Caller:
  1793. *
  1794. * Uncomment to enable support for (rare) MD4-signed X.509 certs.
  1795. */
  1796. //#define MBEDTLS_MD4_C
  1797. /**
  1798. * \def MBEDTLS_MD5_C
  1799. *
  1800. * Enable the MD5 hash algorithm.
  1801. *
  1802. * Module: library/mbedtls_md5.c
  1803. * Caller: library/mbedtls_md.c
  1804. * library/pem.c
  1805. * library/ssl_tls.c
  1806. *
  1807. * This module is required for SSL/TLS and X.509.
  1808. * PEM_PARSE uses MD5 for decrypting encrypted keys.
  1809. */
  1810. #define MBEDTLS_MD5_C
  1811. /**
  1812. * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
  1813. *
  1814. * Enable the buffer allocator implementation that makes use of a (stack)
  1815. * based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
  1816. * calls)
  1817. *
  1818. * Module: library/memory_buffer_alloc.c
  1819. *
  1820. * Requires: MBEDTLS_PLATFORM_C
  1821. * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS)
  1822. *
  1823. * Enable this module to enable the buffer memory allocator.
  1824. */
  1825. //#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
  1826. /**
  1827. * \def MBEDTLS_NET_C
  1828. *
  1829. * Enable the TCP and UDP over IPv6/IPv4 networking routines.
  1830. *
  1831. * \note This module only works on POSIX/Unix (including Linux, BSD and OS X)
  1832. * and Windows. For other platforms, you'll want to disable it, and write your
  1833. * own networking callbacks to be passed to \c mbedtls_ssl_set_bio().
  1834. *
  1835. * \note See also our Knowledge Base article about porting to a new
  1836. * environment:
  1837. * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
  1838. *
  1839. * Module: library/net_sockets.c
  1840. *
  1841. * This module provides networking routines.
  1842. */
  1843. #define MBEDTLS_NET_C
  1844. /**
  1845. * \def MBEDTLS_OID_C
  1846. *
  1847. * Enable the OID database.
  1848. *
  1849. * Module: library/oid.c
  1850. * Caller: library/asn1write.c
  1851. * library/pkcs5.c
  1852. * library/pkparse.c
  1853. * library/pkwrite.c
  1854. * library/rsa.c
  1855. * library/x509.c
  1856. * library/x509_create.c
  1857. * library/mbedtls_x509_crl.c
  1858. * library/mbedtls_x509_crt.c
  1859. * library/mbedtls_x509_csr.c
  1860. * library/x509write_crt.c
  1861. * library/mbedtls_x509write_csr.c
  1862. *
  1863. * This modules translates between OIDs and internal values.
  1864. */
  1865. #define MBEDTLS_OID_C
  1866. /**
  1867. * \def MBEDTLS_PADLOCK_C
  1868. *
  1869. * Enable VIA Padlock support on x86.
  1870. *
  1871. * Module: library/padlock.c
  1872. * Caller: library/aes.c
  1873. *
  1874. * Requires: MBEDTLS_HAVE_ASM
  1875. *
  1876. * This modules adds support for the VIA PadLock on x86.
  1877. */
  1878. #define MBEDTLS_PADLOCK_C
  1879. /**
  1880. * \def MBEDTLS_PEM_PARSE_C
  1881. *
  1882. * Enable PEM decoding / parsing.
  1883. *
  1884. * Module: library/pem.c
  1885. * Caller: library/dhm.c
  1886. * library/pkparse.c
  1887. * library/mbedtls_x509_crl.c
  1888. * library/mbedtls_x509_crt.c
  1889. * library/mbedtls_x509_csr.c
  1890. *
  1891. * Requires: MBEDTLS_BASE64_C
  1892. *
  1893. * This modules adds support for decoding / parsing PEM files.
  1894. */
  1895. #define MBEDTLS_PEM_PARSE_C
  1896. /**
  1897. * \def MBEDTLS_PEM_WRITE_C
  1898. *
  1899. * Enable PEM encoding / writing.
  1900. *
  1901. * Module: library/pem.c
  1902. * Caller: library/pkwrite.c
  1903. * library/x509write_crt.c
  1904. * library/mbedtls_x509write_csr.c
  1905. *
  1906. * Requires: MBEDTLS_BASE64_C
  1907. *
  1908. * This modules adds support for encoding / writing PEM files.
  1909. */
  1910. #define MBEDTLS_PEM_WRITE_C
  1911. /**
  1912. * \def MBEDTLS_PK_C
  1913. *
  1914. * Enable the generic public (asymetric) key layer.
  1915. *
  1916. * Module: library/pk.c
  1917. * Caller: library/ssl_tls.c
  1918. * library/ssl_cli.c
  1919. * library/ssl_srv.c
  1920. *
  1921. * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
  1922. *
  1923. * Uncomment to enable generic public key wrappers.
  1924. */
  1925. #define MBEDTLS_PK_C
  1926. /**
  1927. * \def MBEDTLS_PK_PARSE_C
  1928. *
  1929. * Enable the generic public (asymetric) key parser.
  1930. *
  1931. * Module: library/pkparse.c
  1932. * Caller: library/mbedtls_x509_crt.c
  1933. * library/mbedtls_x509_csr.c
  1934. *
  1935. * Requires: MBEDTLS_PK_C
  1936. *
  1937. * Uncomment to enable generic public key parse functions.
  1938. */
  1939. #define MBEDTLS_PK_PARSE_C
  1940. /**
  1941. * \def MBEDTLS_PK_WRITE_C
  1942. *
  1943. * Enable the generic public (asymetric) key writer.
  1944. *
  1945. * Module: library/pkwrite.c
  1946. * Caller: library/x509write.c
  1947. *
  1948. * Requires: MBEDTLS_PK_C
  1949. *
  1950. * Uncomment to enable generic public key write functions.
  1951. */
  1952. #define MBEDTLS_PK_WRITE_C
  1953. /**
  1954. * \def MBEDTLS_PKCS5_C
  1955. *
  1956. * Enable PKCS#5 functions.
  1957. *
  1958. * Module: library/pkcs5.c
  1959. *
  1960. * Requires: MBEDTLS_MD_C
  1961. *
  1962. * This module adds support for the PKCS#5 functions.
  1963. */
  1964. #define MBEDTLS_PKCS5_C
  1965. /**
  1966. * \def MBEDTLS_PKCS11_C
  1967. *
  1968. * Enable wrapper for PKCS#11 smartcard support.
  1969. *
  1970. * Module: library/pkcs11.c
  1971. * Caller: library/pk.c
  1972. *
  1973. * Requires: MBEDTLS_PK_C
  1974. *
  1975. * This module enables SSL/TLS PKCS #11 smartcard support.
  1976. * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
  1977. */
  1978. //#define MBEDTLS_PKCS11_C
  1979. /**
  1980. * \def MBEDTLS_PKCS12_C
  1981. *
  1982. * Enable PKCS#12 PBE functions.
  1983. * Adds algorithms for parsing PKCS#8 encrypted private keys
  1984. *
  1985. * Module: library/pkcs12.c
  1986. * Caller: library/pkparse.c
  1987. *
  1988. * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
  1989. * Can use: MBEDTLS_ARC4_C
  1990. *
  1991. * This module enables PKCS#12 functions.
  1992. */
  1993. #define MBEDTLS_PKCS12_C
  1994. /**
  1995. * \def MBEDTLS_PLATFORM_C
  1996. *
  1997. * Enable the platform abstraction layer that allows you to re-assign
  1998. * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
  1999. *
  2000. * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
  2001. * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
  2002. * above to be specified at runtime or compile time respectively.
  2003. *
  2004. * \note This abstraction layer must be enabled on Windows (including MSYS2)
  2005. * as other module rely on it for a fixed snprintf implementation.
  2006. *
  2007. * Module: library/platform.c
  2008. * Caller: Most other .c files
  2009. *
  2010. * This module enables abstraction of common (libc) functions.
  2011. */
  2012. #define MBEDTLS_PLATFORM_C
  2013. /**
  2014. * \def MBEDTLS_RIPEMD160_C
  2015. *
  2016. * Enable the RIPEMD-160 hash algorithm.
  2017. *
  2018. * Module: library/mbedtls_ripemd160.c
  2019. * Caller: library/mbedtls_md.c
  2020. *
  2021. */
  2022. #define MBEDTLS_RIPEMD160_C
  2023. /**
  2024. * \def MBEDTLS_RSA_C
  2025. *
  2026. * Enable the RSA public-key cryptosystem.
  2027. *
  2028. * Module: library/rsa.c
  2029. * Caller: library/ssl_cli.c
  2030. * library/ssl_srv.c
  2031. * library/ssl_tls.c
  2032. * library/x509.c
  2033. *
  2034. * This module is used by the following key exchanges:
  2035. * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
  2036. *
  2037. * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
  2038. */
  2039. #define MBEDTLS_RSA_C
  2040. /**
  2041. * \def MBEDTLS_SHA1_C
  2042. *
  2043. * Enable the SHA1 cryptographic hash algorithm.
  2044. *
  2045. * Module: library/mbedtls_sha1.c
  2046. * Caller: library/mbedtls_md.c
  2047. * library/ssl_cli.c
  2048. * library/ssl_srv.c
  2049. * library/ssl_tls.c
  2050. * library/x509write_crt.c
  2051. *
  2052. * This module is required for SSL/TLS and SHA1-signed certificates.
  2053. */
  2054. #define MBEDTLS_SHA1_C
  2055. /**
  2056. * \def MBEDTLS_SHA256_C
  2057. *
  2058. * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
  2059. *
  2060. * Module: library/mbedtls_sha256.c
  2061. * Caller: library/entropy.c
  2062. * library/mbedtls_md.c
  2063. * library/ssl_cli.c
  2064. * library/ssl_srv.c
  2065. * library/ssl_tls.c
  2066. *
  2067. * This module adds support for SHA-224 and SHA-256.
  2068. * This module is required for the SSL/TLS 1.2 PRF function.
  2069. */
  2070. #define MBEDTLS_SHA256_C
  2071. /**
  2072. * \def MBEDTLS_SHA512_C
  2073. *
  2074. * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
  2075. *
  2076. * Module: library/mbedtls_sha512.c
  2077. * Caller: library/entropy.c
  2078. * library/mbedtls_md.c
  2079. * library/ssl_cli.c
  2080. * library/ssl_srv.c
  2081. *
  2082. * This module adds support for SHA-384 and SHA-512.
  2083. */
  2084. #define MBEDTLS_SHA512_C
  2085. /**
  2086. * \def MBEDTLS_SSL_CACHE_C
  2087. *
  2088. * Enable simple SSL cache implementation.
  2089. *
  2090. * Module: library/ssl_cache.c
  2091. * Caller:
  2092. *
  2093. * Requires: MBEDTLS_SSL_CACHE_C
  2094. */
  2095. #define MBEDTLS_SSL_CACHE_C
  2096. /**
  2097. * \def MBEDTLS_SSL_COOKIE_C
  2098. *
  2099. * Enable basic implementation of DTLS cookies for hello verification.
  2100. *
  2101. * Module: library/ssl_cookie.c
  2102. * Caller:
  2103. */
  2104. #define MBEDTLS_SSL_COOKIE_C
  2105. /**
  2106. * \def MBEDTLS_SSL_TICKET_C
  2107. *
  2108. * Enable an implementation of TLS server-side callbacks for session tickets.
  2109. *
  2110. * Module: library/ssl_ticket.c
  2111. * Caller:
  2112. *
  2113. * Requires: MBEDTLS_CIPHER_C
  2114. */
  2115. #define MBEDTLS_SSL_TICKET_C
  2116. /**
  2117. * \def MBEDTLS_SSL_CLI_C
  2118. *
  2119. * Enable the SSL/TLS client code.
  2120. *
  2121. * Module: library/ssl_cli.c
  2122. * Caller:
  2123. *
  2124. * Requires: MBEDTLS_SSL_TLS_C
  2125. *
  2126. * This module is required for SSL/TLS client support.
  2127. */
  2128. #define MBEDTLS_SSL_CLI_C
  2129. /**
  2130. * \def MBEDTLS_SSL_SRV_C
  2131. *
  2132. * Enable the SSL/TLS server code.
  2133. *
  2134. * Module: library/ssl_srv.c
  2135. * Caller:
  2136. *
  2137. * Requires: MBEDTLS_SSL_TLS_C
  2138. *
  2139. * This module is required for SSL/TLS server support.
  2140. */
  2141. #define MBEDTLS_SSL_SRV_C
  2142. /**
  2143. * \def MBEDTLS_SSL_TLS_C
  2144. *
  2145. * Enable the generic SSL/TLS code.
  2146. *
  2147. * Module: library/ssl_tls.c
  2148. * Caller: library/ssl_cli.c
  2149. * library/ssl_srv.c
  2150. *
  2151. * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
  2152. * and at least one of the MBEDTLS_SSL_PROTO_XXX defines
  2153. *
  2154. * This module is required for SSL/TLS.
  2155. */
  2156. #define MBEDTLS_SSL_TLS_C
  2157. /**
  2158. * \def MBEDTLS_THREADING_C
  2159. *
  2160. * Enable the threading abstraction layer.
  2161. * By default mbed TLS assumes it is used in a non-threaded environment or that
  2162. * contexts are not shared between threads. If you do intend to use contexts
  2163. * between threads, you will need to enable this layer to prevent race
  2164. * conditions. See also our Knowledge Base article about threading:
  2165. * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
  2166. *
  2167. * Module: library/threading.c
  2168. *
  2169. * This allows different threading implementations (self-implemented or
  2170. * provided).
  2171. *
  2172. * You will have to enable either MBEDTLS_THREADING_ALT or
  2173. * MBEDTLS_THREADING_PTHREAD.
  2174. *
  2175. * Enable this layer to allow use of mutexes within mbed TLS
  2176. */
  2177. //#define MBEDTLS_THREADING_C
  2178. /**
  2179. * \def MBEDTLS_TIMING_C
  2180. *
  2181. * Enable the semi-portable timing interface.
  2182. *
  2183. * \note The provided implementation only works on POSIX/Unix (including Linux,
  2184. * BSD and OS X) and Windows. On other platforms, you can either disable that
  2185. * module and provide your own implementations of the callbacks needed by
  2186. * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide
  2187. * your own implementation of the whole module by setting
  2188. * \c MBEDTLS_TIMING_ALT in the current file.
  2189. *
  2190. * \note See also our Knowledge Base article about porting to a new
  2191. * environment:
  2192. * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
  2193. *
  2194. * Module: library/timing.c
  2195. * Caller: library/havege.c
  2196. *
  2197. * This module is used by the HAVEGE random number generator.
  2198. */
  2199. #define MBEDTLS_TIMING_C
  2200. /**
  2201. * \def MBEDTLS_VERSION_C
  2202. *
  2203. * Enable run-time version information.
  2204. *
  2205. * Module: library/version.c
  2206. *
  2207. * This module provides run-time version information.
  2208. */
  2209. #define MBEDTLS_VERSION_C
  2210. /**
  2211. * \def MBEDTLS_X509_USE_C
  2212. *
  2213. * Enable X.509 core for using certificates.
  2214. *
  2215. * Module: library/x509.c
  2216. * Caller: library/mbedtls_x509_crl.c
  2217. * library/mbedtls_x509_crt.c
  2218. * library/mbedtls_x509_csr.c
  2219. *
  2220. * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
  2221. * MBEDTLS_PK_PARSE_C
  2222. *
  2223. * This module is required for the X.509 parsing modules.
  2224. */
  2225. #define MBEDTLS_X509_USE_C
  2226. /**
  2227. * \def MBEDTLS_X509_CRT_PARSE_C
  2228. *
  2229. * Enable X.509 certificate parsing.
  2230. *
  2231. * Module: library/mbedtls_x509_crt.c
  2232. * Caller: library/ssl_cli.c
  2233. * library/ssl_srv.c
  2234. * library/ssl_tls.c
  2235. *
  2236. * Requires: MBEDTLS_X509_USE_C
  2237. *
  2238. * This module is required for X.509 certificate parsing.
  2239. */
  2240. #define MBEDTLS_X509_CRT_PARSE_C
  2241. /**
  2242. * \def MBEDTLS_X509_CRL_PARSE_C
  2243. *
  2244. * Enable X.509 CRL parsing.
  2245. *
  2246. * Module: library/mbedtls_x509_crl.c
  2247. * Caller: library/mbedtls_x509_crt.c
  2248. *
  2249. * Requires: MBEDTLS_X509_USE_C
  2250. *
  2251. * This module is required for X.509 CRL parsing.
  2252. */
  2253. #define MBEDTLS_X509_CRL_PARSE_C
  2254. /**
  2255. * \def MBEDTLS_X509_CSR_PARSE_C
  2256. *
  2257. * Enable X.509 Certificate Signing Request (CSR) parsing.
  2258. *
  2259. * Module: library/mbedtls_x509_csr.c
  2260. * Caller: library/x509_crt_write.c
  2261. *
  2262. * Requires: MBEDTLS_X509_USE_C
  2263. *
  2264. * This module is used for reading X.509 certificate request.
  2265. */
  2266. #define MBEDTLS_X509_CSR_PARSE_C
  2267. /**
  2268. * \def MBEDTLS_X509_CREATE_C
  2269. *
  2270. * Enable X.509 core for creating certificates.
  2271. *
  2272. * Module: library/x509_create.c
  2273. *
  2274. * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C
  2275. *
  2276. * This module is the basis for creating X.509 certificates and CSRs.
  2277. */
  2278. #define MBEDTLS_X509_CREATE_C
  2279. /**
  2280. * \def MBEDTLS_X509_CRT_WRITE_C
  2281. *
  2282. * Enable creating X.509 certificates.
  2283. *
  2284. * Module: library/x509_crt_write.c
  2285. *
  2286. * Requires: MBEDTLS_X509_CREATE_C
  2287. *
  2288. * This module is required for X.509 certificate creation.
  2289. */
  2290. #define MBEDTLS_X509_CRT_WRITE_C
  2291. /**
  2292. * \def MBEDTLS_X509_CSR_WRITE_C
  2293. *
  2294. * Enable creating X.509 Certificate Signing Requests (CSR).
  2295. *
  2296. * Module: library/x509_csr_write.c
  2297. *
  2298. * Requires: MBEDTLS_X509_CREATE_C
  2299. *
  2300. * This module is required for X.509 certificate request writing.
  2301. */
  2302. #define MBEDTLS_X509_CSR_WRITE_C
  2303. /**
  2304. * \def MBEDTLS_XTEA_C
  2305. *
  2306. * Enable the XTEA block cipher.
  2307. *
  2308. * Module: library/xtea.c
  2309. * Caller:
  2310. */
  2311. #define MBEDTLS_XTEA_C
  2312. /* \} name SECTION: mbed TLS modules */
  2313. /**
  2314. * \name SECTION: Module configuration options
  2315. *
  2316. * This section allows for the setting of module specific sizes and
  2317. * configuration options. The default values are already present in the
  2318. * relevant header files and should suffice for the regular use cases.
  2319. *
  2320. * Our advice is to enable options and change their values here
  2321. * only if you have a good reason and know the consequences.
  2322. *
  2323. * Please check the respective header file for documentation on these
  2324. * parameters (to prevent duplicate documentation).
  2325. * \{
  2326. */
  2327. /* MPI / BIGNUM options */
  2328. //#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
  2329. //#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
  2330. /* CTR_DRBG options */
  2331. //#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
  2332. //#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
  2333. //#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
  2334. //#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
  2335. //#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
  2336. /* HMAC_DRBG options */
  2337. //#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
  2338. //#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
  2339. //#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
  2340. //#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
  2341. /* ECP options */
  2342. //#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
  2343. //#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */
  2344. //#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
  2345. /* Entropy options */
  2346. //#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
  2347. //#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
  2348. //#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */
  2349. /* Memory buffer allocator options */
  2350. //#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
  2351. /* Platform options */
  2352. //#define MBEDTLS_PLATFORM_STD_MEM_HDR <stdlib.h> /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */
  2353. //#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
  2354. //#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
  2355. //#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
  2356. //#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
  2357. //#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
  2358. //#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
  2359. /* Note: your snprintf must correclty zero-terminate the buffer! */
  2360. //#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
  2361. //#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */
  2362. //#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */
  2363. //#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
  2364. //#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
  2365. //#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */
  2366. /* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
  2367. /* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
  2368. //#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */
  2369. //#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
  2370. //#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
  2371. //#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
  2372. //#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
  2373. //#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
  2374. //#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
  2375. /* Note: your snprintf must correclty zero-terminate the buffer! */
  2376. //#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
  2377. //#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
  2378. //#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
  2379. /* SSL Cache options */
  2380. //#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
  2381. //#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
  2382. /* SSL options */
  2383. //#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */
  2384. //#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
  2385. //#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */
  2386. //#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
  2387. /**
  2388. * Complete list of ciphersuites to use, in order of preference.
  2389. *
  2390. * \warning No dependency checking is done on that field! This option can only
  2391. * be used to restrict the set of available ciphersuites. It is your
  2392. * responsibility to make sure the needed modules are active.
  2393. *
  2394. * Use this to save a few hundred bytes of ROM (default ordering of all
  2395. * available ciphersuites) and a few to a few hundred bytes of RAM.
  2396. *
  2397. * The value below is only an example, not the default.
  2398. */
  2399. //#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
  2400. /* X509 options */
  2401. //#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
  2402. //#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
  2403. /* \} name SECTION: Customisation configuration options */
  2404. /* Target and application specific configurations */
  2405. //#define YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE "mbedtls/target_config.h"
  2406. #if defined(TARGET_LIKE_MBED) && defined(YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE)
  2407. #include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
  2408. #endif
  2409. /*
  2410. * Allow user to override any previous default.
  2411. *
  2412. * Use two macro names for that, as:
  2413. * - with yotta the prefix YOTTA_CFG_ is forced
  2414. * - without yotta is looks weird to have a YOTTA prefix.
  2415. */
  2416. #if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE)
  2417. #include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
  2418. #elif defined(MBEDTLS_USER_CONFIG_FILE)
  2419. #include MBEDTLS_USER_CONFIG_FILE
  2420. #endif
  2421. #include "check_config.h"
  2422. #endif /* MBEDTLS_CONFIG_H */