diff --git a/src/app/icd/ICDCheckInSender.cpp b/src/app/icd/ICDCheckInSender.cpp index cbb0cc9ba5a6e5..2643b96086f4b6 100644 --- a/src/app/icd/ICDCheckInSender.cpp +++ b/src/app/icd/ICDCheckInSender.cpp @@ -60,9 +60,9 @@ CHIP_ERROR ICDCheckInSender::SendCheckInMsg(const Transport::PeerAddress & addr) // Encoded ActiveModeThreshold in littleEndian for Check-In message application data uint8_t activeModeThresholdBuffer[2] = {}; - ByteSpan activeModeThresholdByteSpan(activeModeThresholdBuffer); - Encoding::LittleEndian::Put16((uint8_t *) activeModeThresholdByteSpan.data(), + Encoding::LittleEndian::Put16(activeModeThresholdBuffer, ICDConfigurationData::GetInstance().GetActiveModeThresholdMs()); + ByteSpan activeModeThresholdByteSpan(activeModeThresholdBuffer); ReturnErrorOnFailure(CheckinMessage::GenerateCheckinMessagePayload(mAes128KeyHandle, mHmac128KeyHandle, mICDCounter, activeModeThresholdByteSpan, output)); diff --git a/src/protocols/secure_channel/tests/TestCheckinMsg.cpp b/src/protocols/secure_channel/tests/TestCheckinMsg.cpp index 30859a363ed6df..1b93af09336f50 100644 --- a/src/protocols/secure_channel/tests/TestCheckinMsg.cpp +++ b/src/protocols/secure_channel/tests/TestCheckinMsg.cpp @@ -56,7 +56,7 @@ void TestCheckin_Generate(nlTestSuite * inSuite, void * inContext) { const ccm_128_test_vector & test = *testPtr; - // Two disctint key material buffers to force the PSA unit tests to create two different Key IDs + // Two distinct key material buffers to ensure crypto-hardware-assist with single-usage keys create two different handles. Symmetric128BitsKeyByteArray aesKeyMaterial; memcpy(aesKeyMaterial, test.key, test.key_len);