| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ |
| 6 #define CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ | 6 #define CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // a.b.example.com ~ *.example.com --> true | 110 // a.b.example.com ~ *.example.com --> true |
| 111 // b.example.com ~ *.example.com --> false | 111 // b.example.com ~ *.example.com --> false |
| 112 bool IsSubDomainOutsideWildcard(const Tokens& hostname) const; | 112 bool IsSubDomainOutsideWildcard(const Tokens& hostname) const; |
| 113 | 113 |
| 114 // Returns true if the certificate is a shared certificate. Note - This | 114 // Returns true if the certificate is a shared certificate. Note - This |
| 115 // function should be used with caution (only for UMA histogram) as an | 115 // function should be used with caution (only for UMA histogram) as an |
| 116 // attacker could easily get a certificate with more than 5 names in the SAN | 116 // attacker could easily get a certificate with more than 5 names in the SAN |
| 117 // fields. | 117 // fields. |
| 118 bool IsCertLikelyFromMultiTenantHosting() const; | 118 bool IsCertLikelyFromMultiTenantHosting() const; |
| 119 | 119 |
| 120 // Returns true if the hostname in |request_url_| has the same domain |
| 121 // (effective TLD + 1 label) as at least one of the subject |
| 122 // alternative names in |cert_|. |
| 123 bool IsCertLikelyFromSameDomain() const; |
| 124 |
| 120 static std::vector<Tokens> GetTokenizedDNSNames( | 125 static std::vector<Tokens> GetTokenizedDNSNames( |
| 121 const std::vector<std::string>& dns_names); | 126 const std::vector<std::string>& dns_names); |
| 122 | 127 |
| 123 // If |potential_subdomain| is a subdomain of |parent|, returns the | 128 // If |potential_subdomain| is a subdomain of |parent|, returns the |
| 124 // number of DNS labels by which |potential_subdomain| is under | 129 // number of DNS labels by which |potential_subdomain| is under |
| 125 // |parent|. Otherwise, returns 0. | 130 // |parent|. Otherwise, returns 0. |
| 126 // | 131 // |
| 127 // For example, | 132 // For example, |
| 128 // | 133 // |
| 129 // FindSubDomainDifference(Tokenize("a.b.example.com"), | 134 // FindSubDomainDifference(Tokenize("a.b.example.com"), |
| (...skipping 25 matching lines...) Expand all Loading... |
| 155 bool captive_portal_probe_completed_; | 160 bool captive_portal_probe_completed_; |
| 156 // Did the captive portal probe receive an error or get a non-HTTP response? | 161 // Did the captive portal probe receive an error or get a non-HTTP response? |
| 157 bool captive_portal_no_response_; | 162 bool captive_portal_no_response_; |
| 158 // Was a captive portal detected? | 163 // Was a captive portal detected? |
| 159 bool captive_portal_detected_; | 164 bool captive_portal_detected_; |
| 160 | 165 |
| 161 content::NotificationRegistrar registrar_; | 166 content::NotificationRegistrar registrar_; |
| 162 }; | 167 }; |
| 163 | 168 |
| 164 #endif // CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ | 169 #endif // CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ |
| OLD | NEW |