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

Unified Diff: components/sync/core_impl/sync_encryption_handler_impl.cc

Issue 2260953002: Supplimentary identifier for passwords specific (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl format Created 4 years, 4 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/sync/core_impl/sync_encryption_handler_impl.cc
diff --git a/components/sync/core_impl/sync_encryption_handler_impl.cc b/components/sync/core_impl/sync_encryption_handler_impl.cc
index 686abbb45c4fddadeaa1e601fc0682f5b82497da..f5f64cd94ee5b8576735be1550d30729f367fd9f 100644
--- a/components/sync/core_impl/sync_encryption_handler_impl.cc
+++ b/components/sync/core_impl/sync_encryption_handler_impl.cc
@@ -195,6 +195,14 @@ bool UnpackKeystoreBootstrapToken(const std::string& keystore_bootstrap_token,
return true;
}
+// If the user starts using custom passphrase, then unencrypted metadata fields
+// for the password entity should be cleared.
+sync_pb::PasswordSpecificsMetadata
+ProcessPasswordSpecificMetadataForExplicitPassphareUsers(
+ const sync_pb::PasswordSpecificsMetadata& password_metadata) {
+ return sync_pb::PasswordSpecificsMetadata();
+}
+
} // namespace
SyncEncryptionHandlerImpl::Vault::Vault(Encryptor* encryptor,
@@ -842,6 +850,11 @@ void SyncEncryptionHandlerImpl::ReEncryptEverything(WriteTransaction* trans) {
if (child.InitByIdLookup(child_id) != BaseNode::INIT_OK)
break; // Possible if we failed to decrypt the data for some reason.
child.SetPasswordSpecifics(child.GetPasswordSpecifics());
+ if (IsExplicitPassphrase(passphrase_type_)) {
+ child.SetPasswordSpecificsMetadata(
Nicolas Zea 2016/08/20 00:23:43 It occurs to me that I don't think you need this.
melandory 2016/08/22 22:08:41 Disclaimer. Text below is written with an assumpti
+ ProcessPasswordSpecificMetadataForExplicitPassphareUsers(
+ child.GetPasswordSpecificsMetadata()));
+ }
child_id = child.GetSuccessorId();
}
}

Powered by Google App Engine
This is Rietveld 408576698