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

Unified Diff: components/password_manager/core/browser/psl_matching_helper.cc

Issue 2664763002: Only apply federated matches on HTTPS (Closed)
Patch Set: Fix Subdomain. Created 3 years, 11 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
Index: components/password_manager/core/browser/psl_matching_helper.cc
diff --git a/components/password_manager/core/browser/psl_matching_helper.cc b/components/password_manager/core/browser/psl_matching_helper.cc
index 02bccbe4b97a11dd755ef61f5326d64b2c5e8cff..5ae887d4c549e0db3d6fe9dda92c8fd5a7963063 100644
--- a/components/password_manager/core/browser/psl_matching_helper.cc
+++ b/components/password_manager/core/browser/psl_matching_helper.cc
@@ -99,6 +99,10 @@ std::string GetRegistryControlledDomain(const GURL& signon_realm) {
}
bool IsFederatedMatch(const std::string& signon_realm, const GURL& origin) {
+ // Federated matches only apply to HTTPS.
+ if (!origin.SchemeIs(url::kHttpsScheme))
+ return false;
+
// The format should be "federation://origin.host/federation.host;
std::string federated_realm = "federation://" + origin.host() + "/";
return signon_realm.size() > federated_realm.size() &&

Powered by Google App Engine
This is Rietveld 408576698