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

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

Issue 2114703002: Ignore Crypto-Key header values that do not have "dh" values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/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 35015369f5d25a0746e0783489422bf78a21ced6..e9ca7855cdd97525aac91edbd2377e6114e25d21 100644
--- a/components/gcm_driver/crypto/gcm_encryption_provider.cc
+++ b/components/gcm_driver/crypto/gcm_encryption_provider.cc
@@ -150,6 +150,11 @@ void GCMEncryptionProvider::DecryptMessage(
return;
}
+ // Ignore values that don't include the "dh" property. When using VAPID, it is
+ // valid for the application server to supply multiple values.
+ while (crypto_key_header_iterator.dh().empty() &&
johnme 2016/06/30 16:55:58 The spec requires "at most one entry having a `dh`
Peter Beverloo 2016/06/30 18:00:42 Done.
+ crypto_key_header_iterator.GetNext()) {}
+
if (crypto_key_header_iterator.dh().empty()) {
DLOG(ERROR) << "Invalid values supplied in the Crypto-Key header";
callback.Run(DECRYPTION_RESULT_INVALID_CRYPTO_KEY_HEADER,

Powered by Google App Engine
This is Rietveld 408576698