ssl_ciphersuites.c 101 KB

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