diff options
author | zea <zea@chromium.org> | 2015-06-09 18:51:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-10 01:52:03 +0000 |
commit | dea3a922a415ef050c3a5fb0d2d19571fe578413 (patch) | |
tree | 848a8bbd3712ceb76c92ba922373343c8ef4be37 /sync/util/cryptographer.cc | |
parent | ac85d0bf9e57a2089dc07c7fb9ff4af2d4bdd819 (diff) | |
download | chromium_src-dea3a922a415ef050c3a5fb0d2d19571fe578413.zip chromium_src-dea3a922a415ef050c3a5fb0d2d19571fe578413.tar.gz chromium_src-dea3a922a415ef050c3a5fb0d2d19571fe578413.tar.bz2 |
[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}
Diffstat (limited to 'sync/util/cryptographer.cc')
-rw-r--r-- | sync/util/cryptographer.cc | 6 |
1 files changed, 4 insertions, 2 deletions
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; |