diff --git a/src/app/OperationalDeviceProxy.cpp b/src/app/OperationalDeviceProxy.cpp index b6b6a46cc89732..b308764ea065cd 100644 --- a/src/app/OperationalDeviceProxy.cpp +++ b/src/app/OperationalDeviceProxy.cpp @@ -96,6 +96,10 @@ CHIP_ERROR OperationalDeviceProxy::UpdateDeviceData(const Transport::PeerAddress mMRPConfig = config; + // Initialize CASE session state with any MRP parameters that DNS-SD has provided. + // It can be overridden by CASE session protocol messages that include MRP parameters. + mCASESession.SetMRPConfig(mMRPConfig); + if (mState == State::NeedsAddress) { mState = State::Initialized; @@ -225,7 +229,6 @@ void OperationalDeviceProxy::OnSessionEstablished() VerifyOrReturn(mState != State::Uninitialized, ChipLogError(Controller, "OnSessionEstablished was called while the device was not initialized")); - // TODO Update the MRP params based on the MRP params extracted from CASE, when this is available. CHIP_ERROR err = mInitParams.sessionManager->NewPairing( Optional::Value(mDeviceAddress), mPeerId.GetNodeId(), &mCASESession, CryptoContext::SessionRole::kInitiator, mInitParams.fabricInfo->GetFabricIndex()); diff --git a/src/controller/CommissioneeDeviceProxy.cpp b/src/controller/CommissioneeDeviceProxy.cpp index 84128527e6d9d3..04465221303797 100644 --- a/src/controller/CommissioneeDeviceProxy.cpp +++ b/src/controller/CommissioneeDeviceProxy.cpp @@ -121,6 +121,10 @@ CHIP_ERROR CommissioneeDeviceProxy::UpdateDeviceData(const Transport::PeerAddres mMRPConfig = config; + // Initialize PASE session state with any MRP parameters that DNS-SD has provided. + // It can be overridden by PASE session protocol messages that include MRP parameters. + mPairing.SetMRPConfig(mMRPConfig); + ReturnErrorOnFailure(LoadSecureSessionParametersIfNeeded(didLoad)); if (!mSecureSession.HasValue()) diff --git a/src/transport/PairingSession.h b/src/transport/PairingSession.h index fa47f093313454..8f9b2f242fed21 100644 --- a/src/transport/PairingSession.h +++ b/src/transport/PairingSession.h @@ -92,11 +92,9 @@ class DLL_EXPORT PairingSession * @brief * Get the value of peer session counter which is synced during session establishment */ - virtual const ReliableMessageProtocolConfig & GetMRPConfig() const - { - // TODO(#6652): This is a stub implementation, should be replaced by the real one when CASE and PASE is completed - return gDefaultMRPConfig; - } + virtual const ReliableMessageProtocolConfig & GetMRPConfig() const { return mMRPConfig; } + + void SetMRPConfig(const ReliableMessageProtocolConfig & config) { mMRPConfig = config; } virtual const char * GetI2RSessionInfo() const = 0; @@ -186,6 +184,8 @@ class DLL_EXPORT PairingSession Transport::PeerAddress mPeerAddress = Transport::PeerAddress::Uninitialized(); Optional mPeerSessionId; + + ReliableMessageProtocolConfig mMRPConfig = gDefaultMRPConfig; }; } // namespace chip