Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: net/ssl/ssl_cipher_suite_names.cc

Issue 12680003: net: split net/ssl out of net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/ssl/ssl_cipher_suite_names.h ('k') | net/ssl/ssl_cipher_suite_names_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/ssl/ssl_cipher_suite_names.h ('k') | net/ssl/ssl_cipher_suite_names_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698