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