ssl_ciphersuites.c 102 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373
  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 and 3DES, 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. * ChaCha > AES-256 > Camellia-256 > ARIA-256 > AES-128 > Camellia-128 > ARIA-128
  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. /* Chacha-Poly ephemeral suites */
  55. MBEDTLS_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
  56. MBEDTLS_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
  57. MBEDTLS_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
  58. /* All AES-256 ephemeral suites */
  59. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
  60. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
  61. MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,
  62. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM,
  63. MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM,
  64. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
  65. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,
  66. MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,
  67. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
  68. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
  69. MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
  70. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8,
  71. MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8,
  72. /* All CAMELLIA-256 ephemeral suites */
  73. MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384,
  74. MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384,
  75. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384,
  76. MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
  77. MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
  78. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
  79. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
  80. /* All ARIA-256 ephemeral suites */
  81. MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
  82. MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
  83. MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
  84. MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384,
  85. MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384,
  86. MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384,
  87. /* All AES-128 ephemeral suites */
  88. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
  89. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
  90. MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
  91. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM,
  92. MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM,
  93. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
  94. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
  95. MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,
  96. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
  97. MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
  98. MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
  99. MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8,
  100. MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8,
  101. /* All CAMELLIA-128 ephemeral suites */
  102. MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256,
  103. MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256,
  104. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256,
  105. MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
  106. MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  107. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  108. MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
  109. /* All ARIA-128 ephemeral suites */
  110. MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
  111. MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
  112. MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
  113. MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256,
  114. MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256,
  115. MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256,
  116. /* The PSK ephemeral suites */
  117. MBEDTLS_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256,
  118. MBEDTLS_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256,
  119. MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384,
  120. MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM,
  121. MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
  122. MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384,
  123. MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA,
  124. MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA,
  125. MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384,
  126. MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  127. MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  128. MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8,
  129. MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
  130. MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384,
  131. MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384,
  132. MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256,
  133. MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM,
  134. MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
  135. MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256,
  136. MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA,
  137. MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA,
  138. MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256,
  139. MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  140. MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  141. MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8,
  142. MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
  143. MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256,
  144. MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256,
  145. /* The ECJPAKE suite */
  146. MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8,
  147. /* All AES-256 suites */
  148. MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384,
  149. MBEDTLS_TLS_RSA_WITH_AES_256_CCM,
  150. MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256,
  151. MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA,
  152. MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384,
  153. MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384,
  154. MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA,
  155. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,
  156. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384,
  157. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
  158. MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8,
  159. /* All CAMELLIA-256 suites */
  160. MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384,
  161. MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256,
  162. MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA,
  163. MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384,
  164. MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384,
  165. MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384,
  166. MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
  167. /* All ARIA-256 suites */
  168. MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384,
  169. MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384,
  170. MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384,
  171. MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384,
  172. MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384,
  173. MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384,
  174. /* All AES-128 suites */
  175. MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256,
  176. MBEDTLS_TLS_RSA_WITH_AES_128_CCM,
  177. MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256,
  178. MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA,
  179. MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256,
  180. MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256,
  181. MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA,
  182. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
  183. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256,
  184. MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
  185. MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8,
  186. /* All CAMELLIA-128 suites */
  187. MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256,
  188. MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  189. MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA,
  190. MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256,
  191. MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  192. MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256,
  193. MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
  194. /* All ARIA-128 suites */
  195. MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256,
  196. MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256,
  197. MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256,
  198. MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256,
  199. MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256,
  200. MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256,
  201. /* The RSA PSK suites */
  202. MBEDTLS_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256,
  203. MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384,
  204. MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384,
  205. MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA,
  206. MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384,
  207. MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  208. MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
  209. MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384,
  210. MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256,
  211. MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256,
  212. MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA,
  213. MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256,
  214. MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  215. MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
  216. MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256,
  217. /* The PSK suites */
  218. MBEDTLS_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256,
  219. MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384,
  220. MBEDTLS_TLS_PSK_WITH_AES_256_CCM,
  221. MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384,
  222. MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA,
  223. MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384,
  224. MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  225. MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8,
  226. MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384,
  227. MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384,
  228. MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256,
  229. MBEDTLS_TLS_PSK_WITH_AES_128_CCM,
  230. MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256,
  231. MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA,
  232. MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256,
  233. MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  234. MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8,
  235. MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256,
  236. MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256,
  237. /* 3DES suites */
  238. MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
  239. MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
  240. MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
  241. MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
  242. MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
  243. MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA,
  244. MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,
  245. MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,
  246. MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
  247. MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA,
  248. /* RC4 suites */
  249. MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
  250. MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA,
  251. MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA,
  252. MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA,
  253. MBEDTLS_TLS_RSA_WITH_RC4_128_SHA,
  254. MBEDTLS_TLS_RSA_WITH_RC4_128_MD5,
  255. MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA,
  256. MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA,
  257. MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA,
  258. MBEDTLS_TLS_PSK_WITH_RC4_128_SHA,
  259. /* Weak suites */
  260. MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA,
  261. MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA,
  262. /* NULL suites */
  263. MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA,
  264. MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA,
  265. MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384,
  266. MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256,
  267. MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA,
  268. MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384,
  269. MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256,
  270. MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA,
  271. MBEDTLS_TLS_RSA_WITH_NULL_SHA256,
  272. MBEDTLS_TLS_RSA_WITH_NULL_SHA,
  273. MBEDTLS_TLS_RSA_WITH_NULL_MD5,
  274. MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA,
  275. MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA,
  276. MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384,
  277. MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256,
  278. MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA,
  279. MBEDTLS_TLS_PSK_WITH_NULL_SHA384,
  280. MBEDTLS_TLS_PSK_WITH_NULL_SHA256,
  281. MBEDTLS_TLS_PSK_WITH_NULL_SHA,
  282. #endif /* MBEDTLS_SSL_CIPHERSUITES */
  283. 0
  284. };
  285. static const mbedtls_ssl_ciphersuite_t ciphersuite_definitions[] =
  286. {
  287. #if defined(MBEDTLS_CHACHAPOLY_C) && \
  288. defined(MBEDTLS_SHA256_C) && \
  289. defined(MBEDTLS_SSL_PROTO_TLS1_2)
  290. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)
  291. { MBEDTLS_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
  292. "TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256",
  293. MBEDTLS_CIPHER_CHACHA20_POLY1305, MBEDTLS_MD_SHA256,
  294. MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  295. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  296. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  297. 0 },
  298. #endif
  299. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
  300. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
  301. "TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256",
  302. MBEDTLS_CIPHER_CHACHA20_POLY1305, MBEDTLS_MD_SHA256,
  303. 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. 0 },
  307. #endif
  308. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)
  309. { MBEDTLS_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
  310. "TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256",
  311. MBEDTLS_CIPHER_CHACHA20_POLY1305, MBEDTLS_MD_SHA256,
  312. MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  313. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  314. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  315. 0 },
  316. #endif
  317. #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)
  318. { MBEDTLS_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256,
  319. "TLS-PSK-WITH-CHACHA20-POLY1305-SHA256",
  320. MBEDTLS_CIPHER_CHACHA20_POLY1305, MBEDTLS_MD_SHA256,
  321. MBEDTLS_KEY_EXCHANGE_PSK,
  322. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  323. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  324. 0 },
  325. #endif
  326. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
  327. { MBEDTLS_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256,
  328. "TLS-ECDHE-PSK-WITH-CHACHA20-POLY1305-SHA256",
  329. MBEDTLS_CIPHER_CHACHA20_POLY1305, MBEDTLS_MD_SHA256,
  330. MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  331. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  332. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  333. 0 },
  334. #endif
  335. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
  336. { MBEDTLS_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256,
  337. "TLS-DHE-PSK-WITH-CHACHA20-POLY1305-SHA256",
  338. MBEDTLS_CIPHER_CHACHA20_POLY1305, MBEDTLS_MD_SHA256,
  339. MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  340. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  341. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  342. 0 },
  343. #endif
  344. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)
  345. { MBEDTLS_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256,
  346. "TLS-RSA-PSK-WITH-CHACHA20-POLY1305-SHA256",
  347. MBEDTLS_CIPHER_CHACHA20_POLY1305, MBEDTLS_MD_SHA256,
  348. MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  349. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  350. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  351. 0 },
  352. #endif
  353. #endif /* MBEDTLS_CHACHAPOLY_C &&
  354. MBEDTLS_SHA256_C &&
  355. MBEDTLS_SSL_PROTO_TLS1_2 */
  356. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
  357. #if defined(MBEDTLS_AES_C)
  358. #if defined(MBEDTLS_SHA1_C)
  359. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  360. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, "TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA",
  361. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  362. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  363. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  364. 0 },
  365. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, "TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA",
  366. MBEDTLS_CIPHER_AES_256_CBC, 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. 0 },
  370. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  371. #endif /* MBEDTLS_SHA1_C */
  372. #if defined(MBEDTLS_SHA256_C)
  373. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  374. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, "TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256",
  375. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  376. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  377. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  378. 0 },
  379. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  380. #if defined(MBEDTLS_GCM_C)
  381. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, "TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256",
  382. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  383. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  384. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  385. 0 },
  386. #endif /* MBEDTLS_GCM_C */
  387. #endif /* MBEDTLS_SHA256_C */
  388. #if defined(MBEDTLS_SHA512_C)
  389. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  390. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, "TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384",
  391. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  392. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  393. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  394. 0 },
  395. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  396. #if defined(MBEDTLS_GCM_C)
  397. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, "TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384",
  398. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  399. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  400. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  401. 0 },
  402. #endif /* MBEDTLS_GCM_C */
  403. #endif /* MBEDTLS_SHA512_C */
  404. #if defined(MBEDTLS_CCM_C)
  405. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM, "TLS-ECDHE-ECDSA-WITH-AES-256-CCM",
  406. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  407. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  408. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  409. 0 },
  410. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8, "TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8",
  411. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  412. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  413. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  414. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  415. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM, "TLS-ECDHE-ECDSA-WITH-AES-128-CCM",
  416. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  417. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  418. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  419. 0 },
  420. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8, "TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8",
  421. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  422. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  423. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  424. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  425. #endif /* MBEDTLS_CCM_C */
  426. #endif /* MBEDTLS_AES_C */
  427. #if defined(MBEDTLS_CAMELLIA_C)
  428. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  429. #if defined(MBEDTLS_SHA256_C)
  430. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-ECDHE-ECDSA-WITH-CAMELLIA-128-CBC-SHA256",
  431. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  432. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  433. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  434. 0 },
  435. #endif /* MBEDTLS_SHA256_C */
  436. #if defined(MBEDTLS_SHA512_C)
  437. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, "TLS-ECDHE-ECDSA-WITH-CAMELLIA-256-CBC-SHA384",
  438. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  439. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  440. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  441. 0 },
  442. #endif /* MBEDTLS_SHA512_C */
  443. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  444. #if defined(MBEDTLS_GCM_C)
  445. #if defined(MBEDTLS_SHA256_C)
  446. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-ECDHE-ECDSA-WITH-CAMELLIA-128-GCM-SHA256",
  447. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  448. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  449. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  450. 0 },
  451. #endif /* MBEDTLS_SHA256_C */
  452. #if defined(MBEDTLS_SHA512_C)
  453. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-ECDHE-ECDSA-WITH-CAMELLIA-256-GCM-SHA384",
  454. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  455. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  456. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  457. 0 },
  458. #endif /* MBEDTLS_SHA512_C */
  459. #endif /* MBEDTLS_GCM_C */
  460. #endif /* MBEDTLS_CAMELLIA_C */
  461. #if defined(MBEDTLS_DES_C)
  462. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  463. #if defined(MBEDTLS_SHA1_C)
  464. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, "TLS-ECDHE-ECDSA-WITH-3DES-EDE-CBC-SHA",
  465. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  466. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  467. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  468. 0 },
  469. #endif /* MBEDTLS_SHA1_C */
  470. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  471. #endif /* MBEDTLS_DES_C */
  472. #if defined(MBEDTLS_ARC4_C)
  473. #if defined(MBEDTLS_SHA1_C)
  474. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, "TLS-ECDHE-ECDSA-WITH-RC4-128-SHA",
  475. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  476. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  477. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  478. MBEDTLS_CIPHERSUITE_NODTLS },
  479. #endif /* MBEDTLS_SHA1_C */
  480. #endif /* MBEDTLS_ARC4_C */
  481. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  482. #if defined(MBEDTLS_SHA1_C)
  483. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA, "TLS-ECDHE-ECDSA-WITH-NULL-SHA",
  484. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  485. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  486. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  487. MBEDTLS_CIPHERSUITE_WEAK },
  488. #endif /* MBEDTLS_SHA1_C */
  489. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  490. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED */
  491. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)
  492. #if defined(MBEDTLS_AES_C)
  493. #if defined(MBEDTLS_SHA1_C)
  494. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  495. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, "TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA",
  496. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  497. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  498. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  499. 0 },
  500. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, "TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA",
  501. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  502. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  503. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  504. 0 },
  505. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  506. #endif /* MBEDTLS_SHA1_C */
  507. #if defined(MBEDTLS_SHA256_C)
  508. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  509. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, "TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256",
  510. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_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. #if defined(MBEDTLS_GCM_C)
  516. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, "TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256",
  517. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  518. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  519. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  520. 0 },
  521. #endif /* MBEDTLS_GCM_C */
  522. #endif /* MBEDTLS_SHA256_C */
  523. #if defined(MBEDTLS_SHA512_C)
  524. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  525. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, "TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384",
  526. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  527. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  528. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  529. 0 },
  530. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  531. #if defined(MBEDTLS_GCM_C)
  532. { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, "TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384",
  533. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  534. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  535. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  536. 0 },
  537. #endif /* MBEDTLS_GCM_C */
  538. #endif /* MBEDTLS_SHA512_C */
  539. #endif /* MBEDTLS_AES_C */
  540. #if defined(MBEDTLS_CAMELLIA_C)
  541. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  542. #if defined(MBEDTLS_SHA256_C)
  543. { MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-ECDHE-RSA-WITH-CAMELLIA-128-CBC-SHA256",
  544. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  545. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  546. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  547. 0 },
  548. #endif /* MBEDTLS_SHA256_C */
  549. #if defined(MBEDTLS_SHA512_C)
  550. { MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384, "TLS-ECDHE-RSA-WITH-CAMELLIA-256-CBC-SHA384",
  551. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  552. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  553. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  554. 0 },
  555. #endif /* MBEDTLS_SHA512_C */
  556. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  557. #if defined(MBEDTLS_GCM_C)
  558. #if defined(MBEDTLS_SHA256_C)
  559. { MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-ECDHE-RSA-WITH-CAMELLIA-128-GCM-SHA256",
  560. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  561. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  562. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  563. 0 },
  564. #endif /* MBEDTLS_SHA256_C */
  565. #if defined(MBEDTLS_SHA512_C)
  566. { MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-ECDHE-RSA-WITH-CAMELLIA-256-GCM-SHA384",
  567. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  568. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  569. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  570. 0 },
  571. #endif /* MBEDTLS_SHA512_C */
  572. #endif /* MBEDTLS_GCM_C */
  573. #endif /* MBEDTLS_CAMELLIA_C */
  574. #if defined(MBEDTLS_DES_C)
  575. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  576. #if defined(MBEDTLS_SHA1_C)
  577. { MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, "TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA",
  578. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  579. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  580. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  581. 0 },
  582. #endif /* MBEDTLS_SHA1_C */
  583. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  584. #endif /* MBEDTLS_DES_C */
  585. #if defined(MBEDTLS_ARC4_C)
  586. #if defined(MBEDTLS_SHA1_C)
  587. { MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA, "TLS-ECDHE-RSA-WITH-RC4-128-SHA",
  588. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  589. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  590. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  591. MBEDTLS_CIPHERSUITE_NODTLS },
  592. #endif /* MBEDTLS_SHA1_C */
  593. #endif /* MBEDTLS_ARC4_C */
  594. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  595. #if defined(MBEDTLS_SHA1_C)
  596. { MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA, "TLS-ECDHE-RSA-WITH-NULL-SHA",
  597. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  598. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  599. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  600. MBEDTLS_CIPHERSUITE_WEAK },
  601. #endif /* MBEDTLS_SHA1_C */
  602. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  603. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED */
  604. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)
  605. #if defined(MBEDTLS_AES_C)
  606. #if defined(MBEDTLS_SHA512_C) && defined(MBEDTLS_GCM_C)
  607. { MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, "TLS-DHE-RSA-WITH-AES-256-GCM-SHA384",
  608. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  609. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  610. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  611. 0 },
  612. #endif /* MBEDTLS_SHA512_C && MBEDTLS_GCM_C */
  613. #if defined(MBEDTLS_SHA256_C)
  614. #if defined(MBEDTLS_GCM_C)
  615. { MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, "TLS-DHE-RSA-WITH-AES-128-GCM-SHA256",
  616. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  617. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  618. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  619. 0 },
  620. #endif /* MBEDTLS_GCM_C */
  621. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  622. { MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, "TLS-DHE-RSA-WITH-AES-128-CBC-SHA256",
  623. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  624. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  625. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  626. 0 },
  627. { MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, "TLS-DHE-RSA-WITH-AES-256-CBC-SHA256",
  628. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_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. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  633. #endif /* MBEDTLS_SHA256_C */
  634. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  635. #if defined(MBEDTLS_SHA1_C)
  636. { MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA, "TLS-DHE-RSA-WITH-AES-128-CBC-SHA",
  637. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  638. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  639. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  640. 0 },
  641. { MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA, "TLS-DHE-RSA-WITH-AES-256-CBC-SHA",
  642. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_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. #endif /* MBEDTLS_SHA1_C */
  647. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  648. #if defined(MBEDTLS_CCM_C)
  649. { MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM, "TLS-DHE-RSA-WITH-AES-256-CCM",
  650. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  651. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  652. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  653. 0 },
  654. { MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8, "TLS-DHE-RSA-WITH-AES-256-CCM-8",
  655. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  656. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  657. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  658. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  659. { MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM, "TLS-DHE-RSA-WITH-AES-128-CCM",
  660. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  661. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  662. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  663. 0 },
  664. { MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8, "TLS-DHE-RSA-WITH-AES-128-CCM-8",
  665. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  666. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  667. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  668. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  669. #endif /* MBEDTLS_CCM_C */
  670. #endif /* MBEDTLS_AES_C */
  671. #if defined(MBEDTLS_CAMELLIA_C)
  672. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  673. #if defined(MBEDTLS_SHA256_C)
  674. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256",
  675. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  676. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  677. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  678. 0 },
  679. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256, "TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256",
  680. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_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. #endif /* MBEDTLS_SHA256_C */
  685. #if defined(MBEDTLS_SHA1_C)
  686. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA, "TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA",
  687. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  688. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  689. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  690. 0 },
  691. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA, "TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA",
  692. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_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. #endif /* MBEDTLS_SHA1_C */
  697. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  698. #if defined(MBEDTLS_GCM_C)
  699. #if defined(MBEDTLS_SHA256_C)
  700. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-DHE-RSA-WITH-CAMELLIA-128-GCM-SHA256",
  701. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  702. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  703. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  704. 0 },
  705. #endif /* MBEDTLS_SHA256_C */
  706. #if defined(MBEDTLS_SHA512_C)
  707. { MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-DHE-RSA-WITH-CAMELLIA-256-GCM-SHA384",
  708. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  709. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  710. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  711. 0 },
  712. #endif /* MBEDTLS_SHA512_C */
  713. #endif /* MBEDTLS_GCM_C */
  714. #endif /* MBEDTLS_CAMELLIA_C */
  715. #if defined(MBEDTLS_DES_C)
  716. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  717. #if defined(MBEDTLS_SHA1_C)
  718. { MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, "TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA",
  719. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  720. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  721. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  722. 0 },
  723. #endif /* MBEDTLS_SHA1_C */
  724. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  725. #endif /* MBEDTLS_DES_C */
  726. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */
  727. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)
  728. #if defined(MBEDTLS_AES_C)
  729. #if defined(MBEDTLS_SHA512_C) && defined(MBEDTLS_GCM_C)
  730. { MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384, "TLS-RSA-WITH-AES-256-GCM-SHA384",
  731. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA,
  732. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  733. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  734. 0 },
  735. #endif /* MBEDTLS_SHA512_C && MBEDTLS_GCM_C */
  736. #if defined(MBEDTLS_SHA256_C)
  737. #if defined(MBEDTLS_GCM_C)
  738. { MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256, "TLS-RSA-WITH-AES-128-GCM-SHA256",
  739. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  740. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  741. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  742. 0 },
  743. #endif /* MBEDTLS_GCM_C */
  744. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  745. { MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256, "TLS-RSA-WITH-AES-128-CBC-SHA256",
  746. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  747. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  748. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  749. 0 },
  750. { MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256, "TLS-RSA-WITH-AES-256-CBC-SHA256",
  751. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  752. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  753. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  754. 0 },
  755. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  756. #endif /* MBEDTLS_SHA256_C */
  757. #if defined(MBEDTLS_SHA1_C)
  758. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  759. { MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA, "TLS-RSA-WITH-AES-128-CBC-SHA",
  760. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  761. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  762. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  763. 0 },
  764. { MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA, "TLS-RSA-WITH-AES-256-CBC-SHA",
  765. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  766. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  767. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  768. 0 },
  769. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  770. #endif /* MBEDTLS_SHA1_C */
  771. #if defined(MBEDTLS_CCM_C)
  772. { MBEDTLS_TLS_RSA_WITH_AES_256_CCM, "TLS-RSA-WITH-AES-256-CCM",
  773. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  774. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  775. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  776. 0 },
  777. { MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8, "TLS-RSA-WITH-AES-256-CCM-8",
  778. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  779. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  780. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  781. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  782. { MBEDTLS_TLS_RSA_WITH_AES_128_CCM, "TLS-RSA-WITH-AES-128-CCM",
  783. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_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. { MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8, "TLS-RSA-WITH-AES-128-CCM-8",
  788. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  789. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  790. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  791. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  792. #endif /* MBEDTLS_CCM_C */
  793. #endif /* MBEDTLS_AES_C */
  794. #if defined(MBEDTLS_CAMELLIA_C)
  795. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  796. #if defined(MBEDTLS_SHA256_C)
  797. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256",
  798. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  799. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  800. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  801. 0 },
  802. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256, "TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256",
  803. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  804. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  805. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  806. 0 },
  807. #endif /* MBEDTLS_SHA256_C */
  808. #if defined(MBEDTLS_SHA1_C)
  809. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA, "TLS-RSA-WITH-CAMELLIA-128-CBC-SHA",
  810. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  811. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  812. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  813. 0 },
  814. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA, "TLS-RSA-WITH-CAMELLIA-256-CBC-SHA",
  815. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  816. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  817. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  818. 0 },
  819. #endif /* MBEDTLS_SHA1_C */
  820. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  821. #if defined(MBEDTLS_GCM_C)
  822. #if defined(MBEDTLS_SHA256_C)
  823. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-RSA-WITH-CAMELLIA-128-GCM-SHA256",
  824. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_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_SHA256_C */
  829. #if defined(MBEDTLS_SHA1_C)
  830. { MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-RSA-WITH-CAMELLIA-256-GCM-SHA384",
  831. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA,
  832. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  833. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  834. 0 },
  835. #endif /* MBEDTLS_SHA1_C */
  836. #endif /* MBEDTLS_GCM_C */
  837. #endif /* MBEDTLS_CAMELLIA_C */
  838. #if defined(MBEDTLS_DES_C)
  839. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  840. #if defined(MBEDTLS_SHA1_C)
  841. { MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA, "TLS-RSA-WITH-3DES-EDE-CBC-SHA",
  842. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  843. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  844. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  845. 0 },
  846. #endif /* MBEDTLS_SHA1_C */
  847. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  848. #endif /* MBEDTLS_DES_C */
  849. #if defined(MBEDTLS_ARC4_C)
  850. #if defined(MBEDTLS_MD5_C)
  851. { MBEDTLS_TLS_RSA_WITH_RC4_128_MD5, "TLS-RSA-WITH-RC4-128-MD5",
  852. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_MD5, MBEDTLS_KEY_EXCHANGE_RSA,
  853. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  854. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  855. MBEDTLS_CIPHERSUITE_NODTLS },
  856. #endif
  857. #if defined(MBEDTLS_SHA1_C)
  858. { MBEDTLS_TLS_RSA_WITH_RC4_128_SHA, "TLS-RSA-WITH-RC4-128-SHA",
  859. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  860. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  861. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  862. MBEDTLS_CIPHERSUITE_NODTLS },
  863. #endif
  864. #endif /* MBEDTLS_ARC4_C */
  865. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */
  866. #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED)
  867. #if defined(MBEDTLS_AES_C)
  868. #if defined(MBEDTLS_SHA1_C)
  869. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  870. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, "TLS-ECDH-RSA-WITH-AES-128-CBC-SHA",
  871. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  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. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, "TLS-ECDH-RSA-WITH-AES-256-CBC-SHA",
  876. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  877. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  878. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  879. 0 },
  880. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  881. #endif /* MBEDTLS_SHA1_C */
  882. #if defined(MBEDTLS_SHA256_C)
  883. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  884. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, "TLS-ECDH-RSA-WITH-AES-128-CBC-SHA256",
  885. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  886. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  887. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  888. 0 },
  889. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  890. #if defined(MBEDTLS_GCM_C)
  891. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, "TLS-ECDH-RSA-WITH-AES-128-GCM-SHA256",
  892. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  893. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  894. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  895. 0 },
  896. #endif /* MBEDTLS_GCM_C */
  897. #endif /* MBEDTLS_SHA256_C */
  898. #if defined(MBEDTLS_SHA512_C)
  899. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  900. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, "TLS-ECDH-RSA-WITH-AES-256-CBC-SHA384",
  901. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  902. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  903. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  904. 0 },
  905. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  906. #if defined(MBEDTLS_GCM_C)
  907. { MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, "TLS-ECDH-RSA-WITH-AES-256-GCM-SHA384",
  908. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  909. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  910. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  911. 0 },
  912. #endif /* MBEDTLS_GCM_C */
  913. #endif /* MBEDTLS_SHA512_C */
  914. #endif /* MBEDTLS_AES_C */
  915. #if defined(MBEDTLS_CAMELLIA_C)
  916. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  917. #if defined(MBEDTLS_SHA256_C)
  918. { MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-ECDH-RSA-WITH-CAMELLIA-128-CBC-SHA256",
  919. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  920. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  921. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  922. 0 },
  923. #endif /* MBEDTLS_SHA256_C */
  924. #if defined(MBEDTLS_SHA512_C)
  925. { MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384, "TLS-ECDH-RSA-WITH-CAMELLIA-256-CBC-SHA384",
  926. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  927. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  928. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  929. 0 },
  930. #endif /* MBEDTLS_SHA512_C */
  931. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  932. #if defined(MBEDTLS_GCM_C)
  933. #if defined(MBEDTLS_SHA256_C)
  934. { MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-ECDH-RSA-WITH-CAMELLIA-128-GCM-SHA256",
  935. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  936. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  937. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  938. 0 },
  939. #endif /* MBEDTLS_SHA256_C */
  940. #if defined(MBEDTLS_SHA512_C)
  941. { MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-ECDH-RSA-WITH-CAMELLIA-256-GCM-SHA384",
  942. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  943. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  944. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  945. 0 },
  946. #endif /* MBEDTLS_SHA512_C */
  947. #endif /* MBEDTLS_GCM_C */
  948. #endif /* MBEDTLS_CAMELLIA_C */
  949. #if defined(MBEDTLS_DES_C)
  950. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  951. #if defined(MBEDTLS_SHA1_C)
  952. { MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, "TLS-ECDH-RSA-WITH-3DES-EDE-CBC-SHA",
  953. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  954. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  955. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  956. 0 },
  957. #endif /* MBEDTLS_SHA1_C */
  958. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  959. #endif /* MBEDTLS_DES_C */
  960. #if defined(MBEDTLS_ARC4_C)
  961. #if defined(MBEDTLS_SHA1_C)
  962. { MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA, "TLS-ECDH-RSA-WITH-RC4-128-SHA",
  963. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  964. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  965. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  966. MBEDTLS_CIPHERSUITE_NODTLS },
  967. #endif /* MBEDTLS_SHA1_C */
  968. #endif /* MBEDTLS_ARC4_C */
  969. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  970. #if defined(MBEDTLS_SHA1_C)
  971. { MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA, "TLS-ECDH-RSA-WITH-NULL-SHA",
  972. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  973. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  974. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  975. MBEDTLS_CIPHERSUITE_WEAK },
  976. #endif /* MBEDTLS_SHA1_C */
  977. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  978. #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED */
  979. #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
  980. #if defined(MBEDTLS_AES_C)
  981. #if defined(MBEDTLS_SHA1_C)
  982. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  983. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, "TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA",
  984. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  985. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  986. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  987. 0 },
  988. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, "TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA",
  989. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  990. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  991. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  992. 0 },
  993. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  994. #endif /* MBEDTLS_SHA1_C */
  995. #if defined(MBEDTLS_SHA256_C)
  996. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  997. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, "TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA256",
  998. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  999. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1000. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1001. 0 },
  1002. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1003. #if defined(MBEDTLS_GCM_C)
  1004. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, "TLS-ECDH-ECDSA-WITH-AES-128-GCM-SHA256",
  1005. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1006. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1007. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1008. 0 },
  1009. #endif /* MBEDTLS_GCM_C */
  1010. #endif /* MBEDTLS_SHA256_C */
  1011. #if defined(MBEDTLS_SHA512_C)
  1012. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1013. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, "TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA384",
  1014. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1015. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1016. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1017. 0 },
  1018. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1019. #if defined(MBEDTLS_GCM_C)
  1020. { MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, "TLS-ECDH-ECDSA-WITH-AES-256-GCM-SHA384",
  1021. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1022. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1023. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1024. 0 },
  1025. #endif /* MBEDTLS_GCM_C */
  1026. #endif /* MBEDTLS_SHA512_C */
  1027. #endif /* MBEDTLS_AES_C */
  1028. #if defined(MBEDTLS_CAMELLIA_C)
  1029. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1030. #if defined(MBEDTLS_SHA256_C)
  1031. { MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, "TLS-ECDH-ECDSA-WITH-CAMELLIA-128-CBC-SHA256",
  1032. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1033. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1034. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1035. 0 },
  1036. #endif /* MBEDTLS_SHA256_C */
  1037. #if defined(MBEDTLS_SHA512_C)
  1038. { MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, "TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384",
  1039. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1040. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1041. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1042. 0 },
  1043. #endif /* MBEDTLS_SHA512_C */
  1044. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1045. #if defined(MBEDTLS_GCM_C)
  1046. #if defined(MBEDTLS_SHA256_C)
  1047. { MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256, "TLS-ECDH-ECDSA-WITH-CAMELLIA-128-GCM-SHA256",
  1048. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1049. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1050. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1051. 0 },
  1052. #endif /* MBEDTLS_SHA256_C */
  1053. #if defined(MBEDTLS_SHA512_C)
  1054. { MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384, "TLS-ECDH-ECDSA-WITH-CAMELLIA-256-GCM-SHA384",
  1055. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1056. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1057. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1058. 0 },
  1059. #endif /* MBEDTLS_SHA512_C */
  1060. #endif /* MBEDTLS_GCM_C */
  1061. #endif /* MBEDTLS_CAMELLIA_C */
  1062. #if defined(MBEDTLS_DES_C)
  1063. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1064. #if defined(MBEDTLS_SHA1_C)
  1065. { MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, "TLS-ECDH-ECDSA-WITH-3DES-EDE-CBC-SHA",
  1066. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1067. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1068. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1069. 0 },
  1070. #endif /* MBEDTLS_SHA1_C */
  1071. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1072. #endif /* MBEDTLS_DES_C */
  1073. #if defined(MBEDTLS_ARC4_C)
  1074. #if defined(MBEDTLS_SHA1_C)
  1075. { MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA, "TLS-ECDH-ECDSA-WITH-RC4-128-SHA",
  1076. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1077. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1078. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1079. MBEDTLS_CIPHERSUITE_NODTLS },
  1080. #endif /* MBEDTLS_SHA1_C */
  1081. #endif /* MBEDTLS_ARC4_C */
  1082. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  1083. #if defined(MBEDTLS_SHA1_C)
  1084. { MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA, "TLS-ECDH-ECDSA-WITH-NULL-SHA",
  1085. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1086. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1087. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1088. MBEDTLS_CIPHERSUITE_WEAK },
  1089. #endif /* MBEDTLS_SHA1_C */
  1090. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  1091. #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */
  1092. #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)
  1093. #if defined(MBEDTLS_AES_C)
  1094. #if defined(MBEDTLS_GCM_C)
  1095. #if defined(MBEDTLS_SHA256_C)
  1096. { MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256, "TLS-PSK-WITH-AES-128-GCM-SHA256",
  1097. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1098. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1099. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1100. 0 },
  1101. #endif /* MBEDTLS_SHA256_C */
  1102. #if defined(MBEDTLS_SHA512_C)
  1103. { MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384, "TLS-PSK-WITH-AES-256-GCM-SHA384",
  1104. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  1105. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1106. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1107. 0 },
  1108. #endif /* MBEDTLS_SHA512_C */
  1109. #endif /* MBEDTLS_GCM_C */
  1110. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1111. #if defined(MBEDTLS_SHA256_C)
  1112. { MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256, "TLS-PSK-WITH-AES-128-CBC-SHA256",
  1113. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1114. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1115. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1116. 0 },
  1117. #endif /* MBEDTLS_SHA256_C */
  1118. #if defined(MBEDTLS_SHA512_C)
  1119. { MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384, "TLS-PSK-WITH-AES-256-CBC-SHA384",
  1120. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  1121. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1122. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1123. 0 },
  1124. #endif /* MBEDTLS_SHA512_C */
  1125. #if defined(MBEDTLS_SHA1_C)
  1126. { MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA, "TLS-PSK-WITH-AES-128-CBC-SHA",
  1127. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_PSK,
  1128. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1129. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1130. 0 },
  1131. { MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA, "TLS-PSK-WITH-AES-256-CBC-SHA",
  1132. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_PSK,
  1133. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1134. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1135. 0 },
  1136. #endif /* MBEDTLS_SHA1_C */
  1137. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1138. #if defined(MBEDTLS_CCM_C)
  1139. { MBEDTLS_TLS_PSK_WITH_AES_256_CCM, "TLS-PSK-WITH-AES-256-CCM",
  1140. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1141. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1142. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1143. 0 },
  1144. { MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, "TLS-PSK-WITH-AES-256-CCM-8",
  1145. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1146. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1147. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1148. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  1149. { MBEDTLS_TLS_PSK_WITH_AES_128_CCM, "TLS-PSK-WITH-AES-128-CCM",
  1150. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1151. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1152. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1153. 0 },
  1154. { MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8, "TLS-PSK-WITH-AES-128-CCM-8",
  1155. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1156. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1157. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1158. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  1159. #endif /* MBEDTLS_CCM_C */
  1160. #endif /* MBEDTLS_AES_C */
  1161. #if defined(MBEDTLS_CAMELLIA_C)
  1162. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1163. #if defined(MBEDTLS_SHA256_C)
  1164. { MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256, "TLS-PSK-WITH-CAMELLIA-128-CBC-SHA256",
  1165. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1166. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1167. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1168. 0 },
  1169. #endif /* MBEDTLS_SHA256_C */
  1170. #if defined(MBEDTLS_SHA512_C)
  1171. { MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384, "TLS-PSK-WITH-CAMELLIA-256-CBC-SHA384",
  1172. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  1173. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1174. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1175. 0 },
  1176. #endif /* MBEDTLS_SHA512_C */
  1177. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1178. #if defined(MBEDTLS_GCM_C)
  1179. #if defined(MBEDTLS_SHA256_C)
  1180. { MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256, "TLS-PSK-WITH-CAMELLIA-128-GCM-SHA256",
  1181. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1182. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1183. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1184. 0 },
  1185. #endif /* MBEDTLS_SHA256_C */
  1186. #if defined(MBEDTLS_SHA512_C)
  1187. { MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384, "TLS-PSK-WITH-CAMELLIA-256-GCM-SHA384",
  1188. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  1189. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1190. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1191. 0 },
  1192. #endif /* MBEDTLS_SHA512_C */
  1193. #endif /* MBEDTLS_GCM_C */
  1194. #endif /* MBEDTLS_CAMELLIA_C */
  1195. #if defined(MBEDTLS_DES_C)
  1196. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1197. #if defined(MBEDTLS_SHA1_C)
  1198. { MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA, "TLS-PSK-WITH-3DES-EDE-CBC-SHA",
  1199. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_PSK,
  1200. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1201. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1202. 0 },
  1203. #endif /* MBEDTLS_SHA1_C */
  1204. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1205. #endif /* MBEDTLS_DES_C */
  1206. #if defined(MBEDTLS_ARC4_C)
  1207. #if defined(MBEDTLS_SHA1_C)
  1208. { MBEDTLS_TLS_PSK_WITH_RC4_128_SHA, "TLS-PSK-WITH-RC4-128-SHA",
  1209. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_PSK,
  1210. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1211. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1212. MBEDTLS_CIPHERSUITE_NODTLS },
  1213. #endif /* MBEDTLS_SHA1_C */
  1214. #endif /* MBEDTLS_ARC4_C */
  1215. #endif /* MBEDTLS_KEY_EXCHANGE_PSK_ENABLED */
  1216. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
  1217. #if defined(MBEDTLS_AES_C)
  1218. #if defined(MBEDTLS_GCM_C)
  1219. #if defined(MBEDTLS_SHA256_C)
  1220. { MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256, "TLS-DHE-PSK-WITH-AES-128-GCM-SHA256",
  1221. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1222. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1223. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1224. 0 },
  1225. #endif /* MBEDTLS_SHA256_C */
  1226. #if defined(MBEDTLS_SHA512_C)
  1227. { MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384, "TLS-DHE-PSK-WITH-AES-256-GCM-SHA384",
  1228. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1229. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1230. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1231. 0 },
  1232. #endif /* MBEDTLS_SHA512_C */
  1233. #endif /* MBEDTLS_GCM_C */
  1234. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1235. #if defined(MBEDTLS_SHA256_C)
  1236. { MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, "TLS-DHE-PSK-WITH-AES-128-CBC-SHA256",
  1237. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1238. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1239. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1240. 0 },
  1241. #endif /* MBEDTLS_SHA256_C */
  1242. #if defined(MBEDTLS_SHA512_C)
  1243. { MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384, "TLS-DHE-PSK-WITH-AES-256-CBC-SHA384",
  1244. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1245. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1246. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1247. 0 },
  1248. #endif /* MBEDTLS_SHA512_C */
  1249. #if defined(MBEDTLS_SHA1_C)
  1250. { MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA, "TLS-DHE-PSK-WITH-AES-128-CBC-SHA",
  1251. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1252. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1253. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1254. 0 },
  1255. { MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA, "TLS-DHE-PSK-WITH-AES-256-CBC-SHA",
  1256. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1257. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1258. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1259. 0 },
  1260. #endif /* MBEDTLS_SHA1_C */
  1261. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1262. #if defined(MBEDTLS_CCM_C)
  1263. { MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM, "TLS-DHE-PSK-WITH-AES-256-CCM",
  1264. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1265. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1266. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1267. 0 },
  1268. { MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8, "TLS-DHE-PSK-WITH-AES-256-CCM-8",
  1269. MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1270. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1271. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1272. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  1273. { MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM, "TLS-DHE-PSK-WITH-AES-128-CCM",
  1274. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1275. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1276. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1277. 0 },
  1278. { MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8, "TLS-DHE-PSK-WITH-AES-128-CCM-8",
  1279. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1280. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1281. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1282. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  1283. #endif /* MBEDTLS_CCM_C */
  1284. #endif /* MBEDTLS_AES_C */
  1285. #if defined(MBEDTLS_CAMELLIA_C)
  1286. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1287. #if defined(MBEDTLS_SHA256_C)
  1288. { MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256, "TLS-DHE-PSK-WITH-CAMELLIA-128-CBC-SHA256",
  1289. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1290. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1291. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1292. 0 },
  1293. #endif /* MBEDTLS_SHA256_C */
  1294. #if defined(MBEDTLS_SHA512_C)
  1295. { MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384, "TLS-DHE-PSK-WITH-CAMELLIA-256-CBC-SHA384",
  1296. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1297. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1298. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1299. 0 },
  1300. #endif /* MBEDTLS_SHA512_C */
  1301. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1302. #if defined(MBEDTLS_GCM_C)
  1303. #if defined(MBEDTLS_SHA256_C)
  1304. { MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256, "TLS-DHE-PSK-WITH-CAMELLIA-128-GCM-SHA256",
  1305. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1306. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1307. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1308. 0 },
  1309. #endif /* MBEDTLS_SHA256_C */
  1310. #if defined(MBEDTLS_SHA512_C)
  1311. { MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384, "TLS-DHE-PSK-WITH-CAMELLIA-256-GCM-SHA384",
  1312. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1313. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1314. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1315. 0 },
  1316. #endif /* MBEDTLS_SHA512_C */
  1317. #endif /* MBEDTLS_GCM_C */
  1318. #endif /* MBEDTLS_CAMELLIA_C */
  1319. #if defined(MBEDTLS_DES_C)
  1320. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1321. #if defined(MBEDTLS_SHA1_C)
  1322. { MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, "TLS-DHE-PSK-WITH-3DES-EDE-CBC-SHA",
  1323. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1324. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1325. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1326. 0 },
  1327. #endif /* MBEDTLS_SHA1_C */
  1328. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1329. #endif /* MBEDTLS_DES_C */
  1330. #if defined(MBEDTLS_ARC4_C)
  1331. #if defined(MBEDTLS_SHA1_C)
  1332. { MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA, "TLS-DHE-PSK-WITH-RC4-128-SHA",
  1333. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1334. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1335. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1336. MBEDTLS_CIPHERSUITE_NODTLS },
  1337. #endif /* MBEDTLS_SHA1_C */
  1338. #endif /* MBEDTLS_ARC4_C */
  1339. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */
  1340. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
  1341. #if defined(MBEDTLS_AES_C)
  1342. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1343. #if defined(MBEDTLS_SHA256_C)
  1344. { MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, "TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256",
  1345. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1346. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1347. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1348. 0 },
  1349. #endif /* MBEDTLS_SHA256_C */
  1350. #if defined(MBEDTLS_SHA512_C)
  1351. { MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384, "TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384",
  1352. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1353. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1354. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1355. 0 },
  1356. #endif /* MBEDTLS_SHA512_C */
  1357. #if defined(MBEDTLS_SHA1_C)
  1358. { MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA, "TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA",
  1359. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1360. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1361. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1362. 0 },
  1363. { MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA, "TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA",
  1364. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1365. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1366. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1367. 0 },
  1368. #endif /* MBEDTLS_SHA1_C */
  1369. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1370. #endif /* MBEDTLS_AES_C */
  1371. #if defined(MBEDTLS_CAMELLIA_C)
  1372. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1373. #if defined(MBEDTLS_SHA256_C)
  1374. { MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256, "TLS-ECDHE-PSK-WITH-CAMELLIA-128-CBC-SHA256",
  1375. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1376. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1377. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1378. 0 },
  1379. #endif /* MBEDTLS_SHA256_C */
  1380. #if defined(MBEDTLS_SHA512_C)
  1381. { MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384, "TLS-ECDHE-PSK-WITH-CAMELLIA-256-CBC-SHA384",
  1382. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1383. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1384. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1385. 0 },
  1386. #endif /* MBEDTLS_SHA512_C */
  1387. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1388. #endif /* MBEDTLS_CAMELLIA_C */
  1389. #if defined(MBEDTLS_DES_C)
  1390. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1391. #if defined(MBEDTLS_SHA1_C)
  1392. { MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA, "TLS-ECDHE-PSK-WITH-3DES-EDE-CBC-SHA",
  1393. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1394. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1395. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1396. 0 },
  1397. #endif /* MBEDTLS_SHA1_C */
  1398. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1399. #endif /* MBEDTLS_DES_C */
  1400. #if defined(MBEDTLS_ARC4_C)
  1401. #if defined(MBEDTLS_SHA1_C)
  1402. { MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA, "TLS-ECDHE-PSK-WITH-RC4-128-SHA",
  1403. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1404. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1405. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1406. MBEDTLS_CIPHERSUITE_NODTLS },
  1407. #endif /* MBEDTLS_SHA1_C */
  1408. #endif /* MBEDTLS_ARC4_C */
  1409. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED */
  1410. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)
  1411. #if defined(MBEDTLS_AES_C)
  1412. #if defined(MBEDTLS_GCM_C)
  1413. #if defined(MBEDTLS_SHA256_C)
  1414. { MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256, "TLS-RSA-PSK-WITH-AES-128-GCM-SHA256",
  1415. MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1416. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1417. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1418. 0 },
  1419. #endif /* MBEDTLS_SHA256_C */
  1420. #if defined(MBEDTLS_SHA512_C)
  1421. { MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384, "TLS-RSA-PSK-WITH-AES-256-GCM-SHA384",
  1422. MBEDTLS_CIPHER_AES_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1423. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1424. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1425. 0 },
  1426. #endif /* MBEDTLS_SHA512_C */
  1427. #endif /* MBEDTLS_GCM_C */
  1428. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1429. #if defined(MBEDTLS_SHA256_C)
  1430. { MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256, "TLS-RSA-PSK-WITH-AES-128-CBC-SHA256",
  1431. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1432. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1433. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1434. 0 },
  1435. #endif /* MBEDTLS_SHA256_C */
  1436. #if defined(MBEDTLS_SHA512_C)
  1437. { MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384, "TLS-RSA-PSK-WITH-AES-256-CBC-SHA384",
  1438. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1439. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1440. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1441. 0 },
  1442. #endif /* MBEDTLS_SHA512_C */
  1443. #if defined(MBEDTLS_SHA1_C)
  1444. { MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA, "TLS-RSA-PSK-WITH-AES-128-CBC-SHA",
  1445. MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1446. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1447. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1448. 0 },
  1449. { MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA, "TLS-RSA-PSK-WITH-AES-256-CBC-SHA",
  1450. MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1451. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1452. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1453. 0 },
  1454. #endif /* MBEDTLS_SHA1_C */
  1455. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1456. #endif /* MBEDTLS_AES_C */
  1457. #if defined(MBEDTLS_CAMELLIA_C)
  1458. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1459. #if defined(MBEDTLS_SHA256_C)
  1460. { MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256, "TLS-RSA-PSK-WITH-CAMELLIA-128-CBC-SHA256",
  1461. MBEDTLS_CIPHER_CAMELLIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1462. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1463. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1464. 0 },
  1465. #endif /* MBEDTLS_SHA256_C */
  1466. #if defined(MBEDTLS_SHA512_C)
  1467. { MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384, "TLS-RSA-PSK-WITH-CAMELLIA-256-CBC-SHA384",
  1468. MBEDTLS_CIPHER_CAMELLIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1469. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1470. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1471. 0 },
  1472. #endif /* MBEDTLS_SHA512_C */
  1473. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1474. #if defined(MBEDTLS_GCM_C)
  1475. #if defined(MBEDTLS_SHA256_C)
  1476. { MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256, "TLS-RSA-PSK-WITH-CAMELLIA-128-GCM-SHA256",
  1477. MBEDTLS_CIPHER_CAMELLIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1478. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1479. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1480. 0 },
  1481. #endif /* MBEDTLS_SHA256_C */
  1482. #if defined(MBEDTLS_SHA512_C)
  1483. { MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384, "TLS-RSA-PSK-WITH-CAMELLIA-256-GCM-SHA384",
  1484. MBEDTLS_CIPHER_CAMELLIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1485. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1486. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1487. 0 },
  1488. #endif /* MBEDTLS_SHA512_C */
  1489. #endif /* MBEDTLS_GCM_C */
  1490. #endif /* MBEDTLS_CAMELLIA_C */
  1491. #if defined(MBEDTLS_DES_C)
  1492. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1493. #if defined(MBEDTLS_SHA1_C)
  1494. { MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, "TLS-RSA-PSK-WITH-3DES-EDE-CBC-SHA",
  1495. MBEDTLS_CIPHER_DES_EDE3_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1496. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1497. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1498. 0 },
  1499. #endif /* MBEDTLS_SHA1_C */
  1500. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1501. #endif /* MBEDTLS_DES_C */
  1502. #if defined(MBEDTLS_ARC4_C)
  1503. #if defined(MBEDTLS_SHA1_C)
  1504. { MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA, "TLS-RSA-PSK-WITH-RC4-128-SHA",
  1505. MBEDTLS_CIPHER_ARC4_128, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1506. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1507. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1508. MBEDTLS_CIPHERSUITE_NODTLS },
  1509. #endif /* MBEDTLS_SHA1_C */
  1510. #endif /* MBEDTLS_ARC4_C */
  1511. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED */
  1512. #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
  1513. #if defined(MBEDTLS_AES_C)
  1514. #if defined(MBEDTLS_CCM_C)
  1515. { MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8, "TLS-ECJPAKE-WITH-AES-128-CCM-8",
  1516. MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECJPAKE,
  1517. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1518. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1519. MBEDTLS_CIPHERSUITE_SHORT_TAG },
  1520. #endif /* MBEDTLS_CCM_C */
  1521. #endif /* MBEDTLS_AES_C */
  1522. #endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */
  1523. #if defined(MBEDTLS_ENABLE_WEAK_CIPHERSUITES)
  1524. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  1525. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)
  1526. #if defined(MBEDTLS_MD5_C)
  1527. { MBEDTLS_TLS_RSA_WITH_NULL_MD5, "TLS-RSA-WITH-NULL-MD5",
  1528. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_MD5, MBEDTLS_KEY_EXCHANGE_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
  1533. #if defined(MBEDTLS_SHA1_C)
  1534. { MBEDTLS_TLS_RSA_WITH_NULL_SHA, "TLS-RSA-WITH-NULL-SHA",
  1535. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  1536. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1537. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1538. MBEDTLS_CIPHERSUITE_WEAK },
  1539. #endif
  1540. #if defined(MBEDTLS_SHA256_C)
  1541. { MBEDTLS_TLS_RSA_WITH_NULL_SHA256, "TLS-RSA-WITH-NULL-SHA256",
  1542. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  1543. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1544. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1545. MBEDTLS_CIPHERSUITE_WEAK },
  1546. #endif
  1547. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */
  1548. #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)
  1549. #if defined(MBEDTLS_SHA1_C)
  1550. { MBEDTLS_TLS_PSK_WITH_NULL_SHA, "TLS-PSK-WITH-NULL-SHA",
  1551. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_PSK,
  1552. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1553. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1554. MBEDTLS_CIPHERSUITE_WEAK },
  1555. #endif /* MBEDTLS_SHA1_C */
  1556. #if defined(MBEDTLS_SHA256_C)
  1557. { MBEDTLS_TLS_PSK_WITH_NULL_SHA256, "TLS-PSK-WITH-NULL-SHA256",
  1558. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1559. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1560. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1561. MBEDTLS_CIPHERSUITE_WEAK },
  1562. #endif
  1563. #if defined(MBEDTLS_SHA512_C)
  1564. { MBEDTLS_TLS_PSK_WITH_NULL_SHA384, "TLS-PSK-WITH-NULL-SHA384",
  1565. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  1566. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1567. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1568. MBEDTLS_CIPHERSUITE_WEAK },
  1569. #endif
  1570. #endif /* MBEDTLS_KEY_EXCHANGE_PSK_ENABLED */
  1571. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
  1572. #if defined(MBEDTLS_SHA1_C)
  1573. { MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA, "TLS-DHE-PSK-WITH-NULL-SHA",
  1574. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1575. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1576. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1577. MBEDTLS_CIPHERSUITE_WEAK },
  1578. #endif /* MBEDTLS_SHA1_C */
  1579. #if defined(MBEDTLS_SHA256_C)
  1580. { MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256, "TLS-DHE-PSK-WITH-NULL-SHA256",
  1581. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1582. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1583. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1584. MBEDTLS_CIPHERSUITE_WEAK },
  1585. #endif
  1586. #if defined(MBEDTLS_SHA512_C)
  1587. { MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384, "TLS-DHE-PSK-WITH-NULL-SHA384",
  1588. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1589. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1590. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1591. MBEDTLS_CIPHERSUITE_WEAK },
  1592. #endif
  1593. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */
  1594. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
  1595. #if defined(MBEDTLS_SHA1_C)
  1596. { MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA, "TLS-ECDHE-PSK-WITH-NULL-SHA",
  1597. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1598. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1599. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1600. MBEDTLS_CIPHERSUITE_WEAK },
  1601. #endif /* MBEDTLS_SHA1_C */
  1602. #if defined(MBEDTLS_SHA256_C)
  1603. { MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256, "TLS-ECDHE-PSK-WITH-NULL-SHA256",
  1604. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1605. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1606. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1607. MBEDTLS_CIPHERSUITE_WEAK },
  1608. #endif
  1609. #if defined(MBEDTLS_SHA512_C)
  1610. { MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384, "TLS-ECDHE-PSK-WITH-NULL-SHA384",
  1611. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1612. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1613. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1614. MBEDTLS_CIPHERSUITE_WEAK },
  1615. #endif
  1616. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED */
  1617. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)
  1618. #if defined(MBEDTLS_SHA1_C)
  1619. { MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA, "TLS-RSA-PSK-WITH-NULL-SHA",
  1620. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1621. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1622. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1623. MBEDTLS_CIPHERSUITE_WEAK },
  1624. #endif /* MBEDTLS_SHA1_C */
  1625. #if defined(MBEDTLS_SHA256_C)
  1626. { MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256, "TLS-RSA-PSK-WITH-NULL-SHA256",
  1627. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1628. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1629. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1630. MBEDTLS_CIPHERSUITE_WEAK },
  1631. #endif
  1632. #if defined(MBEDTLS_SHA512_C)
  1633. { MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384, "TLS-RSA-PSK-WITH-NULL-SHA384",
  1634. MBEDTLS_CIPHER_NULL, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1635. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_1,
  1636. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1637. MBEDTLS_CIPHERSUITE_WEAK },
  1638. #endif
  1639. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED */
  1640. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  1641. #if defined(MBEDTLS_DES_C)
  1642. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  1643. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)
  1644. #if defined(MBEDTLS_SHA1_C)
  1645. { MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA, "TLS-DHE-RSA-WITH-DES-CBC-SHA",
  1646. MBEDTLS_CIPHER_DES_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  1647. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1648. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1649. MBEDTLS_CIPHERSUITE_WEAK },
  1650. #endif /* MBEDTLS_SHA1_C */
  1651. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */
  1652. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)
  1653. #if defined(MBEDTLS_SHA1_C)
  1654. { MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA, "TLS-RSA-WITH-DES-CBC-SHA",
  1655. MBEDTLS_CIPHER_DES_CBC, MBEDTLS_MD_SHA1, MBEDTLS_KEY_EXCHANGE_RSA,
  1656. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0,
  1657. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1658. MBEDTLS_CIPHERSUITE_WEAK },
  1659. #endif /* MBEDTLS_SHA1_C */
  1660. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */
  1661. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  1662. #endif /* MBEDTLS_DES_C */
  1663. #endif /* MBEDTLS_ENABLE_WEAK_CIPHERSUITES */
  1664. #if defined(MBEDTLS_ARIA_C)
  1665. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)
  1666. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA512_C))
  1667. { MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384,
  1668. "TLS-RSA-WITH-ARIA-256-GCM-SHA384",
  1669. MBEDTLS_CIPHER_ARIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA,
  1670. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1671. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1672. 0 },
  1673. #endif
  1674. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA512_C))
  1675. { MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384,
  1676. "TLS-RSA-WITH-ARIA-256-CBC-SHA384",
  1677. MBEDTLS_CIPHER_ARIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA,
  1678. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1679. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1680. 0 },
  1681. #endif
  1682. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA256_C))
  1683. { MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256,
  1684. "TLS-RSA-WITH-ARIA-128-GCM-SHA256",
  1685. MBEDTLS_CIPHER_ARIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  1686. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1687. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1688. 0 },
  1689. #endif
  1690. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA256_C))
  1691. { MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256,
  1692. "TLS-RSA-WITH-ARIA-128-CBC-SHA256",
  1693. MBEDTLS_CIPHER_ARIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA,
  1694. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1695. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1696. 0 },
  1697. #endif
  1698. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */
  1699. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)
  1700. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA512_C))
  1701. { MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
  1702. "TLS-RSA-PSK-WITH-ARIA-256-GCM-SHA384",
  1703. MBEDTLS_CIPHER_ARIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1704. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1705. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1706. 0 },
  1707. #endif
  1708. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA512_C))
  1709. { MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384,
  1710. "TLS-RSA-PSK-WITH-ARIA-256-CBC-SHA384",
  1711. MBEDTLS_CIPHER_ARIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1712. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1713. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1714. 0 },
  1715. #endif
  1716. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA256_C))
  1717. { MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
  1718. "TLS-RSA-PSK-WITH-ARIA-128-GCM-SHA256",
  1719. MBEDTLS_CIPHER_ARIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1720. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1721. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1722. 0 },
  1723. #endif
  1724. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA256_C))
  1725. { MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256,
  1726. "TLS-RSA-PSK-WITH-ARIA-128-CBC-SHA256",
  1727. MBEDTLS_CIPHER_ARIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_RSA_PSK,
  1728. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1729. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1730. 0 },
  1731. #endif
  1732. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED */
  1733. #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)
  1734. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA512_C))
  1735. { MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384,
  1736. "TLS-PSK-WITH-ARIA-256-GCM-SHA384",
  1737. MBEDTLS_CIPHER_ARIA_256_GCM, MBEDTLS_MD_SHA384,MBEDTLS_KEY_EXCHANGE_PSK,
  1738. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1739. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1740. 0 },
  1741. #endif
  1742. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA512_C))
  1743. { MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384,
  1744. "TLS-PSK-WITH-ARIA-256-CBC-SHA384",
  1745. MBEDTLS_CIPHER_ARIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_PSK,
  1746. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1747. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1748. 0 },
  1749. #endif
  1750. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA256_C))
  1751. { MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256,
  1752. "TLS-PSK-WITH-ARIA-128-GCM-SHA256",
  1753. MBEDTLS_CIPHER_ARIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1754. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1755. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1756. 0 },
  1757. #endif
  1758. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA256_C))
  1759. { MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256,
  1760. "TLS-PSK-WITH-ARIA-128-CBC-SHA256",
  1761. MBEDTLS_CIPHER_ARIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_PSK,
  1762. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1763. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1764. 0 },
  1765. #endif
  1766. #endif /* MBEDTLS_KEY_EXCHANGE_PSK_ENABLED */
  1767. #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED)
  1768. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA512_C))
  1769. { MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384,
  1770. "TLS-ECDH-RSA-WITH-ARIA-256-GCM-SHA384",
  1771. MBEDTLS_CIPHER_ARIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  1772. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1773. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1774. 0 },
  1775. #endif
  1776. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA512_C))
  1777. { MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384,
  1778. "TLS-ECDH-RSA-WITH-ARIA-256-CBC-SHA384",
  1779. MBEDTLS_CIPHER_ARIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  1780. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1781. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1782. 0 },
  1783. #endif
  1784. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA256_C))
  1785. { MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256,
  1786. "TLS-ECDH-RSA-WITH-ARIA-128-GCM-SHA256",
  1787. MBEDTLS_CIPHER_ARIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  1788. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1789. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1790. 0 },
  1791. #endif
  1792. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA256_C))
  1793. { MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256,
  1794. "TLS-ECDH-RSA-WITH-ARIA-128-CBC-SHA256",
  1795. MBEDTLS_CIPHER_ARIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
  1796. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1797. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1798. 0 },
  1799. #endif
  1800. #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED */
  1801. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)
  1802. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA512_C))
  1803. { MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
  1804. "TLS-ECDHE-RSA-WITH-ARIA-256-GCM-SHA384",
  1805. MBEDTLS_CIPHER_ARIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  1806. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1807. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1808. 0 },
  1809. #endif
  1810. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA512_C))
  1811. { MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384,
  1812. "TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384",
  1813. MBEDTLS_CIPHER_ARIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  1814. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1815. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1816. 0 },
  1817. #endif
  1818. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA256_C))
  1819. { MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
  1820. "TLS-ECDHE-RSA-WITH-ARIA-128-GCM-SHA256",
  1821. MBEDTLS_CIPHER_ARIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  1822. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1823. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1824. 0 },
  1825. #endif
  1826. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA256_C))
  1827. { MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256,
  1828. "TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256",
  1829. MBEDTLS_CIPHER_ARIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
  1830. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1831. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1832. 0 },
  1833. #endif
  1834. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED */
  1835. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
  1836. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA512_C))
  1837. { MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384,
  1838. "TLS-ECDHE-PSK-WITH-ARIA-256-CBC-SHA384",
  1839. MBEDTLS_CIPHER_ARIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1840. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1841. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1842. 0 },
  1843. #endif
  1844. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA256_C))
  1845. { MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256,
  1846. "TLS-ECDHE-PSK-WITH-ARIA-128-CBC-SHA256",
  1847. MBEDTLS_CIPHER_ARIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
  1848. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1849. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1850. 0 },
  1851. #endif
  1852. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED */
  1853. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
  1854. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA512_C))
  1855. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
  1856. "TLS-ECDHE-ECDSA-WITH-ARIA-256-GCM-SHA384",
  1857. MBEDTLS_CIPHER_ARIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  1858. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1859. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1860. 0 },
  1861. #endif
  1862. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA512_C))
  1863. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384,
  1864. "TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC-SHA384",
  1865. MBEDTLS_CIPHER_ARIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  1866. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1867. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1868. 0 },
  1869. #endif
  1870. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA256_C))
  1871. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
  1872. "TLS-ECDHE-ECDSA-WITH-ARIA-128-GCM-SHA256",
  1873. MBEDTLS_CIPHER_ARIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  1874. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1875. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1876. 0 },
  1877. #endif
  1878. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA256_C))
  1879. { MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256,
  1880. "TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC-SHA256",
  1881. MBEDTLS_CIPHER_ARIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
  1882. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1883. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1884. 0 },
  1885. #endif
  1886. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED */
  1887. #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
  1888. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA512_C))
  1889. { MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384,
  1890. "TLS-ECDH-ECDSA-WITH-ARIA-256-GCM-SHA384",
  1891. MBEDTLS_CIPHER_ARIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1892. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1893. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1894. 0 },
  1895. #endif
  1896. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA512_C))
  1897. { MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384,
  1898. "TLS-ECDH-ECDSA-WITH-ARIA-256-CBC-SHA384",
  1899. MBEDTLS_CIPHER_ARIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1900. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1901. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1902. 0 },
  1903. #endif
  1904. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA256_C))
  1905. { MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256,
  1906. "TLS-ECDH-ECDSA-WITH-ARIA-128-GCM-SHA256",
  1907. MBEDTLS_CIPHER_ARIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1908. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1909. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1910. 0 },
  1911. #endif
  1912. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA256_C))
  1913. { MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256,
  1914. "TLS-ECDH-ECDSA-WITH-ARIA-128-CBC-SHA256",
  1915. MBEDTLS_CIPHER_ARIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
  1916. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1917. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1918. 0 },
  1919. #endif
  1920. #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */
  1921. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)
  1922. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA512_C))
  1923. { MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
  1924. "TLS-DHE-RSA-WITH-ARIA-256-GCM-SHA384",
  1925. MBEDTLS_CIPHER_ARIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  1926. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1927. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1928. 0 },
  1929. #endif
  1930. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA512_C))
  1931. { MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384,
  1932. "TLS-DHE-RSA-WITH-ARIA-256-CBC-SHA384",
  1933. MBEDTLS_CIPHER_ARIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  1934. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1935. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1936. 0 },
  1937. #endif
  1938. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA256_C))
  1939. { MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
  1940. "TLS-DHE-RSA-WITH-ARIA-128-GCM-SHA256",
  1941. MBEDTLS_CIPHER_ARIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  1942. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1943. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1944. 0 },
  1945. #endif
  1946. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA256_C))
  1947. { MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256,
  1948. "TLS-DHE-RSA-WITH-ARIA-128-CBC-SHA256",
  1949. MBEDTLS_CIPHER_ARIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_RSA,
  1950. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1951. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1952. 0 },
  1953. #endif
  1954. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */
  1955. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
  1956. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA512_C))
  1957. { MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
  1958. "TLS-DHE-PSK-WITH-ARIA-256-GCM-SHA384",
  1959. MBEDTLS_CIPHER_ARIA_256_GCM, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1960. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1961. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1962. 0 },
  1963. #endif
  1964. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA512_C))
  1965. { MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384,
  1966. "TLS-DHE-PSK-WITH-ARIA-256-CBC-SHA384",
  1967. MBEDTLS_CIPHER_ARIA_256_CBC, MBEDTLS_MD_SHA384, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1968. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1969. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1970. 0 },
  1971. #endif
  1972. #if (defined(MBEDTLS_GCM_C) && defined(MBEDTLS_SHA256_C))
  1973. { MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
  1974. "TLS-DHE-PSK-WITH-ARIA-128-GCM-SHA256",
  1975. MBEDTLS_CIPHER_ARIA_128_GCM, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1976. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1977. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1978. 0 },
  1979. #endif
  1980. #if (defined(MBEDTLS_CIPHER_MODE_CBC) && defined(MBEDTLS_SHA256_C))
  1981. { MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256,
  1982. "TLS-DHE-PSK-WITH-ARIA-128-CBC-SHA256",
  1983. MBEDTLS_CIPHER_ARIA_128_CBC, MBEDTLS_MD_SHA256, MBEDTLS_KEY_EXCHANGE_DHE_PSK,
  1984. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1985. MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3,
  1986. 0 },
  1987. #endif
  1988. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */
  1989. #endif /* MBEDTLS_ARIA_C */
  1990. { 0, "",
  1991. MBEDTLS_CIPHER_NONE, MBEDTLS_MD_NONE, MBEDTLS_KEY_EXCHANGE_NONE,
  1992. 0, 0, 0, 0, 0 }
  1993. };
  1994. #if defined(MBEDTLS_SSL_CIPHERSUITES)
  1995. const int *mbedtls_ssl_list_ciphersuites( void )
  1996. {
  1997. return( ciphersuite_preference );
  1998. }
  1999. #else
  2000. #define MAX_CIPHERSUITES sizeof( ciphersuite_definitions ) / \
  2001. sizeof( ciphersuite_definitions[0] )
  2002. static int supported_ciphersuites[MAX_CIPHERSUITES];
  2003. static int supported_init = 0;
  2004. static int ciphersuite_is_removed( const mbedtls_ssl_ciphersuite_t *cs_info )
  2005. {
  2006. (void)cs_info;
  2007. #if defined(MBEDTLS_REMOVE_ARC4_CIPHERSUITES)
  2008. if( cs_info->cipher == MBEDTLS_CIPHER_ARC4_128 )
  2009. return( 1 );
  2010. #endif /* MBEDTLS_REMOVE_ARC4_CIPHERSUITES */
  2011. #if defined(MBEDTLS_REMOVE_3DES_CIPHERSUITES)
  2012. if( cs_info->cipher == MBEDTLS_CIPHER_DES_EDE3_ECB ||
  2013. cs_info->cipher == MBEDTLS_CIPHER_DES_EDE3_CBC )
  2014. {
  2015. return( 1 );
  2016. }
  2017. #endif /* MBEDTLS_REMOVE_3DES_CIPHERSUITES */
  2018. return( 0 );
  2019. }
  2020. const int *mbedtls_ssl_list_ciphersuites( void )
  2021. {
  2022. /*
  2023. * On initial call filter out all ciphersuites not supported by current
  2024. * build based on presence in the ciphersuite_definitions.
  2025. */
  2026. if( supported_init == 0 )
  2027. {
  2028. const int *p;
  2029. int *q;
  2030. for( p = ciphersuite_preference, q = supported_ciphersuites;
  2031. *p != 0 && q < supported_ciphersuites + MAX_CIPHERSUITES - 1;
  2032. p++ )
  2033. {
  2034. const mbedtls_ssl_ciphersuite_t *cs_info;
  2035. if( ( cs_info = mbedtls_ssl_ciphersuite_from_id( *p ) ) != NULL &&
  2036. !ciphersuite_is_removed( cs_info ) )
  2037. {
  2038. *(q++) = *p;
  2039. }
  2040. }
  2041. *q = 0;
  2042. supported_init = 1;
  2043. }
  2044. return( supported_ciphersuites );
  2045. }
  2046. #endif /* MBEDTLS_SSL_CIPHERSUITES */
  2047. const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_string(
  2048. const char *ciphersuite_name )
  2049. {
  2050. const mbedtls_ssl_ciphersuite_t *cur = ciphersuite_definitions;
  2051. if( NULL == ciphersuite_name )
  2052. return( NULL );
  2053. while( cur->id != 0 )
  2054. {
  2055. if( 0 == strcmp( cur->name, ciphersuite_name ) )
  2056. return( cur );
  2057. cur++;
  2058. }
  2059. return( NULL );
  2060. }
  2061. const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_id( int ciphersuite )
  2062. {
  2063. const mbedtls_ssl_ciphersuite_t *cur = ciphersuite_definitions;
  2064. while( cur->id != 0 )
  2065. {
  2066. if( cur->id == ciphersuite )
  2067. return( cur );
  2068. cur++;
  2069. }
  2070. return( NULL );
  2071. }
  2072. const char *mbedtls_ssl_get_ciphersuite_name( const int ciphersuite_id )
  2073. {
  2074. const mbedtls_ssl_ciphersuite_t *cur;
  2075. cur = mbedtls_ssl_ciphersuite_from_id( ciphersuite_id );
  2076. if( cur == NULL )
  2077. return( "unknown" );
  2078. return( cur->name );
  2079. }
  2080. int mbedtls_ssl_get_ciphersuite_id( const char *ciphersuite_name )
  2081. {
  2082. const mbedtls_ssl_ciphersuite_t *cur;
  2083. cur = mbedtls_ssl_ciphersuite_from_string( ciphersuite_name );
  2084. if( cur == NULL )
  2085. return( 0 );
  2086. return( cur->id );
  2087. }
  2088. #if defined(MBEDTLS_PK_C)
  2089. mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_pk_alg( const mbedtls_ssl_ciphersuite_t *info )
  2090. {
  2091. switch( info->key_exchange )
  2092. {
  2093. case MBEDTLS_KEY_EXCHANGE_RSA:
  2094. case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
  2095. case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
  2096. case MBEDTLS_KEY_EXCHANGE_RSA_PSK:
  2097. return( MBEDTLS_PK_RSA );
  2098. case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
  2099. return( MBEDTLS_PK_ECDSA );
  2100. case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
  2101. case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
  2102. return( MBEDTLS_PK_ECKEY );
  2103. default:
  2104. return( MBEDTLS_PK_NONE );
  2105. }
  2106. }
  2107. mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_alg( const mbedtls_ssl_ciphersuite_t *info )
  2108. {
  2109. switch( info->key_exchange )
  2110. {
  2111. case MBEDTLS_KEY_EXCHANGE_RSA:
  2112. case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
  2113. case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
  2114. return( MBEDTLS_PK_RSA );
  2115. case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
  2116. return( MBEDTLS_PK_ECDSA );
  2117. default:
  2118. return( MBEDTLS_PK_NONE );
  2119. }
  2120. }
  2121. #endif /* MBEDTLS_PK_C */
  2122. #if defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_ECDSA_C) || \
  2123. defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
  2124. int mbedtls_ssl_ciphersuite_uses_ec( const mbedtls_ssl_ciphersuite_t *info )
  2125. {
  2126. switch( info->key_exchange )
  2127. {
  2128. case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
  2129. case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
  2130. case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK:
  2131. case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
  2132. case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
  2133. case MBEDTLS_KEY_EXCHANGE_ECJPAKE:
  2134. return( 1 );
  2135. default:
  2136. return( 0 );
  2137. }
  2138. }
  2139. #endif /* MBEDTLS_ECDH_C || MBEDTLS_ECDSA_C || MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED*/
  2140. #if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED)
  2141. int mbedtls_ssl_ciphersuite_uses_psk( const mbedtls_ssl_ciphersuite_t *info )
  2142. {
  2143. switch( info->key_exchange )
  2144. {
  2145. case MBEDTLS_KEY_EXCHANGE_PSK:
  2146. case MBEDTLS_KEY_EXCHANGE_RSA_PSK:
  2147. case MBEDTLS_KEY_EXCHANGE_DHE_PSK:
  2148. case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK:
  2149. return( 1 );
  2150. default:
  2151. return( 0 );
  2152. }
  2153. }
  2154. #endif /* MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED */
  2155. #endif /* MBEDTLS_SSL_TLS_C */