-
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
CASE: Handle failure if unable to schedule handle/send sigma3c #27226
Conversation
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.
Couple more naming/comment suggestions.
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.
Approving, but note the comments.
PR #27226: Size comparison from a7edf3d to cf2eb88 Increases above 0.2%:
Increases (58 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Full report (58 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
- We are no longer unregistering the unsolicit message hander for sigma1. Based on handshake state and failure to schedule work, decide what to do. 1. If in middle of handshake but it's zombie, tear down the handshake. 2. If still in middle of handshake, return without responding. 3. Otherwise, jsut do a new handshake. - Added APIs in helper to check if it fails to schedule after work callback and to re run it from foreground thread. - Added wrapper around the APIs for HandleSigma3 and SendSigma3 cases.
Added the accessor for CASESession state. Now, all the logic for checking and resetting stays with CASESession
Co-authored-by: Marc Lepage <[email protected]>
Co-authored-by: Marc Lepage <[email protected]>
PR #27226: Size comparison from df986c9 to ede7156 Increases above 0.2%:
Increases (58 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Full report (58 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
* Cleanup in aisle CASESession (#26339) * Cleanup in aisle CASESession * Reduce nesting in function * CASE: Handle failure if unable to schedule handle/send sigma3c (#27226) * CASE: Handle failure if unable to schedule handle/send sigma3c - We are no longer unregistering the unsolicit message hander for sigma1. Based on handshake state and failure to schedule work, decide what to do. 1. If in middle of handshake but it's zombie, tear down the handshake. 2. If still in middle of handshake, return without responding. 3. Otherwise, jsut do a new handshake. - Added APIs in helper to check if it fails to schedule after work callback and to re run it from foreground thread. - Added wrapper around the APIs for HandleSigma3 and SendSigma3 cases. * Restyled by clang-format * Address review comments Added the accessor for CASESession state. Now, all the logic for checking and resetting stays with CASESession * Fix some API docs * Addressed review comments * Update src/protocols/secure_channel/CASESession.cpp Co-authored-by: Marc Lepage <[email protected]> * Update src/protocols/secure_channel/CASEServer.cpp Co-authored-by: Marc Lepage <[email protected]> * Moved status check before setting atomic variable * fix build failures --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Justin Wood <[email protected]> Co-authored-by: Marc Lepage <[email protected]> --------- Co-authored-by: Marc Lepage <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Justin Wood <[email protected]>
Problem
Sending and Handling Sigma3 is an async process and divided into three parts, Sigma3a, Sigma3b, and Sigma3c.
Sigma3a schedules Sigma3b, and Sigma3b is suppose to schedule the Sigma3c.
If We fail to schedule Sigma3c then, we are in the state where the only option to recover is reboot. Problem is more described in #25695 (comment) and logs in #26737 has hit this problem.
Fixes #26737 and completes below item from #26280
Change Overview
Implemented the suggestion provided by Marc here: #26280 (comment)
We are no longer unregistering the unsolicit message hander for sigma1. Based on handshake state and failure to schedule work, decide what to do:
Added APIs in helper to check if it fails to schedule after work callback and to re run it from foreground thread.
Added wrapper around the APIs for HandleSigma3 and SendSigma3 cases.
Tests
connectedhomeip/src/protocols/secure_channel/CASESession.cpp
Line 230 in 643f7aa
Follow ups to do
RegisterUnsolicitedMessageHandlerForType()
can be moved out fromPrepareForSessionEstablishment()
, this gets called every time after case is established/failed.IsSendSigma3PermanentlyBlockedOnBackgroundWork()
andUnblockSendSigma3FromForegroundWork()
from CASEClient.#27474 and #27473