Skip to content

Commit

Permalink
[ICD] refreshKey needs to be set with length (project-chip#35379)
Browse files Browse the repository at this point in the history
* refreshKey needs to be set with length

* address comments
  • Loading branch information
yunhanw-google authored Sep 3, 2024
1 parent 3b83878 commit 3de6f04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/icd/client/DefaultCheckInDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ void DefaultCheckInDelegate::OnCheckInComplete(const ICDClientInfo & clientInfo)

CHIP_ERROR DefaultCheckInDelegate::GenerateRefreshKey(RefreshKeySender::RefreshKeyBuffer & newKey)
{
return Crypto::DRBG_get_bytes(newKey.Bytes(), newKey.Capacity());
ReturnErrorOnFailure(Crypto::DRBG_get_bytes(newKey.Bytes(), newKey.Capacity()));
return newKey.SetLength(newKey.Capacity());
}

RefreshKeySender * DefaultCheckInDelegate::OnKeyRefreshNeeded(ICDClientInfo & clientInfo, ICDClientStorage * clientStorage)
Expand Down

0 comments on commit 3de6f04

Please sign in to comment.