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

Resolve issue when adding same index with different credential type. #24156

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/app/clusters/door-lock-server/door-lock-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2085,8 +2085,11 @@ DlStatus DoorLockServer::addCredentialToUser(chip::EndpointId endpointId, chip::

for (size_t i = 0; i < user.credentials.size(); ++i)
{
// appclusters, 5.2.4.40: user should not be already associated with given credentialIndex
krypton36 marked this conversation as resolved.
Show resolved Hide resolved
if (user.credentials.data()[i].CredentialIndex == credential.CredentialIndex)
// appclusters, 5.2.4.40: CredentialIndex in CredentialStruct provided SHALL be for an available credential slot.
// appclusters, 5.6.3.2: This is the index of the specific credential used to authorize
// the lock operation in the list of credentials identified by CredentialType
if (user.credentials.data()[i].CredentialIndex == credential.CredentialIndex &&
user.credentials.data()[i].CredentialType == credential.CredentialType)
{
emberAfDoorLockClusterPrintln(
"[AddCredentialToUser] Unable to add credential to user: credential with this index is already associated "
Expand Down