feat: Enable APS layer encryption for Zigbee Direct cluster operations#1762
Conversation
Enable APS layer encryption for Zigbee Direct cluster.
|
@Nerivec How should we go about this? Especially writing a somewhat useful test... I'm also only familiar with |
|
I'm not sure this stuff is available in all adapters. Determining that would be the first order of business I guess. Need to dig into the types for all adapters, see if there are APS options somewhere, and if so, if one is about encryption/security 😅 |
True, Silabs is quite ahead.
I looked through the zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts Lines 1149 to 1164 in a62a4d5 According to TI docs, security can be enabled:
Question is, why is this attribute hardcoded to Edit: Looks like @Koenkk had a similar question back then 😄 Edit 2: Bitmask values defined here: zigbee-herdsman/src/adapter/z-stack/constants/af.ts Lines 16 to 23 in a62a4d5 These transmit options are all disabled and also a bit different from what's available on |
|
cc: @manup zigbee-herdsman/src/adapter/zboss/driver.ts Line 320 in fb2b2fe Based on NCP serial protocol v1.5 cc: @kirovilya As long as it's always scoped to the ZD cluster, we should be fine merging this after all these + zstack are handled. Since ZD cluster support is new anyway, and the potential breakage surface is minimal. |
|
Need to implement for all four before ready. We have the data, so, should mostly be replicating. |
Do you want me to implement them as well? |
|
Should just be adding the same logic as ember in the two places I linked above (and where you linked for zstack), with the values described (can just hardcode the number for now, if you don't find the appropriate const/enum). |
|
@Nerivec Would you mind taking a look? 🤞 |
Nerivec
left a comment
There was a problem hiding this comment.
Looks good.
I say we merge after next release.
|
@Nerivec Thx! But what about ZoH? 👀 |
|
It's not exposed in ZoH for now. Would need to refactor that side. Haven't had time to finish the big Z4 refactor though, need that one first. Very edge-case feature, it can wait a bit. We'll probably do the support for this on ZoH side, since this is spec. |
Good thing that I've already disabled ZD with my locally patched ZH. 😜 |
|
Thanks! |
As discussed in #1760, we need to enable APS layer encryption to read/write the Zigbee Direct Configuration cluster.
This can be done by checking the destination cluster ID and setting the respective APS frame options.
ember)ember