config.h 83 KB

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