Mbed OS Reference
Loading...
Searching...
No Matches
ssl_ciphersuites.h
Go to the documentation of this file.
1/**
2 * \file ssl_ciphersuites.h
3 *
4 * \brief SSL Ciphersuites for mbed TLS
5 */
6/*
7 * Copyright The Mbed TLS Contributors
8 * SPDX-License-Identifier: Apache-2.0
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 */
22#ifndef MBEDTLS_SSL_CIPHERSUITES_H
23#define MBEDTLS_SSL_CIPHERSUITES_H
24
25#if !defined(MBEDTLS_CONFIG_FILE)
26#include "mbedtls/config.h"
27#else
28#include MBEDTLS_CONFIG_FILE
29#endif
30
31#include "mbedtls/pk.h"
32#include "mbedtls/cipher.h"
33#include "mbedtls/md.h"
34
35/**
36 * \ingroup mbedtls_ssl_module
37 * \{
38 */
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44/*
45 * Supported ciphersuites (Official IANA names)
46 */
47#define MBEDTLS_TLS_RSA_WITH_NULL_MD5 0x01 /**< Weak! */
48#define MBEDTLS_TLS_RSA_WITH_NULL_SHA 0x02 /**< Weak! */
49
50#define MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 0x04
51#define MBEDTLS_TLS_RSA_WITH_RC4_128_SHA 0x05
52#define MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA 0x09 /**< Weak! Not in TLS 1.2 */
53
54#define MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA 0x0A
55
56#define MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA 0x15 /**< Weak! Not in TLS 1.2 */
57#define MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x16
58
59#define MBEDTLS_TLS_PSK_WITH_NULL_SHA 0x2C /**< Weak! */
60#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA 0x2D /**< Weak! */
61#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA 0x2E /**< Weak! */
62#define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA 0x2F
63
64#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x33
65#define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA 0x35
66#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x39
67
68#define MBEDTLS_TLS_RSA_WITH_NULL_SHA256 0x3B /**< Weak! */
69#define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 0x3C /**< TLS 1.2 */
70#define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 0x3D /**< TLS 1.2 */
71
72#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA 0x41
73#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x45
74
75#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 0x67 /**< TLS 1.2 */
76#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 0x6B /**< TLS 1.2 */
77
78#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA 0x84
79#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x88
80
81#define MBEDTLS_TLS_PSK_WITH_RC4_128_SHA 0x8A
82#define MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA 0x8B
83#define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA 0x8C
84#define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA 0x8D
85
86#define MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA 0x8E
87#define MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA 0x8F
88#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA 0x90
89#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA 0x91
90
91#define MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA 0x92
92#define MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA 0x93
93#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA 0x94
94#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA 0x95
95
96#define MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 0x9C /**< TLS 1.2 */
97#define MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 0x9D /**< TLS 1.2 */
98#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 0x9E /**< TLS 1.2 */
99#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 0x9F /**< TLS 1.2 */
100
101#define MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 0xA8 /**< TLS 1.2 */
102#define MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 0xA9 /**< TLS 1.2 */
103#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 0xAA /**< TLS 1.2 */
104#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 0xAB /**< TLS 1.2 */
105#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 0xAC /**< TLS 1.2 */
106#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 0xAD /**< TLS 1.2 */
107
108#define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 0xAE
109#define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 0xAF
110#define MBEDTLS_TLS_PSK_WITH_NULL_SHA256 0xB0 /**< Weak! */
111#define MBEDTLS_TLS_PSK_WITH_NULL_SHA384 0xB1 /**< Weak! */
112
113#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 0xB2
114#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 0xB3
115#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 0xB4 /**< Weak! */
116#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 0xB5 /**< Weak! */
117
118#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 0xB6
119#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 0xB7
120#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 0xB8 /**< Weak! */
121#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 0xB9 /**< Weak! */
122
123#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBA /**< TLS 1.2 */
124#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBE /**< TLS 1.2 */
125
126#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC0 /**< TLS 1.2 */
127#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC4 /**< TLS 1.2 */
128
129#define MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA 0xC001 /**< Weak! */
130#define MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA 0xC002 /**< Not in SSL3! */
131#define MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC003 /**< Not in SSL3! */
132#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0xC004 /**< Not in SSL3! */
133#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0xC005 /**< Not in SSL3! */
134
135#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA 0xC006 /**< Weak! */
136#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA 0xC007 /**< Not in SSL3! */
137#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC008 /**< Not in SSL3! */
138#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xC009 /**< Not in SSL3! */
139#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0xC00A /**< Not in SSL3! */
140
141#define MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA 0xC00B /**< Weak! */
142#define MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA 0xC00C /**< Not in SSL3! */
143#define MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA 0xC00D /**< Not in SSL3! */
144#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 0xC00E /**< Not in SSL3! */
145#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA 0xC00F /**< Not in SSL3! */
146
147#define MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA 0xC010 /**< Weak! */
148#define MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA 0xC011 /**< Not in SSL3! */
149#define MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA 0xC012 /**< Not in SSL3! */
150#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xC013 /**< Not in SSL3! */
151#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 0xC014 /**< Not in SSL3! */
152
153#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xC023 /**< TLS 1.2 */
154#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xC024 /**< TLS 1.2 */
155#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 0xC025 /**< TLS 1.2 */
156#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 0xC026 /**< TLS 1.2 */
157#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 0xC027 /**< TLS 1.2 */
158#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 0xC028 /**< TLS 1.2 */
159#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 0xC029 /**< TLS 1.2 */
160#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 0xC02A /**< TLS 1.2 */
161
162#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xC02B /**< TLS 1.2 */
163#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xC02C /**< TLS 1.2 */
164#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0xC02D /**< TLS 1.2 */
165#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0xC02E /**< TLS 1.2 */
166#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F /**< TLS 1.2 */
167#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0xC030 /**< TLS 1.2 */
168#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031 /**< TLS 1.2 */
169#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 0xC032 /**< TLS 1.2 */
170
171#define MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA 0xC033 /**< Not in SSL3! */
172#define MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA 0xC034 /**< Not in SSL3! */
173#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA 0xC035 /**< Not in SSL3! */
174#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA 0xC036 /**< Not in SSL3! */
175#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 0xC037 /**< Not in SSL3! */
176#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 0xC038 /**< Not in SSL3! */
177#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA 0xC039 /**< Weak! No SSL3! */
178#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 0xC03A /**< Weak! No SSL3! */
179#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 0xC03B /**< Weak! No SSL3! */
180
181#define MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256 0xC03C /**< TLS 1.2 */
182#define MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384 0xC03D /**< TLS 1.2 */
183#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 0xC044 /**< TLS 1.2 */
184#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 0xC045 /**< TLS 1.2 */
185#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC048 /**< TLS 1.2 */
186#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC049 /**< TLS 1.2 */
187#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC04A /**< TLS 1.2 */
188#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC04B /**< TLS 1.2 */
189#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 0xC04C /**< TLS 1.2 */
190#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 0xC04D /**< TLS 1.2 */
191#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 0xC04E /**< TLS 1.2 */
192#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 0xC04F /**< TLS 1.2 */
193#define MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256 0xC050 /**< TLS 1.2 */
194#define MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384 0xC051 /**< TLS 1.2 */
195#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 0xC052 /**< TLS 1.2 */
196#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 0xC053 /**< TLS 1.2 */
197#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05C /**< TLS 1.2 */
198#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05D /**< TLS 1.2 */
199#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05E /**< TLS 1.2 */
200#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05F /**< TLS 1.2 */
201#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 0xC060 /**< TLS 1.2 */
202#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 0xC061 /**< TLS 1.2 */
203#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 0xC062 /**< TLS 1.2 */
204#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 0xC063 /**< TLS 1.2 */
205#define MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256 0xC064 /**< TLS 1.2 */
206#define MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384 0xC065 /**< TLS 1.2 */
207#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 0xC066 /**< TLS 1.2 */
208#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 0xC067 /**< TLS 1.2 */
209#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 0xC068 /**< TLS 1.2 */
210#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 0xC069 /**< TLS 1.2 */
211#define MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256 0xC06A /**< TLS 1.2 */
212#define MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384 0xC06B /**< TLS 1.2 */
213#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 0xC06C /**< TLS 1.2 */
214#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 0xC06D /**< TLS 1.2 */
215#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 0xC06E /**< TLS 1.2 */
216#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 0xC06F /**< TLS 1.2 */
217#define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 0xC070 /**< TLS 1.2 */
218#define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 0xC071 /**< TLS 1.2 */
219
220#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072 /**< Not in SSL3! */
221#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073 /**< Not in SSL3! */
222#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC074 /**< Not in SSL3! */
223#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC075 /**< Not in SSL3! */
224#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC076 /**< Not in SSL3! */
225#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC077 /**< Not in SSL3! */
226#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC078 /**< Not in SSL3! */
227#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC079 /**< Not in SSL3! */
228
229#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07A /**< TLS 1.2 */
230#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07B /**< TLS 1.2 */
231#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07C /**< TLS 1.2 */
232#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07D /**< TLS 1.2 */
233#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086 /**< TLS 1.2 */
234#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087 /**< TLS 1.2 */
235#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC088 /**< TLS 1.2 */
236#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC089 /**< TLS 1.2 */
237#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08A /**< TLS 1.2 */
238#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08B /**< TLS 1.2 */
239#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08C /**< TLS 1.2 */
240#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08D /**< TLS 1.2 */
241
242#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC08E /**< TLS 1.2 */
243#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC08F /**< TLS 1.2 */
244#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC090 /**< TLS 1.2 */
245#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC091 /**< TLS 1.2 */
246#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC092 /**< TLS 1.2 */
247#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC093 /**< TLS 1.2 */
248
249#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC094
250#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC095
251#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC096
252#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC097
253#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC098
254#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC099
255#define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A /**< Not in SSL3! */
256#define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC09B /**< Not in SSL3! */
257
258#define MBEDTLS_TLS_RSA_WITH_AES_128_CCM 0xC09C /**< TLS 1.2 */
259#define MBEDTLS_TLS_RSA_WITH_AES_256_CCM 0xC09D /**< TLS 1.2 */
260#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM 0xC09E /**< TLS 1.2 */
261#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM 0xC09F /**< TLS 1.2 */
262#define MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8 0xC0A0 /**< TLS 1.2 */
263#define MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8 0xC0A1 /**< TLS 1.2 */
264#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8 0xC0A2 /**< TLS 1.2 */
265#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8 0xC0A3 /**< TLS 1.2 */
266#define MBEDTLS_TLS_PSK_WITH_AES_128_CCM 0xC0A4 /**< TLS 1.2 */
267#define MBEDTLS_TLS_PSK_WITH_AES_256_CCM 0xC0A5 /**< TLS 1.2 */
268#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM 0xC0A6 /**< TLS 1.2 */
269#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM 0xC0A7 /**< TLS 1.2 */
270#define MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 0xC0A8 /**< TLS 1.2 */
271#define MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8 0xC0A9 /**< TLS 1.2 */
272#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8 0xC0AA /**< TLS 1.2 */
273#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8 0xC0AB /**< TLS 1.2 */
274/* The last two are named with PSK_DHE in the RFC, which looks like a typo */
275
276#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM 0xC0AC /**< TLS 1.2 */
277#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM 0xC0AD /**< TLS 1.2 */
278#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 0xC0AE /**< TLS 1.2 */
279#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 0xC0AF /**< TLS 1.2 */
280
281#define MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 0xC0FF /**< experimental */
282
283/* RFC 7905 */
284#define MBEDTLS_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 0xCCA8 /**< TLS 1.2 */
285#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0xCCA9 /**< TLS 1.2 */
286#define MBEDTLS_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 0xCCAA /**< TLS 1.2 */
287#define MBEDTLS_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAB /**< TLS 1.2 */
288#define MBEDTLS_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAC /**< TLS 1.2 */
289#define MBEDTLS_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAD /**< TLS 1.2 */
290#define MBEDTLS_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAE /**< TLS 1.2 */
291
292/* Reminder: update mbedtls_ssl_premaster_secret when adding a new key exchange.
293 * Reminder: update MBEDTLS_KEY_EXCHANGE__xxx below
294 */
295typedef enum {
296 MBEDTLS_KEY_EXCHANGE_NONE = 0,
297 MBEDTLS_KEY_EXCHANGE_RSA,
298 MBEDTLS_KEY_EXCHANGE_DHE_RSA,
299 MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
300 MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
301 MBEDTLS_KEY_EXCHANGE_PSK,
302 MBEDTLS_KEY_EXCHANGE_DHE_PSK,
303 MBEDTLS_KEY_EXCHANGE_RSA_PSK,
304 MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
305 MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
306 MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
307 MBEDTLS_KEY_EXCHANGE_ECJPAKE,
308} mbedtls_key_exchange_type_t;
309
310/* Key exchanges using a certificate */
311#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \
312 defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
313 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
314 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \
315 defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \
316 defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \
317 defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
318#define MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED
319#endif
320
321/* Key exchanges allowing client certificate requests */
322#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \
323 defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
324 defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \
325 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
326 defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \
327 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
328#define MBEDTLS_KEY_EXCHANGE_CERT_REQ_ALLOWED_ENABLED
329#endif
330
331/* Key exchanges involving server signature in ServerKeyExchange */
332#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
333 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
334 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
335#define MBEDTLS_KEY_EXCHANGE_WITH_SERVER_SIGNATURE_ENABLED
336#endif
337
338/* Key exchanges using ECDH */
339#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \
340 defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
341#define MBEDTLS_KEY_EXCHANGE_SOME_ECDH_ENABLED
342#endif
343
344/* Key exchanges that don't involve ephemeral keys */
345#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \
346 defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \
347 defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \
348 defined(MBEDTLS_KEY_EXCHANGE_SOME_ECDH_ENABLED)
349#define MBEDTLS_KEY_EXCHANGE_SOME_NON_PFS_ENABLED
350#endif
351
352/* Key exchanges that involve ephemeral keys */
353#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
354 defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \
355 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
356 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \
357 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \
358 defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
359#define MBEDTLS_KEY_EXCHANGE_SOME_PFS_ENABLED
360#endif
361
362/* Key exchanges using a PSK */
363#if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \
364 defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \
365 defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \
366 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
367#define MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED
368#endif
369
370/* Key exchanges using DHE */
371#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
372 defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
373#define MBEDTLS_KEY_EXCHANGE_SOME_DHE_ENABLED
374#endif
375
376/* Key exchanges using ECDHE */
377#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
378 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \
379 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
380#define MBEDTLS_KEY_EXCHANGE_SOME_ECDHE_ENABLED
381#endif
382
384
385#define MBEDTLS_CIPHERSUITE_WEAK 0x01 /**< Weak ciphersuite flag */
386#define MBEDTLS_CIPHERSUITE_SHORT_TAG 0x02 /**< Short authentication tag,
387 eg for CCM_8 */
388#define MBEDTLS_CIPHERSUITE_NODTLS 0x04 /**< Can't be used with DTLS */
389
390/**
391 * \brief This structure is used for storing ciphersuite information
392 */
394{
395 int id;
396 const char * name;
397
400 mbedtls_key_exchange_type_t key_exchange;
401
402 int min_major_ver;
403 int min_minor_ver;
404 int max_major_ver;
405 int max_minor_ver;
406
407 unsigned char flags;
408};
409
410const int *mbedtls_ssl_list_ciphersuites( void );
411
412const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_string( const char *ciphersuite_name );
413const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_id( int ciphersuite_id );
414
415#if defined(MBEDTLS_PK_C)
416mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_pk_alg( const mbedtls_ssl_ciphersuite_t *info );
417mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_alg( const mbedtls_ssl_ciphersuite_t *info );
418#endif
419
420int mbedtls_ssl_ciphersuite_uses_ec( const mbedtls_ssl_ciphersuite_t *info );
421int mbedtls_ssl_ciphersuite_uses_psk( const mbedtls_ssl_ciphersuite_t *info );
422
423#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PFS_ENABLED)
424static inline int mbedtls_ssl_ciphersuite_has_pfs( const mbedtls_ssl_ciphersuite_t *info )
425{
426 switch( info->key_exchange )
427 {
428 case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
429 case MBEDTLS_KEY_EXCHANGE_DHE_PSK:
430 case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
431 case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK:
432 case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
433 case MBEDTLS_KEY_EXCHANGE_ECJPAKE:
434 return( 1 );
435
436 default:
437 return( 0 );
438 }
439}
440#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PFS_ENABLED */
441
442#if defined(MBEDTLS_KEY_EXCHANGE_SOME_NON_PFS_ENABLED)
443static inline int mbedtls_ssl_ciphersuite_no_pfs( const mbedtls_ssl_ciphersuite_t *info )
444{
445 switch( info->key_exchange )
446 {
447 case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
448 case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
449 case MBEDTLS_KEY_EXCHANGE_RSA:
450 case MBEDTLS_KEY_EXCHANGE_PSK:
451 case MBEDTLS_KEY_EXCHANGE_RSA_PSK:
452 return( 1 );
453
454 default:
455 return( 0 );
456 }
457}
458#endif /* MBEDTLS_KEY_EXCHANGE_SOME_NON_PFS_ENABLED */
459
460#if defined(MBEDTLS_KEY_EXCHANGE_SOME_ECDH_ENABLED)
461static inline int mbedtls_ssl_ciphersuite_uses_ecdh( const mbedtls_ssl_ciphersuite_t *info )
462{
463 switch( info->key_exchange )
464 {
465 case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
466 case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
467 return( 1 );
468
469 default:
470 return( 0 );
471 }
472}
473#endif /* MBEDTLS_KEY_EXCHANGE_SOME_ECDH_ENABLED */
474
475static inline int mbedtls_ssl_ciphersuite_cert_req_allowed( const mbedtls_ssl_ciphersuite_t *info )
476{
477 switch( info->key_exchange )
478 {
479 case MBEDTLS_KEY_EXCHANGE_RSA:
480 case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
481 case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
482 case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
483 case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
484 case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
485 return( 1 );
486
487 default:
488 return( 0 );
489 }
490}
491
492static inline int mbedtls_ssl_ciphersuite_uses_srv_cert( const mbedtls_ssl_ciphersuite_t *info )
493{
494 switch( info->key_exchange )
495 {
496 case MBEDTLS_KEY_EXCHANGE_RSA:
497 case MBEDTLS_KEY_EXCHANGE_RSA_PSK:
498 case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
499 case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
500 case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
501 case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
502 case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
503 return( 1 );
504
505 default:
506 return( 0 );
507 }
508}
509
510#if defined(MBEDTLS_KEY_EXCHANGE_SOME_DHE_ENABLED)
511static inline int mbedtls_ssl_ciphersuite_uses_dhe( const mbedtls_ssl_ciphersuite_t *info )
512{
513 switch( info->key_exchange )
514 {
515 case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
516 case MBEDTLS_KEY_EXCHANGE_DHE_PSK:
517 return( 1 );
518
519 default:
520 return( 0 );
521 }
522}
523#endif /* MBEDTLS_KEY_EXCHANGE_SOME_DHE_ENABLED) */
524
525#if defined(MBEDTLS_KEY_EXCHANGE_SOME_ECDHE_ENABLED)
526static inline int mbedtls_ssl_ciphersuite_uses_ecdhe( const mbedtls_ssl_ciphersuite_t *info )
527{
528 switch( info->key_exchange )
529 {
530 case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
531 case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
532 case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK:
533 return( 1 );
534
535 default:
536 return( 0 );
537 }
538}
539#endif /* MBEDTLS_KEY_EXCHANGE_SOME_ECDHE_ENABLED) */
540
541#if defined(MBEDTLS_KEY_EXCHANGE_WITH_SERVER_SIGNATURE_ENABLED)
542static inline int mbedtls_ssl_ciphersuite_uses_server_signature( const mbedtls_ssl_ciphersuite_t *info )
543{
544 switch( info->key_exchange )
545 {
546 case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
547 case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
548 case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
549 return( 1 );
550
551 default:
552 return( 0 );
553 }
554}
555#endif /* MBEDTLS_KEY_EXCHANGE_WITH_SERVER_SIGNATURE_ENABLED */
556
557#ifdef __cplusplus
558}
559#endif
560
561/// \}
562
563#endif /* ssl_ciphersuites.h */
This file contains an abstraction interface for use with the cipher primitives provided by the librar...
Configuration options (set of defines)
mbedtls_cipher_type_t
Supported {cipher type, cipher mode} pairs.
Definition: cipher.h:109
mbedtls_md_type_t
Supported message digests.
Definition: md.h:64
This file contains the generic message-digest wrapper.
Public Key abstraction layer.
mbedtls_pk_type_t
Public key types.
Definition: pk.h:80
The key size.
This structure is used for storing ciphersuite information.