config.h 111 KB

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