-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Message Counter Synchronization Protocol part #4712
Conversation
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 191 to 197 in 17fd7cd
This comment was generated by todo based on a
|
(#4641) We shall also set the C flag in the packet header, this will be used for message protection later.connectedhomeip/src/messaging/SecureChannelMgr.cpp Lines 130 to 140 in 17fd7cd
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/SecureChannelMgr.cpp Lines 253 to 263 in 17fd7cd
This comment was generated by todo based on a
|
src/messaging/SecureChannelMgr.cpp
Outdated
@@ -0,0 +1,269 @@ | |||
/* | |||
* | |||
* Copyright (c) 2021 Project CHIP Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove copyright line (years are annoying to update).
@woody-apple - is this ok with you? I find updating years tedious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer a separate PR to update the Copyright header part unanimously after we finalize what should be kept and what should be removed.
src/messaging/SecureChannelMgr.cpp
Outdated
|
||
/** | ||
* @file | ||
* This file implements the CHIP Secure Channel protocol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this @file ?
@@ -0,0 +1,272 @@ | |||
/* | |||
* | |||
* Copyright (c) 2020-2021 Project CHIP Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If keeping this should be just 2021 probably.
However I would still remove both Copyright and All rights reserved lines.
|
||
/** | ||
* @file | ||
* This file implements unit tests for the ExchangeManager implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would drop this @file
comment: generally I have not found any of these @file
comments valuable when reading code and they seem to have a high probability of being copy & pasted - like this one I believe it should not be ExchangeManager but rather SecureChannelManager.
A comment saying that 'TestSecureChannelMgr.cpp implements unit tests for SecureChannelManager' seems redundant.
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 191 to 197 in 492f55a
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/SecureChannelMgr.cpp Lines 253 to 263 in 492f55a
This comment was generated by todo based on a
|
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 191 to 197 in 7e5a1bb
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/SecureChannelMgr.cpp Lines 254 to 264 in 7e5a1bb
This comment was generated by todo based on a
|
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 191 to 197 in 16fd9bb
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/SecureChannelMgr.cpp Lines 254 to 264 in 16fd9bb
This comment was generated by todo based on a
|
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 191 to 197 in 1db754e
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/SecureChannelMgr.cpp Lines 254 to 264 in 1db754e
This comment was generated by todo based on a
|
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 191 to 197 in b949ac5
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/SecureChannelMgr.cpp Lines 251 to 261 in b949ac5
This comment was generated by todo based on a
|
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 191 to 197 in 2703eab
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/SecureChannelMgr.cpp Lines 251 to 261 in 2703eab
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/MessageCounterSync.cpp Lines 251 to 261 in 1d4d7d5
This comment was generated by todo based on a
|
Acked, SecureChannelMgr was originally designed to run MCSP and CASE protocols, since we have figured out how to implement multiple CASE sessions using ephemeral TCP ports within Transport layer, we can rename SecureChannelMgr to MessageCounterSyncMgr |
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 191 to 197 in 187aad2
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/MessageCounterSync.cpp Lines 251 to 261 in 187aad2
This comment was generated by todo based on a
|
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 191 to 197 in 11dc138
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/MessageCounterSync.cpp Lines 251 to 261 in 11dc138
This comment was generated by todo based on a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yufengwangca , there are some minor comments. Once those are addressed, it looks good to me.
@@ -33,6 +33,9 @@ | |||
#include <transport/SecureSessionMgr.h> | |||
|
|||
namespace chip { | |||
|
|||
constexpr uint16_t kMsgCounterChallengeSize = 8; // The size of the message counter synchronization request message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move this to MessageCounterSync.h
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause mutual including during compiling.
The mChallenge should not be declared in ExchangeContext.h, it will be moved to MessageCounterSync.h after:
// [TODO: #4711]: this field need to be moved to appState object which implement 'exchange-specific' contextual actions with a delegate pattern.
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 191 to 197 in 979fa5d
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/MessageCounterSync.cpp Lines 250 to 260 in 979fa5d
This comment was generated by todo based on a
|
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 207 to 213 in 2428bc8
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/MessageCounterSync.cpp Lines 250 to 260 in 2428bc8
This comment was generated by todo based on a
|
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 207 to 213 in 7bd07d8
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/MessageCounterSync.cpp Lines 257 to 267 in 7bd07d8
This comment was generated by todo based on a
|
#4711]: this field need to be moved to appState object which implement 'exchange-specific' contextualconnectedhomeip/src/messaging/ExchangeContext.h Lines 207 to 213 in 2428bc8
This comment was generated by todo based on a
|
(#4628)Initialize/synchronize peer's message counter to FabricState.connectedhomeip/src/messaging/MessageCounterSync.cpp Lines 250 to 260 in 2428bc8
This comment was generated by todo based on a
|
…ect-chip#4712)" This reverts commit a949773.
Problem
Peer message counter synchronization is an essential part of enabling secure CHIP messaging between members of an application group.
Summary of Changes
Implement the protocol used to synchronize message counters between peers when using the same symmetric group key.
This PR does not handle the Initiating Message Counter Synchronization part which is depending on the following issues:
#4628
#4571
Fixes #4626