-
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
Need a solution to get correct generated SecureSessionHandle for each new connection #4451
Comments
For server sideThe application will receive an For client sideThe protocols will take either a |
The client does not know the keyid of SecureSessionHandle at the first place, how to get it before calling sendMessage? will this get addressed in your channel PR? |
Yes, the session is derived from But before that, I think you temporary fix is fine. |
That is exactly issue I hit, there are multiple instances get set as the delegate of SecureSessionMgr, only the last one get OnNewConnection called |
@pan-apple can you weigh in here? |
@pan-apple @andreilitvin @bzbarsky-apple @erjiaqing Hi Mingjie, It seems there is no easy solution for this issue, I just did some background study and try to understand why we have this problem at the first place and how Weave handle this case. It seems the motivation to introduce SessionHanlde is we believe it is not enough to use PeerNodeId as key to find PeerConnectionState. I am thinking of the scenarios we might have the confusion.
Since weave does not need to use keyID to identify the connection, I would like to understand what requirements make CHIP different than Weave in this case. If we could use the solution from Weave, then all issues are going away. |
Currently we are using #4019 will be the solution to this problem. A secure session is only obtainable via a |
Problem
I found #3728 broke the end-to-end messaging testing which is temporarily disabled in CI.
With this change, the app does not specify the target NodeID, but relay on the following callback to update the SecureSessionHandle.
void OnNewConnection(chip::SecureSessionHandle session, chip::SecureSessionMgr * mgr) override {
mSecureSession = session;
}
We can only specify one delegate of SecureSessionMgr at a time, but there are multiple connections managed by the SecureSessionMgr, how we make sure the SecureSessionMgr can pass the generated SecureSessionHandle to the corresponding target of its connection?
For example, there are multiple objects are set as the delegate of SecureSessionMgr, including DeviceController, ExchangeManager and application itself. The later SetDelegate() will overwrite the previous one.
Echo Application:
gSessionManager.SetDelegate(&gTestSecureSessionMgrDelegate); // Set the echo app as the delegate of SecureSessionMgr.
err = gExchangeManager.Init(&gSessionManager); // Set the ExchangeManager as the delegate of SecureSessionMgr.
The echo application won't received the generated SecureSessionHandle and it will sendMessage to garbage target.
The text was updated successfully, but these errors were encountered: