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

Unified Diff: chrome/browser/sync/util/user_settings_posix.cc

Issue 3058003: Load the token from the user settings DB as a blob because it might include (Closed)
Patch Set: Bind the token with bind_blob Created 10 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/sync/util/user_settings_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/util/user_settings_posix.cc
diff --git a/chrome/browser/sync/util/user_settings_posix.cc b/chrome/browser/sync/util/user_settings_posix.cc
index da9a944fb4c1048485bfa8be51c78a58b5ccfe1c..f3f6cdc8c2bb9f5d1e02ec9c7b26d7cd1b1208a8 100644
--- a/chrome/browser/sync/util/user_settings_posix.cc
+++ b/chrome/browser/sync/util/user_settings_posix.cc
@@ -33,7 +33,8 @@ void UserSettings::SetAuthTokenForService(
"values (?, ?, ?)");
statement.bind_string(0, email);
statement.bind_string(1, service_name);
- statement.bind_string(2, encrypted_service_token);
+ statement.bind_blob(2, encrypted_service_token.data(),
+ encrypted_service_token.size());
if (SQLITE_DONE != statement.step()) {
LOG(FATAL) << sqlite3_errmsg(dbhandle.get());
}
@@ -51,7 +52,7 @@ bool UserSettings::GetLastUserAndServiceToken(const std::string& service_name,
if (SQLITE_ROW == query.step()) {
std::string encrypted_service_token;
- query.column_string(1, &encrypted_service_token);
+ query.column_blob_as_string(1, &encrypted_service_token);
if (!Encryptor::DecryptString(encrypted_service_token, service_token)) {
LOG(ERROR) << "Decryption failed: " << encrypted_service_token;
return false;
« no previous file with comments | « no previous file | chrome/browser/sync/util/user_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698