config.h 106 KB

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