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

Unified Diff: components/cryptauth/device_to_device_secure_context.h

Issue 2899863002: Updating D2D protocol to v1 to support separate sequence numbers. (Closed)
Patch Set: Addressing comments Created 3 years, 7 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/cryptauth/device_to_device_secure_context.h
diff --git a/components/cryptauth/device_to_device_secure_context.h b/components/cryptauth/device_to_device_secure_context.h
index 0b59033cdc46444f514bab1275cf30a547d24971..70f1c35298534493e67afef6c43124f4b9f92f60 100644
--- a/components/cryptauth/device_to_device_secure_context.h
+++ b/components/cryptauth/device_to_device_secure_context.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "components/cryptauth/secure_context.h"
+#include "components/cryptauth/session_keys.h"
namespace securemessage {
class Header;
@@ -24,7 +25,7 @@ class DeviceToDeviceSecureContext : public SecureContext {
public:
DeviceToDeviceSecureContext(
std::unique_ptr<SecureMessageDelegate> secure_message_delegate,
- const std::string& symmetric_key,
+ const SessionKeys& session_keys,
const std::string& responder_auth_message_,
ProtocolVersion protocol_version);
@@ -51,8 +52,11 @@ class DeviceToDeviceSecureContext : public SecureContext {
// Delegate for handling the creation and unwrapping of SecureMessages.
std::unique_ptr<SecureMessageDelegate> secure_message_delegate_;
- // The symmetric key used to create and unwrap messages.
- const std::string symmetric_key_;
+ // The symmetric key used for encryption.
+ const std::string encryption_key_;
+
+ // The symmetric key used for decryption.
+ const std::string decryption_key_;
// The [Responder Auth] message received from the remote device during
// authentication.
@@ -61,8 +65,11 @@ class DeviceToDeviceSecureContext : public SecureContext {
// The protocol version supported by the remote device.
const ProtocolVersion protocol_version_;
- // The last sequence number of the message sent or received.
- int last_sequence_number_;
+ // The last sequence number of the message sent.
+ int last_encode_sequence_number_;
+
+ // The last sequence number of the message received.
+ int last_decode_sequence_number_;
base::WeakPtrFactory<DeviceToDeviceSecureContext> weak_ptr_factory_;
« no previous file with comments | « components/cryptauth/device_to_device_responder_operations.cc ('k') | components/cryptauth/device_to_device_secure_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698