config.h 89 KB

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