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

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

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/sdch_manager.cc ('k') | net/cookies/cookie_constants.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/x509_certificate.h" 5 #include "net/cert/x509_certificate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 presented_names = &common_name_as_vector; 603 presented_names = &common_name_as_vector;
604 } 604 }
605 for (std::vector<std::string>::const_iterator it = 605 for (std::vector<std::string>::const_iterator it =
606 presented_names->begin(); 606 presented_names->begin();
607 it != presented_names->end(); ++it) { 607 it != presented_names->end(); ++it) {
608 // Catch badly corrupt cert names up front. 608 // Catch badly corrupt cert names up front.
609 if (it->empty() || it->find('\0') != std::string::npos) { 609 if (it->empty() || it->find('\0') != std::string::npos) {
610 DVLOG(1) << "Bad name in cert: " << *it; 610 DVLOG(1) << "Bad name in cert: " << *it;
611 continue; 611 continue;
612 } 612 }
613 std::string presented_name(StringToLowerASCII(*it)); 613 std::string presented_name(base::StringToLowerASCII(*it));
614 614
615 // Remove trailing dot, if any. 615 // Remove trailing dot, if any.
616 if (*presented_name.rbegin() == '.') 616 if (*presented_name.rbegin() == '.')
617 presented_name.resize(presented_name.length() - 1); 617 presented_name.resize(presented_name.length() - 1);
618 618
619 // The hostname must be at least as long as the cert name it is matching, 619 // The hostname must be at least as long as the cert name it is matching,
620 // as we require the wildcard (if present) to match at least one character. 620 // as we require the wildcard (if present) to match at least one character.
621 if (presented_name.length() > reference_name.length()) 621 if (presented_name.length() > reference_name.length())
622 continue; 622 continue;
623 623
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 RemoveFromCache(cert_handle_); 760 RemoveFromCache(cert_handle_);
761 FreeOSCertHandle(cert_handle_); 761 FreeOSCertHandle(cert_handle_);
762 } 762 }
763 for (size_t i = 0; i < intermediate_ca_certs_.size(); ++i) { 763 for (size_t i = 0; i < intermediate_ca_certs_.size(); ++i) {
764 RemoveFromCache(intermediate_ca_certs_[i]); 764 RemoveFromCache(intermediate_ca_certs_[i]);
765 FreeOSCertHandle(intermediate_ca_certs_[i]); 765 FreeOSCertHandle(intermediate_ca_certs_[i]);
766 } 766 }
767 } 767 }
768 768
769 } // namespace net 769 } // namespace net
OLDNEW
« no previous file with comments | « net/base/sdch_manager.cc ('k') | net/cookies/cookie_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698