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

Unified Diff: content/browser/ssl/ssl_manager.cc

Issue 2362523003: Add (some) password detection for HTTP-bad (Closed)
Patch Set: trigger the downgrade from OnPasswordFormsParsed Created 4 years, 2 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: content/browser/ssl/ssl_manager.cc
diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc
index bc38ee4b0c42a0dc891eafef5bb7f60d5adf6222..dc8e746bb15a0f5d417c3a6782ea850e291722fa 100644
--- a/content/browser/ssl/ssl_manager.cc
+++ b/content/browser/ssl/ssl_manager.cc
@@ -353,6 +353,24 @@ void SSLManager::UpdateEntry(NavigationEntryImpl* entry) {
WebContentsImpl* web_contents_impl =
static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents());
+
+ // For sensitive inputs (password, credit card) on HTTP, do not clear
+ // the |content_status| flag when the WebContents no longer has the
+ // flag set. This is different from how DISPLAYED_INSECURE_CONTENT and
+ // DISPLAYED_CONTENT_WITH_CERT_ERRORS are handled below. For sensitive
+ // inputs on HTTP, once the NavigationEntry has been marked as having
+ // displayed a sensitive input, it stays that way, even if the
+ // sensitive input is subsequently removed from the page.
+ if (web_contents_impl->DisplayedPasswordFieldOnHttp()) {
+ entry->GetSSL().content_status |=
+ SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP;
+ }
+
+ if (web_contents_impl->DisplayedCreditCardFieldOnHttp()) {
+ entry->GetSSL().content_status |=
+ SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP;
+ }
+
if (entry->GetSSL().security_style == SECURITY_STYLE_UNAUTHENTICATED)
return;
@@ -361,12 +379,14 @@ void SSLManager::UpdateEntry(NavigationEntryImpl* entry) {
entry->GetSSL().content_status &= ~SSLStatus::DISPLAYED_INSECURE_CONTENT;
if (web_contents_impl->DisplayedInsecureContent())
entry->GetSSL().content_status |= SSLStatus::DISPLAYED_INSECURE_CONTENT;
- if (!web_contents_impl->DisplayedContentWithCertErrors())
+ if (!web_contents_impl->DisplayedContentWithCertErrors()) {
entry->GetSSL().content_status &=
~SSLStatus::DISPLAYED_CONTENT_WITH_CERT_ERRORS;
- if (web_contents_impl->DisplayedContentWithCertErrors())
+ }
+ if (web_contents_impl->DisplayedContentWithCertErrors()) {
entry->GetSSL().content_status |=
SSLStatus::DISPLAYED_CONTENT_WITH_CERT_ERRORS;
+ }
SiteInstance* site_instance = entry->site_instance();
// Note that |site_instance| can be NULL here because NavigationEntries don't

Powered by Google App Engine
This is Rietveld 408576698