mbedtls_config_air101.h 89 KB

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