HAL_TLS_config.h 91 KB

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