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

Unified Diff: net/cert/x509_certificate.cc

Issue 762013002: Disallow support for a*.example.net, *a.example.net, and a*b.example.net in certificate wildcard ha… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | net/cert/x509_certificate_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate.cc
diff --git a/net/cert/x509_certificate.cc b/net/cert/x509_certificate.cc
index 880d487308be1cf7d85f47f7d41efe76739d6320..02e02344a9970bfb8d7543ff022e17dcf8e3255e 100644
--- a/net/cert/x509_certificate.cc
+++ b/net/cert/x509_certificate.cc
@@ -629,27 +629,16 @@ bool X509Certificate::VerifyHostname(
if (presented_domain != reference_domain)
continue;
- base::StringPiece pattern_begin, pattern_end;
- SplitOnChar(presented_host, '*', &pattern_begin, &pattern_end);
-
- if (pattern_end.empty()) { // No '*' in the presented_host
+ if (presented_host != "*") {
if (presented_host == reference_host)
return true;
continue;
}
- pattern_end.remove_prefix(1); // move past the *
if (!allow_wildcards)
continue;
- // * must not match a substring of an IDN A label; just a whole fragment.
- if (reference_host.starts_with("xn--") &&
- !(pattern_begin.empty() && pattern_end.empty()))
- continue;
-
- if (reference_host.starts_with(pattern_begin) &&
- reference_host.ends_with(pattern_end))
- return true;
+ return true;
}
return false;
}
« no previous file with comments | « no previous file | net/cert/x509_certificate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698