From 69f8762799f4e26115f3721678b9891dc1f214f9 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 6 Jun 2024 22:19:41 -0400 Subject: [PATCH] Clear Aliro credentials when ClearCredential for all credentials happens. We were not clearing credentials of the Aliro types in this situation. --- .../door-lock-server/door-lock-server.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index 742afee28480f3..b48327bc6c5ce0 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -3038,6 +3038,24 @@ Status DoorLockServer::clearCredentials(chip::EndpointId endpointId, chip::Fabri ChipLogProgress(Zcl, "[clearCredentials] All face credentials were cleared [endpointId=%d]", endpointId); } + if (SupportsAliroProvisioning(endpointId)) + { + for (auto & credentialType : + { CredentialTypeEnum::kAliroEvictableEndpointKey, CredentialTypeEnum::kAliroCredentialIssuerKey, + CredentialTypeEnum::kAliroNonEvictableEndpointKey }) + { + auto status = clearCredentials(endpointId, modifier, sourceNodeId, credentialType); + if (Status::Success != status) + { + ChipLogError(Zcl, + "[clearCredentials] Unable to clear all Aliro credentials [endpointId=%d,credentialType=%d,status=%d]", + endpointId, to_underlying(credentialType), to_underlying(status)); + return status; + } + } + ChipLogProgress(Zcl, "[clearCredentials] All Aliro credentials were cleared [endpointId=%d]", endpointId); + } + return Status::Success; }