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..dd82252cf7cb5a758a5443c26b7079c0c49d37e8 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,19 @@ namespace password_manager { |
LoginDatabase::EncryptionResult LoginDatabase::EncryptedString( |
const base::string16& plain_text, |
std::string* cipher_text) { |
- *cipher_text = std::string(); |
- return ENCRYPTION_RESULT_SUCCESS; |
+ // Handling the empty string shouldn't use the Keychain. |
vabr (Chromium)
2015/06/18 13:39:09
It is not clear to me why it is important to menti
vasilii
2015/06/18 14:28:14
The comment is obsolete.
|
+ 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 |