mbedtls_config.h 132 KB

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