From a50fbb329939f7bd9f7ea4018ecbe3891cd72f88 Mon Sep 17 00:00:00 2001 From: Timothy Maes Date: Thu, 13 Jan 2022 19:21:02 +0100 Subject: [PATCH] Fix CASE session break for not fully implemented timers (FreeRTOS) (#13540) Error catch on timer broadened to also allow NOT_SYNCED or other errors. --- src/protocols/secure_channel/CASESession.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index 23fc70aed7d565..90a0326d5a3cbe 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -1317,7 +1317,8 @@ CHIP_ERROR CASESession::SetEffectiveTime() { System::Clock::Milliseconds64 currentTimeMS; CHIP_ERROR err = System::SystemClock().GetClock_RealTimeMS(currentTimeMS); - if (err == CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE) + + if (err != CHIP_NO_ERROR) { ChipLogError( SecureChannel, @@ -1325,7 +1326,6 @@ CHIP_ERROR CASESession::SetEffectiveTime() // TODO: Remove use of hardcoded time during CASE setup return GetHardcodedTime(); } - ReturnErrorOnFailure(err); System::Clock::Seconds32 currentTime = std::chrono::duration_cast(currentTimeMS); VerifyOrReturnError(UnixEpochToChipEpochTime(currentTime.count(), mValidContext.mEffectiveTime), CHIP_ERROR_INVALID_TIME);