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

Unified Diff: components/gcm_driver/crypto/gcm_message_cryptographer.h

Issue 2716443002: Implement support for draft-ietf-webpush-encryption-08 (Closed)
Patch Set: Implement support for draft-ietf-webpush-encryption-08 Created 3 years, 10 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_message_cryptographer.h
diff --git a/components/gcm_driver/crypto/gcm_message_cryptographer.h b/components/gcm_driver/crypto/gcm_message_cryptographer.h
index 1ebe8a1ea892c1b9c1e1ba16ec622a7e544e9d6d..067f980b75a023fa1dd1b9c65edd4dfab0c267c5 100644
--- a/components/gcm_driver/crypto/gcm_message_cryptographer.h
+++ b/components/gcm_driver/crypto/gcm_message_cryptographer.h
@@ -17,9 +17,11 @@
namespace gcm {
// Messages delivered through GCM may be encrypted according to the IETF Web
-// Push protocol. We support the third draft of ietf-webpush-encryption:
+// Push protocol. We support two versions of ietf-webpush-encryption. The user
+// of this class must pass in the version to use when constructing an instance.
//
// https://tools.ietf.org/html/draft-ietf-webpush-encryption-03
+// https://tools.ietf.org/html/draft-ietf-webpush-encryption-08 (WGLC)
//
// This class implements the ability to encrypt or decrypt such messages using
// AEAD_AES_128_GCM with a 16-octet authentication tag. The encrypted payload
@@ -38,9 +40,10 @@ class GCMMessageCryptographer {
// Version of the encryption scheme desired by the consumer.
enum class Version {
// https://tools.ietf.org/html/draft-ietf-webpush-encryption-03
- DRAFT_03
+ DRAFT_03,
- // TODO(peter): Add support for ietf-webpush-encryption-08.
+ // https://tools.ietf.org/html/draft-ietf-webpush-encryption-08 (WGLC)
+ DRAFT_08
};
// Interface that different versions of the encryption scheme must implement.
@@ -54,6 +57,8 @@ class GCMMessageCryptographer {
// Derives the pseuro random key (PRK) to use for deriving the content
// encryption key and the nonce.
virtual std::string DerivePseudoRandomKey(
+ const base::StringPiece& recipient_public_key,
+ const base::StringPiece& sender_public_key,
const base::StringPiece& ecdh_shared_secret,
const base::StringPiece& auth_secret) = 0;

Powered by Google App Engine
This is Rietveld 408576698