Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #773 +/- ##
=======================================
Coverage 99.59% 99.59%
=======================================
Files 64 64
Lines 4417 4471 +54
=======================================
+ Hits 4399 4453 +54
Misses 18 18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Concurrent join-window calls can interfere with each other’s keys and policies, while cleanup failures and missing policy flags can prevent existing devices from rejoining.
4 open issues
What changed in this PR
Updates Bellows’ EZSPv8+ Trust Center defaults to support link-key-protected rejoins outside join windows, while keeping new-device joins controlled by permit joining.
Changes:
- Share the updated Trust Center policy defaults across EZSPv8+ versions.
- Replace pre-permit hooks with managed join windows and transient-key cleanup.
- Refine join callbacks, security documentation, and related tests.
| File | Description |
|---|---|
tests/test_ezsp.py |
Tests join contexts, cleanup, and policy defaults. |
tests/test_ezsp_v9.py |
Removes obsolete pre-permit coverage. |
tests/test_ezsp_v8.py |
Tests join-policy selection and restoration. |
tests/test_ezsp_v5.py |
Tests transient-key addition and cleanup. |
tests/test_ezsp_v4.py |
Tests legacy no-op policy and cleanup methods. |
tests/test_ezsp_v13.py |
Tests transient-key import behavior. |
tests/test_ezsp_v10.py |
Removes obsolete pre-permit coverage. |
tests/test_application.py |
Tests join callbacks and join-window lifecycle. |
bellows/zigbee/application.py |
Manages join windows and limits direct join handling to secured rejoins. |
bellows/types/named.py |
Clarifies security enum documentation and adds a join-decision value. |
bellows/ezsp/v9/config.py |
Uses updated shared policy defaults. |
bellows/ezsp/v8/config.py |
Defines rejoin-enabled Trust Center defaults. |
bellows/ezsp/v8/__init__.py |
Selects and restores Trust Center join policies. |
bellows/ezsp/v5/__init__.py |
Adds transient-key cleanup support. |
bellows/ezsp/v4/__init__.py |
Provides legacy no-op join-management methods. |
bellows/ezsp/v19/config.py |
Uses updated shared policy defaults. |
bellows/ezsp/v18/config.py |
Uses updated shared policy defaults. |
bellows/ezsp/v17/config.py |
Uses updated shared policy defaults. |
bellows/ezsp/v16/config.py |
Uses updated shared policy defaults. |
bellows/ezsp/v14/config.py |
Uses updated shared policy defaults. |
bellows/ezsp/v13/config.py |
Uses updated shared policy defaults. |
bellows/ezsp/v12/config.py |
Uses updated shared policy defaults. |
bellows/ezsp/v11/config.py |
Uses updated shared policy defaults. |
bellows/ezsp/v10/config.py |
Uses updated shared policy defaults. |
bellows/ezsp/protocol.py |
Defines abstract join-policy and key-cleanup methods. |
bellows/ezsp/__init__.py |
Adds the join context manager and shared key constants. |
Review effort: Max
|
Is the Or the question is the TC blocked for rejoining with only no update TCLK then is not in paining mode. PS: ref https://docs.silabs.com/zigbee/latest/zigbee-security/03-standard-security |
|
@MattWestb Secure rejoins are always allowed, as before. I don't think you can turn that off. This PR enables insecure rejoin (renamed to Trust Center Rejoin) as well, outside of the permit window. It does not enable unsecured rejoin if the device doesn't have a TCLK. |
|
Thanks for trying explaining P (but its not working so well on my side allways) !! So is the well known (link) key "ZigBeeAlliance09" allowed for device rejoining if they is not having the network key and the network is closed for (new) joining or only if the device have update the TCLK (ala Zigbee PRO / 3) and using that ? I can read out that you is enabling and disabling the "ZigBeeAlliance09" but its out of my knowledge getting how its working in the end. The different is if the network is running in Zigbee 3 security mode or Zigbee HA / 1.X = no security / old hard code well known keys all the time. Have it open for using the old key then joining was implemented by Adming so Aqara sensors can rejoining then they have left without resetting them and some more nice behaving devices. |
|
@MattWestb I ran a bunch of tests with Ziggurat in "router" mode, against my live network for practically every combination I could think of. This all behaves the same on EZSP v13 (Gecko SDK) and v19 (Simplicity SDK): Fresh join, device has no keys:
TC rejoin, device "lost" the network key and ask for it in the clear:
Secured rejoin, device still has the network key:
As far as I can tell, everything behaves properly with this PR. |
|
Great work and test done !! One more T !!!! |


Don't let the title scare you, this turned out to be a very poorly named Gecko SDK/Simplicity SDK/spec term that does not do what it says it does.
The SDK provides
SL_ZIGBEE_EZSP_TRUST_CENTER_POLICY, which controls how the coordinator deals with device joins:This policy is not what controls when devices join a network, it instead dictates what EmberZNet will do when either a new device joins (only allowed during the
permitJoining/ZDOMgmt_Permit_Joining_reqperiod) or an old device tries to re-join.There are a few joining scenarios:
ZigBeeAlliance09(Zigbee 4.0 should have fixed this hole but it was removed from the spec). Allowed byALLOW_JOINSalone.ALLOW_JOINS | JOINS_USE_INSTALL_CODE_KEY.ALLOW_UNSECURED_REJOINS.ALLOW_UNSECURED_REJOINSto originally mean. This would actually requireALLOW_UNSECURED_REJOINS | SEND_KEY_IN_CLEAROur old behavior set
ALLOW_JOINSand then enabledALLOW_UNSECURED_REJOINSduring the join window.This new behavior now always sets
ALLOW_JOINS | ALLOW_UNSECURED_REJOINS.