From dea3a922a415ef050c3a5fb0d2d19571fe578413 Mon Sep 17 00:00:00 2001 From: zea Date: Tue, 9 Jun 2015 18:51:30 -0700 Subject: [Sync] Don't crash for encryption errors Encryption errors can arise due to OS issues in some cases or simply directory corruption. Rather than crashing trigger an unrecoverable error. BUG=123223 Review URL: https://codereview.chromium.org/1161463005 Cr-Commit-Position: refs/heads/master@{#333644} --- sync/util/cryptographer.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sync/util') diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc index c22f0a3..bccf9a2 100644 --- a/sync/util/cryptographer.cc +++ b/sync/util/cryptographer.cc @@ -127,8 +127,10 @@ 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). + // The key used to encrypt the blob is not part of the set of installed + // nigoris. + LOG(ERROR) << "Cannot decrypt message"; + return std::string(); } std::string plaintext; -- cgit v1.1