config.h 101 KB

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