Skip to content

feat: Implement EZSP v13 SecurityManager API#1479

Merged
cdjackson merged 1 commit into
zsmartsystems:masterfrom
abidkhan148:feature/ezsp-v13-security-manager
Apr 5, 2026
Merged

feat: Implement EZSP v13 SecurityManager API#1479
cdjackson merged 1 commit into
zsmartsystems:masterfrom
abidkhan148:feature/ezsp-v13-security-manager

Conversation

@abidkhan148
Copy link
Copy Markdown
Contributor

Summary

EZSP v13 (EmberZNet 7.4 / Gecko SDK 4.4) removed 12 legacy security commands and replaced them with a new SecurityManager API. PR #1413 bumped EZSP_MAX_VERSION to 13 but did not implement the replacement commands, causing all key management operations to silently fail on EZSP v13 firmware.

Observed symptoms on EZSP v13:

  • getZigBeeNetworkKey() returns null (network key invisible)
  • getZigBeeLinkKey() returns null (link key invisible)
  • Device joining unreliable (addTransientLinkKey fails silently)

Changes

New data structures (4 files)

  • EzspSecurityManagerKeyType — enum for SecurityManager key types
  • EzspSecurityManagerContext — context struct for SecurityManager operations
  • EzspSecurityManagerNetworkKeyInfo — network key info struct
  • EzspSecurityManagerApsKeyMetadata — APS key metadata struct

New EZSP command classes (22 files — 11 Request/Response pairs)

Command Frame ID Replaces
exportKey 0x0114 getKey (0x6A)
importKey 0x0115 setKeyTableEntry (0x72)
secManImportTransientKey 0x0111 addTransientLinkKey (0xAF)
secManExportTransientKeyByEui 0x0113 getTransientLinkKey (0xCE)
secManExportTransientKeyByIndex 0x0112 getTransientKeyTableEntry (0x6D)
secManExportLinkKeyByEui 0x010D getKeyTableEntry by EUI (0x71)
secManExportLinkKeyByIndex 0x010F getKeyTableEntry by index (0x71)
secManImportLinkKey 0x010E addOrUpdateKeyTableEntry (0x66)
secManCheckKeyContext 0x0110 (new)
secManGetNetworkKeyInfo 0x0116 (new)
secManGetApsKeyInfo 0x010C (new)

Version-conditional routing (2 file edits)

  • EmberNcp.getKey() — detects EZSP v13+ and routes to exportKey
  • EmberNcp.addTransientLinkKey() — detects v13+ and routes to secManImportTransientKey
  • EzspFrame.java — registered all 11 new frame IDs and handler map entries

Backwards compatible

EZSP v4-v12 code paths are completely unchanged. The version check uses EzspFrame.getEzspVersion() >= 13.

References

Test plan

  • Compiles successfully (mvn compile — 422 source files, 0 errors)
  • Verify with EZSP v8 firmware (EmberZNet 6.10.3) — legacy paths unchanged
  • Verify with EZSP v13 firmware (EmberZNet 7.4.x) — network key, link key, and device joining work

cc @cdjackson

EZSP v13 (EmberZNet 7.4 / Gecko SDK 4.4) removed 12 legacy security
commands and replaced them with a new SecurityManager API. PR zsmartsystems#1413
bumped EZSP_MAX_VERSION to 13 but did not implement the replacement
commands, causing all key management operations to silently fail on
EZSP v13 firmware.

This commit adds:

New data structures:
- EzspSecurityManagerKeyType enum
- EzspSecurityManagerContext struct
- EzspSecurityManagerNetworkKeyInfo struct
- EzspSecurityManagerApsKeyMetadata struct

New EZSP command classes (11 Request/Response pairs):
- exportKey (0x0114) - replaces getKey
- importKey (0x0115) - replaces setKeyTableEntry
- secManImportTransientKey (0x0111) - replaces addTransientLinkKey
- secManExportTransientKeyByEui (0x0113) - replaces getTransientLinkKey
- secManExportTransientKeyByIndex (0x0112)
- secManExportLinkKeyByEui (0x010D)
- secManExportLinkKeyByIndex (0x010F)
- secManImportLinkKey (0x010E)
- secManCheckKeyContext (0x0110)
- secManGetNetworkKeyInfo (0x0116)
- secManGetApsKeyInfo (0x010C)

Version-conditional routing in EmberNcp:
- getKey() detects EZSP v13+ and routes to exportKey
- addTransientLinkKey() detects v13+ and routes to secManImportTransientKey

Backwards compatible: EZSP v4-v12 paths are unchanged.

Fixes zsmartsystems#1411

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 2, 2026

CLA assistant check
All committers have signed the CLA.

@cdjackson
Copy link
Copy Markdown
Member

Thanks Abid.

One thing to note - I plan to deprecate this EZSP driver after EZSP13. I think I've already pushed the branch with the new driver (called Silabs) - I'll port over this change when I get a chance (maybe next week).

The reason for the change is that Silabs made some significant changes to the protocol - small change, but hard to maintain compatibility... In general everything remains the same, but upgraded for v14, and I'm hoping also to add a few enhancements that were difficult to back port into the exisiting driver...

@cdjackson cdjackson merged commit 8e13e2a into zsmartsystems:master Apr 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants