Skip to content

Commit 5203667

Browse files
tehampsonrestyled-commits
authored andcommitted
Allow plumbing of SessionParameters from Session (#30525)
* Change plumbing from remoteMRP to remoteSessionParameters * Restyled by clang-format * Update test to use SetRemoteSessionParameters * Minor fix --------- Co-authored-by: Restyled.io <[email protected]>
1 parent 0f072c9 commit 5203667

13 files changed

+101
-91
lines changed

src/messaging/tests/MessagingContext.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ void MessagingContext::SetMRPMode(MRPMode mode)
105105
{
106106
if (mode == MRPMode::kDefault)
107107
{
108-
mSessionBobToAlice->AsSecureSession()->SetRemoteMRPConfig(GetDefaultMRPConfig());
109-
mSessionAliceToBob->AsSecureSession()->SetRemoteMRPConfig(GetDefaultMRPConfig());
110-
mSessionCharlieToDavid->AsSecureSession()->SetRemoteMRPConfig(GetDefaultMRPConfig());
111-
mSessionDavidToCharlie->AsSecureSession()->SetRemoteMRPConfig(GetDefaultMRPConfig());
108+
mSessionBobToAlice->AsSecureSession()->SetRemoteSessionParameters(GetDefaultMRPConfig());
109+
mSessionAliceToBob->AsSecureSession()->SetRemoteSessionParameters(GetDefaultMRPConfig());
110+
mSessionCharlieToDavid->AsSecureSession()->SetRemoteSessionParameters(GetDefaultMRPConfig());
111+
mSessionDavidToCharlie->AsSecureSession()->SetRemoteSessionParameters(GetDefaultMRPConfig());
112112

113113
#if CONFIG_BUILD_FOR_HOST_UNIT_TEST
114114
ClearLocalMRPConfigOverride();
@@ -132,13 +132,13 @@ void MessagingContext::SetMRPMode(MRPMode mode)
132132
VerifyOrDie(false);
133133
#endif
134134

135-
mSessionBobToAlice->AsSecureSession()->SetRemoteMRPConfig(ReliableMessageProtocolConfig(
135+
mSessionBobToAlice->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig(
136136
MessagingContext::kResponsiveIdleRetransTimeout, MessagingContext::kResponsiveActiveRetransTimeout));
137-
mSessionAliceToBob->AsSecureSession()->SetRemoteMRPConfig(ReliableMessageProtocolConfig(
137+
mSessionAliceToBob->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig(
138138
MessagingContext::kResponsiveIdleRetransTimeout, MessagingContext::kResponsiveActiveRetransTimeout));
139-
mSessionCharlieToDavid->AsSecureSession()->SetRemoteMRPConfig(ReliableMessageProtocolConfig(
139+
mSessionCharlieToDavid->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig(
140140
MessagingContext::kResponsiveIdleRetransTimeout, MessagingContext::kResponsiveActiveRetransTimeout));
141-
mSessionDavidToCharlie->AsSecureSession()->SetRemoteMRPConfig(ReliableMessageProtocolConfig(
141+
mSessionDavidToCharlie->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig(
142142
MessagingContext::kResponsiveIdleRetransTimeout, MessagingContext::kResponsiveActiveRetransTimeout));
143143
}
144144
}

src/messaging/tests/TestAbortExchangesForFabric.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ void CommonCheckAbortAllButOneExchange(nlTestSuite * inSuite, TestContext & ctx,
163163
const auto & sessionHandle1 = session1.Get();
164164
const auto & sessionHandle2 = session2.Get();
165165

166-
session1->AsSecureSession()->SetRemoteMRPConfig(ReliableMessageProtocolConfig(
166+
session1->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig(
167167
Test::MessagingContext::kResponsiveIdleRetransTimeout, Test::MessagingContext::kResponsiveActiveRetransTimeout));
168168

169-
session1Reply->AsSecureSession()->SetRemoteMRPConfig(ReliableMessageProtocolConfig(
169+
session1Reply->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig(
170170
Test::MessagingContext::kResponsiveIdleRetransTimeout, Test::MessagingContext::kResponsiveActiveRetransTimeout));
171171

172172
NL_TEST_ASSERT(inSuite, session1);

src/messaging/tests/TestReliableMessageProtocol.cpp

+32-32
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,10 @@ void TestReliableMessageProtocol::CheckResendApplicationMessage(nlTestSuite * in
395395
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
396396
NL_TEST_ASSERT(inSuite, rm != nullptr);
397397

398-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
398+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
399399
System::Clock::Timestamp(300), // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
400400
System::Clock::Timestamp(300), // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
401-
});
401+
}));
402402

403403
// Let's drop the initial message
404404
auto & loopback = ctx.GetLoopback();
@@ -508,10 +508,10 @@ void TestReliableMessageProtocol::CheckCloseExchangeAndResendApplicationMessage(
508508
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
509509
NL_TEST_ASSERT(inSuite, rm != nullptr);
510510

511-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
511+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
512512
64_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
513513
64_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
514-
});
514+
}));
515515

516516
// Let's drop the initial message
517517
auto & loopback = ctx.GetLoopback();
@@ -567,10 +567,10 @@ void TestReliableMessageProtocol::CheckFailedMessageRetainOnSend(nlTestSuite * i
567567
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
568568
NL_TEST_ASSERT(inSuite, rm != nullptr);
569569

570-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
570+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
571571
64_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
572572
64_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
573-
});
573+
}));
574574

575575
mockSender.mMessageDispatch.mRetainMessageOnSend = false;
576576
// Let's drop the initial message
@@ -657,10 +657,10 @@ void TestReliableMessageProtocol::CheckResendApplicationMessageWithPeerExchange(
657657
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
658658
NL_TEST_ASSERT(inSuite, rm != nullptr);
659659

660-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
660+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
661661
64_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
662662
64_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
663-
});
663+
}));
664664

665665
// Let's drop the initial message
666666
auto & loopback = ctx.GetLoopback();
@@ -719,10 +719,10 @@ void TestReliableMessageProtocol::CheckDuplicateMessageClosedExchange(nlTestSuit
719719
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
720720
NL_TEST_ASSERT(inSuite, rm != nullptr);
721721

722-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
722+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
723723
64_ms32, // CHIP_CONFIG_RMP_DEFAULT_INITIAL_RETRY_INTERVAL
724724
64_ms32, // CHIP_CONFIG_RMP_DEFAULT_ACTIVE_RETRY_INTERVAL
725-
});
725+
}));
726726

727727
// Let's not drop the message. Expectation is that it is received by the peer, but the ack is dropped
728728
auto & loopback = ctx.GetLoopback();
@@ -786,10 +786,10 @@ void TestReliableMessageProtocol::CheckDuplicateOldMessageClosedExchange(nlTestS
786786
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
787787
NL_TEST_ASSERT(inSuite, rm != nullptr);
788788

789-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
789+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
790790
64_ms32, // CHIP_CONFIG_RMP_DEFAULT_INITIAL_RETRY_INTERVAL
791791
64_ms32, // CHIP_CONFIG_RMP_DEFAULT_ACTIVE_RETRY_INTERVAL
792-
});
792+
}));
793793

794794
// Let's not drop the message. Expectation is that it is received by the peer, but the ack is dropped
795795
auto & loopback = ctx.GetLoopback();
@@ -887,10 +887,10 @@ void TestReliableMessageProtocol::CheckResendSessionEstablishmentMessageWithPeer
887887
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
888888
NL_TEST_ASSERT(inSuite, rm != nullptr);
889889

890-
exchange->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteMRPConfig({
890+
exchange->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
891891
64_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
892892
64_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
893-
});
893+
}));
894894

895895
// Let's drop the initial message
896896
auto & loopback = inctx.GetLoopback();
@@ -951,10 +951,10 @@ void TestReliableMessageProtocol::CheckDuplicateMessage(nlTestSuite * inSuite, v
951951
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
952952
NL_TEST_ASSERT(inSuite, rm != nullptr);
953953

954-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
954+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
955955
64_ms32, // CHIP_CONFIG_RMP_DEFAULT_INITIAL_RETRY_INTERVAL
956956
64_ms32, // CHIP_CONFIG_RMP_DEFAULT_ACTIVE_RETRY_INTERVAL
957-
});
957+
}));
958958

959959
// Let's not drop the message. Expectation is that it is received by the peer, but the ack is dropped
960960
auto & loopback = ctx.GetLoopback();
@@ -1453,10 +1453,10 @@ void TestReliableMessageProtocol::CheckLostResponseWithPiggyback(nlTestSuite * i
14531453
NL_TEST_ASSERT(inSuite, rm->TestGetCountRetransTable() == 0);
14541454

14551455
// Make sure that we resend our message before the other side does.
1456-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
1456+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
14571457
64_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
14581458
64_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
1459-
});
1459+
}));
14601460

14611461
// We send a message, the other side sends an application-level response
14621462
// (which is lost), then we do a retransmit that is acked, then the other
@@ -1491,10 +1491,10 @@ void TestReliableMessageProtocol::CheckLostResponseWithPiggyback(nlTestSuite * i
14911491
// Make sure receiver resends after sender does, and there's enough of a gap
14921492
// that we are very unlikely to actually trigger the resends on the receiver
14931493
// when we trigger the resends on the sender.
1494-
mockReceiver.mExchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
1494+
mockReceiver.mExchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
14951495
256_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
14961496
256_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
1497-
});
1497+
}));
14981498

14991499
// Now send a message from the other side, but drop it.
15001500
loopback.mNumMessagesToDrop = 1;
@@ -1601,10 +1601,10 @@ void TestReliableMessageProtocol::CheckIsPeerActiveNotInitiator(nlTestSuite * in
16011601

16021602
mockSender.mTestSuite = inSuite;
16031603

1604-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
1604+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
16051605
1000_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
16061606
1000_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
1607-
});
1607+
}));
16081608

16091609
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
16101610
NL_TEST_ASSERT(inSuite, rm != nullptr);
@@ -1655,10 +1655,10 @@ void TestReliableMessageProtocol::CheckIsPeerActiveNotInitiator(nlTestSuite * in
16551655
NL_TEST_ASSERT(inSuite, !exchange->HasReceivedAtLeastOneMessage());
16561656
NL_TEST_ASSERT(inSuite, mockReceiver.mExchange->HasReceivedAtLeastOneMessage());
16571657

1658-
mockReceiver.mExchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
1658+
mockReceiver.mExchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
16591659
1000_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
16601660
100_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
1661-
});
1661+
}));
16621662

16631663
mockReceiver.mRetainExchange = false;
16641664
mockSender.mRetainExchange = false;
@@ -1870,10 +1870,10 @@ void TestReliableMessageProtocol::CheckApplicationResponseDelayed(nlTestSuite *
18701870
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
18711871
NL_TEST_ASSERT(inSuite, rm != nullptr);
18721872

1873-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
1873+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
18741874
30_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
18751875
30_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
1876-
});
1876+
}));
18771877

18781878
constexpr uint32_t kMaxMRPTransmits = 5; // Counting the initial message.
18791879

@@ -1932,10 +1932,10 @@ void TestReliableMessageProtocol::CheckApplicationResponseDelayed(nlTestSuite *
19321932
loopback.mNumMessagesToDrop = kMaxMRPTransmits - 1;
19331933
loopback.mDroppedMessageCount = 0;
19341934

1935-
mockReceiver.mExchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
1935+
mockReceiver.mExchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
19361936
30_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
19371937
30_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
1938-
});
1938+
}));
19391939

19401940
buffer = chip::MessagePacketBuffer::NewWithData(PAYLOAD, sizeof(PAYLOAD));
19411941
NL_TEST_ASSERT(inSuite, !buffer.IsNull());
@@ -2032,10 +2032,10 @@ void TestReliableMessageProtocol::CheckApplicationResponseNeverComes(nlTestSuite
20322032
ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
20332033
NL_TEST_ASSERT(inSuite, rm != nullptr);
20342034

2035-
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteMRPConfig({
2035+
exchange->GetSessionHandle()->AsSecureSession()->SetRemoteSessionParameters(ReliableMessageProtocolConfig({
20362036
30_ms32, // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
20372037
30_ms32, // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
2038-
});
2038+
}));
20392039

20402040
constexpr uint32_t kMaxMRPTransmits = 5; // Counting the initial message.
20412041

@@ -2133,8 +2133,8 @@ void TestReliableMessageProtocol::CheckApplicationResponseNeverComes(nlTestSuite
21332133
int TestReliableMessageProtocol::InitializeTestCase(void * inContext)
21342134
{
21352135
TestContext & ctx = *static_cast<TestContext *>(inContext);
2136-
ctx.GetSessionAliceToBob()->AsSecureSession()->SetRemoteMRPConfig(GetLocalMRPConfig().ValueOr(GetDefaultMRPConfig()));
2137-
ctx.GetSessionBobToAlice()->AsSecureSession()->SetRemoteMRPConfig(GetLocalMRPConfig().ValueOr(GetDefaultMRPConfig()));
2136+
ctx.GetSessionAliceToBob()->AsSecureSession()->SetRemoteSessionParameters(GetLocalMRPConfig().ValueOr(GetDefaultMRPConfig()));
2137+
ctx.GetSessionBobToAlice()->AsSecureSession()->SetRemoteSessionParameters(GetLocalMRPConfig().ValueOr(GetDefaultMRPConfig()));
21382138
return SUCCESS;
21392139
}
21402140

src/protocols/secure_channel/CASESession.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ CHIP_ERROR CASESession::HandleSigma2Resume(System::PacketBufferHandle && msg)
11351135
if (tlvReader.Next() != CHIP_END_OF_TLV)
11361136
{
11371137
SuccessOrExit(err = DecodeMRPParametersIfPresent(TLV::ContextTag(4), tlvReader));
1138-
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteMRPConfig(GetRemoteMRPConfig());
1138+
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteSessionParameters(GetRemoteSessionParameters());
11391139
}
11401140

11411141
ChipLogDetail(SecureChannel, "Peer assigned session session ID %d", responderSessionId);
@@ -1328,7 +1328,7 @@ CHIP_ERROR CASESession::HandleSigma2(System::PacketBufferHandle && msg)
13281328
if (tlvReader.Next() != CHIP_END_OF_TLV)
13291329
{
13301330
SuccessOrExit(err = DecodeMRPParametersIfPresent(TLV::ContextTag(kTag_Sigma2_ResponderMRPParams), tlvReader));
1331-
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteMRPConfig(GetRemoteMRPConfig());
1331+
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteSessionParameters(GetRemoteSessionParameters());
13321332
}
13331333

13341334
exit:
@@ -2017,7 +2017,7 @@ CHIP_ERROR CASESession::ParseSigma1(TLV::ContiguousBufferTLVReader & tlvReader,
20172017
if (err == CHIP_NO_ERROR && tlvReader.GetTag() == ContextTag(kInitiatorMRPParamsTag))
20182018
{
20192019
ReturnErrorOnFailure(DecodeMRPParametersIfPresent(TLV::ContextTag(kInitiatorMRPParamsTag), tlvReader));
2020-
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteMRPConfig(GetRemoteMRPConfig());
2020+
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteSessionParameters(GetRemoteSessionParameters());
20212021
err = tlvReader.Next();
20222022
}
20232023

src/protocols/secure_channel/PASESession.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ CHIP_ERROR PASESession::HandlePBKDFParamRequest(System::PacketBufferHandle && ms
355355
if (tlvReader.Next() != CHIP_END_OF_TLV)
356356
{
357357
SuccessOrExit(err = DecodeMRPParametersIfPresent(TLV::ContextTag(5), tlvReader));
358-
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteMRPConfig(GetRemoteMRPConfig());
358+
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteSessionParameters(GetRemoteSessionParameters());
359359
}
360360

361361
err = SendPBKDFParamResponse(ByteSpan(initiatorRandom), hasPBKDFParameters);
@@ -474,7 +474,7 @@ CHIP_ERROR PASESession::HandlePBKDFParamResponse(System::PacketBufferHandle && m
474474
if (tlvReader.Next() != CHIP_END_OF_TLV)
475475
{
476476
SuccessOrExit(err = DecodeMRPParametersIfPresent(TLV::ContextTag(5), tlvReader));
477-
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteMRPConfig(GetRemoteMRPConfig());
477+
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteSessionParameters(GetRemoteSessionParameters());
478478
}
479479

480480
// TODO - Add a unit test that exercises mHavePBKDFParameters path
@@ -499,7 +499,7 @@ CHIP_ERROR PASESession::HandlePBKDFParamResponse(System::PacketBufferHandle && m
499499
if (tlvReader.Next() != CHIP_END_OF_TLV)
500500
{
501501
SuccessOrExit(err = DecodeMRPParametersIfPresent(TLV::ContextTag(5), tlvReader));
502-
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteMRPConfig(GetRemoteMRPConfig());
502+
mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->SetRemoteSessionParameters(GetRemoteSessionParameters());
503503
}
504504
}
505505

src/protocols/secure_channel/PairingSession.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ CHIP_ERROR PairingSession::ActivateSecureSession(const Transport::PeerAddress &
4848

4949
// Call Activate last, otherwise errors on anything after would lead to
5050
// a partially valid session.
51-
secureSession->Activate(GetLocalScopedNodeId(), GetPeer(), GetPeerCATs(), peerSessionId, GetRemoteMRPConfig());
51+
secureSession->Activate(GetLocalScopedNodeId(), GetPeer(), GetPeerCATs(), peerSessionId, GetRemoteSessionParameters());
5252

5353
ChipLogDetail(Inet, "New secure session activated for device " ChipLogFormatScopedNodeId ", LSID:%d PSID:%d!",
5454
ChipLogValueScopedNodeId(GetPeer()), secureSession->GetLocalSessionId(), peerSessionId);

src/protocols/secure_channel/PairingSession.h

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class DLL_EXPORT PairingSession : public SessionDelegate
9898
virtual CHIP_ERROR DeriveSecureSession(CryptoContext & session) const = 0;
9999

100100
const ReliableMessageProtocolConfig & GetRemoteMRPConfig() const { return mRemoteSessionParams.GetMRPConfig(); }
101+
const SessionParameters & GetRemoteSessionParameters() const { return mRemoteSessionParams; }
101102
void SetRemoteMRPConfig(const ReliableMessageProtocolConfig & config) { mRemoteSessionParams.SetMRPConfig(config); }
102103

103104
/**

0 commit comments

Comments
 (0)