diff --git a/src/app/DeviceProxy.cpp b/src/app/DeviceProxy.cpp index 8488e78f24f9f5..b3618742a55961 100644 --- a/src/app/DeviceProxy.cpp +++ b/src/app/DeviceProxy.cpp @@ -46,4 +46,15 @@ CHIP_ERROR DeviceProxy::SendCommands(app::CommandSender * commandObj, OptionalSendCommandRequest(GetSecureSession().Value(), timeout); } +CHIP_ERROR DeviceProxy::GetAttestationChallenge(ByteSpan & attestationChallenge) +{ + Optional secureSessionHandle; + + secureSessionHandle = GetSecureSession(); + VerifyOrReturnError(secureSessionHandle.HasValue(), CHIP_ERROR_INCORRECT_STATE); + + attestationChallenge = secureSessionHandle.Value()->AsSecureSession()->GetCryptoContext().GetAttestationChallenge(); + return CHIP_NO_ERROR; +} + } // namespace chip diff --git a/src/app/DeviceProxy.h b/src/app/DeviceProxy.h index 843ebd9d364111..3f4bdb89649cc7 100644 --- a/src/app/DeviceProxy.h +++ b/src/app/DeviceProxy.h @@ -67,16 +67,7 @@ class DLL_EXPORT DeviceProxy * * @return CHIP_ERROR CHIP_NO_ERROR on success, or CHIP_ERROR_INVALID_ARGUMENT if no secure session is active */ - virtual CHIP_ERROR GetAttestationChallenge(ByteSpan & attestationChallenge) - { - Optional secureSessionHandle; - - secureSessionHandle = GetSecureSession(); - VerifyOrReturnError(secureSessionHandle.HasValue(), CHIP_ERROR_INCORRECT_STATE); - - attestationChallenge = secureSessionHandle.Value()->AsSecureSession()->GetCryptoContext().GetAttestationChallenge(); - return CHIP_NO_ERROR; - } + virtual CHIP_ERROR GetAttestationChallenge(ByteSpan & attestationChallenge); protected: virtual bool IsSecureConnected() const = 0;