From 52281502616077da270414ad0bf43a737440fcdc Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Tue, 14 Dec 2021 23:53:32 -0800 Subject: [PATCH] Account for MRP ACKs timeout in CASE and PASE message timeouts (#12998) --- src/protocols/secure_channel/CASESession.cpp | 4 ++-- src/protocols/secure_channel/PASESession.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index db782eac4b4322..5026813a64af6a 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -231,7 +231,7 @@ CHIP_ERROR CASESession::EstablishSession(const Transport::PeerAddress peerAddres mFabricInfo = fabric; mLocalMRPConfig = mrpConfig; - mExchangeCtxt->SetResponseTimeout(kSigma_Response_Timeout); + mExchangeCtxt->SetResponseTimeout(kSigma_Response_Timeout + mExchangeCtxt->GetAckTimeout()); SetPeerAddress(peerAddress); SetPeerNodeId(peerNodeId); @@ -1454,7 +1454,7 @@ CHIP_ERROR CASESession::ValidateReceivedMessage(ExchangeContext * ec, const Payl else { mExchangeCtxt = ec; - mExchangeCtxt->SetResponseTimeout(kSigma_Response_Timeout); + mExchangeCtxt->SetResponseTimeout(kSigma_Response_Timeout + mExchangeCtxt->GetAckTimeout()); } VerifyOrReturnError(!msg.IsNull(), CHIP_ERROR_INVALID_ARGUMENT); diff --git a/src/protocols/secure_channel/PASESession.cpp b/src/protocols/secure_channel/PASESession.cpp index d43f01c5ae0eb8..24cc043cb6e9ff 100644 --- a/src/protocols/secure_channel/PASESession.cpp +++ b/src/protocols/secure_channel/PASESession.cpp @@ -316,7 +316,7 @@ CHIP_ERROR PASESession::Pair(const Transport::PeerAddress peerAddress, uint32_t SuccessOrExit(err); mExchangeCtxt = exchangeCtxt; - mExchangeCtxt->SetResponseTimeout(kSpake2p_Response_Timeout); + mExchangeCtxt->SetResponseTimeout(kSpake2p_Response_Timeout + mExchangeCtxt->GetAckTimeout()); SetPeerAddress(peerAddress); @@ -884,7 +884,7 @@ CHIP_ERROR PASESession::ValidateReceivedMessage(ExchangeContext * exchange, cons else { mExchangeCtxt = exchange; - mExchangeCtxt->SetResponseTimeout(kSpake2p_Response_Timeout); + mExchangeCtxt->SetResponseTimeout(kSpake2p_Response_Timeout + mExchangeCtxt->GetAckTimeout()); } VerifyOrReturnError(!msg.IsNull(), CHIP_ERROR_INVALID_ARGUMENT);