summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzea <zea@chromium.org>2015-07-07 16:54:47 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-07 23:55:09 +0000
commit63d4f06c4e82edcdbd65c80de3f921b71924be22 (patch)
tree039b173f67c076d99f79b343aeec78752499467b
parente3c4d1a1228e00b190ad743a83f88a2266f45238 (diff)
downloadchromium_src-63d4f06c4e82edcdbd65c80de3f921b71924be22.zip
chromium_src-63d4f06c4e82edcdbd65c80de3f921b71924be22.tar.gz
chromium_src-63d4f06c4e82edcdbd65c80de3f921b71924be22.tar.bz2
[Sync] Gracefully handle keychain failures
We trigger DCHECKs when we attempt to create bootstrap tokens while the Mac keychain isn't ready. This doesn't actually affect correctness, and is problematic for developers. Now, we'll simply persist empty bootstrap tokens, forcing the user to re-enter their passphrase on restart (or the client to redownload the server encryption key if they have a keystore type nigori). BUG=457153 Review URL: https://codereview.chromium.org/1211273012 Cr-Commit-Position: refs/heads/master@{#337704}
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_impl.cc1
-rw-r--r--sync/internal_api/sync_encryption_handler_impl.cc2
-rw-r--r--sync/util/cryptographer.cc1
3 files changed, 1 insertions, 3 deletions
diff --git a/chrome/browser/sync/glue/sync_backend_host_impl.cc b/chrome/browser/sync/glue/sync_backend_host_impl.cc
index a499d09..833a9d9 100644
--- a/chrome/browser/sync/glue/sync_backend_host_impl.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_impl.cc
@@ -704,7 +704,6 @@ void SyncBackendHostImpl::PersistEncryptionBootstrapToken(
const std::string& token,
syncer::BootstrapTokenType token_type) {
CHECK(sync_prefs_.get());
- DCHECK(!token.empty());
if (token_type == syncer::PASSPHRASE_BOOTSTRAP_TOKEN)
sync_prefs_->SetEncryptionBootstrapToken(token);
else
diff --git a/sync/internal_api/sync_encryption_handler_impl.cc b/sync/internal_api/sync_encryption_handler_impl.cc
index 8ae4c5d..f83c3e1 100644
--- a/sync/internal_api/sync_encryption_handler_impl.cc
+++ b/sync/internal_api/sync_encryption_handler_impl.cc
@@ -718,7 +718,7 @@ bool SyncEncryptionHandlerImpl::SetKeystoreKeys(
old_keystore_keys_,
keystore_key_,
cryptographer->encryptor());
- DCHECK_EQ(keystore_bootstrap.empty(), keystore_key_.empty());
+
FOR_EACH_OBSERVER(SyncEncryptionHandler::Observer, observers_,
OnBootstrapTokenUpdated(keystore_bootstrap,
KEYSTORE_BOOTSTRAP_TOKEN));
diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc
index bccf9a2..4191465 100644
--- a/sync/util/cryptographer.cc
+++ b/sync/util/cryptographer.cc
@@ -277,7 +277,6 @@ bool Cryptographer::GetBootstrapToken(std::string* token) const {
std::string encrypted_token;
if (!encryptor_->EncryptString(unencrypted_token, &encrypted_token)) {
- NOTREACHED();
return false;
}