config.h 88 KB

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