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

Unified Diff: components/password_manager/core/browser/password_manager.h

Issue 2607413003: Add security feature to ProvisionalSavePassword (Closed)
Patch Set: Addressed nit. 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/password_manager.h
diff --git a/components/password_manager/core/browser/password_manager.h b/components/password_manager/core/browser/password_manager.h
index 467f6a886550e9321030a52d58c749ff60a3a927..ccc1d89028c1a683d3c124dde0b1f1eb922d4f33 100644
--- a/components/password_manager/core/browser/password_manager.h
+++ b/components/password_manager/core/browser/password_manager.h
@@ -11,6 +11,7 @@
#include <vector>
#include "base/callback.h"
+#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
@@ -183,6 +184,10 @@ class PasswordManager : public LoginModel {
#endif
private:
+ FRIEND_TEST_ALL_PREFIXES(
+ PasswordManagerTest,
+ ShouldBlockPasswordForSameOriginButDifferentSchemeTest);
+
enum ProvisionalSaveFailure {
SAVING_DISABLED,
EMPTY_PASSWORD,
@@ -210,6 +215,13 @@ class PasswordManager : public LoginModel {
// non-blacklisted.
bool CanProvisionalManagerSave();
+ // Returns true if there already exists a provisionally saved password form
+ // from the same origin as |form|, but with a different and secure scheme.
+ // This prevents a potential attack where users can be tricked into saving
+ // unwanted credentials, see http://crbug.com/571580 for details.
+ bool ShouldBlockPasswordForSameOriginButDifferentScheme(
+ const autofill::PasswordForm& form) const;
+
// Returns true if the user needs to be prompted before a password can be
// saved (instead of automatically saving
// the password), based on inspecting the state of

Powered by Google App Engine
This is Rietveld 408576698