Skip to content

Commit 9efee65

Browse files
krypton36restyled-io[bot]restyled-commitsbzbarsky-apple
authored
Properly handle Aliro credential validation in door lock server (project-chip#31932)
* Handle Aliro credential in door lock server * Restyled by clang-format (project-chip#31933) Co-authored-by: Restyled.io <commits@restyled.io> * Update src/app/clusters/door-lock-server/door-lock-server.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Restyled by clang-format (project-chip#31935) Co-authored-by: Restyled.io <commits@restyled.io> * Update constant name from git chage * Update to use SupportsAliroProvisioning API --------- Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
1 parent bf3f996 commit 9efee65

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/app/clusters/door-lock-server/door-lock-server.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ using namespace chip::app::Clusters::DoorLock;
4444
using namespace chip::app::Clusters::DoorLock::Attributes;
4545
using chip::Protocols::InteractionModel::Status;
4646

47-
static constexpr uint8_t DOOR_LOCK_SCHEDULE_MAX_HOUR = 23;
48-
static constexpr uint8_t DOOR_LOCK_SCHEDULE_MAX_MINUTE = 59;
47+
static constexpr uint8_t DOOR_LOCK_SCHEDULE_MAX_HOUR = 23;
48+
static constexpr uint8_t DOOR_LOCK_SCHEDULE_MAX_MINUTE = 59;
49+
static constexpr uint8_t DOOR_LOCK_ALIRO_CREDENTIAL_SIZE = 65;
4950

5051
static constexpr uint32_t DOOR_LOCK_MAX_LOCK_TIMEOUT_SEC = MAX_INT32U_VALUE / MILLISECOND_TICKS_PER_SECOND;
5152

@@ -1556,6 +1557,11 @@ DlStatus DoorLockServer::credentialLengthWithinRange(chip::EndpointId endpointId
15561557
case CredentialTypeEnum::kFace:
15571558
statusMin = statusMax = emberAfPluginDoorLockGetFaceCredentialLengthConstraints(endpointId, minLen, maxLen);
15581559
break;
1560+
case CredentialTypeEnum::kAliroCredentialIssuerKey:
1561+
case CredentialTypeEnum::kAliroEvictableEndpointKey:
1562+
case CredentialTypeEnum::kAliroNonEvictableEndpointKey:
1563+
minLen = maxLen = DOOR_LOCK_ALIRO_CREDENTIAL_SIZE;
1564+
break;
15591565
default:
15601566
return DlStatus::kFailure;
15611567
}
@@ -2555,6 +2561,10 @@ bool DoorLockServer::credentialTypeSupported(chip::EndpointId endpointId, Creden
25552561
return SupportsFingers(endpointId);
25562562
case CredentialTypeEnum::kFace:
25572563
return SupportsFace(endpointId);
2564+
case CredentialTypeEnum::kAliroEvictableEndpointKey:
2565+
case CredentialTypeEnum::kAliroCredentialIssuerKey:
2566+
case CredentialTypeEnum::kAliroNonEvictableEndpointKey:
2567+
return SupportsAliroProvisioning(endpointId);
25582568
default:
25592569
return false;
25602570
}

0 commit comments

Comments
 (0)