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

Side by Side Diff: net/cert/cert_verify_proc.cc

Issue 255333003: Renamed namespaces in src/net. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tue 04/29/2014 19:22:06.75 Created 6 years, 7 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/base/url_util.cc ('k') | net/cert/x509_certificate.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/cert/cert_verify_proc.h" 5 #include "net/cert/cert_verify_proc.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/sha1.h" 8 #include "base/sha1.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 static const size_t kMaxTLDLength = 4; 424 static const size_t kMaxTLDLength = 4;
425 425
426 // CheckNameConstraints verifies that every name in |dns_names| is in one of 426 // CheckNameConstraints verifies that every name in |dns_names| is in one of
427 // the domains specified by |tlds|. The |tlds| array is terminated by an empty 427 // the domains specified by |tlds|. The |tlds| array is terminated by an empty
428 // string. 428 // string.
429 static bool CheckNameConstraints(const std::vector<std::string>& dns_names, 429 static bool CheckNameConstraints(const std::vector<std::string>& dns_names,
430 const char tlds[][kMaxTLDLength]) { 430 const char tlds[][kMaxTLDLength]) {
431 for (std::vector<std::string>::const_iterator i = dns_names.begin(); 431 for (std::vector<std::string>::const_iterator i = dns_names.begin();
432 i != dns_names.end(); ++i) { 432 i != dns_names.end(); ++i) {
433 bool ok = false; 433 bool ok = false;
434 url_canon::CanonHostInfo host_info; 434 url::CanonHostInfo host_info;
435 const std::string dns_name = CanonicalizeHost(*i, &host_info); 435 const std::string dns_name = CanonicalizeHost(*i, &host_info);
436 if (host_info.IsIPAddress()) 436 if (host_info.IsIPAddress())
437 continue; 437 continue;
438 438
439 const size_t registry_len = registry_controlled_domains::GetRegistryLength( 439 const size_t registry_len = registry_controlled_domains::GetRegistryLength(
440 dns_name, 440 dns_name,
441 registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, 441 registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
442 registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); 442 registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
443 // If the name is not in a known TLD, ignore it. This permits internal 443 // If the name is not in a known TLD, ignore it. This permits internal
444 // names. 444 // names.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 return true; 535 return true;
536 } 536 }
537 } 537 }
538 } 538 }
539 } 539 }
540 540
541 return false; 541 return false;
542 } 542 }
543 543
544 } // namespace net 544 } // namespace net
OLDNEW
« no previous file with comments | « net/base/url_util.cc ('k') | net/cert/x509_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698