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

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

Issue 1192493005: Encrypt password values in LoginDatabase on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments 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 side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/login_database_mac.cc
diff --git a/components/password_manager/core/browser/login_database_mac.cc b/components/password_manager/core/browser/login_database_mac.cc
index ad6eaa55fa3b8274dc49d17637d7beb790a89fee..ffaa1c344411a93f8b44dbf998b238a36bd397a6 100644
--- a/components/password_manager/core/browser/login_database_mac.cc
+++ b/components/password_manager/core/browser/login_database_mac.cc
@@ -4,9 +4,7 @@
#include "components/password_manager/core/browser/login_database.h"
-// On the Mac, the LoginDatabase nulls out passwords, so that we can use the
-// rest of the database as a suplemental storage system to complement Keychain,
-// providing storage of fields Keychain doesn't allow.
+#include "components/os_crypt/os_crypt.h"
namespace password_manager {
@@ -14,16 +12,18 @@ namespace password_manager {
LoginDatabase::EncryptionResult LoginDatabase::EncryptedString(
const base::string16& plain_text,
std::string* cipher_text) {
- *cipher_text = std::string();
- return ENCRYPTION_RESULT_SUCCESS;
+ return OSCrypt::EncryptString16(plain_text, cipher_text)
+ ? ENCRYPTION_RESULT_SUCCESS
+ : ENCRYPTION_RESULT_SERVICE_FAILURE;
}
// static
LoginDatabase::EncryptionResult LoginDatabase::DecryptedString(
const std::string& cipher_text,
base::string16* plain_text) {
- *plain_text = base::string16();
- return ENCRYPTION_RESULT_SUCCESS;
+ return OSCrypt::DecryptString16(cipher_text, plain_text)
+ ? ENCRYPTION_RESULT_SUCCESS
+ : ENCRYPTION_RESULT_SERVICE_FAILURE;
}
} // namespace password_manager

Powered by Google App Engine
This is Rietveld 408576698