FreeBSD: better support for TFO
[exim.git] / src / src / tls-cipher-stdname.c
1 /*************************************************
2 *     Exim - an Internet mail transport agent    *
3 *************************************************/
4
5 /* Copyright (c) Jeremy Harris 2019 */
6 /* See the file NOTICE for conditions of use and distribution. */
7
8 /* Translate an IETF TLS ciphersuite code to an IETF ciphersuite name,
9 for use when the TLS library do not provide such names.
10 This file is #included by the tls-<library>.c file.
11
12 Values for these tables pulled on 2019/02/03 from
13 https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml */
14
15
16
17 static const uschar * ctb_00[] = {
18 [0x00] = US "TLS_NULL_WITH_NULL_NULL",
19 [0x01] = US "TLS_RSA_WITH_NULL_MD5",
20 [0x02] = US "TLS_RSA_WITH_NULL_SHA",
21 [0x03] = US "TLS_RSA_EXPORT_WITH_RC4_40_MD5",
22 [0x04] = US "TLS_RSA_WITH_RC4_128_MD5",
23 [0x05] = US "TLS_RSA_WITH_RC4_128_SHA",
24 [0x06] = US "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5",
25 [0x07] = US "TLS_RSA_WITH_IDEA_CBC_SHA",
26 [0x08] = US "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA",
27 [0x09] = US "TLS_RSA_WITH_DES_CBC_SHA",
28 [0x0A] = US "TLS_RSA_WITH_3DES_EDE_CBC_SHA",
29 [0x0B] = US "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA",
30 [0x0C] = US "TLS_DH_DSS_WITH_DES_CBC_SHA",
31 [0x0D] = US "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA",
32 [0x0E] = US "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA",
33 [0x0F] = US "TLS_DH_RSA_WITH_DES_CBC_SHA",
34 [0x10] = US "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA",
35 [0x11] = US "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
36 [0x12] = US "TLS_DHE_DSS_WITH_DES_CBC_SHA",
37 [0x13] = US "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
38 [0x14] = US "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
39 [0x15] = US "TLS_DHE_RSA_WITH_DES_CBC_SHA",
40 [0x16] = US "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
41 [0x17] = US "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5",
42 [0x18] = US "TLS_DH_anon_WITH_RC4_128_MD5",
43 [0x19] = US "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
44 [0x1A] = US "TLS_DH_anon_WITH_DES_CBC_SHA",
45 [0x1B] = US "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA",
46
47 [0x1E] = US "TLS_KRB5_WITH_DES_CBC_SHA",
48 [0x1F] = US "TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
49 [0x20] = US "TLS_KRB5_WITH_RC4_128_SHA",
50 [0x21] = US "TLS_KRB5_WITH_IDEA_CBC_SHA",
51 [0x22] = US "TLS_KRB5_WITH_DES_CBC_MD5",
52 [0x23] = US "TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
53 [0x24] = US "TLS_KRB5_WITH_RC4_128_MD5",
54 [0x25] = US "TLS_KRB5_WITH_IDEA_CBC_MD5",
55 [0x26] = US "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
56 [0x27] = US "TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA",
57 [0x28] = US "TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
58 [0x29] = US "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
59 [0x2A] = US "TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5",
60 [0x2B] = US "TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
61 [0x2C] = US "TLS_PSK_WITH_NULL_SHA",
62 [0x2D] = US "TLS_DHE_PSK_WITH_NULL_SHA",
63 [0x2E] = US "TLS_RSA_PSK_WITH_NULL_SHA",
64 [0x2F] = US "TLS_RSA_WITH_AES_128_CBC_SHA",
65 [0x30] = US "TLS_DH_DSS_WITH_AES_128_CBC_SHA",
66 [0x31] = US "TLS_DH_RSA_WITH_AES_128_CBC_SHA",
67 [0x32] = US "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
68 [0x33] = US "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
69 [0x34] = US "TLS_DH_anon_WITH_AES_128_CBC_SHA",
70 [0x35] = US "TLS_RSA_WITH_AES_256_CBC_SHA",
71 [0x36] = US "TLS_DH_DSS_WITH_AES_256_CBC_SHA",
72 [0x37] = US "TLS_DH_RSA_WITH_AES_256_CBC_SHA",
73 [0x38] = US "TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
74 [0x39] = US "TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
75 [0x3A] = US "TLS_DH_anon_WITH_AES_256_CBC_SHA",
76 [0x3B] = US "TLS_RSA_WITH_NULL_SHA256",
77 [0x3C] = US "TLS_RSA_WITH_AES_128_CBC_SHA256",
78 [0x3D] = US "TLS_RSA_WITH_AES_256_CBC_SHA256",
79 [0x3E] = US "TLS_DH_DSS_WITH_AES_128_CBC_SHA256",
80 [0x3F] = US "TLS_DH_RSA_WITH_AES_128_CBC_SHA256",
81 [0x40] = US "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
82 [0x41] = US "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA",
83 [0x42] = US "TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA",
84 [0x43] = US "TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA",
85 [0x44] = US "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA",
86 [0x45] = US "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA",
87 [0x46] = US "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA",
88
89 [0x67] = US "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
90 [0x68] = US "TLS_DH_DSS_WITH_AES_256_CBC_SHA256",
91 [0x69] = US "TLS_DH_RSA_WITH_AES_256_CBC_SHA256",
92 [0x6A] = US "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
93 [0x6B] = US "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
94 [0x6C] = US "TLS_DH_anon_WITH_AES_128_CBC_SHA256",
95 [0x6D] = US "TLS_DH_anon_WITH_AES_256_CBC_SHA256",
96
97 [0x84] = US "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA",
98 [0x85] = US "TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA",
99 [0x86] = US "TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA",
100 [0x87] = US "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA",
101 [0x88] = US "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA",
102 [0x89] = US "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA",
103 [0x8A] = US "TLS_PSK_WITH_RC4_128_SHA",
104 [0x8B] = US "TLS_PSK_WITH_3DES_EDE_CBC_SHA",
105 [0x8C] = US "TLS_PSK_WITH_AES_128_CBC_SHA",
106 [0x8D] = US "TLS_PSK_WITH_AES_256_CBC_SHA",
107 [0x8E] = US "TLS_DHE_PSK_WITH_RC4_128_SHA",
108 [0x8F] = US "TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA",
109 [0x90] = US "TLS_DHE_PSK_WITH_AES_128_CBC_SHA",
110 [0x91] = US "TLS_DHE_PSK_WITH_AES_256_CBC_SHA",
111 [0x92] = US "TLS_RSA_PSK_WITH_RC4_128_SHA",
112 [0x93] = US "TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA",
113 [0x94] = US "TLS_RSA_PSK_WITH_AES_128_CBC_SHA",
114 [0x95] = US "TLS_RSA_PSK_WITH_AES_256_CBC_SHA",
115 [0x96] = US "TLS_RSA_WITH_SEED_CBC_SHA",
116 [0x97] = US "TLS_DH_DSS_WITH_SEED_CBC_SHA",
117 [0x98] = US "TLS_DH_RSA_WITH_SEED_CBC_SHA",
118 [0x99] = US "TLS_DHE_DSS_WITH_SEED_CBC_SHA",
119 [0x9A] = US "TLS_DHE_RSA_WITH_SEED_CBC_SHA",
120 [0x9B] = US "TLS_DH_anon_WITH_SEED_CBC_SHA",
121 [0x9C] = US "TLS_RSA_WITH_AES_128_GCM_SHA256",
122 [0x9D] = US "TLS_RSA_WITH_AES_256_GCM_SHA384",
123 [0x9E] = US "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
124 [0x9F] = US "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384",
125 [0xA0] = US "TLS_DH_RSA_WITH_AES_128_GCM_SHA256",
126 [0xA1] = US "TLS_DH_RSA_WITH_AES_256_GCM_SHA384",
127 [0xA2] = US "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",
128 [0xA3] = US "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384",
129 [0xA4] = US "TLS_DH_DSS_WITH_AES_128_GCM_SHA256",
130 [0xA5] = US "TLS_DH_DSS_WITH_AES_256_GCM_SHA384",
131 [0xA6] = US "TLS_DH_anon_WITH_AES_128_GCM_SHA256",
132 [0xA7] = US "TLS_DH_anon_WITH_AES_256_GCM_SHA384",
133 [0xA8] = US "TLS_PSK_WITH_AES_128_GCM_SHA256",
134 [0xA9] = US "TLS_PSK_WITH_AES_256_GCM_SHA384",
135 [0xAA] = US "TLS_DHE_PSK_WITH_AES_128_GCM_SHA256",
136 [0xAB] = US "TLS_DHE_PSK_WITH_AES_256_GCM_SHA384",
137 [0xAC] = US "TLS_RSA_PSK_WITH_AES_128_GCM_SHA256",
138 [0xAD] = US "TLS_RSA_PSK_WITH_AES_256_GCM_SHA384",
139 [0xAE] = US "TLS_PSK_WITH_AES_128_CBC_SHA256",
140 [0xAF] = US "TLS_PSK_WITH_AES_256_CBC_SHA384",
141 [0xB0] = US "TLS_PSK_WITH_NULL_SHA256",
142 [0xB1] = US "TLS_PSK_WITH_NULL_SHA384",
143 [0xB2] = US "TLS_DHE_PSK_WITH_AES_128_CBC_SHA256",
144 [0xB3] = US "TLS_DHE_PSK_WITH_AES_256_CBC_SHA384",
145 [0xB4] = US "TLS_DHE_PSK_WITH_NULL_SHA256",
146 [0xB5] = US "TLS_DHE_PSK_WITH_NULL_SHA384",
147 [0xB6] = US "TLS_RSA_PSK_WITH_AES_128_CBC_SHA256",
148 [0xB7] = US "TLS_RSA_PSK_WITH_AES_256_CBC_SHA384",
149 [0xB8] = US "TLS_RSA_PSK_WITH_NULL_SHA256",
150 [0xB9] = US "TLS_RSA_PSK_WITH_NULL_SHA384",
151 [0xBA] = US "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256",
152 [0xBB] = US "TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256",
153 [0xBC] = US "TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256",
154 [0xBD] = US "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256",
155 [0xBE] = US "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256",
156 [0xBF] = US "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256",
157 [0xC0] = US "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256",
158 [0xC1] = US "TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256",
159 [0xC2] = US "TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256",
160 [0xC3] = US "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256",
161 [0xC4] = US "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256",
162 [0xC5] = US "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256",
163 };
164 static const uschar * ctb_13[] = {
165 [0x01] = US "TLS_AES_128_GCM_SHA256",
166 [0x02] = US "TLS_AES_256_GCM_SHA384",
167 [0x03] = US "TLS_CHACHA20_POLY1305_SHA256",
168 [0x04] = US "TLS_AES_128_CCM_SHA256",
169 [0x05] = US "TLS_AES_128_CCM_8_SHA256",
170 };
171 static const uschar * ctb_c0[] = {
172 [0x01] = US "TLS_ECDH_ECDSA_WITH_NULL_SHA",
173 [0x02] = US "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
174 [0x03] = US "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
175 [0x04] = US "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
176 [0x05] = US "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
177 [0x06] = US "TLS_ECDHE_ECDSA_WITH_NULL_SHA",
178 [0x07] = US "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
179 [0x08] = US "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
180 [0x09] = US "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
181 [0x0A] = US "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
182 [0x0B] = US "TLS_ECDH_RSA_WITH_NULL_SHA",
183 [0x0C] = US "TLS_ECDH_RSA_WITH_RC4_128_SHA",
184 [0x0D] = US "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
185 [0x0E] = US "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
186 [0x0F] = US "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
187 [0x10] = US "TLS_ECDHE_RSA_WITH_NULL_SHA",
188 [0x11] = US "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
189 [0x12] = US "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
190 [0x13] = US "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
191 [0x14] = US "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
192 [0x15] = US "TLS_ECDH_anon_WITH_NULL_SHA",
193 [0x16] = US "TLS_ECDH_anon_WITH_RC4_128_SHA",
194 [0x17] = US "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
195 [0x18] = US "TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
196 [0x19] = US "TLS_ECDH_anon_WITH_AES_256_CBC_SHA",
197 [0x1A] = US "TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA",
198 [0x1B] = US "TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA",
199 [0x1C] = US "TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA",
200 [0x1D] = US "TLS_SRP_SHA_WITH_AES_128_CBC_SHA",
201 [0x1E] = US "TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA",
202 [0x1F] = US "TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA",
203 [0x20] = US "TLS_SRP_SHA_WITH_AES_256_CBC_SHA",
204 [0x21] = US "TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA",
205 [0x22] = US "TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA",
206 [0x23] = US "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
207 [0x24] = US "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
208 [0x25] = US "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
209 [0x26] = US "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
210 [0x27] = US "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
211 [0x28] = US "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
212 [0x29] = US "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
213 [0x2A] = US "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
214 [0x2B] = US "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
215 [0x2C] = US "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
216 [0x2D] = US "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
217 [0x2E] = US "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",
218 [0x2F] = US "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
219 [0x30] = US "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
220 [0x31] = US "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
221 [0x32] = US "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",
222 [0x33] = US "TLS_ECDHE_PSK_WITH_RC4_128_SHA",
223 [0x34] = US "TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA",
224 [0x35] = US "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA",
225 [0x36] = US "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA",
226 [0x37] = US "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256",
227 [0x38] = US "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384",
228 [0x39] = US "TLS_ECDHE_PSK_WITH_NULL_SHA",
229 [0x3A] = US "TLS_ECDHE_PSK_WITH_NULL_SHA256",
230 [0x3B] = US "TLS_ECDHE_PSK_WITH_NULL_SHA384",
231 [0x3C] = US "TLS_RSA_WITH_ARIA_128_CBC_SHA256",
232 [0x3D] = US "TLS_RSA_WITH_ARIA_256_CBC_SHA384",
233 [0x3E] = US "TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256",
234 [0x3F] = US "TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384",
235 [0x40] = US "TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256",
236 [0x41] = US "TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384",
237 [0x42] = US "TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256",
238 [0x43] = US "TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384",
239 [0x44] = US "TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256",
240 [0x45] = US "TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384",
241 [0x46] = US "TLS_DH_anon_WITH_ARIA_128_CBC_SHA256",
242 [0x47] = US "TLS_DH_anon_WITH_ARIA_256_CBC_SHA384",
243 [0x48] = US "TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256",
244 [0x49] = US "TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384",
245 [0x4A] = US "TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256",
246 [0x4B] = US "TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384",
247 [0x4C] = US "TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256",
248 [0x4D] = US "TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384",
249 [0x4E] = US "TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256",
250 [0x4F] = US "TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384",
251 [0x50] = US "TLS_RSA_WITH_ARIA_128_GCM_SHA256",
252 [0x51] = US "TLS_RSA_WITH_ARIA_256_GCM_SHA384",
253 [0x52] = US "TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256",
254 [0x53] = US "TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384",
255 [0x54] = US "TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256",
256 [0x55] = US "TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384",
257 [0x56] = US "TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256",
258 [0x57] = US "TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384",
259 [0x58] = US "TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256",
260 [0x59] = US "TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384",
261 [0x5A] = US "TLS_DH_anon_WITH_ARIA_128_GCM_SHA256",
262 [0x5B] = US "TLS_DH_anon_WITH_ARIA_256_GCM_SHA384",
263 [0x5C] = US "TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256",
264 [0x5D] = US "TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384",
265 [0x5E] = US "TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256",
266 [0x5F] = US "TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384",
267 [0x60] = US "TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256",
268 [0x61] = US "TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384",
269 [0x62] = US "TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256",
270 [0x63] = US "TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384",
271 [0x64] = US "TLS_PSK_WITH_ARIA_128_CBC_SHA256",
272 [0x65] = US "TLS_PSK_WITH_ARIA_256_CBC_SHA384",
273 [0x66] = US "TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256",
274 [0x67] = US "TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384",
275 [0x68] = US "TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256",
276 [0x69] = US "TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384",
277 [0x6A] = US "TLS_PSK_WITH_ARIA_128_GCM_SHA256",
278 [0x6B] = US "TLS_PSK_WITH_ARIA_256_GCM_SHA384",
279 [0x6C] = US "TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256",
280 [0x6D] = US "TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384",
281 [0x6E] = US "TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256",
282 [0x6F] = US "TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384",
283 [0x70] = US "TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256",
284 [0x71] = US "TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384",
285 [0x72] = US "TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256",
286 [0x73] = US "TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384",
287 [0x74] = US "TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256",
288 [0x75] = US "TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384",
289 [0x76] = US "TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256",
290 [0x77] = US "TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384",
291 [0x78] = US "TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256",
292 [0x79] = US "TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384",
293 [0x7A] = US "TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256",
294 [0x7B] = US "TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384",
295 [0x7C] = US "TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256",
296 [0x7D] = US "TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384",
297 [0x7E] = US "TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256",
298 [0x7F] = US "TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384",
299 [0x80] = US "TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256",
300 [0x81] = US "TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384",
301 [0x82] = US "TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256",
302 [0x83] = US "TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384",
303 [0x84] = US "TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256",
304 [0x85] = US "TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384",
305 [0x86] = US "TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256",
306 [0x87] = US "TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384",
307 [0x88] = US "TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256",
308 [0x89] = US "TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384",
309 [0x8A] = US "TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256",
310 [0x8B] = US "TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384",
311 [0x8C] = US "TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256",
312 [0x8D] = US "TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384",
313 [0x8E] = US "TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256",
314 [0x8F] = US "TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384",
315 [0x90] = US "TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256",
316 [0x91] = US "TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384",
317 [0x92] = US "TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256",
318 [0x93] = US "TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384",
319 [0x94] = US "TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256",
320 [0x95] = US "TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384",
321 [0x96] = US "TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256",
322 [0x97] = US "TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384",
323 [0x98] = US "TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256",
324 [0x99] = US "TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384",
325 [0x9A] = US "TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256",
326 [0x9B] = US "TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384",
327 [0x9C] = US "TLS_RSA_WITH_AES_128_CCM",
328 [0x9D] = US "TLS_RSA_WITH_AES_256_CCM",
329 [0x9E] = US "TLS_DHE_RSA_WITH_AES_128_CCM",
330 [0x9F] = US "TLS_DHE_RSA_WITH_AES_256_CCM",
331 [0xA0] = US "TLS_RSA_WITH_AES_128_CCM_8",
332 [0xA1] = US "TLS_RSA_WITH_AES_256_CCM_8",
333 [0xA2] = US "TLS_DHE_RSA_WITH_AES_128_CCM_8",
334 [0xA3] = US "TLS_DHE_RSA_WITH_AES_256_CCM_8",
335 [0xA4] = US "TLS_PSK_WITH_AES_128_CCM",
336 [0xA5] = US "TLS_PSK_WITH_AES_256_CCM",
337 [0xA6] = US "TLS_DHE_PSK_WITH_AES_128_CCM",
338 [0xA7] = US "TLS_DHE_PSK_WITH_AES_256_CCM",
339 [0xA8] = US "TLS_PSK_WITH_AES_128_CCM_8",
340 [0xA9] = US "TLS_PSK_WITH_AES_256_CCM_8",
341 [0xAA] = US "TLS_PSK_DHE_WITH_AES_128_CCM_8",
342 [0xAB] = US "TLS_PSK_DHE_WITH_AES_256_CCM_8",
343 [0xAC] = US "TLS_ECDHE_ECDSA_WITH_AES_128_CCM",
344 [0xAD] = US "TLS_ECDHE_ECDSA_WITH_AES_256_CCM",
345 [0xAE] = US "TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8",
346 [0xAF] = US "TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8",
347 [0xB0] = US "TLS_ECCPWD_WITH_AES_128_GCM_SHA256",
348 [0xB1] = US "TLS_ECCPWD_WITH_AES_256_GCM_SHA384",
349 [0xB2] = US "TLS_ECCPWD_WITH_AES_128_CCM_SHA256",
350 [0xB3] = US "TLS_ECCPWD_WITH_AES_256_CCM_SHA384",
351 [0xB4] = US "TLS_SHA256_SHA256",
352 [0xB5] = US "TLS_SHA384_SHA384",
353 };
354 static const uschar * ctb_cc[] = {
355 [0xA8] = US "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
356 [0xA9] = US "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256",
357 [0xAA] = US "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
358 [0xAB] = US "TLS_PSK_WITH_CHACHA20_POLY1305_SHA256",
359 [0xAC] = US "TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256",
360 [0xAD] = US "TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256",
361 [0xAE] = US "TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256",
362 };
363 static const uschar * ctb_d0[] = {
364 [0x01] = US "TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256",
365 [0x02] = US "TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384",
366 [0x03] = US "TLS_ECDHE_PSK_WITH_AES_128_CCM_8_SHA256",
367
368 [0x05] = US "TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256",
369 };
370
371 static const uschar *
372 cipher_stdname_tb(uschar idx, const uschar ** tb, int lim)
373 {
374 return idx >= lim ? NULL : tb[idx];
375 }
376
377 static const uschar *
378 cipher_stdname(uschar id0, uschar id1)
379 {
380 switch (id0)
381   {
382   case 0x00:    return cipher_stdname_tb(id1, ctb_00, nelem(ctb_00));
383   case 0x13:    return cipher_stdname_tb(id1, ctb_13, nelem(ctb_00));
384   case 0xc0:    return cipher_stdname_tb(id1, ctb_c0, nelem(ctb_c0));
385   case 0xcc:    return cipher_stdname_tb(id1, ctb_cc, nelem(ctb_cc));
386   case 0xd0:    return cipher_stdname_tb(id1, ctb_d0, nelem(ctb_d0));
387   default:      return NULL;
388   }
389 }
390
391 /* vi: aw ai sw=2
392 */
393 /* End of tls-cipher-stdname.c */