Skip to content

Commit

Permalink
Account for MRP ACKs timeout in CASE and PASE message timeouts (#12998)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-apple authored and pull[bot] committed Jul 26, 2023
1 parent 0242814 commit 5228150
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/protocols/secure_channel/CASESession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/secure_channel/PASESession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5228150

Please sign in to comment.