OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/ssl/ssl_cipher_suite_names.h" | 5 #include "net/ssl/ssl_cipher_suite_names.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 {0xc084, 0xc7f}, // TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256 | 187 {0xc084, 0xc7f}, // TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256 |
188 {0xc085, 0xc87}, // TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384 | 188 {0xc085, 0xc87}, // TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384 |
189 {0xc086, 0xe7f}, // TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 | 189 {0xc086, 0xe7f}, // TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 |
190 {0xc087, 0xe87}, // TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 | 190 {0xc087, 0xe87}, // TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 |
191 {0xc088, 0xd7f}, // TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 | 191 {0xc088, 0xd7f}, // TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 |
192 {0xc089, 0xd87}, // TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 | 192 {0xc089, 0xd87}, // TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 |
193 {0xc08a, 0x107f}, // TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 | 193 {0xc08a, 0x107f}, // TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 |
194 {0xc08b, 0x1087}, // TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 | 194 {0xc08b, 0x1087}, // TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 |
195 {0xc08c, 0xf7f}, // TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 | 195 {0xc08c, 0xf7f}, // TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 |
196 {0xc08d, 0xf87}, // TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 | 196 {0xc08d, 0xf87}, // TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 |
| 197 {0xcc13, 0x108f}, // TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 |
| 198 {0xcc14, 0x0d8f}, // TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 |
197 }; | 199 }; |
198 | 200 |
199 static const struct { | 201 static const struct { |
200 char name[15]; | 202 char name[15]; |
201 } kKeyExchangeNames[18] = { | 203 } kKeyExchangeNames[18] = { |
202 {"NULL"}, // 0 | 204 {"NULL"}, // 0 |
203 {"RSA"}, // 1 | 205 {"RSA"}, // 1 |
204 {"RSA_EXPORT"}, // 2 | 206 {"RSA_EXPORT"}, // 2 |
205 {"DH_DSS_EXPORT"}, // 3 | 207 {"DH_DSS_EXPORT"}, // 3 |
206 {"DH_DSS"}, // 4 | 208 {"DH_DSS"}, // 4 |
207 {"DH_RSA_EXPORT"}, // 5 | 209 {"DH_RSA_EXPORT"}, // 5 |
208 {"DH_RSA"}, // 6 | 210 {"DH_RSA"}, // 6 |
209 {"DHE_DSS_EXPORT"}, // 7 | 211 {"DHE_DSS_EXPORT"}, // 7 |
210 {"DHE_DSS"}, // 8 | 212 {"DHE_DSS"}, // 8 |
211 {"DHE_RSA_EXPORT"}, // 9 | 213 {"DHE_RSA_EXPORT"}, // 9 |
212 {"DHE_RSA"}, // 10 | 214 {"DHE_RSA"}, // 10 |
213 {"DH_anon_EXPORT"}, // 11 | 215 {"DH_anon_EXPORT"}, // 11 |
214 {"DH_anon"}, // 12 | 216 {"DH_anon"}, // 12 |
215 {"ECDH_ECDSA"}, // 13 | 217 {"ECDH_ECDSA"}, // 13 |
216 {"ECDHE_ECDSA"}, // 14 | 218 {"ECDHE_ECDSA"}, // 14 |
217 {"ECDH_RSA"}, // 15 | 219 {"ECDH_RSA"}, // 15 |
218 {"ECDHE_RSA"}, // 16 | 220 {"ECDHE_RSA"}, // 16 |
219 {"ECDH_anon"}, // 17 | 221 {"ECDH_anon"}, // 17 |
220 }; | 222 }; |
221 | 223 |
222 static const struct { | 224 static const struct { |
223 char name[17]; | 225 char name[18]; |
224 } kCipherNames[17] = { | 226 } kCipherNames[18] = { |
225 {"NULL"}, // 0 | 227 {"NULL"}, // 0 |
226 {"RC4_40"}, // 1 | 228 {"RC4_40"}, // 1 |
227 {"RC4_128"}, // 2 | 229 {"RC4_128"}, // 2 |
228 {"RC2_CBC_40"}, // 3 | 230 {"RC2_CBC_40"}, // 3 |
229 {"IDEA_CBC"}, // 4 | 231 {"IDEA_CBC"}, // 4 |
230 {"DES40_CBC"}, // 5 | 232 {"DES40_CBC"}, // 5 |
231 {"DES_CBC"}, // 6 | 233 {"DES_CBC"}, // 6 |
232 {"3DES_EDE_CBC"}, // 7 | 234 {"3DES_EDE_CBC"}, // 7 |
233 {"AES_128_CBC"}, // 8 | 235 {"AES_128_CBC"}, // 8 |
234 {"AES_256_CBC"}, // 9 | 236 {"AES_256_CBC"}, // 9 |
235 {"CAMELLIA_128_CBC"}, // 10 | 237 {"CAMELLIA_128_CBC"}, // 10 |
236 {"CAMELLIA_256_CBC"}, // 11 | 238 {"CAMELLIA_256_CBC"}, // 11 |
237 {"SEED_CBC"}, // 12 | 239 {"SEED_CBC"}, // 12 |
238 {"AES_128_GCM"}, // 13 | 240 {"AES_128_GCM"}, // 13 |
239 {"AES_256_GCM"}, // 14 | 241 {"AES_256_GCM"}, // 14 |
240 {"CAMELLIA_128_GCM"}, // 15 | 242 {"CAMELLIA_128_GCM"}, // 15 |
241 {"CAMELLIA_256_GCM"}, // 16 | 243 {"CAMELLIA_256_GCM"}, // 16 |
| 244 {"CHACHA20_POLY1305"}, // 17 |
242 }; | 245 }; |
243 | 246 |
244 static const struct { | 247 static const struct { |
245 char name[7]; | 248 char name[7]; |
246 } kMacNames[5] = { | 249 } kMacNames[5] = { |
247 {"NULL"}, // 0 | 250 {"NULL"}, // 0 |
248 {"MD5"}, // 1 | 251 {"MD5"}, // 1 |
249 {"SHA1"}, // 2 | 252 {"SHA1"}, // 2 |
250 {"SHA256"}, // 3 | 253 {"SHA256"}, // 3 |
251 {"SHA384"}, // 4 | 254 {"SHA384"}, // 4 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 if (cipher_string.size() == 6 && | 336 if (cipher_string.size() == 6 && |
334 StartsWithASCII(cipher_string, "0x", false /* case insensitive */) && | 337 StartsWithASCII(cipher_string, "0x", false /* case insensitive */) && |
335 base::HexStringToInt(cipher_string, &value)) { | 338 base::HexStringToInt(cipher_string, &value)) { |
336 *cipher_suite = static_cast<uint16>(value); | 339 *cipher_suite = static_cast<uint16>(value); |
337 return true; | 340 return true; |
338 } | 341 } |
339 return false; | 342 return false; |
340 } | 343 } |
341 | 344 |
342 } // namespace net | 345 } // namespace net |
OLD | NEW |