Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move GetAttestationChallenge() implementation to DeviceProxy.cpp #19058

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/app/DeviceProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,15 @@ CHIP_ERROR DeviceProxy::SendCommands(app::CommandSender * commandObj, Optional<S
return commandObj->SendCommandRequest(GetSecureSession().Value(), timeout);
}

CHIP_ERROR DeviceProxy::GetAttestationChallenge(ByteSpan & attestationChallenge)
{
Optional<SessionHandle> secureSessionHandle;

secureSessionHandle = GetSecureSession();
VerifyOrReturnError(secureSessionHandle.HasValue(), CHIP_ERROR_INCORRECT_STATE);

attestationChallenge = secureSessionHandle.Value()->AsSecureSession()->GetCryptoContext().GetAttestationChallenge();
return CHIP_NO_ERROR;
}

} // namespace chip
11 changes: 1 addition & 10 deletions src/app/DeviceProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<SessionHandle> 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;
Expand Down