diff --git a/src/app/OperationalDeviceProxy.cpp b/src/app/OperationalDeviceProxy.cpp index bc8ab9e1ab6a3f..6fce1a64781938 100644 --- a/src/app/OperationalDeviceProxy.cpp +++ b/src/app/OperationalDeviceProxy.cpp @@ -96,7 +96,7 @@ CHIP_ERROR OperationalDeviceProxy::Emplace(const Transport::PeerAddress & addr, { mPeerId = peerId; mState = State::Initialized; - if (session && mInitParams.sessionManager->GetSecureSession(session.Get())) + if (session && session.Get()->AsSecureSession()) { mSecureSession.Grab(session.Get()); mState = State::SecureConnected; diff --git a/src/commissioner/States.h b/src/commissioner/States.h index 758cee96c15347..66493b8d49941e 100644 --- a/src/commissioner/States.h +++ b/src/commissioner/States.h @@ -390,10 +390,7 @@ struct CapturingAttestationChallenge : Base {} void Enter() { - const ByteSpan challenge = this->mCommissionee.mSystemState->SessionMgr() - ->GetSecureSession(this->mCommissionee.mPaseSession.Get()) - ->GetCryptoContext() - .GetAttestationChallenge(); + ByteSpan challenge = this->mCommissionee.mPaseSession.Get()->AsSecureSession()->GetCryptoContext().GetAttestationChallenge(); if (mAttestationInformation.Challenge()->Set(challenge) == CHIP_NO_ERROR) { this->mCtx.Dispatch(TContext::Event::template Create(mAttestationInformation));