Skip to content
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

GH-22: Fix Multi Channel Handling of Secure NIF #22

Merged
merged 4 commits into from
Feb 13, 2024

Conversation

nkljajic
Copy link
Collaborator

@nkljajic nkljajic commented Nov 28, 2023

Change

Some S0 multichannel endpoints will not respond to multichannel encapsulated SECURITY_COMMANDS_SUPPORTED_GET command [ 60 0D 00 01 98 02 ]. In such case, copy endpoint NIF to Secure NIF.

For reference, see document:
https://sdomembers.z-wavealliance.org/document/dl/652
Z-Wave Transport-Encapsulation Command Class Specification
3.5.4.1 Multi Channel Handling
Page 46

The implicit rule that all non-secure command classes for an End Point must be controllable securely is still in effect, if the endpoint is reported secure.

Checklist

Copy link
Collaborator

@rzr rzr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build: https://github.com/nkljajic/UnifySDK/actions/runs/7016067209/job/19086528904
Forwarded-SiliconLabs: task/UIC-3082/phcoval/GH-22/develop

@rzr
Copy link
Collaborator

rzr commented Jan 16, 2024

Tests might need to be revised, current results:

zwave_command_class_node_info_resolver_test.c:76:test_resolve_node_info_endpoint_4:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_resolve_node_info_endpoint_0:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_resolve_node_info_zpc:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_resolve_node_info_undefined_endpoint:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_resolve_secure_node_info_s2_key:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_resolve_secure_node_info_s0_key:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_resolve_secure_node_info_no_granted_key:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_creating_secure_nif_after_nif_granted_keys_updates:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_not_creating_secure_nif_for_zpc:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_not_creating_secure_nif_for_valueless_node_id:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_on_node_information_update:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_on_node_information_update_downgrade:FAIL: Expected 257 Was 258
zwave_command_class_node_info_resolver_test.c:76:test_on_nif_resolution_aborted:FAIL: Expected 257 Was 258
-----------------------
13 Tests 13 Failures 0 Ignored 
FAIL

rzr pushed a commit to rzr/UnifySDK that referenced this pull request Jan 17, 2024
Some S0 multichannel endpoints will not respond to multichannel encapsulated
SECURITY_COMMANDS_SUPPORTED_GET command [ 60 0D 00 01 98 02 ].
In such case, copy endpoint NIF to Secure NIF.

For reference, see:
Z-Wave Transport-Encapsulation Command Class Specification
3.5.4.1 Multi Channel Handling

The implicit rule that all non-secure command classes for an End Point must be controllable
securely is still in effect, if the endpoint is reported secure.

Signed-off-by: Nenad Kljajic <nkljajic@control4.com>
@rzr
Copy link
Collaborator

rzr commented Jan 17, 2024

Let's try to resolve this on your branch:

nkljajic#2

@rzr
Copy link
Collaborator

rzr commented Jan 17, 2024

don't bother looking we fixed it you can merge this PR:

nkljajic#2

Then expect an other PR from us that fix test like I've done before

nkljajic added a commit to nkljajic/UnifySDK that referenced this pull request Jan 17, 2024
nkljajic added a commit to nkljajic/UnifySDK that referenced this pull request Jan 17, 2024
Some S0 multichannel endpoints will not respond to multichannel encapsulated
SECURITY_COMMANDS_SUPPORTED_GET command [ 60 0D 00 01 98 02 ].
In such case, copy endpoint NIF to Secure NIF.

For reference, see:
Z-Wave Transport-Encapsulation Command Class Specification
3.5.4.1 Multi Channel Handling

The implicit rule that all non-secure command classes for an End Point must be controllable
securely is still in effect, if the endpoint is reported secure.

Signed-off-by: Nenad Kljajic <nkljajic@control4.com>
nkljajic added a commit to nkljajic/UnifySDK that referenced this pull request Jan 17, 2024
Some S0 multichannel endpoints will not respond to multichannel encapsulated
SECURITY_COMMANDS_SUPPORTED_GET command [ 60 0D 00 01 98 02 ].
In such case, copy endpoint NIF to Secure NIF.

For reference, see:
Z-Wave Transport-Encapsulation Command Class Specification
3.5.4.1 Multi Channel Handling

The implicit rule that all non-secure command classes for an End Point must be controllable
securely is still in effect, if the endpoint is reported secure.

Signed-off-by: Nenad Kljajic <nkljajic@control4.com>
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Jan 18, 2024
SiliconLabsGH-22 add a new callback on the give_up_listener on the ATTRIBUTE_ZWAVE_SECURE_NIF attribute causing the test case to fail.

The test only expect this listener to be called on the non-secure NIF ATTRIBUTE_ZWAVE_NIF. This change make sure that the code is only executed in the context of ATTRIBUTE_ZWAVE_NIF and ignored  for ATTRIBUTE_ZWAVE_SECURE_NIF as this test don't care about it.

Bug-SiliconLabs: UIC-3082
Relate-to: SiliconLabs#22
Forwarded-SiliconLabs: task/UIC-3082/phcoval/SiliconLabsGH-22/develop
@silabs-borisl
Copy link
Collaborator

attribute_store_node_t node_id_node
= attribute_store_get_first_parent_with_type(secure_nif_node, ATTRIBUTE_NODE_ID);

if (get_zpc_node_id_node() == node_id_node) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking: refactor to avoid creating node_id_node

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compiler will optimize that extra variable ? will it ?

REPORTED_ATTRIBUTE,
nif,
&nif_length))) {
uint8_t j=0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking: add space before and after =

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this in a next patch (clang format will help)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

rzr added a commit to rzr/UnifySDK that referenced this pull request Jan 22, 2024
Bug-SiliconLabs: UIC-3082
Relate-to: SiliconLabs#22
Forwarded-SiliconLabs: task/UIC-3082/phcoval/SiliconLabsGH-22/develop
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
rzr added a commit to rzr/UnifySDK that referenced this pull request Jan 22, 2024
Bug-SiliconLabs: UIC-3082
Relate-to: SiliconLabs#22
Forwarded-SiliconLabs: task/UIC-3082/phcoval/SiliconLabsGH-22/develop
Origin: silabs-borisl#2
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Jan 22, 2024
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Jan 22, 2024
@rzr
Copy link
Collaborator

rzr commented Jan 22, 2024

Origin-SiliconLabs: ver_1.5.0-unstable-107-g1eb22d3fd

nkljajic added a commit to nkljajic/UnifySDK that referenced this pull request Jan 23, 2024
SiliconLabsGH-22: Fix zwave_command_class_node_info_resolver unit test
nkljajic and others added 4 commits January 23, 2024 16:20
Some S0 multichannel endpoints will not respond to multichannel encapsulated
SECURITY_COMMANDS_SUPPORTED_GET command [ 60 0D 00 01 98 02 ].
In such case, copy endpoint NIF to Secure NIF.

For reference, see:
Z-Wave Transport-Encapsulation Command Class Specification
3.5.4.1 Multi Channel Handling

The implicit rule that all non-secure command classes for an End Point must be controllable
securely is still in effect, if the endpoint is reported secure.

Signed-off-by: Nenad Kljajic <nkljajic@control4.com>
SiliconLabsGH-22 add a new callback on the give_up_listener on the ATTRIBUTE_ZWAVE_SECURE_NIF attribute causing the test case to fail.

The test only expect this listener to be called on the non-secure NIF ATTRIBUTE_ZWAVE_NIF. This change make sure that the code is only executed in the context of ATTRIBUTE_ZWAVE_NIF and ignored  for ATTRIBUTE_ZWAVE_SECURE_NIF as this test don't care about it.

Bug-SiliconLabs: UIC-3082
Relate-to: SiliconLabs#22
Forwarded-SiliconLabs: task/UIC-3082/phcoval/SiliconLabsGH-22/develop
Bug-SiliconLabs: UIC-3082
Relate-to: SiliconLabs#22
Forwarded-SiliconLabs: task/UIC-3082/phcoval/SiliconLabsGH-22/develop
Origin: silabs-borisl#2
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
@agarwal57 agarwal57 merged commit f172eca into SiliconLabs:main Feb 13, 2024
agarwal57 pushed a commit that referenced this pull request Feb 13, 2024
Some S0 multichannel endpoints will not respond to multichannel encapsulated
SECURITY_COMMANDS_SUPPORTED_GET command [ 60 0D 00 01 98 02 ].
In such case, copy endpoint NIF to Secure NIF.

For reference, see:
Z-Wave Transport-Encapsulation Command Class Specification
3.5.4.1 Multi Channel Handling

The implicit rule that all non-secure command classes for an End Point must be controllable
securely is still in effect, if the endpoint is reported secure.

Signed-off-by: Nenad Kljajic <nkljajic@control4.com>
agarwal57 pushed a commit that referenced this pull request Feb 13, 2024
GH-22 add a new callback on the give_up_listener on the ATTRIBUTE_ZWAVE_SECURE_NIF attribute causing the test case to fail.

The test only expect this listener to be called on the non-secure NIF ATTRIBUTE_ZWAVE_NIF. This change make sure that the code is only executed in the context of ATTRIBUTE_ZWAVE_NIF and ignored  for ATTRIBUTE_ZWAVE_SECURE_NIF as this test don't care about it.

Bug-SiliconLabs: UIC-3082
Relate-to: #22
Forwarded-SiliconLabs: task/UIC-3082/phcoval/GH-22/develop
agarwal57 pushed a commit that referenced this pull request Feb 13, 2024
Bug-SiliconLabs: UIC-3082
Relate-to: #22
Forwarded-SiliconLabs: task/UIC-3082/phcoval/GH-22/develop
Origin: silabs-borisl#2
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
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.

5 participants