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

Unified Diff: chrome/browser/ssl/ssl_error_classification.h

Issue 1223233002: Common Name Mismatch Handler For WWW Subdomain Mismatch case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolving comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/ssl/ssl_error_classification.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_error_classification.h
diff --git a/chrome/browser/ssl/ssl_error_classification.h b/chrome/browser/ssl/ssl_error_classification.h
index 89869b9ad6dc0f9804841523e57874b81aec24da..7d377dc6bee303a44e735be0a946465474585d01 100644
--- a/chrome/browser/ssl/ssl_error_classification.h
+++ b/chrome/browser/ssl/ssl_error_classification.h
@@ -50,6 +50,19 @@ class SSLErrorClassification : public content::NotificationObserver {
// 3.|hostname| is a dotless domain.
static bool IsHostnameNonUniqueOrDotless(const std::string& hostname);
+ // Returns true if the site's hostname differs from one of the DNS
+ // names in the certificate (CN or SANs) only by the presence or
+ // absence of the single-label prefix "www". E.g.: (The first domain
+ // is hostname and the second domain is a DNS name in the certificate)
+ //
+ // www.example.com ~ example.com -> true
+ // example.com ~ www.example.com -> true
+ // www.food.example.com ~ example.com -> false
+ // mail.example.com ~ example.com -> false
+ static bool GetWWWSubDomainMatch(const std::string& host_name,
+ const std::vector<std::string>& dns_names,
+ std::string* www_match_host_name);
+
// A function which calculates the severity score when the ssl error is
// |CERT_DATE_INVALID|. The calculated score is between 0.0 and 1.0, higher
// being more severe, indicating how severe the certificate's
@@ -83,14 +96,7 @@ class SSLErrorClassification : public content::NotificationObserver {
// Returns true if the hostname has a known Top Level Domain.
static bool IsHostNameKnownTLD(const std::string& host_name);
- // Returns true if the site's hostname differs from one of the DNS
- // names in the certificate (CN or SANs) only by the presence or
- // absence of the single-label prefix "www". E.g.:
- //
- // www.example.com ~ example.com -> true
- // example.com ~ www.example.com -> true
- // www.food.example.com ~ example.com -> false
- // mail.example.com ~ example.com -> false
+ // Returns true if GetWWWSubDomainMatch finds a www mismatch.
bool IsWWWSubDomainMatch() const;
// Returns true if |child| is a subdomain of any of the |potential_parents|.
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/ssl/ssl_error_classification.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698