config.h 98 KB

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