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

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

Issue 6537027: Revert 75287 - [Sync] Initial support for encrypting any datatype (no UI hook... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | « chrome/browser/sync/util/cryptographer.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/util/cryptographer.cc
===================================================================
--- chrome/browser/sync/util/cryptographer.cc (revision 75295)
+++ chrome/browser/sync/util/cryptographer.cc (working copy)
@@ -59,24 +59,19 @@
bool Cryptographer::Decrypt(const sync_pb::EncryptedData& encrypted,
::google::protobuf::MessageLite* message) const {
DCHECK(message);
- std::string plaintext = DecryptToString(encrypted);
- return message->ParseFromString(plaintext);
-}
-std::string Cryptographer::DecryptToString(
- const sync_pb::EncryptedData& encrypted) const {
NigoriMap::const_iterator it = nigoris_.find(encrypted.key_name());
if (nigoris_.end() == it) {
NOTREACHED() << "Cannot decrypt message";
- return std::string(""); // Caller should have called CanDecrypt(encrypt).
+ return false; // Caller should have called CanDecrypt(encrypt).
}
std::string plaintext;
if (!it->second->Decrypt(encrypted.blob(), &plaintext)) {
- return std::string("");
+ return false;
}
- return plaintext;
+ return message->ParseFromString(plaintext);
}
bool Cryptographer::GetKeys(sync_pb::EncryptedData* encrypted) const {
@@ -209,7 +204,7 @@
return NULL;
std::string encrypted_data;
- if (!base::Base64Decode(token, &encrypted_data)) {
+ if (!base::Base64Decode(token, &encrypted_data)){
DLOG(WARNING) << "Could not decode token.";
return NULL;
}
« no previous file with comments | « chrome/browser/sync/util/cryptographer.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698