config.h 132 KB

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