ssl_ciphersuites.c 79 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857
  1. /**
  2. * \file ssl_ciphersuites.c
  3. *
  4. * \brief SSL ciphersuites for mbed TLS
  5. *
  6. * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
  7. * SPDX-License-Identifier: Apache-2.0
  8. *
  9. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  10. * not use this file except in compliance with the License.
  11. * You may obtain a copy of the License at
  12. *
  13. * http://www.apache.org/licenses/LICENSE-2.0
  14. *
  15. * Unless required by applicable law or agreed to in writing, software
  16. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  17. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. * See the License for the specific language governing permissions and
  19. * limitations under the License.
  20. *
  21. * This file is part of mbed TLS (https://tls.mbed.org)
  22. */
  23. #if !defined(MBEDTLS_CONFIG_FILE)
  24. #include "mbedtls/config.h"
  25. #else
  26. #include MBEDTLS_CONFIG_FILE
  27. #endif
  28. #if defined(MBEDTLS_SSL_TLS_C)
  29. #if defined(MBEDTLS_PLATFORM_C)
  30. #include "mbedtls/platform.h"
  31. #else
  32. #include <stdlib.h>
  33. #endif
  34. #include "mbedtls/ssl_ciphersuites.h"
  35. #include "mbedtls/ssl.h"
  36. #include <string.h>
  37. /*
  38. * Ordered from most preferred to least preferred in terms of security.
  39. *
  40. * Current rule (except rc4, weak and null which come last):
  41. * 1. By key exchange:
  42. * Forward-secure non-PSK > forward-secure PSK > ECJPAKE > other non-PSK > other PSK
  43. * 2. By key length and cipher:
  44. * AES-256 > Camellia-256 > AES-128 > Camellia-128 > 3DES
  45. * 3. By cipher mode when relevant GCM > CCM > CBC > CCM_8
  46. * 4. By hash function used when relevant
  47. * 5. By key exchange/auth again: EC > non-EC
  48. */
  49. static const int ciphersuite_preference[] =
  50. {
  51. #if defined(MBEDTLS_SSL_CIPHERSUITES)
  52. MBEDTLS_SSL_CIPHERSUITES,
  53. #else
  54. /* All AES-256 ephemeral suites */
  55. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
  56. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
  57. MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,
  58. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM,
  59. MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM,
  60. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
  61. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,
  62. MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,
  63. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
  64. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
  65. MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
  66. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8,
  67. MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8,
  68. /* All CAMELLIA-256 ephemeral suites */
  69. MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384,
  70. MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384,
  71. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384,
  72. MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
  73. MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
  74. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
  75. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
  76. /* All AES-128 ephemeral suites */
  77. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
  78. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
  79. MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
  80. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM,
  81. MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM,
  82. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
  83. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
  84. MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,
  85. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
  86. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
  87. MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
  88. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8,
  89. MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8,
  90. /* All CAMELLIA-128 ephemeral suites */
  91. MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256,
  92. MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256,
  93. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256,
  94. MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
  95. MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  96. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  97. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
  98. /* All remaining >= 128-bit ephemeral suites */
  99. MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
  100. MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
  101. MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
  102. /* The PSK ephemeral suites */
  103. MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384,
  104. MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM,
  105. MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
  106. MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384,
  107. MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA,
  108. MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA,
  109. MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384,
  110. MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  111. MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  112. MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8,
  113. MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256,
  114. MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM,
  115. MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
  116. MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256,
  117. MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA,
  118. MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA,
  119. MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256,
  120. MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  121. MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  122. MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8,
  123. MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
  124. MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
  125. /* The ECJPAKE suite */
  126. MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8,
  127. /* All AES-256 suites */
  128. MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384,
  129. MBEDTLS_TLS_RSA_WITH_AES_256_CCM,
  130. MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256,
  131. MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA,
  132. MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384,
  133. MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384,
  134. MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA,
  135. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,
  136. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384,
  137. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
  138. MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8,
  139. /* All CAMELLIA-256 suites */
  140. MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384,
  141. MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256,
  142. MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA,
  143. MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384,
  144. MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384,
  145. MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384,
  146. MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
  147. /* All AES-128 suites */
  148. MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256,
  149. MBEDTLS_TLS_RSA_WITH_AES_128_CCM,
  150. MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256,
  151. MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA,
  152. MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256,
  153. MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256,
  154. MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA,
  155. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
  156. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256,
  157. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
  158. MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8,
  159. /* All CAMELLIA-128 suites */
  160. MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256,
  161. MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  162. MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA,
  163. MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256,
  164. MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  165. MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256,
  166. MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
  167. /* All remaining >= 128-bit suites */
  168. MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA,
  169. MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,
  170. MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,
  171. /* The RSA PSK suites */
  172. MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384,
  173. MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384,
  174. MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA,
  175. MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384,
  176. MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  177. MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256,
  178. MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256,
  179. MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA,
  180. MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256,
  181. MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  182. MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
  183. /* The PSK suites */
  184. MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384,
  185. MBEDTLS_TLS_PSK_WITH_AES_256_CCM,
  186. MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384,
  187. MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA,
  188. MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384,
  189. MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  190. MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8,
  191. MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256,
  192. MBEDTLS_TLS_PSK_WITH_AES_128_CCM,
  193. MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256,
  194. MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA,
  195. MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256,
  196. MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  197. MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8,
  198. MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA,
  199. /* RC4 suites */
  200. MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
  201. MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA,
  202. MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA,
  203. MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA,
  204. MBEDTLS_TLS_RSA_WITH_RC4_128_SHA,
  205. MBEDTLS_TLS_RSA_WITH_RC4_128_MD5,
  206. MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA,
  207. MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA,
  208. MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA,
  209. MBEDTLS_TLS_PSK_WITH_RC4_128_SHA,
  210. /* Weak suites */
  211. MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA,
  212. MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA,
  213. /* NULL suites */
  214. MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA,
  215. MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA,
  216. MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384,
  217. MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256,
  218. MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA,
  219. MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384,
  220. MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256,
  221. MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA,
  222. MBEDTLS_TLS_RSA_WITH_NULL_SHA256,
  223. MBEDTLS_TLS_RSA_WITH_NULL_SHA,
  224. MBEDTLS_TLS_RSA_WITH_NULL_MD5,
  225. MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA,
  226. MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA,
  227. MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384,
  228. MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256,
  229. MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA,
  230. MBEDTLS_TLS_PSK_WITH_NULL_SHA384,
  231. MBEDTLS_TLS_PSK_WITH_NULL_SHA256,
  232. MBEDTLS_TLS_PSK_WITH_NULL_SHA,
  233. #endif /* MBEDTLS_SSL_CIPHERSUITES */
  234. 0
  235. };
  236. static const mbedtls_ssl_ciphersuite_t ciphersuite_definitions[] =
  237. {
  238. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
  239. #if defined(MBEDTLS_AES_C)
  240. #if defined(MBEDTLS_SHA1_C)
  241. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  242. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, "TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA",
  243. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  244. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  245. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  246. 0 },
  247. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, "TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA",
  248. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  249. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  250. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  251. 0 },
  252. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  253. #endif /* MBEDTLS_SHA1_C */
  254. #if defined(MBEDTLS_SHA256_C)
  255. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  256. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, "TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256",
  257. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  258. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  259. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  260. 0 },
  261. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  262. #if defined(MBEDTLS_GCM_C)
  263. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, "TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256",
  264. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  265. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  266. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  267. 0 },
  268. #endif /* MBEDTLS_GCM_C */
  269. #endif /* MBEDTLS_SHA256_C */
  270. #if defined(MBEDTLS_SHA512_C)
  271. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  272. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, "TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384",
  273. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  274. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  275. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  276. 0 },
  277. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  278. #if defined(MBEDTLS_GCM_C)
  279. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, "TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384",
  280. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  281. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  282. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  283. 0 },
  284. #endif /* MBEDTLS_GCM_C */
  285. #endif /* MBEDTLS_SHA512_C */
  286. #if defined(MBEDTLS_CCM_C)
  287. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM, "TLS-ECDHE-ECDSA-WITH-AES-256-CCM",
  288. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  289. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  290. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  291. 0 },
  292. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8, "TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8",
  293. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  294. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  295. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  296. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  297. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM, "TLS-ECDHE-ECDSA-WITH-AES-128-CCM",
  298. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  299. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  300. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  301. 0 },
  302. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8, "TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8",
  303. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  304. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  305. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  306. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  307. #endif /* MBEDTLS_CCM_C */
  308. #endif /* MBEDTLS_AES_C */
  309. #if defined(MBEDTLS_CAMELLIA_C)
  310. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  311. #if defined(MBEDTLS_SHA256_C)
  312. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-ECDHE-ECDSA-WITH-CAMELLIA-128-CBC-SHA256",
  313. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  314. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  315. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  316. 0 },
  317. #endif /* MBEDTLS_SHA256_C */
  318. #if defined(MBEDTLS_SHA512_C)
  319. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, "TLS-ECDHE-ECDSA-WITH-CAMELLIA-256-CBC-SHA384",
  320. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  321. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  322. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  323. 0 },
  324. #endif /* MBEDTLS_SHA512_C */
  325. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  326. #if defined(MBEDTLS_GCM_C)
  327. #if defined(MBEDTLS_SHA256_C)
  328. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-ECDHE-ECDSA-WITH-CAMELLIA-128-GCM-SHA256",
  329. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  330. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  331. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  332. 0 },
  333. #endif /* MBEDTLS_SHA256_C */
  334. #if defined(MBEDTLS_SHA512_C)
  335. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-ECDHE-ECDSA-WITH-CAMELLIA-256-GCM-SHA384",
  336. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  337. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  338. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  339. 0 },
  340. #endif /* MBEDTLS_SHA512_C */
  341. #endif /* MBEDTLS_GCM_C */
  342. #endif /* MBEDTLS_CAMELLIA_C */
  343. #if defined(MBEDTLS_DES_C)
  344. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  345. #if defined(MBEDTLS_SHA1_C)
  346. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, "TLS-ECDHE-ECDSA-WITH-3DES-EDE-CBC-SHA",
  347. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  348. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  349. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  350. 0 },
  351. #endif /* MBEDTLS_SHA1_C */
  352. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  353. #endif /* MBEDTLS_DES_C */
  354. #if defined(MBEDTLS_ARC4_C)
  355. #if defined(MBEDTLS_SHA1_C)
  356. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, "TLS-ECDHE-ECDSA-WITH-RC4-128-SHA",
  357. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  358. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  359. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  360. MBEDTLS_CIPHERSUITE_NODTLS },
  361. #endif /* MBEDTLS_SHA1_C */
  362. #endif /* MBEDTLS_ARC4_C */
  363. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  364. #if defined(MBEDTLS_SHA1_C)
  365. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA, "TLS-ECDHE-ECDSA-WITH-NULL-SHA",
  366. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  367. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  368. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  369. MBEDTLS_CIPHERSUITE_WEAK },
  370. #endif /* MBEDTLS_SHA1_C */
  371. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  372. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED */
  373. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)
  374. #if defined(MBEDTLS_AES_C)
  375. #if defined(MBEDTLS_SHA1_C)
  376. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  377. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, "TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA",
  378. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  379. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  380. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  381. 0 },
  382. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, "TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA",
  383. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  384. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  385. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  386. 0 },
  387. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  388. #endif /* MBEDTLS_SHA1_C */
  389. #if defined(MBEDTLS_SHA256_C)
  390. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  391. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, "TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256",
  392. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  393. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  394. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  395. 0 },
  396. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  397. #if defined(MBEDTLS_GCM_C)
  398. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, "TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256",
  399. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  400. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  401. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  402. 0 },
  403. #endif /* MBEDTLS_GCM_C */
  404. #endif /* MBEDTLS_SHA256_C */
  405. #if defined(MBEDTLS_SHA512_C)
  406. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  407. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, "TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384",
  408. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  409. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  410. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  411. 0 },
  412. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  413. #if defined(MBEDTLS_GCM_C)
  414. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, "TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384",
  415. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  416. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  417. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  418. 0 },
  419. #endif /* MBEDTLS_GCM_C */
  420. #endif /* MBEDTLS_SHA512_C */
  421. #endif /* MBEDTLS_AES_C */
  422. #if defined(MBEDTLS_CAMELLIA_C)
  423. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  424. #if defined(MBEDTLS_SHA256_C)
  425. { MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-ECDHE-RSA-WITH-CAMELLIA-128-CBC-SHA256",
  426. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  427. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  428. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  429. 0 },
  430. #endif /* MBEDTLS_SHA256_C */
  431. #if defined(MBEDTLS_SHA512_C)
  432. { MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384, "TLS-ECDHE-RSA-WITH-CAMELLIA-256-CBC-SHA384",
  433. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  434. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  435. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  436. 0 },
  437. #endif /* MBEDTLS_SHA512_C */
  438. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  439. #if defined(MBEDTLS_GCM_C)
  440. #if defined(MBEDTLS_SHA256_C)
  441. { MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-ECDHE-RSA-WITH-CAMELLIA-128-GCM-SHA256",
  442. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  443. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  444. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  445. 0 },
  446. #endif /* MBEDTLS_SHA256_C */
  447. #if defined(MBEDTLS_SHA512_C)
  448. { MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-ECDHE-RSA-WITH-CAMELLIA-256-GCM-SHA384",
  449. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  450. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  451. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  452. 0 },
  453. #endif /* MBEDTLS_SHA512_C */
  454. #endif /* MBEDTLS_GCM_C */
  455. #endif /* MBEDTLS_CAMELLIA_C */
  456. #if defined(MBEDTLS_DES_C)
  457. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  458. #if defined(MBEDTLS_SHA1_C)
  459. { MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, "TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA",
  460. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  461. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  462. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  463. 0 },
  464. #endif /* MBEDTLS_SHA1_C */
  465. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  466. #endif /* MBEDTLS_DES_C */
  467. #if defined(MBEDTLS_ARC4_C)
  468. #if defined(MBEDTLS_SHA1_C)
  469. { MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA, "TLS-ECDHE-RSA-WITH-RC4-128-SHA",
  470. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  471. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  472. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  473. MBEDTLS_CIPHERSUITE_NODTLS },
  474. #endif /* MBEDTLS_SHA1_C */
  475. #endif /* MBEDTLS_ARC4_C */
  476. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  477. #if defined(MBEDTLS_SHA1_C)
  478. { MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA, "TLS-ECDHE-RSA-WITH-NULL-SHA",
  479. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  480. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  481. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  482. MBEDTLS_CIPHERSUITE_WEAK },
  483. #endif /* MBEDTLS_SHA1_C */
  484. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  485. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED */
  486. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)
  487. #if defined(MBEDTLS_AES_C)
  488. #if defined(MBEDTLS_SHA512_C) && defined(MBEDTLS_GCM_C)
  489. { MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, "TLS-DHE-RSA-WITH-AES-256-GCM-SHA384",
  490. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  491. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  492. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  493. 0 },
  494. #endif /* MBEDTLS_SHA512_C && MBEDTLS_GCM_C */
  495. #if defined(MBEDTLS_SHA256_C)
  496. #if defined(MBEDTLS_GCM_C)
  497. { MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, "TLS-DHE-RSA-WITH-AES-128-GCM-SHA256",
  498. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  499. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  500. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  501. 0 },
  502. #endif /* MBEDTLS_GCM_C */
  503. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  504. { MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, "TLS-DHE-RSA-WITH-AES-128-CBC-SHA256",
  505. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  506. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  507. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  508. 0 },
  509. { MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, "TLS-DHE-RSA-WITH-AES-256-CBC-SHA256",
  510. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  511. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  512. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  513. 0 },
  514. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  515. #endif /* MBEDTLS_SHA256_C */
  516. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  517. #if defined(MBEDTLS_SHA1_C)
  518. { MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA, "TLS-DHE-RSA-WITH-AES-128-CBC-SHA",
  519. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  520. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  521. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  522. 0 },
  523. { MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA, "TLS-DHE-RSA-WITH-AES-256-CBC-SHA",
  524. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  525. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  526. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  527. 0 },
  528. #endif /* MBEDTLS_SHA1_C */
  529. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  530. #if defined(MBEDTLS_CCM_C)
  531. { MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM, "TLS-DHE-RSA-WITH-AES-256-CCM",
  532. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  533. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  534. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  535. 0 },
  536. { MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8, "TLS-DHE-RSA-WITH-AES-256-CCM-8",
  537. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  538. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  539. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  540. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  541. { MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM, "TLS-DHE-RSA-WITH-AES-128-CCM",
  542. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  543. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  544. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  545. 0 },
  546. { MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8, "TLS-DHE-RSA-WITH-AES-128-CCM-8",
  547. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  548. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  549. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  550. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  551. #endif /* MBEDTLS_CCM_C */
  552. #endif /* MBEDTLS_AES_C */
  553. #if defined(MBEDTLS_CAMELLIA_C)
  554. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  555. #if defined(MBEDTLS_SHA256_C)
  556. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256",
  557. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  558. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  559. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  560. 0 },
  561. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256, "TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256",
  562. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  563. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  564. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  565. 0 },
  566. #endif /* MBEDTLS_SHA256_C */
  567. #if defined(MBEDTLS_SHA1_C)
  568. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA, "TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA",
  569. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  570. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  571. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  572. 0 },
  573. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA, "TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA",
  574. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  575. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  576. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  577. 0 },
  578. #endif /* MBEDTLS_SHA1_C */
  579. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  580. #if defined(MBEDTLS_GCM_C)
  581. #if defined(MBEDTLS_SHA256_C)
  582. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-DHE-RSA-WITH-CAMELLIA-128-GCM-SHA256",
  583. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  584. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  585. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  586. 0 },
  587. #endif /* MBEDTLS_SHA256_C */
  588. #if defined(MBEDTLS_SHA512_C)
  589. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-DHE-RSA-WITH-CAMELLIA-256-GCM-SHA384",
  590. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  591. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  592. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  593. 0 },
  594. #endif /* MBEDTLS_SHA512_C */
  595. #endif /* MBEDTLS_GCM_C */
  596. #endif /* MBEDTLS_CAMELLIA_C */
  597. #if defined(MBEDTLS_DES_C)
  598. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  599. #if defined(MBEDTLS_SHA1_C)
  600. { MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, "TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA",
  601. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  602. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  603. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  604. 0 },
  605. #endif /* MBEDTLS_SHA1_C */
  606. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  607. #endif /* MBEDTLS_DES_C */
  608. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */
  609. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)
  610. #if defined(MBEDTLS_AES_C)
  611. #if defined(MBEDTLS_SHA512_C) && defined(MBEDTLS_GCM_C)
  612. { MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384, "TLS-RSA-WITH-AES-256-GCM-SHA384",
  613. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA,
  614. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  615. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  616. 0 },
  617. #endif /* MBEDTLS_SHA512_C && MBEDTLS_GCM_C */
  618. #if defined(MBEDTLS_SHA256_C)
  619. #if defined(MBEDTLS_GCM_C)
  620. { MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256, "TLS-RSA-WITH-AES-128-GCM-SHA256",
  621. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  622. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  623. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  624. 0 },
  625. #endif /* MBEDTLS_GCM_C */
  626. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  627. { MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256, "TLS-RSA-WITH-AES-128-CBC-SHA256",
  628. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  629. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  630. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  631. 0 },
  632. { MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256, "TLS-RSA-WITH-AES-256-CBC-SHA256",
  633. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  634. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  635. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  636. 0 },
  637. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  638. #endif /* MBEDTLS_SHA256_C */
  639. #if defined(MBEDTLS_SHA1_C)
  640. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  641. { MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA, "TLS-RSA-WITH-AES-128-CBC-SHA",
  642. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  643. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  644. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  645. 0 },
  646. { MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA, "TLS-RSA-WITH-AES-256-CBC-SHA",
  647. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  648. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  649. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  650. 0 },
  651. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  652. #endif /* MBEDTLS_SHA1_C */
  653. #if defined(MBEDTLS_CCM_C)
  654. { MBEDTLS_TLS_RSA_WITH_AES_256_CCM, "TLS-RSA-WITH-AES-256-CCM",
  655. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  656. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  657. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  658. 0 },
  659. { MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8, "TLS-RSA-WITH-AES-256-CCM-8",
  660. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  661. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  662. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  663. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  664. { MBEDTLS_TLS_RSA_WITH_AES_128_CCM, "TLS-RSA-WITH-AES-128-CCM",
  665. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  666. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  667. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  668. 0 },
  669. { MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8, "TLS-RSA-WITH-AES-128-CCM-8",
  670. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  671. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  672. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  673. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  674. #endif /* MBEDTLS_CCM_C */
  675. #endif /* MBEDTLS_AES_C */
  676. #if defined(MBEDTLS_CAMELLIA_C)
  677. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  678. #if defined(MBEDTLS_SHA256_C)
  679. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256",
  680. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  681. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  682. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  683. 0 },
  684. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256, "TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256",
  685. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  686. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  687. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  688. 0 },
  689. #endif /* MBEDTLS_SHA256_C */
  690. #if defined(MBEDTLS_SHA1_C)
  691. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA, "TLS-RSA-WITH-CAMELLIA-128-CBC-SHA",
  692. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  693. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  694. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  695. 0 },
  696. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA, "TLS-RSA-WITH-CAMELLIA-256-CBC-SHA",
  697. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  698. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  699. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  700. 0 },
  701. #endif /* MBEDTLS_SHA1_C */
  702. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  703. #if defined(MBEDTLS_GCM_C)
  704. #if defined(MBEDTLS_SHA256_C)
  705. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-RSA-WITH-CAMELLIA-128-GCM-SHA256",
  706. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  707. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  708. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  709. 0 },
  710. #endif /* MBEDTLS_SHA256_C */
  711. #if defined(MBEDTLS_SHA1_C)
  712. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-RSA-WITH-CAMELLIA-256-GCM-SHA384",
  713. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA,
  714. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  715. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  716. 0 },
  717. #endif /* MBEDTLS_SHA1_C */
  718. #endif /* MBEDTLS_GCM_C */
  719. #endif /* MBEDTLS_CAMELLIA_C */
  720. #if defined(MBEDTLS_DES_C)
  721. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  722. #if defined(MBEDTLS_SHA1_C)
  723. { MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA, "TLS-RSA-WITH-3DES-EDE-CBC-SHA",
  724. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  725. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  726. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  727. 0 },
  728. #endif /* MBEDTLS_SHA1_C */
  729. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  730. #endif /* MBEDTLS_DES_C */
  731. #if defined(MBEDTLS_ARC4_C)
  732. #if defined(MBEDTLS_MD5_C)
  733. { MBEDTLS_TLS_RSA_WITH_RC4_128_MD5, "TLS-RSA-WITH-RC4-128-MD5",
  734. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_MD5, MBEDTLS_KEY_EXCHANGE_RSA,
  735. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  736. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  737. MBEDTLS_CIPHERSUITE_NODTLS },
  738. #endif
  739. #if defined(MBEDTLS_SHA1_C)
  740. { MBEDTLS_TLS_RSA_WITH_RC4_128_SHA, "TLS-RSA-WITH-RC4-128-SHA",
  741. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  742. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  743. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  744. MBEDTLS_CIPHERSUITE_NODTLS },
  745. #endif
  746. #endif /* MBEDTLS_ARC4_C */
  747. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */
  748. #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED)
  749. #if defined(MBEDTLS_AES_C)
  750. #if defined(MBEDTLS_SHA1_C)
  751. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  752. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, "TLS-ECDH-RSA-WITH-AES-128-CBC-SHA",
  753. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  754. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  755. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  756. 0 },
  757. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, "TLS-ECDH-RSA-WITH-AES-256-CBC-SHA",
  758. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  759. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  760. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  761. 0 },
  762. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  763. #endif /* MBEDTLS_SHA1_C */
  764. #if defined(MBEDTLS_SHA256_C)
  765. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  766. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, "TLS-ECDH-RSA-WITH-AES-128-CBC-SHA256",
  767. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  768. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  769. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  770. 0 },
  771. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  772. #if defined(MBEDTLS_GCM_C)
  773. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, "TLS-ECDH-RSA-WITH-AES-128-GCM-SHA256",
  774. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  775. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  776. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  777. 0 },
  778. #endif /* MBEDTLS_GCM_C */
  779. #endif /* MBEDTLS_SHA256_C */
  780. #if defined(MBEDTLS_SHA512_C)
  781. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  782. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, "TLS-ECDH-RSA-WITH-AES-256-CBC-SHA384",
  783. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  784. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  785. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  786. 0 },
  787. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  788. #if defined(MBEDTLS_GCM_C)
  789. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, "TLS-ECDH-RSA-WITH-AES-256-GCM-SHA384",
  790. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  791. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  792. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  793. 0 },
  794. #endif /* MBEDTLS_GCM_C */
  795. #endif /* MBEDTLS_SHA512_C */
  796. #endif /* MBEDTLS_AES_C */
  797. #if defined(MBEDTLS_CAMELLIA_C)
  798. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  799. #if defined(MBEDTLS_SHA256_C)
  800. { MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-ECDH-RSA-WITH-CAMELLIA-128-CBC-SHA256",
  801. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  802. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  803. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  804. 0 },
  805. #endif /* MBEDTLS_SHA256_C */
  806. #if defined(MBEDTLS_SHA512_C)
  807. { MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384, "TLS-ECDH-RSA-WITH-CAMELLIA-256-CBC-SHA384",
  808. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  809. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  810. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  811. 0 },
  812. #endif /* MBEDTLS_SHA512_C */
  813. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  814. #if defined(MBEDTLS_GCM_C)
  815. #if defined(MBEDTLS_SHA256_C)
  816. { MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-ECDH-RSA-WITH-CAMELLIA-128-GCM-SHA256",
  817. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  818. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  819. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  820. 0 },
  821. #endif /* MBEDTLS_SHA256_C */
  822. #if defined(MBEDTLS_SHA512_C)
  823. { MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-ECDH-RSA-WITH-CAMELLIA-256-GCM-SHA384",
  824. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  825. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  826. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  827. 0 },
  828. #endif /* MBEDTLS_SHA512_C */
  829. #endif /* MBEDTLS_GCM_C */
  830. #endif /* MBEDTLS_CAMELLIA_C */
  831. #if defined(MBEDTLS_DES_C)
  832. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  833. #if defined(MBEDTLS_SHA1_C)
  834. { MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, "TLS-ECDH-RSA-WITH-3DES-EDE-CBC-SHA",
  835. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  836. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  837. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  838. 0 },
  839. #endif /* MBEDTLS_SHA1_C */
  840. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  841. #endif /* MBEDTLS_DES_C */
  842. #if defined(MBEDTLS_ARC4_C)
  843. #if defined(MBEDTLS_SHA1_C)
  844. { MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA, "TLS-ECDH-RSA-WITH-RC4-128-SHA",
  845. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  846. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  847. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  848. MBEDTLS_CIPHERSUITE_NODTLS },
  849. #endif /* MBEDTLS_SHA1_C */
  850. #endif /* MBEDTLS_ARC4_C */
  851. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  852. #if defined(MBEDTLS_SHA1_C)
  853. { MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA, "TLS-ECDH-RSA-WITH-NULL-SHA",
  854. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  855. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  856. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  857. MBEDTLS_CIPHERSUITE_WEAK },
  858. #endif /* MBEDTLS_SHA1_C */
  859. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  860. #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED */
  861. #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
  862. #if defined(MBEDTLS_AES_C)
  863. #if defined(MBEDTLS_SHA1_C)
  864. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  865. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, "TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA",
  866. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  867. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  868. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  869. 0 },
  870. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, "TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA",
  871. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  872. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  873. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  874. 0 },
  875. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  876. #endif /* MBEDTLS_SHA1_C */
  877. #if defined(MBEDTLS_SHA256_C)
  878. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  879. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, "TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA256",
  880. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  881. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  882. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  883. 0 },
  884. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  885. #if defined(MBEDTLS_GCM_C)
  886. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, "TLS-ECDH-ECDSA-WITH-AES-128-GCM-SHA256",
  887. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  888. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  889. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  890. 0 },
  891. #endif /* MBEDTLS_GCM_C */
  892. #endif /* MBEDTLS_SHA256_C */
  893. #if defined(MBEDTLS_SHA512_C)
  894. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  895. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, "TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA384",
  896. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  897. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  898. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  899. 0 },
  900. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  901. #if defined(MBEDTLS_GCM_C)
  902. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, "TLS-ECDH-ECDSA-WITH-AES-256-GCM-SHA384",
  903. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  904. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  905. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  906. 0 },
  907. #endif /* MBEDTLS_GCM_C */
  908. #endif /* MBEDTLS_SHA512_C */
  909. #endif /* MBEDTLS_AES_C */
  910. #if defined(MBEDTLS_CAMELLIA_C)
  911. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  912. #if defined(MBEDTLS_SHA256_C)
  913. { MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-ECDH-ECDSA-WITH-CAMELLIA-128-CBC-SHA256",
  914. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  915. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  916. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  917. 0 },
  918. #endif /* MBEDTLS_SHA256_C */
  919. #if defined(MBEDTLS_SHA512_C)
  920. { MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, "TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384",
  921. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  922. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  923. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  924. 0 },
  925. #endif /* MBEDTLS_SHA512_C */
  926. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  927. #if defined(MBEDTLS_GCM_C)
  928. #if defined(MBEDTLS_SHA256_C)
  929. { MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-ECDH-ECDSA-WITH-CAMELLIA-128-GCM-SHA256",
  930. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  931. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  932. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  933. 0 },
  934. #endif /* MBEDTLS_SHA256_C */
  935. #if defined(MBEDTLS_SHA512_C)
  936. { MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-ECDH-ECDSA-WITH-CAMELLIA-256-GCM-SHA384",
  937. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  938. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  939. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  940. 0 },
  941. #endif /* MBEDTLS_SHA512_C */
  942. #endif /* MBEDTLS_GCM_C */
  943. #endif /* MBEDTLS_CAMELLIA_C */
  944. #if defined(MBEDTLS_DES_C)
  945. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  946. #if defined(MBEDTLS_SHA1_C)
  947. { MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, "TLS-ECDH-ECDSA-WITH-3DES-EDE-CBC-SHA",
  948. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  949. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  950. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  951. 0 },
  952. #endif /* MBEDTLS_SHA1_C */
  953. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  954. #endif /* MBEDTLS_DES_C */
  955. #if defined(MBEDTLS_ARC4_C)
  956. #if defined(MBEDTLS_SHA1_C)
  957. { MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA, "TLS-ECDH-ECDSA-WITH-RC4-128-SHA",
  958. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  959. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  960. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  961. MBEDTLS_CIPHERSUITE_NODTLS },
  962. #endif /* MBEDTLS_SHA1_C */
  963. #endif /* MBEDTLS_ARC4_C */
  964. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  965. #if defined(MBEDTLS_SHA1_C)
  966. { MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA, "TLS-ECDH-ECDSA-WITH-NULL-SHA",
  967. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  968. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  969. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  970. MBEDTLS_CIPHERSUITE_WEAK },
  971. #endif /* MBEDTLS_SHA1_C */
  972. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  973. #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */
  974. #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)
  975. #if defined(MBEDTLS_AES_C)
  976. #if defined(MBEDTLS_GCM_C)
  977. #if defined(MBEDTLS_SHA256_C)
  978. { MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256, "TLS-PSK-WITH-AES-128-GCM-SHA256",
  979. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  980. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  981. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  982. 0 },
  983. #endif /* MBEDTLS_SHA256_C */
  984. #if defined(MBEDTLS_SHA512_C)
  985. { MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384, "TLS-PSK-WITH-AES-256-GCM-SHA384",
  986. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  987. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  988. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  989. 0 },
  990. #endif /* MBEDTLS_SHA512_C */
  991. #endif /* MBEDTLS_GCM_C */
  992. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  993. #if defined(MBEDTLS_SHA256_C)
  994. { MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256, "TLS-PSK-WITH-AES-128-CBC-SHA256",
  995. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  996. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  997. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  998. 0 },
  999. #endif /* MBEDTLS_SHA256_C */
  1000. #if defined(MBEDTLS_SHA512_C)
  1001. { MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384, "TLS-PSK-WITH-AES-256-CBC-SHA384",
  1002. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  1003. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1004. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1005. 0 },
  1006. #endif /* MBEDTLS_SHA512_C */
  1007. #if defined(MBEDTLS_SHA1_C)
  1008. { MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA, "TLS-PSK-WITH-AES-128-CBC-SHA",
  1009. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_PSK,
  1010. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1011. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1012. 0 },
  1013. { MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA, "TLS-PSK-WITH-AES-256-CBC-SHA",
  1014. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_PSK,
  1015. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1016. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1017. 0 },
  1018. #endif /* MBEDTLS_SHA1_C */
  1019. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1020. #if defined(MBEDTLS_CCM_C)
  1021. { MBEDTLS_TLS_PSK_WITH_AES_256_CCM, "TLS-PSK-WITH-AES-256-CCM",
  1022. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1023. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1024. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1025. 0 },
  1026. { MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, "TLS-PSK-WITH-AES-256-CCM-8",
  1027. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1028. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1029. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1030. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  1031. { MBEDTLS_TLS_PSK_WITH_AES_128_CCM, "TLS-PSK-WITH-AES-128-CCM",
  1032. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1033. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1034. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1035. 0 },
  1036. { MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8, "TLS-PSK-WITH-AES-128-CCM-8",
  1037. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1038. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1039. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1040. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  1041. #endif /* MBEDTLS_CCM_C */
  1042. #endif /* MBEDTLS_AES_C */
  1043. #if defined(MBEDTLS_CAMELLIA_C)
  1044. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1045. #if defined(MBEDTLS_SHA256_C)
  1046. { MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256, "TLS-PSK-WITH-CAMELLIA-128-CBC-SHA256",
  1047. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1048. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1049. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1050. 0 },
  1051. #endif /* MBEDTLS_SHA256_C */
  1052. #if defined(MBEDTLS_SHA512_C)
  1053. { MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384, "TLS-PSK-WITH-CAMELLIA-256-CBC-SHA384",
  1054. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  1055. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1056. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1057. 0 },
  1058. #endif /* MBEDTLS_SHA512_C */
  1059. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1060. #if defined(MBEDTLS_GCM_C)
  1061. #if defined(MBEDTLS_SHA256_C)
  1062. { MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256, "TLS-PSK-WITH-CAMELLIA-128-GCM-SHA256",
  1063. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1064. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1065. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1066. 0 },
  1067. #endif /* MBEDTLS_SHA256_C */
  1068. #if defined(MBEDTLS_SHA512_C)
  1069. { MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384, "TLS-PSK-WITH-CAMELLIA-256-GCM-SHA384",
  1070. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  1071. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1072. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1073. 0 },
  1074. #endif /* MBEDTLS_SHA512_C */
  1075. #endif /* MBEDTLS_GCM_C */
  1076. #endif /* MBEDTLS_CAMELLIA_C */
  1077. #if defined(MBEDTLS_DES_C)
  1078. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1079. #if defined(MBEDTLS_SHA1_C)
  1080. { MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA, "TLS-PSK-WITH-3DES-EDE-CBC-SHA",
  1081. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_PSK,
  1082. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1083. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1084. 0 },
  1085. #endif /* MBEDTLS_SHA1_C */
  1086. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1087. #endif /* MBEDTLS_DES_C */
  1088. #if defined(MBEDTLS_ARC4_C)
  1089. #if defined(MBEDTLS_SHA1_C)
  1090. { MBEDTLS_TLS_PSK_WITH_RC4_128_SHA, "TLS-PSK-WITH-RC4-128-SHA",
  1091. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_PSK,
  1092. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1093. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1094. MBEDTLS_CIPHERSUITE_NODTLS },
  1095. #endif /* MBEDTLS_SHA1_C */
  1096. #endif /* MBEDTLS_ARC4_C */
  1097. #endif /* MBEDTLS_KEY_EXCHANGE_PSK_ENABLED */
  1098. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
  1099. #if defined(MBEDTLS_AES_C)
  1100. #if defined(MBEDTLS_GCM_C)
  1101. #if defined(MBEDTLS_SHA256_C)
  1102. { MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256, "TLS-DHE-PSK-WITH-AES-128-GCM-SHA256",
  1103. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1104. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1105. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1106. 0 },
  1107. #endif /* MBEDTLS_SHA256_C */
  1108. #if defined(MBEDTLS_SHA512_C)
  1109. { MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384, "TLS-DHE-PSK-WITH-AES-256-GCM-SHA384",
  1110. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1111. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1112. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1113. 0 },
  1114. #endif /* MBEDTLS_SHA512_C */
  1115. #endif /* MBEDTLS_GCM_C */
  1116. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1117. #if defined(MBEDTLS_SHA256_C)
  1118. { MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, "TLS-DHE-PSK-WITH-AES-128-CBC-SHA256",
  1119. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1120. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1121. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1122. 0 },
  1123. #endif /* MBEDTLS_SHA256_C */
  1124. #if defined(MBEDTLS_SHA512_C)
  1125. { MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384, "TLS-DHE-PSK-WITH-AES-256-CBC-SHA384",
  1126. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1127. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1128. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1129. 0 },
  1130. #endif /* MBEDTLS_SHA512_C */
  1131. #if defined(MBEDTLS_SHA1_C)
  1132. { MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA, "TLS-DHE-PSK-WITH-AES-128-CBC-SHA",
  1133. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1134. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1135. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1136. 0 },
  1137. { MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA, "TLS-DHE-PSK-WITH-AES-256-CBC-SHA",
  1138. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1139. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1140. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1141. 0 },
  1142. #endif /* MBEDTLS_SHA1_C */
  1143. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1144. #if defined(MBEDTLS_CCM_C)
  1145. { MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM, "TLS-DHE-PSK-WITH-AES-256-CCM",
  1146. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1147. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1148. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1149. 0 },
  1150. { MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8, "TLS-DHE-PSK-WITH-AES-256-CCM-8",
  1151. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1152. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1153. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1154. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  1155. { MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM, "TLS-DHE-PSK-WITH-AES-128-CCM",
  1156. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1157. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1158. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1159. 0 },
  1160. { MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8, "TLS-DHE-PSK-WITH-AES-128-CCM-8",
  1161. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1162. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1163. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1164. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  1165. #endif /* MBEDTLS_CCM_C */
  1166. #endif /* MBEDTLS_AES_C */
  1167. #if defined(MBEDTLS_CAMELLIA_C)
  1168. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1169. #if defined(MBEDTLS_SHA256_C)
  1170. { MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256, "TLS-DHE-PSK-WITH-CAMELLIA-128-CBC-SHA256",
  1171. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1172. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1173. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1174. 0 },
  1175. #endif /* MBEDTLS_SHA256_C */
  1176. #if defined(MBEDTLS_SHA512_C)
  1177. { MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384, "TLS-DHE-PSK-WITH-CAMELLIA-256-CBC-SHA384",
  1178. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1179. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1180. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1181. 0 },
  1182. #endif /* MBEDTLS_SHA512_C */
  1183. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1184. #if defined(MBEDTLS_GCM_C)
  1185. #if defined(MBEDTLS_SHA256_C)
  1186. { MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256, "TLS-DHE-PSK-WITH-CAMELLIA-128-GCM-SHA256",
  1187. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1188. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1189. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1190. 0 },
  1191. #endif /* MBEDTLS_SHA256_C */
  1192. #if defined(MBEDTLS_SHA512_C)
  1193. { MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384, "TLS-DHE-PSK-WITH-CAMELLIA-256-GCM-SHA384",
  1194. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1195. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1196. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1197. 0 },
  1198. #endif /* MBEDTLS_SHA512_C */
  1199. #endif /* MBEDTLS_GCM_C */
  1200. #endif /* MBEDTLS_CAMELLIA_C */
  1201. #if defined(MBEDTLS_DES_C)
  1202. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1203. #if defined(MBEDTLS_SHA1_C)
  1204. { MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, "TLS-DHE-PSK-WITH-3DES-EDE-CBC-SHA",
  1205. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1206. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1207. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1208. 0 },
  1209. #endif /* MBEDTLS_SHA1_C */
  1210. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1211. #endif /* MBEDTLS_DES_C */
  1212. #if defined(MBEDTLS_ARC4_C)
  1213. #if defined(MBEDTLS_SHA1_C)
  1214. { MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA, "TLS-DHE-PSK-WITH-RC4-128-SHA",
  1215. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1216. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1217. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1218. MBEDTLS_CIPHERSUITE_NODTLS },
  1219. #endif /* MBEDTLS_SHA1_C */
  1220. #endif /* MBEDTLS_ARC4_C */
  1221. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */
  1222. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
  1223. #if defined(MBEDTLS_AES_C)
  1224. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1225. #if defined(MBEDTLS_SHA256_C)
  1226. { MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, "TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256",
  1227. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1228. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1229. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1230. 0 },
  1231. #endif /* MBEDTLS_SHA256_C */
  1232. #if defined(MBEDTLS_SHA512_C)
  1233. { MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384, "TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384",
  1234. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1235. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1236. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1237. 0 },
  1238. #endif /* MBEDTLS_SHA512_C */
  1239. #if defined(MBEDTLS_SHA1_C)
  1240. { MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA, "TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA",
  1241. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1242. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1243. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1244. 0 },
  1245. { MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA, "TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA",
  1246. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1247. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1248. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1249. 0 },
  1250. #endif /* MBEDTLS_SHA1_C */
  1251. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1252. #endif /* MBEDTLS_AES_C */
  1253. #if defined(MBEDTLS_CAMELLIA_C)
  1254. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1255. #if defined(MBEDTLS_SHA256_C)
  1256. { MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256, "TLS-ECDHE-PSK-WITH-CAMELLIA-128-CBC-SHA256",
  1257. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1258. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1259. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1260. 0 },
  1261. #endif /* MBEDTLS_SHA256_C */
  1262. #if defined(MBEDTLS_SHA512_C)
  1263. { MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384, "TLS-ECDHE-PSK-WITH-CAMELLIA-256-CBC-SHA384",
  1264. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1265. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1266. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1267. 0 },
  1268. #endif /* MBEDTLS_SHA512_C */
  1269. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1270. #endif /* MBEDTLS_CAMELLIA_C */
  1271. #if defined(MBEDTLS_DES_C)
  1272. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1273. #if defined(MBEDTLS_SHA1_C)
  1274. { MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA, "TLS-ECDHE-PSK-WITH-3DES-EDE-CBC-SHA",
  1275. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1276. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1277. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1278. 0 },
  1279. #endif /* MBEDTLS_SHA1_C */
  1280. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1281. #endif /* MBEDTLS_DES_C */
  1282. #if defined(MBEDTLS_ARC4_C)
  1283. #if defined(MBEDTLS_SHA1_C)
  1284. { MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA, "TLS-ECDHE-PSK-WITH-RC4-128-SHA",
  1285. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1286. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1287. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1288. MBEDTLS_CIPHERSUITE_NODTLS },
  1289. #endif /* MBEDTLS_SHA1_C */
  1290. #endif /* MBEDTLS_ARC4_C */
  1291. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED */
  1292. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)
  1293. #if defined(MBEDTLS_AES_C)
  1294. #if defined(MBEDTLS_GCM_C)
  1295. #if defined(MBEDTLS_SHA256_C)
  1296. { MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256, "TLS-RSA-PSK-WITH-AES-128-GCM-SHA256",
  1297. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1298. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1299. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1300. 0 },
  1301. #endif /* MBEDTLS_SHA256_C */
  1302. #if defined(MBEDTLS_SHA512_C)
  1303. { MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384, "TLS-RSA-PSK-WITH-AES-256-GCM-SHA384",
  1304. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1305. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1306. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1307. 0 },
  1308. #endif /* MBEDTLS_SHA512_C */
  1309. #endif /* MBEDTLS_GCM_C */
  1310. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1311. #if defined(MBEDTLS_SHA256_C)
  1312. { MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256, "TLS-RSA-PSK-WITH-AES-128-CBC-SHA256",
  1313. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1314. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1315. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1316. 0 },
  1317. #endif /* MBEDTLS_SHA256_C */
  1318. #if defined(MBEDTLS_SHA512_C)
  1319. { MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384, "TLS-RSA-PSK-WITH-AES-256-CBC-SHA384",
  1320. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1321. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1322. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1323. 0 },
  1324. #endif /* MBEDTLS_SHA512_C */
  1325. #if defined(MBEDTLS_SHA1_C)
  1326. { MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA, "TLS-RSA-PSK-WITH-AES-128-CBC-SHA",
  1327. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1328. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1329. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1330. 0 },
  1331. { MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA, "TLS-RSA-PSK-WITH-AES-256-CBC-SHA",
  1332. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1333. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1334. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1335. 0 },
  1336. #endif /* MBEDTLS_SHA1_C */
  1337. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1338. #endif /* MBEDTLS_AES_C */
  1339. #if defined(MBEDTLS_CAMELLIA_C)
  1340. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1341. #if defined(MBEDTLS_SHA256_C)
  1342. { MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256, "TLS-RSA-PSK-WITH-CAMELLIA-128-CBC-SHA256",
  1343. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1344. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1345. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1346. 0 },
  1347. #endif /* MBEDTLS_SHA256_C */
  1348. #if defined(MBEDTLS_SHA512_C)
  1349. { MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384, "TLS-RSA-PSK-WITH-CAMELLIA-256-CBC-SHA384",
  1350. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1351. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1352. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1353. 0 },
  1354. #endif /* MBEDTLS_SHA512_C */
  1355. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1356. #if defined(MBEDTLS_GCM_C)
  1357. #if defined(MBEDTLS_SHA256_C)
  1358. { MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256, "TLS-RSA-PSK-WITH-CAMELLIA-128-GCM-SHA256",
  1359. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1360. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1361. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1362. 0 },
  1363. #endif /* MBEDTLS_SHA256_C */
  1364. #if defined(MBEDTLS_SHA512_C)
  1365. { MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384, "TLS-RSA-PSK-WITH-CAMELLIA-256-GCM-SHA384",
  1366. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1367. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1368. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1369. 0 },
  1370. #endif /* MBEDTLS_SHA512_C */
  1371. #endif /* MBEDTLS_GCM_C */
  1372. #endif /* MBEDTLS_CAMELLIA_C */
  1373. #if defined(MBEDTLS_DES_C)
  1374. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1375. #if defined(MBEDTLS_SHA1_C)
  1376. { MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, "TLS-RSA-PSK-WITH-3DES-EDE-CBC-SHA",
  1377. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1378. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1379. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1380. 0 },
  1381. #endif /* MBEDTLS_SHA1_C */
  1382. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1383. #endif /* MBEDTLS_DES_C */
  1384. #if defined(MBEDTLS_ARC4_C)
  1385. #if defined(MBEDTLS_SHA1_C)
  1386. { MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA, "TLS-RSA-PSK-WITH-RC4-128-SHA",
  1387. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1388. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1389. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1390. MBEDTLS_CIPHERSUITE_NODTLS },
  1391. #endif /* MBEDTLS_SHA1_C */
  1392. #endif /* MBEDTLS_ARC4_C */
  1393. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED */
  1394. #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
  1395. #if defined(MBEDTLS_AES_C)
  1396. #if defined(MBEDTLS_CCM_C)
  1397. { MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8, "TLS-ECJPAKE-WITH-AES-128-CCM-8",
  1398. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECJPAKE,
  1399. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1400. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1401. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  1402. #endif /* MBEDTLS_CCM_C */
  1403. #endif /* MBEDTLS_AES_C */
  1404. #endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */
  1405. #if defined(MBEDTLS_ENABLE_WEAK_CIPHERSUITES)
  1406. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  1407. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)
  1408. #if defined(MBEDTLS_MD5_C)
  1409. { MBEDTLS_TLS_RSA_WITH_NULL_MD5, "TLS-RSA-WITH-NULL-MD5",
  1410. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_MD5, MBEDTLS_KEY_EXCHANGE_RSA,
  1411. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1412. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1413. MBEDTLS_CIPHERSUITE_WEAK },
  1414. #endif
  1415. #if defined(MBEDTLS_SHA1_C)
  1416. { MBEDTLS_TLS_RSA_WITH_NULL_SHA, "TLS-RSA-WITH-NULL-SHA",
  1417. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  1418. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1419. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1420. MBEDTLS_CIPHERSUITE_WEAK },
  1421. #endif
  1422. #if defined(MBEDTLS_SHA256_C)
  1423. { MBEDTLS_TLS_RSA_WITH_NULL_SHA256, "TLS-RSA-WITH-NULL-SHA256",
  1424. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  1425. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1426. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1427. MBEDTLS_CIPHERSUITE_WEAK },
  1428. #endif
  1429. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */
  1430. #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)
  1431. #if defined(MBEDTLS_SHA1_C)
  1432. { MBEDTLS_TLS_PSK_WITH_NULL_SHA, "TLS-PSK-WITH-NULL-SHA",
  1433. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_PSK,
  1434. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1435. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1436. MBEDTLS_CIPHERSUITE_WEAK },
  1437. #endif /* MBEDTLS_SHA1_C */
  1438. #if defined(MBEDTLS_SHA256_C)
  1439. { MBEDTLS_TLS_PSK_WITH_NULL_SHA256, "TLS-PSK-WITH-NULL-SHA256",
  1440. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1441. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1442. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1443. MBEDTLS_CIPHERSUITE_WEAK },
  1444. #endif
  1445. #if defined(MBEDTLS_SHA512_C)
  1446. { MBEDTLS_TLS_PSK_WITH_NULL_SHA384, "TLS-PSK-WITH-NULL-SHA384",
  1447. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  1448. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1449. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1450. MBEDTLS_CIPHERSUITE_WEAK },
  1451. #endif
  1452. #endif /* MBEDTLS_KEY_EXCHANGE_PSK_ENABLED */
  1453. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
  1454. #if defined(MBEDTLS_SHA1_C)
  1455. { MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA, "TLS-DHE-PSK-WITH-NULL-SHA",
  1456. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1457. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1458. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1459. MBEDTLS_CIPHERSUITE_WEAK },
  1460. #endif /* MBEDTLS_SHA1_C */
  1461. #if defined(MBEDTLS_SHA256_C)
  1462. { MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256, "TLS-DHE-PSK-WITH-NULL-SHA256",
  1463. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1464. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1465. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1466. MBEDTLS_CIPHERSUITE_WEAK },
  1467. #endif
  1468. #if defined(MBEDTLS_SHA512_C)
  1469. { MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384, "TLS-DHE-PSK-WITH-NULL-SHA384",
  1470. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1471. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1472. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1473. MBEDTLS_CIPHERSUITE_WEAK },
  1474. #endif
  1475. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */
  1476. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
  1477. #if defined(MBEDTLS_SHA1_C)
  1478. { MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA, "TLS-ECDHE-PSK-WITH-NULL-SHA",
  1479. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1480. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1481. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1482. MBEDTLS_CIPHERSUITE_WEAK },
  1483. #endif /* MBEDTLS_SHA1_C */
  1484. #if defined(MBEDTLS_SHA256_C)
  1485. { MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256, "TLS-ECDHE-PSK-WITH-NULL-SHA256",
  1486. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1487. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1488. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1489. MBEDTLS_CIPHERSUITE_WEAK },
  1490. #endif
  1491. #if defined(MBEDTLS_SHA512_C)
  1492. { MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384, "TLS-ECDHE-PSK-WITH-NULL-SHA384",
  1493. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1494. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1495. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1496. MBEDTLS_CIPHERSUITE_WEAK },
  1497. #endif
  1498. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED */
  1499. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)
  1500. #if defined(MBEDTLS_SHA1_C)
  1501. { MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA, "TLS-RSA-PSK-WITH-NULL-SHA",
  1502. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1503. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1504. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1505. MBEDTLS_CIPHERSUITE_WEAK },
  1506. #endif /* MBEDTLS_SHA1_C */
  1507. #if defined(MBEDTLS_SHA256_C)
  1508. { MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256, "TLS-RSA-PSK-WITH-NULL-SHA256",
  1509. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1510. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1511. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1512. MBEDTLS_CIPHERSUITE_WEAK },
  1513. #endif
  1514. #if defined(MBEDTLS_SHA512_C)
  1515. { MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384, "TLS-RSA-PSK-WITH-NULL-SHA384",
  1516. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1517. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1518. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1519. MBEDTLS_CIPHERSUITE_WEAK },
  1520. #endif
  1521. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED */
  1522. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  1523. #if defined(MBEDTLS_DES_C)
  1524. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1525. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)
  1526. #if defined(MBEDTLS_SHA1_C)
  1527. { MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA, "TLS-DHE-RSA-WITH-DES-CBC-SHA",
  1528. MBEDTLS_CIPHER_DES_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  1529. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1530. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1531. MBEDTLS_CIPHERSUITE_WEAK },
  1532. #endif /* MBEDTLS_SHA1_C */
  1533. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */
  1534. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)
  1535. #if defined(MBEDTLS_SHA1_C)
  1536. { MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA, "TLS-RSA-WITH-DES-CBC-SHA",
  1537. MBEDTLS_CIPHER_DES_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  1538. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1539. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1540. MBEDTLS_CIPHERSUITE_WEAK },
  1541. #endif /* MBEDTLS_SHA1_C */
  1542. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */
  1543. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1544. #endif /* MBEDTLS_DES_C */
  1545. #endif /* MBEDTLS_ENABLE_WEAK_CIPHERSUITES */
  1546. { 0, "",
  1547. MBEDTLS_CIPHER_NONE, MBEDTLS_MD_NONE, MBEDTLS_KEY_EXCHANGE_NONE,
  1548. 0, 0, 0, 0, 0 }
  1549. };
  1550. #if defined(MBEDTLS_SSL_CIPHERSUITES)
  1551. const int *mbedtls_ssl_list_ciphersuites( void )
  1552. {
  1553. return( ciphersuite_preference );
  1554. }
  1555. #else
  1556. #define MAX_CIPHERSUITES sizeof( ciphersuite_definitions ) / \
  1557. sizeof( ciphersuite_definitions[0] )
  1558. static int supported_ciphersuites[MAX_CIPHERSUITES];
  1559. static int supported_init = 0;
  1560. const int *mbedtls_ssl_list_ciphersuites( void )
  1561. {
  1562. /*
  1563. * On initial call filter out all ciphersuites not supported by current
  1564. * build based on presence in the ciphersuite_definitions.
  1565. */
  1566. if( supported_init == 0 )
  1567. {
  1568. const int *p;
  1569. int *q;
  1570. for( p = ciphersuite_preference, q = supported_ciphersuites;
  1571. *p != 0 && q < supported_ciphersuites + MAX_CIPHERSUITES - 1;
  1572. p++ )
  1573. {
  1574. #if defined(MBEDTLS_REMOVE_ARC4_CIPHERSUITES)
  1575. const mbedtls_ssl_ciphersuite_t *cs_info;
  1576. if( ( cs_info = mbedtls_ssl_ciphersuite_from_id( *p ) ) != NULL &&
  1577. cs_info->cipher != MBEDTLS_CIPHER_ARC4_128 )
  1578. #else
  1579. if( mbedtls_ssl_ciphersuite_from_id( *p ) != NULL )
  1580. #endif
  1581. *(q++) = *p;
  1582. }
  1583. *q = 0;
  1584. supported_init = 1;
  1585. }
  1586. return( supported_ciphersuites );
  1587. }
  1588. #endif /* MBEDTLS_SSL_CIPHERSUITES */
  1589. const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_string(
  1590. const char *ciphersuite_name )
  1591. {
  1592. const mbedtls_ssl_ciphersuite_t *cur = ciphersuite_definitions;
  1593. if( NULL == ciphersuite_name )
  1594. return( NULL );
  1595. while( cur->id != 0 )
  1596. {
  1597. if( 0 == strcmp( cur->name, ciphersuite_name ) )
  1598. return( cur );
  1599. cur++;
  1600. }
  1601. return( NULL );
  1602. }
  1603. const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_id( int ciphersuite )
  1604. {
  1605. const mbedtls_ssl_ciphersuite_t *cur = ciphersuite_definitions;
  1606. while( cur->id != 0 )
  1607. {
  1608. if( cur->id == ciphersuite )
  1609. return( cur );
  1610. cur++;
  1611. }
  1612. return( NULL );
  1613. }
  1614. const char *mbedtls_ssl_get_ciphersuite_name( const int ciphersuite_id )
  1615. {
  1616. const mbedtls_ssl_ciphersuite_t *cur;
  1617. cur = mbedtls_ssl_ciphersuite_from_id( ciphersuite_id );
  1618. if( cur == NULL )
  1619. return( "unknown" );
  1620. return( cur->name );
  1621. }
  1622. int mbedtls_ssl_get_ciphersuite_id( const char *ciphersuite_name )
  1623. {
  1624. const mbedtls_ssl_ciphersuite_t *cur;
  1625. cur = mbedtls_ssl_ciphersuite_from_string( ciphersuite_name );
  1626. if( cur == NULL )
  1627. return( 0 );
  1628. return( cur->id );
  1629. }
  1630. #if defined(MBEDTLS_PK_C)
  1631. mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_pk_alg( const mbedtls_ssl_ciphersuite_t *info )
  1632. {
  1633. switch( info->key_exchange )
  1634. {
  1635. case MBEDTLS_KEY_EXCHANGE_RSA:
  1636. case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
  1637. case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
  1638. case MBEDTLS_KEY_EXCHANGE_RSA_PSK:
  1639. return( MBEDTLS_PK_RSA );
  1640. case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
  1641. return( MBEDTLS_PK_ECDSA );
  1642. case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
  1643. case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
  1644. return( MBEDTLS_PK_ECKEY );
  1645. default:
  1646. return( MBEDTLS_PK_NONE );
  1647. }
  1648. }
  1649. #endif /* MBEDTLS_PK_C */
  1650. #if defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_ECDSA_C)
  1651. int mbedtls_ssl_ciphersuite_uses_ec( const mbedtls_ssl_ciphersuite_t *info )
  1652. {
  1653. switch( info->key_exchange )
  1654. {
  1655. case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
  1656. case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
  1657. case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK:
  1658. case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
  1659. case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
  1660. return( 1 );
  1661. default:
  1662. return( 0 );
  1663. }
  1664. }
  1665. #endif /* MBEDTLS_ECDH_C || MBEDTLS_ECDSA_C */
  1666. #if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED)
  1667. int mbedtls_ssl_ciphersuite_uses_psk( const mbedtls_ssl_ciphersuite_t *info )
  1668. {
  1669. switch( info->key_exchange )
  1670. {
  1671. case MBEDTLS_KEY_EXCHANGE_PSK:
  1672. case MBEDTLS_KEY_EXCHANGE_RSA_PSK:
  1673. case MBEDTLS_KEY_EXCHANGE_DHE_PSK:
  1674. case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK:
  1675. return( 1 );
  1676. default:
  1677. return( 0 );
  1678. }
  1679. }
  1680. #endif /* MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED */
  1681. #endif /* MBEDTLS_SSL_TLS_C */