RetroArch
ssl_ciphersuites.h
Go to the documentation of this file.
1 
23 #ifndef MBEDTLS_SSL_CIPHERSUITES_H
24 #define MBEDTLS_SSL_CIPHERSUITES_H
25 
26 #include <retro_inline.h>
27 
28 #include "pk.h"
29 #include "cipher.h"
30 #include "md.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Supported ciphersuites (Official IANA names)
38  */
39 #define MBEDTLS_TLS_RSA_WITH_NULL_MD5 0x01
40 #define MBEDTLS_TLS_RSA_WITH_NULL_SHA 0x02
42 #define MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 0x04
43 #define MBEDTLS_TLS_RSA_WITH_RC4_128_SHA 0x05
44 #define MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA 0x09
46 #define MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA 0x0A
47 
48 #define MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA 0x15
49 #define MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x16
50 
51 #define MBEDTLS_TLS_PSK_WITH_NULL_SHA 0x2C
52 #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA 0x2D
53 #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA 0x2E
54 #define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA 0x2F
55 
56 #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x33
57 #define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA 0x35
58 #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x39
59 
60 #define MBEDTLS_TLS_RSA_WITH_NULL_SHA256 0x3B
61 #define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 0x3C
62 #define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 0x3D
64 #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA 0x41
65 #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x45
66 
67 #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 0x67
68 #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 0x6B
70 #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA 0x84
71 #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x88
72 
73 #define MBEDTLS_TLS_PSK_WITH_RC4_128_SHA 0x8A
74 #define MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA 0x8B
75 #define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA 0x8C
76 #define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA 0x8D
77 
78 #define MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA 0x8E
79 #define MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA 0x8F
80 #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA 0x90
81 #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA 0x91
82 
83 #define MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA 0x92
84 #define MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA 0x93
85 #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA 0x94
86 #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA 0x95
87 
88 #define MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 0x9C
89 #define MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 0x9D
90 #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 0x9E
91 #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 0x9F
93 #define MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 0xA8
94 #define MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 0xA9
95 #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 0xAA
96 #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 0xAB
97 #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 0xAC
98 #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 0xAD
100 #define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 0xAE
101 #define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 0xAF
102 #define MBEDTLS_TLS_PSK_WITH_NULL_SHA256 0xB0
103 #define MBEDTLS_TLS_PSK_WITH_NULL_SHA384 0xB1
105 #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 0xB2
106 #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 0xB3
107 #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 0xB4
108 #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 0xB5
110 #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 0xB6
111 #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 0xB7
112 #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 0xB8
113 #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 0xB9
115 #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBA
116 #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBE
118 #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC0
119 #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC4
121 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA 0xC001
122 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA 0xC002
123 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC003
124 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0xC004
125 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0xC005
127 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA 0xC006
128 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA 0xC007
129 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC008
130 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xC009
131 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0xC00A
133 #define MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA 0xC00B
134 #define MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA 0xC00C
135 #define MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA 0xC00D
136 #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 0xC00E
137 #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA 0xC00F
139 #define MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA 0xC010
140 #define MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA 0xC011
141 #define MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA 0xC012
142 #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xC013
143 #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 0xC014
145 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xC023
146 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xC024
147 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 0xC025
148 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 0xC026
149 #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 0xC027
150 #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 0xC028
151 #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 0xC029
152 #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 0xC02A
154 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xC02B
155 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xC02C
156 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0xC02D
157 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0xC02E
158 #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F
159 #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0xC030
160 #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031
161 #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 0xC032
163 #define MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA 0xC033
164 #define MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA 0xC034
165 #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA 0xC035
166 #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA 0xC036
167 #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 0xC037
168 #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 0xC038
169 #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA 0xC039
170 #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 0xC03A
171 #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 0xC03B
173 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072
174 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073
175 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC074
176 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC075
177 #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC076
178 #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC077
179 #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC078
180 #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC079
182 #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07A
183 #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07B
184 #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07C
185 #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07D
186 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086
187 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087
188 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC088
189 #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC089
190 #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08A
191 #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08B
192 #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08C
193 #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08D
195 #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC08E
196 #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC08F
197 #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC090
198 #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC091
199 #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC092
200 #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC093
202 #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC094
203 #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC095
204 #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC096
205 #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC097
206 #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC098
207 #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC099
208 #define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A
209 #define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC09B
211 #define MBEDTLS_TLS_RSA_WITH_AES_128_CCM 0xC09C
212 #define MBEDTLS_TLS_RSA_WITH_AES_256_CCM 0xC09D
213 #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM 0xC09E
214 #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM 0xC09F
215 #define MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8 0xC0A0
216 #define MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8 0xC0A1
217 #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8 0xC0A2
218 #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8 0xC0A3
219 #define MBEDTLS_TLS_PSK_WITH_AES_128_CCM 0xC0A4
220 #define MBEDTLS_TLS_PSK_WITH_AES_256_CCM 0xC0A5
221 #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM 0xC0A6
222 #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM 0xC0A7
223 #define MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 0xC0A8
224 #define MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8 0xC0A9
225 #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8 0xC0AA
226 #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8 0xC0AB
227 /* The last two are named with PSK_DHE in the RFC, which looks like a typo */
228 
229 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM 0xC0AC
230 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM 0xC0AD
231 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 0xC0AE
232 #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 0xC0AF
234 #define MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 0xC0FF
236 /* Reminder: update mbedtls_ssl_premaster_secret when adding a new key exchange.
237  * Reminder: update MBEDTLS_KEY_EXCHANGE__xxx below
238  */
239 typedef enum {
253 
254 /* Key exchanges using a certificate */
255 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \
256  defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
257  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
258  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \
259  defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \
260  defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \
261  defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
262 #define MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED
263 #endif
264 
265 /* Key exchanges allowing client certificate requests */
266 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \
267  defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
268  defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \
269  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
270  defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \
271  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
272 #define MBEDTLS_KEY_EXCHANGE__CERT_REQ_ALLOWED__ENABLED
273 #endif
274 
275 /* Key exchanges involving server signature in ServerKeyExchange */
276 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
277  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
278  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
279 #define MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED
280 #endif
281 
282 /* Key exchanges using ECDH */
283 #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \
284  defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
285 #define MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED
286 #endif
287 
288 /* Key exchanges that don't involve ephemeral keys */
289 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \
290  defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \
291  defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \
292  defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED)
293 #define MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED
294 #endif
295 
296 /* Key exchanges that involve ephemeral keys */
297 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
298  defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \
299  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
300  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \
301  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \
302  defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
303 #define MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED
304 #endif
305 
306 /* Key exchanges using a PSK */
307 #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \
308  defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \
309  defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \
310  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
311 #define MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
312 #endif
313 
314 /* Key exchanges using DHE */
315 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
316  defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
317 #define MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED
318 #endif
319 
320 /* Key exchanges using ECDHE */
321 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
322  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \
323  defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
324 #define MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED
325 #endif
326 
328 
329 #define MBEDTLS_CIPHERSUITE_WEAK 0x01
330 #define MBEDTLS_CIPHERSUITE_SHORT_TAG 0x02
332 #define MBEDTLS_CIPHERSUITE_NODTLS 0x04
337 struct mbedtls_ssl_ciphersuite_t
338 {
339  int id;
340  const char * name;
346  int min_major_ver;
351  unsigned char flags;
352 };
353 
354 const int *mbedtls_ssl_list_ciphersuites( void );
355 
356 const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_string( const char *ciphersuite_name );
358 
359 #if defined(MBEDTLS_PK_C)
362 #endif
363 
366 
367 #if defined(MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED)
369 {
370  switch( info->key_exchange )
371  {
378  return( 1 );
379 
380  default:
381  return( 0 );
382  }
383 }
384 #endif /* MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED */
385 
386 #if defined(MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED)
388 {
389  switch( info->key_exchange )
390  {
396  return( 1 );
397 
398  default:
399  return( 0 );
400  }
401 }
402 #endif /* MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED */
403 
404 #if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED)
406 {
407  switch( info->key_exchange )
408  {
411  return( 1 );
412 
413  default:
414  return( 0 );
415  }
416 }
417 #endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED */
418 
420 {
421  switch( info->key_exchange )
422  {
429  return( 1 );
430 
431  default:
432  return( 0 );
433  }
434 }
435 
436 #if defined(MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED)
438 {
439  switch( info->key_exchange )
440  {
443  return( 1 );
444 
445  default:
446  return( 0 );
447  }
448 }
449 #endif /* MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED) */
450 
451 #if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED)
453 {
454  switch( info->key_exchange )
455  {
459  return( 1 );
460 
461  default:
462  return( 0 );
463  }
464 }
465 #endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED) */
466 
467 #if defined(MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED)
469 {
470  switch( info->key_exchange )
471  {
475  return( 1 );
476 
477  default:
478  return( 0 );
479  }
480 }
481 #endif /* MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED */
482 
483 #ifdef __cplusplus
484 }
485 #endif
486 
487 #endif /* ssl_ciphersuites.h */
Definition: ssl_ciphersuites.h:251
const mbedtls_ssl_ciphersuite_t * mbedtls_ssl_ciphersuite_from_id(int ciphersuite_id)
Definition: ssl_ciphersuites.c:1759
GLuint const GLchar * name
Definition: glext.h:6671
const int * mbedtls_ssl_list_ciphersuites(void)
Returns the list of ciphersuites supported by the SSL/TLS module.
Definition: ssl_ciphersuites.c:1707
int mbedtls_ssl_ciphersuite_uses_psk(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.c:1859
mbedtls_cipher_type_t cipher
Definition: ssl_ciphersuites.h:343
#define INLINE
Definition: retro_inline.h:35
Public Key abstraction layer.
Definition: libretro.h:2275
Definition: ssl_ciphersuites.h:241
GLenum GLuint id
Definition: glext.h:6233
Definition: ssl_ciphersuites.h:246
mbedtls_key_exchange_type_t
Definition: ssl_ciphersuites.h:239
mbedtls_md_type_t
Definition: md.h:39
mbedtls_pk_type_t
Public key types.
Definition: pk.h:71
Generic message digest wrapper.
static INLINE int mbedtls_ssl_ciphersuite_uses_server_signature(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.h:469
static INLINE int mbedtls_ssl_ciphersuite_has_pfs(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.h:369
Definition: ssl_ciphersuites.h:243
Generic cipher wrapper.
static INLINE int mbedtls_ssl_ciphersuite_uses_ecdh(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.h:406
This structure is used for storing ciphersuite information.
Definition: ssl_ciphersuites.h:338
Definition: ssl_ciphersuites.h:245
Definition: ssl_ciphersuites.h:249
static INLINE int mbedtls_ssl_ciphersuite_uses_dhe(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.h:438
int min_minor_ver
Definition: ssl_ciphersuites.h:348
Definition: ssl_ciphersuites.h:240
static INLINE int mbedtls_ssl_ciphersuite_cert_req_allowed(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.h:420
const mbedtls_ssl_ciphersuite_t * mbedtls_ssl_ciphersuite_from_string(const char *ciphersuite_name)
Definition: ssl_ciphersuites.c:1740
Definition: ssl_ciphersuites.h:250
int max_major_ver
Definition: ssl_ciphersuites.h:349
mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_alg(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.c:1821
mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_pk_alg(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.c:1799
Definition: ssl_ciphersuites.h:248
Definition: ssl_ciphersuites.h:247
int max_minor_ver
Definition: ssl_ciphersuites.h:350
GLbitfield flags
Definition: glext.h:7828
int mbedtls_ssl_ciphersuite_uses_ec(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.c:1841
mbedtls_key_exchange_type_t key_exchange
Definition: ssl_ciphersuites.h:345
Definition: ssl_ciphersuites.h:242
static INLINE int mbedtls_ssl_ciphersuite_uses_ecdhe(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.h:453
static INLINE int mbedtls_ssl_ciphersuite_no_pfs(const mbedtls_ssl_ciphersuite_t *info)
Definition: ssl_ciphersuites.h:388
int min_major_ver
Definition: ssl_ciphersuites.h:347
mbedtls_cipher_type_t
Definition: cipher.h:77
mbedtls_md_type_t mac
Definition: ssl_ciphersuites.h:344
Definition: ssl_ciphersuites.h:244