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/base/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/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "net/base/ssl_connection_status_flags.h" | 12 #include "net/ssl/ssl_connection_status_flags.h" |
13 | 13 |
14 // Rather than storing the names of all the ciphersuites we eliminate the | 14 // Rather than storing the names of all the ciphersuites we eliminate the |
15 // redundancy and break each cipher suite into a key exchange method, cipher | 15 // redundancy and break each cipher suite into a key exchange method, cipher |
16 // and mac. For all the ciphersuites in the IANA registry, we extract each of | 16 // and mac. For all the ciphersuites in the IANA registry, we extract each of |
17 // those components from the name, number them and pack the result into a | 17 // those components from the name, number them and pack the result into a |
18 // 16-bit number thus: | 18 // 16-bit number thus: |
19 // (MSB to LSB) | 19 // (MSB to LSB) |
20 // <4 bits> unused | 20 // <4 bits> unused |
21 // <5 bits> key exchange | 21 // <5 bits> key exchange |
22 // <4 bits> cipher | 22 // <4 bits> cipher |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 if (cipher_string.size() == 6 && | 368 if (cipher_string.size() == 6 && |
369 StartsWithASCII(cipher_string, "0x", false /* case insensitive */) && | 369 StartsWithASCII(cipher_string, "0x", false /* case insensitive */) && |
370 base::HexStringToInt(cipher_string, &value)) { | 370 base::HexStringToInt(cipher_string, &value)) { |
371 *cipher_suite = static_cast<uint16>(value); | 371 *cipher_suite = static_cast<uint16>(value); |
372 return true; | 372 return true; |
373 } | 373 } |
374 return false; | 374 return false; |
375 } | 375 } |
376 | 376 |
377 } // namespace net | 377 } // namespace net |
OLD | NEW |