diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index f33473d7beddc0..ce45ab4f46ef5c 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -30,7 +30,6 @@ #include #include #include -#include namespace chip { namespace app { @@ -545,11 +544,7 @@ CHIP_ERROR ReadHandler::ProcessSubscribeRequest(System::PacketBufferHandle && aP ReturnLogErrorOnFailure(subscribeRequestParser.GetMinIntervalSeconds(&mMinIntervalFloorSeconds)); ReturnLogErrorOnFailure(subscribeRequestParser.GetMaxIntervalSeconds(&mMaxIntervalCeilingSeconds)); - // TODO: Use GetSecureRandomData to generate subscription id - // it needs #include , but somehow CHIPRNG.h is missing - // err = Platform::Security::GetSecureRandomData((uint8_t *) &mSubscriptionId, sizeof(mSubscriptionId)); - // SuccessOrExit(err); - mSubscriptionId = GetRandU64(); + ReturnLogErrorOnFailure(Crypto::DRBG_get_bytes(reinterpret_cast(&mSubscriptionId), sizeof(mSubscriptionId))); MoveToState(HandlerState::GeneratingReports); diff --git a/src/lib/support/RandUtils.cpp b/src/lib/support/RandUtils.cpp index b63c8f2f75b14e..ffa759bb7f1021 100644 --- a/src/lib/support/RandUtils.cpp +++ b/src/lib/support/RandUtils.cpp @@ -22,7 +22,7 @@ * * @note These utility functions do not generate cryptographically strong * random number. To get cryptographically strong random data use - * chip::Platform::Security::GetSecureRandomData(). + * chip::Crypto::DRBG_get_bytes(). * */ diff --git a/src/lib/support/RandUtils.h b/src/lib/support/RandUtils.h index a363eba8897f2b..46c6f7172623e7 100644 --- a/src/lib/support/RandUtils.h +++ b/src/lib/support/RandUtils.h @@ -22,7 +22,7 @@ * * @note These utility functions do not generate cryptographically strong * random number. To get cryptographically strong random data use - * chip::Platform::Security::GetSecureRandomData(). + * chip::Crypto::DRBG_get_bytes(). * */