Skip to content

Commit

Permalink
GroupKeyManagement: Wrong error code returned from key set remove. (#…
Browse files Browse the repository at this point in the history
…28757)

* Wrong error code returned from key set remove.

* Check for both
  • Loading branch information
cecille authored and pull[bot] committed Oct 24, 2023
1 parent 817ce20 commit 3368450
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ bool emberAfGroupKeyManagementClusterKeySetRemoveCallback(
CHIP_ERROR err = provider->RemoveKeySet(fabricIndex, commandData.groupKeySetID);

Status status = Status::Success;
if (CHIP_ERROR_KEY_NOT_FOUND == err)
if (CHIP_ERROR_NOT_FOUND == err || CHIP_ERROR_KEY_NOT_FOUND == err)
{
status = Status::NotFound;
}
Expand Down
11 changes: 11 additions & 0 deletions src/app/tests/suites/TestGroupKeyManagementCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1114,3 +1114,14 @@ tests:
attribute: "GroupKeyMap"
response:
value: []

- label: "TH tries to remove a non-existent key"
cluster: "Group Key Management"
endpoint: 0
command: "KeySetRemove"
arguments:
values:
- name: "GroupKeySetID"
value: 0x0111
response:
error: NOT_FOUND

0 comments on commit 3368450

Please sign in to comment.