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

Side by Side Diff: components/password_manager/core/browser/login_database.h

Issue 1192493005: Encrypt password values in LoginDatabase on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 // Deletes the login database file on disk, and creates a new, empty database. 105 // Deletes the login database file on disk, and creates a new, empty database.
106 // This can be used after migrating passwords to some other store, to ensure 106 // This can be used after migrating passwords to some other store, to ensure
107 // that SQLite doesn't leave fragments of passwords in the database file. 107 // that SQLite doesn't leave fragments of passwords in the database file.
108 // Returns true on success; otherwise, whether the file was deleted and 108 // Returns true on success; otherwise, whether the file was deleted and
109 // whether further use of this login database will succeed is unspecified. 109 // whether further use of this login database will succeed is unspecified.
110 bool DeleteAndRecreateDatabaseFile(); 110 bool DeleteAndRecreateDatabaseFile();
111 111
112 StatisticsTable& stats_table() { return stats_table_; } 112 StatisticsTable& stats_table() { return stats_table_; }
113 113
114 // If set to 'true', then the password values are cleared before encrypting
vabr (Chromium) 2015/06/18 13:39:09 This comment should go to the variable declaration
vasilii 2015/06/18 14:28:13 Done.
115 // and storing in the database. At the same time AddLogin/UpdateLogin return
116 // PasswordStoreChangeList containing the real password.
117 void set_clear_password_values(bool val) { clear_password_values_ = val; }
118
114 private: 119 private:
115 // Result values for encryption/decryption actions. 120 // Result values for encryption/decryption actions.
116 enum EncryptionResult { 121 enum EncryptionResult {
117 // Success. 122 // Success.
118 ENCRYPTION_RESULT_SUCCESS, 123 ENCRYPTION_RESULT_SUCCESS,
119 // Failure for a specific item (e.g., the encrypted value was manually 124 // Failure for a specific item (e.g., the encrypted value was manually
120 // moved from another machine, and can't be decrypted on this machine). 125 // moved from another machine, and can't be decrypted on this machine).
121 // This is presumed to be a permanent failure. 126 // This is presumed to be a permanent failure.
122 ENCRYPTION_RESULT_ITEM_FAILURE, 127 ENCRYPTION_RESULT_ITEM_FAILURE,
123 // A service-level failure (e.g., on a platform using a keyring, the keyring 128 // A service-level failure (e.g., on a platform using a keyring, the keyring
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // |psl_match| is not null, filters out all results but thos PSL-matching 167 // |psl_match| is not null, filters out all results but thos PSL-matching
163 // |*psl_match|. On success returns true. 168 // |*psl_match|. On success returns true.
164 static bool StatementToForms(sql::Statement* statement, 169 static bool StatementToForms(sql::Statement* statement,
165 const autofill::PasswordForm* psl_match, 170 const autofill::PasswordForm* psl_match,
166 ScopedVector<autofill::PasswordForm>* forms); 171 ScopedVector<autofill::PasswordForm>* forms);
167 172
168 base::FilePath db_path_; 173 base::FilePath db_path_;
169 mutable sql::Connection db_; 174 mutable sql::Connection db_;
170 sql::MetaTable meta_table_; 175 sql::MetaTable meta_table_;
171 StatisticsTable stats_table_; 176 StatisticsTable stats_table_;
177 bool clear_password_values_;
vabr (Chromium) 2015/06/18 13:39:09 Also, is this just some temporary measure until we
vasilii 2015/06/18 14:28:13 Done.
172 178
173 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); 179 DISALLOW_COPY_AND_ASSIGN(LoginDatabase);
174 }; 180 };
175 181
176 } // namespace password_manager 182 } // namespace password_manager
177 183
178 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ 184 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698