Chromium Code Reviews

Unified Diff: components/webdata/encryptor/ie7_password.h

Issue 26465006: Fix IE password import (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Style, documentation, etc. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: components/webdata/encryptor/ie7_password.h
diff --git a/components/webdata/encryptor/ie7_password.h b/components/webdata/encryptor/ie7_password.h
index 458426640d8b8350be1e7e1d73fabb3447ee145d..43dc61aff66ce7eab03a4f03f99ccff1d7bb26d3 100644
--- a/components/webdata/encryptor/ie7_password.h
+++ b/components/webdata/encryptor/ie7_password.h
@@ -27,16 +27,26 @@ struct IE7PasswordInfo {
namespace ie7_password {
-// Parses a data structure to find the password and the username.
+struct DecryptedCredentials {
+ // presubmit: allow wstring
+ std::wstring username;
+ // presubmit: allow wstring
+ std::wstring password;
+};
+
+// Parses a data structure to find passwords and usernames.
+// The collection of bytes in |data| is interpreted as a special PasswordEntry
+// structure. IE saves the login information as a binary dump of this structure.
+// Credentials extracted from |data| end up in |credentials|.
bool GetUserPassFromData(const std::vector<unsigned char>& data,
- std::wstring* username,
- std::wstring* password);
+ std::vector<DecryptedCredentials>* credentials);
-// Decrypts the username and password for a given data vector using the url as
+// Decrypts usernames and passwords for a given data vector using the url as
// the key.
-bool DecryptPassword(const std::wstring& url,
- const std::vector<unsigned char>& data,
- std::wstring* username, std::wstring* password);
+// Output ends up in |credentials|.
+bool DecryptPasswords(const std::wstring& url,
+ const std::vector<unsigned char>& data,
+ std::vector<DecryptedCredentials>* credentials);
// Returns the hash of a url.
std::wstring GetUrlHash(const std::wstring& url);

Powered by Google App Engine