| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/x509_openssl_util.h" | 5 #include "net/base/x509_openssl_util.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/string_piece.h" | 9 #include "base/string_piece.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 reference_name.push_back(c); | 148 reference_name.push_back(c); |
| 149 } | 149 } |
| 150 DCHECK(!reference_name.empty()); | 150 DCHECK(!reference_name.empty()); |
| 151 | 151 |
| 152 if (found_ip6_chars || !found_alpha) { | 152 if (found_ip6_chars || !found_alpha) { |
| 153 // For now we just do simple localhost IP address support, primarily as | 153 // For now we just do simple localhost IP address support, primarily as |
| 154 // it's needed by the test server. TODO(joth): Replace this with full IP | 154 // it's needed by the test server. TODO(joth): Replace this with full IP |
| 155 // address support. See http://crbug.com/62973 | 155 // address support. See http://crbug.com/62973 |
| 156 if (hostname == "127.0.0.1" && | 156 if (hostname == "127.0.0.1" && |
| 157 std::find(cert_names.begin(), cert_names.end(), hostname) | 157 std::find(cert_names.begin(), cert_names.end(), hostname) != |
| 158 != cert_names.end()) { | 158 cert_names.end()) { |
| 159 DVLOG(1) << "Allowing localhost IP certificate: " << hostname; | 159 DVLOG(1) << "Allowing localhost IP certificate: " << hostname; |
| 160 return true; | 160 return true; |
| 161 } | 161 } |
| 162 NOTIMPLEMENTED() << hostname; // See comment above. | 162 NOTIMPLEMENTED() << hostname; // See comment above. |
| 163 return false; | 163 return false; |
| 164 } | 164 } |
| 165 | 165 |
| 166 // |wildcard_domain| is the remainder of |host| after the leading host | 166 // |wildcard_domain| is the remainder of |host| after the leading host |
| 167 // component is stripped off, but includes the leading dot e.g. | 167 // component is stripped off, but includes the leading dot e.g. |
| 168 // "www.f.com" -> ".f.com". | 168 // "www.f.com" -> ".f.com". |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 221 } |
| 222 DVLOG(1) << "Could not find any match for " << hostname | 222 DVLOG(1) << "Could not find any match for " << hostname |
| 223 << " (canonicalized as " << reference_name | 223 << " (canonicalized as " << reference_name |
| 224 << ") in cert names " << JoinString(cert_names, '|'); | 224 << ") in cert names " << JoinString(cert_names, '|'); |
| 225 return false; | 225 return false; |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace x509_openssl_util | 228 } // namespace x509_openssl_util |
| 229 | 229 |
| 230 } // namespace net | 230 } // namespace net |
| OLD | NEW |