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

Unified Diff: components/gcm_driver/crypto/gcm_encryption_provider.cc

Issue 1616113003: List message decryption failures on chrome://gcm-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after CL 1619053003 Created 4 years, 11 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 | « components/gcm_driver/crypto/gcm_encryption_provider.h ('k') | components/gcm_driver/fake_gcm_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/crypto/gcm_encryption_provider.cc
diff --git a/components/gcm_driver/crypto/gcm_encryption_provider.cc b/components/gcm_driver/crypto/gcm_encryption_provider.cc
index b869deeb0ac4707e065c38691d03007af83060f7..5e76ac1e9d9c8276054e1a0a2b5565be97a9a123 100644
--- a/components/gcm_driver/crypto/gcm_encryption_provider.cc
+++ b/components/gcm_driver/crypto/gcm_encryption_provider.cc
@@ -29,6 +29,27 @@ const base::FilePath::CharType kEncryptionDirectoryName[] =
} // namespace
+std::string GCMEncryptionProvider::ToDecryptionFailureDetailsString(
+ DecryptionFailure reason) {
+ switch(reason) {
+ case DECRYPTION_FAILURE_UNKNOWN:
+ return "Unknown failure";
+ case DECRYPTION_FAILURE_INVALID_ENCRYPTION_HEADER:
+ return "Invalid format for the Encryption header";
+ case DECRYPTION_FAILURE_INVALID_CRYPTO_KEY_HEADER:
+ return "Invalid format for the Crypto-Key header";
+ case DECRYPTION_FAILURE_NO_KEYS:
+ return "There are no associated keys with the subscription";
+ case DECRYPTION_FAILURE_INVALID_PUBLIC_KEY:
+ return "The public key in the Crypto-Key header is invalid";
+ case DECRYPTION_FAILURE_INVALID_PAYLOAD:
+ return "AES-GCM decryption failed";
+ }
+
+ NOTREACHED();
+ return "(invalid reason)";
+}
+
GCMEncryptionProvider::GCMEncryptionProvider()
: weak_ptr_factory_(this) {
}
« no previous file with comments | « components/gcm_driver/crypto/gcm_encryption_provider.h ('k') | components/gcm_driver/fake_gcm_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698